Allow users to specify an age limit (fixes #1545)
[youtube-dl] / youtube_dl / extractor / youporn.py
index c85fd4b5af0ccdd3f259bd403ddd4311f2de5fdb..e2860ec9d6dcb643819f42ade62384d23086d2a1 100644 (file)
@@ -51,6 +51,7 @@ class YouPornIE(InfoExtractor):
         req = compat_urllib_request.Request(url)
         req.add_header('Cookie', 'age_verified=1')
         webpage = self._download_webpage(req, video_id)
+        age_limit = self._rta_search(webpage)
 
         # Get JSON parameters
         json_params = self._search_regex(r'var currentVideo = new Video\((.*)\);', webpage, u'JSON parameters')
@@ -115,7 +116,8 @@ class YouPornIE(InfoExtractor):
                 'ext': extension,
                 'format': format,
                 'thumbnail': thumbnail,
-                'description': video_description
+                'description': video_description,
+                'age_restriction': age_limit,
             })
 
         if self._downloader.params.get('listformats', None):