diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-26 18:48:52 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-26 19:17:25 +0100 |
commit | e26f8712289c727a43d74a4669aee4924b9f75f2 (patch) | |
tree | ce2e34f10baacc0eb24d0527154e5374560901cd /youtube_dl/extractor/sina.py | |
parent | 6e47b51eef26dbaa3634b73914e4ee7213ad38f7 (diff) |
Use the new '_download_xml' helper in more extractors
Diffstat (limited to 'youtube_dl/extractor/sina.py')
-rw-r--r-- | youtube_dl/extractor/sina.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/youtube_dl/extractor/sina.py b/youtube_dl/extractor/sina.py index 14b1c656c..74a87fe56 100644 --- a/youtube_dl/extractor/sina.py +++ b/youtube_dl/extractor/sina.py @@ -1,7 +1,6 @@ # coding: utf-8 import re -import xml.etree.ElementTree from .common import InfoExtractor from ..utils import ( @@ -35,12 +34,11 @@ class SinaIE(InfoExtractor): def _extract_video(self, video_id): data = compat_urllib_parse.urlencode({'vid': video_id}) - url_page = self._download_webpage('http://v.iask.com/v_play.php?%s' % data, + url_doc = self._download_xml('http://v.iask.com/v_play.php?%s' % data, video_id, u'Downloading video url') image_page = self._download_webpage( 'http://interface.video.sina.com.cn/interface/common/getVideoImage.php?%s' % data, video_id, u'Downloading thumbnail info') - url_doc = xml.etree.ElementTree.fromstring(url_page.encode('utf-8')) return {'id': video_id, 'url': url_doc.find('./durl/url').text, |