X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=inline;f=youtube_dl%2Fextractor%2Fjeuxvideo.py;h=caf9d8c85f447cf1a8bee6b53b8e3b72ee2ad6b7;hb=fa7df757a70b40e352735de8189f2aa7f900bc8d;hp=6bb54b932298395b8f07554b12ad6091cca140d3;hpb=f219743e33a9a640bfc3845d74282774e51e1ad4;p=youtube-dl
diff --git a/youtube_dl/extractor/jeuxvideo.py b/youtube_dl/extractor/jeuxvideo.py
index 6bb54b932..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
@@ -22,7 +21,7 @@ class JeuxVideoIE(InfoExtractor):
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
- title = re.match(self._VALID_URL, url).group(1)
+ title = mobj.group(1)
webpage = self._download_webpage(url, title)
xml_link = self._html_search_regex(
r'',
@@ -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)(.*?)',
- 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']