summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPhilipp Hagemeister <[email protected]>2015-02-10 03:41:31 +0100
committerPhilipp Hagemeister <[email protected]>2015-02-10 03:41:31 +0100
commitf7a211dcc8d86fe5a4d25f4d209ffb3efc05bdfc (patch)
tree4cac1e9b8fc6a2c90f946287da0d667c3d34d7f2
parent845734773d334b1a338129dad7c656c12c8fbf6f (diff)
downloadyoutube-dl-f7a211dcc8d86fe5a4d25f4d209ffb3efc05bdfc.tar.gz
youtube-dl-f7a211dcc8d86fe5a4d25f4d209ffb3efc05bdfc.zip
[pornhd] Fix extraction (fixes #4915)
-rw-r--r--youtube_dl/extractor/pornhd.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/youtube_dl/extractor/pornhd.py b/youtube_dl/extractor/pornhd.py
index 954dfccb7..dbb2c3bd9 100644
--- a/youtube_dl/extractor/pornhd.py
+++ b/youtube_dl/extractor/pornhd.py
@@ -46,16 +46,17 @@ class PornHdIE(InfoExtractor):
quality = qualities(['sd', 'hd'])
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 = []
- for container, s in sources.items():
- for qname, video_url in s.items():
- formats.append({
- 'url': video_url,
- 'container': container,
- 'format_id': '%s-%s' % (container, qname),
- 'quality': quality(qname),
- })
+ for qname, video_url in sources.items():
+ if not video_url:
+ continue
+ formats.append({
+ 'url': video_url,
+ 'format_id': qname,
+ 'quality': quality(qname),
+ })
self._sort_formats(formats)
return {