Last active
February 9, 2023 09:29
-
-
Save hellojukay/8526dfdb51a7c55d00e54cf5dc793a83 to your computer and use it in GitHub Desktop.
下载 m3u8 电视剧
This file contains hidden or 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 python | |
import sys | |
import os | |
import re | |
data = sys.stdin.readlines() | |
for line in data: | |
url,name = re.compile("[\s\t]+").split(line.rstrip()) | |
# https://github.com/oopsguy/m3u8 使用这个 golang 写的小工具来下载 m3u8 链接 | |
cmds = [ | |
"m3u8 -u \"{}\" -c 48 -o ./".format(url), | |
"ffmpeg -i main.ts -vcodec copy -acodec copy -f mp4 {}.mp4".format(name), | |
"rm -rf main.ts ts" | |
] | |
for cmd in cmds: | |
print(cmd) | |
os.system(cmd); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment