aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/arte.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-08-03 17:32:29 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-08-03 17:32:29 +0200
commitf5791ed136d75efe8b163899ac4239d87a0a278e (patch)
treecc61a6e061143a6e4fe3908714b0a1806958a97c /youtube_dl/extractor/arte.py
parentfbf189a6eedb1a42a5beeea475f1d072db5c2322 (diff)
downloadyoutube-dl-f5791ed136d75efe8b163899ac4239d87a0a278e.tar.xz
[arte] Prefer vídeos without subtitles in the same language (fixes #1173) and fix crash when there's no description
Diffstat (limited to 'youtube_dl/extractor/arte.py')
-rw-r--r--youtube_dl/extractor/arte.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/extractor/arte.py b/youtube_dl/extractor/arte.py
index 18d591658..959ce787f 100644
--- a/youtube_dl/extractor/arte.py
+++ b/youtube_dl/extractor/arte.py
@@ -85,7 +85,7 @@ class ArteTvIE(InfoExtractor):
info_dict = {'id': player_info['VID'],
'title': player_info['VTI'],
- 'description': player_info['VDE'],
+ 'description': player_info.get('VDE'),
'upload_date': unified_strdate(player_info['VDA'].split(' ')[0]),
'thumbnail': player_info['programImage'],
'ext': 'flv',
@@ -104,6 +104,8 @@ class ArteTvIE(InfoExtractor):
formats = filter(_match_lang, formats)
# We order the formats by quality
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
format_info = formats[-1]
if format_info['mediaType'] == u'rtmp':