From 481d8ec6aa98eae62c82c8eff1f97e53dd99fd14 Mon Sep 17 00:00:00 2001 From: burnersauce Date: Sun, 23 Jul 2017 22:31:29 -0400 Subject: [PATCH] [pornhub] Correctly parse categories and tags (#13720) --- youtube_dl/extractor/pornhub.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/youtube_dl/extractor/pornhub.py b/youtube_dl/extractor/pornhub.py index e032817f2..be0b4e902 100644 --- a/youtube_dl/extractor/pornhub.py +++ b/youtube_dl/extractor/pornhub.py @@ -197,16 +197,9 @@ class PornHubIE(InfoExtractor): r'([\d,\.]+)', webpage, 'dislike') comment_count = self._extract_count( r'All Comments\s*\(([\d,.]+)\)', webpage, 'comment') - - page_params = self._parse_json(self._search_regex( - r'page_params\.zoneDetails\[([\'"])[^\'"]+\1\]\s*=\s*(?P{[^}]+})', - webpage, 'page parameters', group='data', default='{}'), - video_id, transform_source=js_to_json, fatal=False) - tags = categories = None - if page_params: - tags = page_params.get('tags', '').split(',') - categories = page_params.get('categories', '').split(',') - + categories = re.findall(r"onclick=\"ga\('send', 'event', 'Watch Page', 'click', 'Category'\);\">([^<]+)<", webpage) + tags = re.findall(r'([^<]+)<', webpage) + return { 'id': video_id, 'url': video_url,