This commit is contained in:
ForgQi committed 2019-08-04 15:35:31 +08:00
1 parent 304b2794fc
commit e00a1585b5
3 files changed
+7 -4

No files matched your search

+1
View File
@@ -8,6 +8,7 @@
.idea/encodings.xml
*.png
*.flv
*.mp4
*.part
old/
config.yaml
+3 -1
View File
@@ -151,9 +151,11 @@ class SDownload(DownloadBase):
raise
# ffmpeg.exe -i http://vfile1.grtn.cn/2018/1542/0254/3368/154202543368.ssm/154202543368.m3u8
# -c copy -bsf:a aac_adtstoasc -movflags +faststart output.mp4
class FFmpegdl(DownloadBase):
def download(self):
args = ['ffmpeg', '-y', '-i', self.ydl_opts['absurl'], '-c', 'copy', '-f', 'flv',
args = ['ffmpeg', '-y', '-i', self.ydl_opts['absurl'], '-c', 'copy', '-f', self.suffix,
self.ydl_opts['outtmpl'] + '.part']
proc = subprocess.Popen(args, stdin=subprocess.PIPE)
try:
+3 -3
View File
@@ -12,7 +12,7 @@ user_agent = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebK
class Huya(FFmpegdl):
def __init__(self, fname, url, suffix='flv'):
def __init__(self, fname, url, suffix='mp4'):
super().__init__(fname, url, suffix)
def check_stream(self):
@@ -23,8 +23,8 @@ class Huya(FFmpegdl):
huya = engine.plugins.match1(data, r'({"sCdnType":"TX".*?})')
if huya:
huyajson = json.loads(huya)
self.ydl_opts["absurl"] = huyajson["sFlvUrl"] + '/' + huyajson["sStreamName"] + '.' + \
huyajson["sFlvUrlSuffix"] + '?' + huyajson["sFlvAntiCode"] + "&ratio=2000"
self.ydl_opts["absurl"] = huyajson["sHlsUrl"] + '/' + huyajson["sStreamName"] + '.' + \
huyajson["sHlsUrlSuffix"] + '?' + huyajson["sHlsAntiCode"]
return True