0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-16 01:25:06 +00:00

[drtuber] Fix categories

This commit is contained in:
Sergey M․ 2014-09-18 20:56:54 +07:00
parent 2f834e9381
commit 2914e5f00f

View file

@ -19,7 +19,7 @@ class DrTuberIE(InfoExtractor):
'like_count': int, 'like_count': int,
'dislike_count': int, 'dislike_count': int,
'comment_count': int, 'comment_count': int,
'categories': list, # NSFW 'categories': ['Babe', 'Blonde', 'Erotic', 'Outdoor', 'Softcore', 'Solo'],
'thumbnail': 're:https?://.*\.jpg$', 'thumbnail': 're:https?://.*\.jpg$',
'age_limit': 18, 'age_limit': 18,
} }
@ -52,9 +52,9 @@ def _real_extract(self, url):
r'<span class="comments_count">([\d,\.]+)</span>', r'<span class="comments_count">([\d,\.]+)</span>',
webpage, 'comment count', fatal=False)) webpage, 'comment count', fatal=False))
cats_str = self._html_search_regex( cats_str = self._search_regex(
r'<meta name="keywords" content="([^"]+)"', webpage, 'categories', fatal=False) r'<span>Categories:</span><div>(.+?)</div>', webpage, 'categories', fatal=False)
categories = None if cats_str is None else cats_str.split(' ') categories = [] if not cats_str else re.findall(r'<a title="([^"]+)"', cats_str)
return { return {
'id': video_id, 'id': video_id,