diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2016-01-01 13:28:45 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2016-01-01 13:28:45 +0100 |
commit | 32f9036447d1211f9ce0750203d71671f0ee99dc (patch) | |
tree | 14b5c9387edc94a06dc7954f51ed309c5be89cb0 /youtube_dl/extractor/ccc.py | |
parent | 190ef0798103908d986e07f54323299084726d42 (diff) |
[ccc] Add language information to formats
Diffstat (limited to 'youtube_dl/extractor/ccc.py')
-rw-r--r-- | youtube_dl/extractor/ccc.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/extractor/ccc.py b/youtube_dl/extractor/ccc.py index 710e5919c..e94b1e35b 100644 --- a/youtube_dl/extractor/ccc.py +++ b/youtube_dl/extractor/ccc.py @@ -58,11 +58,12 @@ class CCCIE(InfoExtractor): webpage, 'duration', fatal=False, group='duration')) matches = re.finditer(r'''(?xs) - <(?:span|div)\s+class='label\s+filetype'>(?P<format>.*?)</(?:span|div)>\s* + <(?:span|div)\s+class='label\s+filetype'>(?P<format>[^<]*)</(?:span|div)>\s* + <(?:span|div)\s+class='label\s+filetype'>(?P<lang>[^<]*)</(?:span|div)>\s* <a\s+download\s+href='(?P<http_url>[^']+)'>\s* (?: .*? - <a\s+href='(?P<torrent_url>[^']+\.torrent)' + <a\s+(?:download\s+)?href='(?P<torrent_url>[^']+\.torrent)' )?''', webpage) formats = [] for m in matches: @@ -70,12 +71,15 @@ class CCCIE(InfoExtractor): format_id = self._search_regex( r'.*/([a-z0-9_-]+)/[^/]*$', m.group('http_url'), 'format id', default=None) + if format_id: + format_id = m.group('lang') + '-' + format_id vcodec = 'h264' if 'h264' in format_id else ( 'none' if format_id in ('mp3', 'opus') else None ) formats.append({ 'format_id': format_id, 'format': format, + 'language': m.group('lang'), 'url': m.group('http_url'), 'vcodec': vcodec, 'preference': preference(format_id), |