- m_download = re.search(r'<param name="flashvars" value="config=(.*?)" />', webpage)
-
- xml_link = m_download.group(1)
-
- id = re.search(r'http://www.jeuxvideo.com/config/\w+/0011/(.*?)/\d+_player\.xml', xml_link).group(1)
-
- xml_config = self._download_webpage(xml_link, title,
- 'Downloading XML config')
- config = xml.etree.ElementTree.fromstring(xml_config.encode('utf-8'))
- info = re.search(r'<format\.json>(.*?)</format\.json>',
- xml_config, re.MULTILINE|re.DOTALL).group(1)
- info = json.loads(info)['versions'][0]
-
+ xml_link = self._html_search_regex(
+ r'<param name="flashvars" value="config=(.*?)" />',
+ webpage, 'config URL')
+
+ video_id = self._search_regex(
+ r'http://www\.jeuxvideo\.com/config/\w+/\d+/(.*?)/\d+_player\.xml',
+ xml_link, 'video ID')
+
+ config = self._download_xml(
+ xml_link, title, 'Downloading XML config')
+ info_json = config.find('format.json').text
+ info = json.loads(info_json)['versions'][0]
+