Skip to content

Commit

Permalink
[zdf] Extract subtitles (closes ytdl-org#9081)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimeMF committed Apr 4, 2016
1 parent 6d4fc66 commit 8c7d6e8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions youtube_dl/extractor/zdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ def extract_from_xml_url(self, video_id, xml_url):
uploader = xpath_text(doc, './/details/originChannelTitle', 'uploader')
uploader_id = xpath_text(doc, './/details/originChannelId', 'uploader id')
upload_date = unified_strdate(xpath_text(doc, './/details/airtime', 'upload date'))
subtitles = {}
captions_url = doc.find('.//caption/url')
if captions_url is not None:
subtitles['de'] = [{
'url': captions_url.text,
'ext': 'ttml',
}]

def xml_to_thumbnails(fnode):
thumbnails = []
Expand Down Expand Up @@ -190,6 +197,7 @@ def get_quality(elem):
'uploader_id': uploader_id,
'upload_date': upload_date,
'formats': formats,
'subtitles': subtitles,
}

def _real_extract(self, url):
Expand Down

0 comments on commit 8c7d6e8

Please sign in to comment.