mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 17:02:30 +00:00
[arte] Prefer vídeos without subtitles in the same language (fixes #1173) and fix crash when there's no description
This commit is contained in:
parent
fbf189a6ee
commit
f5791ed136
@ -85,7 +85,7 @@ def _extract_emission(self, url, video_id, lang):
|
|||||||
|
|
||||||
info_dict = {'id': player_info['VID'],
|
info_dict = {'id': player_info['VID'],
|
||||||
'title': player_info['VTI'],
|
'title': player_info['VTI'],
|
||||||
'description': player_info['VDE'],
|
'description': player_info.get('VDE'),
|
||||||
'upload_date': unified_strdate(player_info['VDA'].split(' ')[0]),
|
'upload_date': unified_strdate(player_info['VDA'].split(' ')[0]),
|
||||||
'thumbnail': player_info['programImage'],
|
'thumbnail': player_info['programImage'],
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
@ -104,6 +104,8 @@ def _match_lang(f):
|
|||||||
formats = filter(_match_lang, formats)
|
formats = filter(_match_lang, formats)
|
||||||
# We order the formats by quality
|
# We order the formats by quality
|
||||||
formats = sorted(formats, key=lambda f: int(f['height']))
|
formats = sorted(formats, key=lambda f: int(f['height']))
|
||||||
|
# Prefer videos without subtitles in the same language
|
||||||
|
formats = sorted(formats, key=lambda f: re.match(r'VO(F|A)-STM\1', f['versionCode']) is None)
|
||||||
# Pick the best quality
|
# Pick the best quality
|
||||||
format_info = formats[-1]
|
format_info = formats[-1]
|
||||||
if format_info['mediaType'] == u'rtmp':
|
if format_info['mediaType'] == u'rtmp':
|
||||||
|
Loading…
Reference in New Issue
Block a user