1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-10 19:37:25 +00:00

[drtuber] Add age_limit and be conservative about categories (#3652)

This commit is contained in:
Philipp Hagemeister 2014-09-01 23:57:46 +02:00
parent 94388f50b3
commit 11fc065c57

View File

@ -16,6 +16,7 @@ class DrTuberIE(InfoExtractor):
'title': 'Hot Perky Blonde Naked Golf', 'title': 'Hot Perky Blonde Naked Golf',
'categories': list, # NSFW 'categories': list, # NSFW
'thumbnail': 're:https?://.*\.jpg$', 'thumbnail': 're:https?://.*\.jpg$',
'age_limit': 18,
} }
} }
@ -35,9 +36,9 @@ class DrTuberIE(InfoExtractor):
r'poster="([^"]+)"', r'poster="([^"]+)"',
webpage, 'thumbnail', fatal=False) webpage, 'thumbnail', fatal=False)
categories_str = self._html_search_regex( cats_str = self._html_search_regex(
r'<meta name="keywords" content="([^"]+)"', webpage, 'categories', fatal=False) r'<meta name="keywords" content="([^"]+)"', webpage, 'categories', fatal=False)
categories = categories_str.split(' ') categories = None if cats_str is None else cats_str.split(' ')
return { return {
'id': video_id, 'id': video_id,
@ -45,4 +46,5 @@ class DrTuberIE(InfoExtractor):
'title': title, 'title': title,
'thumbnail': thumbnail, 'thumbnail': thumbnail,
'categories': categories, 'categories': categories,
'age_limit': self._rta_search(webpage),
} }