This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# author: yuzebin AT gmail | |
# 20180614 | |
# open163_dl_single.sh | |
main() { | |
curl -A "Mozilla/5.0 (iPad; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1" $1 | grep -ohE "https?://[a-zA-Z0-9\.\/_&=@$?~#-]*" | grep m3u8 | xargs -I{} ffmpeg -i {} -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $2.mp4 | |
} | |
if [[ $# -ne 2 ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# author: yuzebin AT gmail | |
# 20180614 | |
# open163_dl.sh | |
main() { | |
mkdir -p $2 | |
cd $2 | |
curl $1 | grep -e "http://open.163.com/movie/" | enca -L zh -x UTF-8 | sed -e "s/\<a href=\"//g" -e "s/\>//g" -e "s/<\/a//g" | grep -v class | sed -e "s/\ //g"> $2.lst | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QtGui/QApplication> | |
#include <QtGui/QPushButton> | |
int main(int argc, char *argv[]) | |
{ | |
QApplication a(argc, argv); | |
QPushButton *button = new QPushButton("Quit"); | |
QObject::connect(button, SIGNAL(clicked()), &a, SLOT(quit())); | |
button->show(); | |
return a.exec(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def read_file(fpath): | |
BLOCK_SIZE = 1024 | |
with open(fpath, 'rb') as f: | |
while True: | |
block = f.read(BLOCK_SIZE) | |
if block: | |
yield block | |
else: | |
return |