diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-10-06 06:06:30 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-10-06 06:08:56 +0200 |
commit | 8dbe9899a985a04690e467510c94c14f3314843b (patch) | |
tree | 137d7cff17d806d180f7763cfa369ceab607759c /youtube_dl/extractor/youporn.py | |
parent | f4aac741d5c98c4350dda478fa4564144d99d13a (diff) |
Allow users to specify an age limit (fixes #1545)
With these changes, users can now restrict what videos are downloaded by the intented audience, by specifying their age with --age-limit YEARS .
Add rudimentary support in youtube, pornotube, and youporn.
Diffstat (limited to 'youtube_dl/extractor/youporn.py')
-rw-r--r-- | youtube_dl/extractor/youporn.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/extractor/youporn.py b/youtube_dl/extractor/youporn.py index c85fd4b5a..e2860ec9d 100644 --- a/youtube_dl/extractor/youporn.py +++ b/youtube_dl/extractor/youporn.py @@ -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): |