projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use a wrapper around xml.etree.ElementTree.fromstring in python 2.x (#7178)
[youtube-dl]
/
youtube_dl
/
utils.py
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index a61e47646712791f0b4aa1efd2606b0667cc2b0d..7d846d68085cdbf13e88f116b30b0ad9f2f21b0c 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-36,6
+36,7
@@
import zlib
from .compat import (
compat_basestring,
compat_chr,
from .compat import (
compat_basestring,
compat_chr,
+ compat_etree_fromstring,
compat_html_entities,
compat_http_client,
compat_kwargs,
compat_html_entities,
compat_http_client,
compat_kwargs,
@@
-1974,7
+1975,7
@@
def dfxp2srt(dfxp_data):
return out
return out
- dfxp =
xml.etree.ElementTree.
fromstring(dfxp_data.encode('utf-8'))
+ 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')
out = []
paras = dfxp.findall(_x('.//ttml:p')) or dfxp.findall(_x('.//ttaf1:p')) or dfxp.findall('.//p')