diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-09 19:01:23 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-09 19:01:23 +0100 |
commit | 566d4e0425245e46f211fec8cd38d369e2c8de2c (patch) | |
tree | 6bc2a8e7fceef44a5f6589a545fd1ca642a8faf4 /youtube_dl/extractor/arte.py | |
parent | 81be02d2f97f63fef0ec6216b8dca2b7184b36a9 (diff) |
[arte] Make sure the format_id is unique (closes #1739)
Include the bitrate and use the height instead of the quality field.
Diffstat (limited to 'youtube_dl/extractor/arte.py')
-rw-r--r-- | youtube_dl/extractor/arte.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/youtube_dl/extractor/arte.py b/youtube_dl/extractor/arte.py index e10c74c11..a636c6be5 100644 --- a/youtube_dl/extractor/arte.py +++ b/youtube_dl/extractor/arte.py @@ -10,6 +10,7 @@ from ..utils import ( unified_strdate, determine_ext, get_element_by_id, + compat_str, ) # There are different sources of video in arte.tv, the extraction process @@ -191,10 +192,13 @@ class ArteTVPlus7IE(InfoExtractor): formats = sorted(formats, key=lambda f: re.match(r'VO(F|A)-STM\1', f.get('versionCode', '')) is None) # Pick the best quality def _format(format_info): - quality = format_info['quality'] - m_quality = re.match(r'\w*? - (\d*)p', quality) - if m_quality is not None: - quality = m_quality.group(1) + quality = '' + height = format_info.get('height') + if height is not None: + quality = compat_str(height) + bitrate = format_info.get('bitrate') + if bitrate is not None: + quality += '-%d' % bitrate if format_info.get('versionCode') is not None: format_id = u'%s-%s' % (quality, format_info['versionCode']) else: @@ -203,7 +207,7 @@ class ArteTVPlus7IE(InfoExtractor): 'format_id': format_id, 'format_note': format_info.get('versionLibelle'), 'width': format_info.get('width'), - 'height': format_info.get('height'), + 'height': height, } if format_info['mediaType'] == u'rtmp': info['url'] = format_info['streamer'] |