mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 22:21:17 +01:00
[francetv] Make subtitles more robust (Closes #7298)
This commit is contained in:
parent
5dadae079b
commit
6e4b8b2891
|
@ -84,14 +84,12 @@ def _extract_video(self, video_id, catalogue):
|
|||
title += ' - %s' % subtitle
|
||||
|
||||
subtitles = {}
|
||||
for subtitle_accessibilite in info['subtitles']:
|
||||
if subtitle_accessibilite['url'] is not '':
|
||||
if not subtitles:
|
||||
subtitles['fr'] = []
|
||||
subtitles['fr'].append({
|
||||
'ext': subtitle_accessibilite['format'],
|
||||
'url': subtitle_accessibilite['url'],
|
||||
})
|
||||
subtitles_list = [{
|
||||
'url': subtitle['url'],
|
||||
'ext': subtitle.get('format'),
|
||||
} for subtitle in info.get('subtitles', []) if subtitle.get('url')]
|
||||
if subtitles_list:
|
||||
subtitles['fr'] = subtitles_list
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
|
|
Loading…
Reference in New Issue
Block a user