mirror of
				https://github.com/ytdl-org/youtube-dl.git
				synced 2025-10-29 09:26:20 -07:00 
			
		
		
		
	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.
This commit is contained in:
		| @@ -54,6 +54,7 @@ class InfoExtractor(object): | ||||
|     view_count:     How many users have watched the video on the platform. | ||||
|     urlhandle:      [internal] The urlHandle to be used to download the file, | ||||
|                     like returned by urllib.request.urlopen | ||||
|     age_limit:      Age restriction for the video, as an integer (years) | ||||
|     formats:        A list of dictionaries for each format available, it must | ||||
|                     be ordered from worst to best quality. Potential fields: | ||||
|                     * url       Mandatory. The URL of the video file | ||||
| @@ -318,6 +319,15 @@ class InfoExtractor(object): | ||||
|                                         self._og_regex('video')], | ||||
|                                        html, name, **kargs) | ||||
|  | ||||
|     def _rta_search(self, html): | ||||
|         # See http://www.rtalabel.org/index.php?content=howtofaq#single | ||||
|         if re.search(r'(?ix)<meta\s+name="rating"\s+' | ||||
|                      r'     content="RTA-5042-1996-1400-1577-RTA"', | ||||
|                      html): | ||||
|             return 18 | ||||
|         return 0 | ||||
|  | ||||
|  | ||||
| class SearchInfoExtractor(InfoExtractor): | ||||
|     """ | ||||
|     Base class for paged search queries extractors. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user