mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-13 18:52:50 +08:00
[pornhub] Correctly parse categories and tags (#13720)
This commit is contained in:
parent
c99d6890cb
commit
481d8ec6aa
@ -197,15 +197,8 @@ class PornHubIE(InfoExtractor):
|
|||||||
r'<span class="votesDown">([\d,\.]+)</span>', webpage, 'dislike')
|
r'<span class="votesDown">([\d,\.]+)</span>', webpage, 'dislike')
|
||||||
comment_count = self._extract_count(
|
comment_count = self._extract_count(
|
||||||
r'All Comments\s*<span>\(([\d,.]+)\)', webpage, 'comment')
|
r'All Comments\s*<span>\(([\d,.]+)\)', webpage, 'comment')
|
||||||
|
categories = re.findall(r"onclick=\"ga\('send', 'event', 'Watch Page', 'click', 'Category'\);\">([^<]+)<", webpage)
|
||||||
page_params = self._parse_json(self._search_regex(
|
tags = re.findall(r'<a href="/video/search\?search=[^"]+">([^<]+)<', webpage)
|
||||||
r'page_params\.zoneDetails\[([\'"])[^\'"]+\1\]\s*=\s*(?P<data>{[^}]+})',
|
|
||||||
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(',')
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user