aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/extractor/arte.py
diff options
context:
space:
mode:
authorrupertbaxter2 <rupertbaxter2@yahoo.com>2014-08-13 04:22:45 -0700
committerrupertbaxter2 <rupertbaxter2@yahoo.com>2014-08-13 04:22:45 -0700
commitf96252b913945a173ebf2388de0c01b401b90a3a (patch)
tree7548dfc2247efb507405b817f0223e517c4ced42 /youtube_dl/extractor/arte.py
parent04b89c9026e14c16d3b53cbddf8654f354174245 (diff)
parent6f600ff5d6bda54d8128e6263a468a08edfc3353 (diff)
downloadhypervideo-pre-f96252b913945a173ebf2388de0c01b401b90a3a.tar.lz
hypervideo-pre-f96252b913945a173ebf2388de0c01b401b90a3a.tar.xz
hypervideo-pre-f96252b913945a173ebf2388de0c01b401b90a3a.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'youtube_dl/extractor/arte.py')
-rw-r--r--youtube_dl/extractor/arte.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/youtube_dl/extractor/arte.py b/youtube_dl/extractor/arte.py
index 9591bad8a..d86dbba8e 100644
--- a/youtube_dl/extractor/arte.py
+++ b/youtube_dl/extractor/arte.py
@@ -109,15 +109,19 @@ class ArteTVPlus7IE(InfoExtractor):
regexes = [r'VO?%s' % l, r'VO?.-ST%s' % l]
return any(re.match(r, f['versionCode']) for r in regexes)
# Some formats may not be in the same language as the url
+ # TODO: Might want not to drop videos that does not match requested language
+ # but to process those formats with lower precedence
formats = filter(_match_lang, all_formats)
- formats = list(formats) # in python3 filter returns an iterator
+ formats = list(formats) # in python3 filter returns an iterator
if not formats:
# Some videos are only available in the 'Originalversion'
# they aren't tagged as being in French or German
- if all(f['versionCode'] == 'VO' or f['versionCode'] == 'VA' for f in all_formats):
- formats = all_formats
- else:
- raise ExtractorError(u'The formats list is empty')
+ # Sometimes there are neither videos of requested lang code
+ # nor original version videos available
+ # For such cases we just take all_formats as is
+ formats = all_formats
+ if not formats:
+ raise ExtractorError('The formats list is empty')
if re.match(r'[A-Z]Q', formats[0]['quality']) is not None:
def sort_key(f):