mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-05 12:00:21 +00:00
[empflix] Adapt to malformed config XML
This commit is contained in:
parent
dbc1366b50
commit
c7bee2a725
@ -35,14 +35,16 @@ def _real_extract(self, url):
|
|||||||
r'flashvars\.config = escape\("([^"]+)"',
|
r'flashvars\.config = escape\("([^"]+)"',
|
||||||
webpage, 'flashvars.config')
|
webpage, 'flashvars.config')
|
||||||
|
|
||||||
cfg_xml = self._download_xml(
|
# XML is malformed
|
||||||
|
cfg_xml = self._download_webpage(
|
||||||
cfg_url, video_id, note='Downloading metadata')
|
cfg_url, video_id, note='Downloading metadata')
|
||||||
|
|
||||||
formats = [
|
formats = [
|
||||||
{
|
{
|
||||||
'url': item.find('videoLink').text,
|
'url': item[1],
|
||||||
'format_id': item.find('res').text,
|
'format_id': item[0],
|
||||||
} for item in cfg_xml.findall('./quality/item')
|
} for item in re.findall(
|
||||||
|
r'<item>\s*<res>([^>]+)</res>\s*<videoLink>([^<]+)</videoLink>\s*</item>', cfg_xml)
|
||||||
]
|
]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user