X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/453698570f26bebd37b39df8537d993b57d77b8b..9f2b33881274af98a9145c533a1d295fad71521a:/youtube_dl/extractor/pornhd.py?ds=inline
diff --git a/youtube_dl/extractor/pornhd.py b/youtube_dl/extractor/pornhd.py
index 954dfcc..57c78ba 100644
--- a/youtube_dl/extractor/pornhd.py
+++ b/youtube_dl/extractor/pornhd.py
@@ -36,7 +36,8 @@ class PornHdIE(InfoExtractor):
webpage = self._download_webpage(url, display_id or video_id)
title = self._html_search_regex(
- r'
(.+) porn HD.+?', webpage, 'title')
+ [r']+class=["\']video-name["\'][^>]*>([^<]+)',
+ r'(.+?) - .*?[Pp]ornHD.*?'], webpage, 'title')
description = self._html_search_regex(
r'([^<]+)
', webpage, 'description', fatal=False)
view_count = int_or_none(self._html_search_regex(
@@ -46,16 +47,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 {