aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-12-11 19:16:51 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-12-11 19:16:51 +0800
commitb6afc225c89e3fc70a588e5822bbb2d86705bd08 (patch)
tree87b6fd8d09fcb73c9de40e00becdc3cd7eaba553 /youtube_dl/extractor
parentad30dc1e20979842b6b81ee3f6d2364c78acf5f1 (diff)
[vevo] Use _download_smil to provide informative error messages
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/vevo.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/youtube_dl/extractor/vevo.py b/youtube_dl/extractor/vevo.py
index 3e3b25da0..02dfd36f4 100644
--- a/youtube_dl/extractor/vevo.py
+++ b/youtube_dl/extractor/vevo.py
@@ -80,7 +80,7 @@ class VevoIE(InfoExtractor):
'title': 'Till I Die - K Camp ft. T.I.',
'duration': 193,
},
- 'expected_warnings': ['HTTP Error 404'],
+ 'expected_warnings': ['Unable to download SMIL file'],
}]
_SMIL_BASE_URL = 'http://smil.lvl3.vevo.com/'
@@ -130,9 +130,8 @@ class VevoIE(InfoExtractor):
})
return formats
- def _formats_from_smil(self, smil_xml):
+ def _formats_from_smil(self, smil_doc):
formats = []
- 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']
@@ -233,10 +232,9 @@ class VevoIE(InfoExtractor):
if smil_url_m is not None:
smil_url = smil_url_m
if smil_url:
- smil_xml = self._download_webpage(
- smil_url, video_id, 'Downloading SMIL info', fatal=False)
- if smil_xml:
- formats.extend(self._formats_from_smil(smil_xml))
+ smil_doc = self._download_smil(smil_url, video_id, fatal=False)
+ if smil_doc:
+ formats.extend(self._formats_from_smil(smil_doc))
self._sort_formats(formats)
timestamp = int_or_none(self._search_regex(