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/jeuxvideo.py | |
parent | 6e47b51eef26dbaa3634b73914e4ee7213ad38f7 (diff) |
Use the new '_download_xml' helper in more extractors
Diffstat (limited to 'youtube_dl/extractor/jeuxvideo.py')
-rw-r--r-- | youtube_dl/extractor/jeuxvideo.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/youtube_dl/extractor/jeuxvideo.py b/youtube_dl/extractor/jeuxvideo.py index 0020c47cf..caf9d8c85 100644 --- a/youtube_dl/extractor/jeuxvideo.py +++ b/youtube_dl/extractor/jeuxvideo.py @@ -2,7 +2,6 @@ import json import re -import xml.etree.ElementTree from .common import InfoExtractor @@ -32,12 +31,9 @@ class JeuxVideoIE(InfoExtractor): r'http://www\.jeuxvideo\.com/config/\w+/\d+/(.*?)/\d+_player\.xml', xml_link, u'video ID') - xml_config = self._download_webpage( + config = self._download_xml( xml_link, title, u'Downloading XML config') - config = xml.etree.ElementTree.fromstring(xml_config.encode('utf-8')) - info_json = self._search_regex( - r'(?sm)<format\.json>(.*?)</format\.json>', - xml_config, u'JSON information') + info_json = config.find('format.json').text info = json.loads(info_json)['versions'][0] video_url = 'http://video720.jeuxvideo.com/' + info['file'] |