about summary refs log tree commit diff
path: root/youtube_dl/extractor/drtuber.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-09-01 23:57:46 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-09-01 23:57:46 +0200
commit11fc065c5733171efcf3db75ce1de3ada143f433 (patch)
tree923152db12f58c7d0b5ed15120a74b240f18d796 /youtube_dl/extractor/drtuber.py
parent94388f50b39e750f81e9baeb9fea0354f209d4e9 (diff)
downloadyoutube-dl-11fc065c5733171efcf3db75ce1de3ada143f433.tar.gz
youtube-dl-11fc065c5733171efcf3db75ce1de3ada143f433.tar.xz
youtube-dl-11fc065c5733171efcf3db75ce1de3ada143f433.zip
[drtuber] Add age_limit and be conservative about categories (#3652)
Diffstat (limited to 'youtube_dl/extractor/drtuber.py')
-rw-r--r--youtube_dl/extractor/drtuber.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/drtuber.py b/youtube_dl/extractor/drtuber.py
index 7b4b19509..9a13925b4 100644
--- a/youtube_dl/extractor/drtuber.py
+++ b/youtube_dl/extractor/drtuber.py
@@ -16,6 +16,7 @@ class DrTuberIE(InfoExtractor):
             'title': 'Hot Perky Blonde Naked Golf',
             'categories': list,  # NSFW
             'thumbnail': 're:https?://.*\.jpg$',
+            'age_limit': 18,
         }
     }
 
@@ -35,9 +36,9 @@ class DrTuberIE(InfoExtractor):
             r'poster="([^"]+)"',
             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)
-        categories = categories_str.split(' ')
+        categories = None if cats_str is None else cats_str.split(' ')
 
         return {
             'id': video_id,
@@ -45,4 +46,5 @@ class DrTuberIE(InfoExtractor):
             'title': title,
             'thumbnail': thumbnail,
             'categories': categories,
+            'age_limit': self._rta_search(webpage),
         }