Skip to content

Instantly share code, notes, and snippets.

@hellojukay
Last active February 9, 2023 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hellojukay/8526dfdb51a7c55d00e54cf5dc793a83 to your computer and use it in GitHub Desktop.
Save hellojukay/8526dfdb51a7c55d00e54cf5dc793a83 to your computer and use it in GitHub Desktop.
下载 m3u8 电视剧
#!/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