- 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]
+ video_id = self._search_regex(
+ r'http://www\.jeuxvideo\.com/config/\w+/\d+/(.*?)/\d+_player\.xml',
+ xml_link, u'video ID')
+
+ config = self._download_xml(
+ xml_link, title, u'Downloading XML config')
+ info_json = config.find('format.json').text
+ info = json.loads(info_json)['versions'][0]