diff --git a/youtube_dl/extractor/empflix.py b/youtube_dl/extractor/empflix.py index e6952588f..1290cd9f7 100644 --- a/youtube_dl/extractor/empflix.py +++ b/youtube_dl/extractor/empflix.py @@ -35,14 +35,16 @@ def _real_extract(self, url): r'flashvars\.config = escape\("([^"]+)"', webpage, 'flashvars.config') - cfg_xml = self._download_xml( + # XML is malformed + cfg_xml = self._download_webpage( cfg_url, video_id, note='Downloading metadata') formats = [ { - 'url': item.find('videoLink').text, - 'format_id': item.find('res').text, - } for item in cfg_xml.findall('./quality/item') + 'url': item[1], + 'format_id': item[0], + } for item in re.findall( + r'\s*([^>]+)\s*([^<]+)\s*', cfg_xml) ] return {