Merge branch 'master' of https://github.com/rg3/youtube-dl
This commit is contained in:
commit
0bacd9fc57
@ -85,6 +85,13 @@ class ZDFIE(InfoExtractor):
|
|||||||
uploader = xpath_text(doc, './/details/originChannelTitle', 'uploader')
|
uploader = xpath_text(doc, './/details/originChannelTitle', 'uploader')
|
||||||
uploader_id = xpath_text(doc, './/details/originChannelId', 'uploader id')
|
uploader_id = xpath_text(doc, './/details/originChannelId', 'uploader id')
|
||||||
upload_date = unified_strdate(xpath_text(doc, './/details/airtime', 'upload date'))
|
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):
|
def xml_to_thumbnails(fnode):
|
||||||
thumbnails = []
|
thumbnails = []
|
||||||
@ -190,6 +197,7 @@ class ZDFIE(InfoExtractor):
|
|||||||
'uploader_id': uploader_id,
|
'uploader_id': uploader_id,
|
||||||
'upload_date': upload_date,
|
'upload_date': upload_date,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
|
'subtitles': subtitles,
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
@ -2133,6 +2133,7 @@ def dfxp2srt(dfxp_data):
|
|||||||
_x = functools.partial(xpath_with_ns, ns_map={
|
_x = functools.partial(xpath_with_ns, ns_map={
|
||||||
'ttml': 'http://www.w3.org/ns/ttml',
|
'ttml': 'http://www.w3.org/ns/ttml',
|
||||||
'ttaf1': 'http://www.w3.org/2006/10/ttaf1',
|
'ttaf1': 'http://www.w3.org/2006/10/ttaf1',
|
||||||
|
'ttaf1_0604': 'http://www.w3.org/2006/04/ttaf1',
|
||||||
})
|
})
|
||||||
|
|
||||||
class TTMLPElementParser(object):
|
class TTMLPElementParser(object):
|
||||||
@ -2159,7 +2160,7 @@ def dfxp2srt(dfxp_data):
|
|||||||
|
|
||||||
dfxp = compat_etree_fromstring(dfxp_data.encode('utf-8'))
|
dfxp = compat_etree_fromstring(dfxp_data.encode('utf-8'))
|
||||||
out = []
|
out = []
|
||||||
paras = dfxp.findall(_x('.//ttml:p')) or dfxp.findall(_x('.//ttaf1:p')) or dfxp.findall('.//p')
|
paras = dfxp.findall(_x('.//ttml:p')) or dfxp.findall(_x('.//ttaf1:p')) or dfxp.findall(_x('.//ttaf1_0604:p')) or dfxp.findall('.//p')
|
||||||
|
|
||||||
if not paras:
|
if not paras:
|
||||||
raise ValueError('Invalid dfxp/TTML subtitle')
|
raise ValueError('Invalid dfxp/TTML subtitle')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user