Moving protocol to download subtitles back to the subtitle_info and keep the download logic in YoutubeDl

This commit is contained in:
Sacha Arnoud
2021-09-21 16:31:43 +00:00
parent d0774569c1
commit 5fb593d50a
5 changed files with 14 additions and 15 deletions

View File

@@ -1708,6 +1708,7 @@ class InfoExtractor(object):
subtitles[media['LANGUAGE']] = [{
'url': format_url(media['URI']),
'ext': media.get('SUBFORMAT', 'webtt'),
'protocol': 'm3u8_native',
}]
return
if media_type not in ('VIDEO', 'AUDIO'):

View File

@@ -206,10 +206,6 @@ class FranceTVIE(InfoExtractor):
info['title'] += ' - %s' % info['subtitle']
info['title'] = info['title'].strip()
for lang, sts in info['subtitles'].items():
for st in sts:
st['downloader'] = lambda ydl, filename: PROTOCOL_MAP['m3u8_native'](ydl, ydl.params).download(filename, st)
return {
'id': video_id,
'title': self._live_title(info['title']) if is_live else info['title'],