mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[francetv] Make subtitles more robust (Closes #7298)
This commit is contained in:
parent
5dadae079b
commit
6e4b8b2891
1 changed files with 6 additions and 8 deletions
|
@ -84,14 +84,12 @@ def _extract_video(self, video_id, catalogue):
|
||||||
title += ' - %s' % subtitle
|
title += ' - %s' % subtitle
|
||||||
|
|
||||||
subtitles = {}
|
subtitles = {}
|
||||||
for subtitle_accessibilite in info['subtitles']:
|
subtitles_list = [{
|
||||||
if subtitle_accessibilite['url'] is not '':
|
'url': subtitle['url'],
|
||||||
if not subtitles:
|
'ext': subtitle.get('format'),
|
||||||
subtitles['fr'] = []
|
} for subtitle in info.get('subtitles', []) if subtitle.get('url')]
|
||||||
subtitles['fr'].append({
|
if subtitles_list:
|
||||||
'ext': subtitle_accessibilite['format'],
|
subtitles['fr'] = subtitles_list
|
||||||
'url': subtitle_accessibilite['url'],
|
|
||||||
})
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
|
Loading…
Reference in a new issue