aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2016-04-04 20:46:35 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2016-04-04 20:46:35 +0200
commit5bf28d7864d83be98233b6d1e478d7911f99e2cb (patch)
treef78d9ee6acf05ce891a6fc60d46390999e916f30 /youtube_dl
parent8c7d6e8e2279beccf638cd0fae9d91876e0486b2 (diff)
[utils] dfxp2srt: add additional namespace
Used by the ZDF subtitles (#9081).
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 5c4ab2748..8e53962c9 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -2131,6 +2131,7 @@ def dfxp2srt(dfxp_data):
_x = functools.partial(xpath_with_ns, ns_map={
'ttml': 'http://www.w3.org/ns/ttml',
'ttaf1': 'http://www.w3.org/2006/10/ttaf1',
+ 'ttaf1_0604': 'http://www.w3.org/2006/04/ttaf1',
})
class TTMLPElementParser(object):
@@ -2157,7 +2158,7 @@ def dfxp2srt(dfxp_data):
dfxp = compat_etree_fromstring(dfxp_data.encode('utf-8'))
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:
raise ValueError('Invalid dfxp/TTML subtitle')