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
/
extractor
/
vevo.py
diff --git
a/youtube_dl/extractor/vevo.py
b/youtube_dl/extractor/vevo.py
index c17094f8193f7678cc3d0a912c3d970f38e6bf7c..4c0de354f7d8ac467f0f027b201d785a38c77ffa 100644
(file)
--- a/
youtube_dl/extractor/vevo.py
+++ b/
youtube_dl/extractor/vevo.py
@@
-1,10
+1,10
@@
from __future__ import unicode_literals
import re
from __future__ import unicode_literals
import re
-import xml.etree.ElementTree
from .common import InfoExtractor
from ..compat import (
from .common import InfoExtractor
from ..compat import (
+ compat_etree_fromstring,
compat_urllib_request,
)
from ..utils import (
compat_urllib_request,
)
from ..utils import (
@@
-97,7
+97,7
@@
class VevoIE(InfoExtractor):
if last_version['version'] == -1:
raise ExtractorError('Unable to extract last version of the video')
if last_version['version'] == -1:
raise ExtractorError('Unable to extract last version of the video')
- renditions =
xml.etree.ElementTree.
fromstring(last_version['data'])
+ renditions =
compat_etree_
fromstring(last_version['data'])
formats = []
# Already sorted from worst to best quality
for rend in renditions.findall('rendition'):
formats = []
# Already sorted from worst to best quality
for rend in renditions.findall('rendition'):
@@
-114,7
+114,7
@@
class VevoIE(InfoExtractor):
def _formats_from_smil(self, smil_xml):
formats = []
def _formats_from_smil(self, smil_xml):
formats = []
- smil_doc =
xml.etree.ElementTree.
fromstring(smil_xml.encode('utf-8'))
+ smil_doc =
compat_etree_
fromstring(smil_xml.encode('utf-8'))
els = smil_doc.findall('.//{http://www.w3.org/2001/SMIL20/Language}video')
for el in els:
src = el.attrib['src']
els = smil_doc.findall('.//{http://www.w3.org/2001/SMIL20/Language}video')
for el in els:
src = el.attrib['src']