aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/arte.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-05-08 02:00:01 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-05-08 02:00:47 +0200
commit5c9f3b8b168a2847c4c1378e5d87a11352710723 (patch)
tree8455a502ca97eba0be3d8d896dd9c93c1e39b78c /youtube_dl/extractor/arte.py
parentbebd6f9308d746a6adc1930963794ded010bee90 (diff)
[arte] Fix versionCode interpretation (#2588)
Diffstat (limited to 'youtube_dl/extractor/arte.py')
-rw-r--r--youtube_dl/extractor/arte.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/youtube_dl/extractor/arte.py b/youtube_dl/extractor/arte.py
index 2abdd5029..b528a9ec5 100644
--- a/youtube_dl/extractor/arte.py
+++ b/youtube_dl/extractor/arte.py
@@ -121,14 +121,17 @@ class ArteTVPlus7IE(InfoExtractor):
return ['HQ', 'MQ', 'EQ', 'SQ'].index(f['quality'])
else:
def sort_key(f):
+ versionCode = f.get('versionCode')
+ if versionCode is None:
+ versionCode = ''
return (
# Sort first by quality
- int(f.get('height',-1)),
- int(f.get('bitrate',-1)),
+ int(f.get('height', -1)),
+ int(f.get('bitrate', -1)),
# The original version with subtitles has lower relevance
- re.match(r'VO-ST(F|A)', f.get('versionCode', '')) is None,
+ re.match(r'VO-ST(F|A)', versionCode) is None,
# The version with sourds/mal subtitles has also lower relevance
- re.match(r'VO?(F|A)-STM\1', f.get('versionCode', '')) is None,
+ re.match(r'VO?(F|A)-STM\1', versionCode) is None,
# Prefer http downloads over m3u8
0 if f['url'].endswith('m3u8') else 1,
)