]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[turner] Fix subtitles extraction
authorSergey M․ <dstftw@gmail.com>
Mon, 29 Aug 2016 14:52:41 +0000 (21:52 +0700)
committerSergey M․ <dstftw@gmail.com>
Mon, 29 Aug 2016 14:52:41 +0000 (21:52 +0700)
youtube_dl/extractor/turner.py

index 108caa9d873ba00c53325c31c9dacd073489a0c9..d69977b566345974cd4b696bf7f989632d75e093 100644 (file)
@@ -135,11 +135,12 @@ class TurnerBaseIE(InfoExtractor):
         subtitles = {}
         for source in video_data.findall('closedCaptions/source'):
             for track in source.findall('track'):
-                source_url = source.get('url')
-                if not source_url:
+                track_url = track.get('url')
+                if not track_url:
                     continue
-                subtitles.set_default(source.get('lang') or source.get('label') or 'en', []).append({
-                    'url': source_url,
+                lang = track.get('lang') or track.get('label') or 'en'
+                subtitles.setdefault(lang, []).append({
+                    'url': track_url,
                     'ext': {
                         'scc': 'scc',
                         'webvtt': 'vtt',