mirror of
https://gitlab.com/dstftw/youtube-dl.git
synced 2020-11-16 09:42:26 +00:00
[pornhd] Fix extraction (fixes #4915)
This commit is contained in:
parent
845734773d
commit
f7a211dcc8
|
@ -46,14 +46,15 @@ class PornHdIE(InfoExtractor):
|
||||||
|
|
||||||
quality = qualities(['sd', 'hd'])
|
quality = qualities(['sd', 'hd'])
|
||||||
sources = json.loads(js_to_json(self._search_regex(
|
sources = json.loads(js_to_json(self._search_regex(
|
||||||
r"(?s)'sources'\s*:\s*(\{.+?\})\s*\}\);", webpage, 'sources')))
|
r"(?s)'sources'\s*:\s*(\{.+?\})\s*\}[;,)]",
|
||||||
|
webpage, 'sources')))
|
||||||
formats = []
|
formats = []
|
||||||
for container, s in sources.items():
|
for qname, video_url in sources.items():
|
||||||
for qname, video_url in s.items():
|
if not video_url:
|
||||||
|
continue
|
||||||
formats.append({
|
formats.append({
|
||||||
'url': video_url,
|
'url': video_url,
|
||||||
'container': container,
|
'format_id': qname,
|
||||||
'format_id': '%s-%s' % (container, qname),
|
|
||||||
'quality': quality(qname),
|
'quality': quality(qname),
|
||||||
})
|
})
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
Loading…
Reference in a new issue