1
0
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-12-21 08:56:52 +00:00

[turner] Fix subtitles extraction

This commit is contained in:
Sergey M․ 2016-08-29 21:52:41 +07:00
parent 6c9b71bc08
commit 547993dcd0
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View 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',