diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2015-01-07 07:20:20 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2015-01-07 07:20:20 +0100 |
commit | 059006292523264f4e7c7e03df3729612af8099c (patch) | |
tree | 8d1e12c32a966aeb373dd972838febe1d591061d /youtube_dl/utils.py | |
parent | 76b3c61012b5cd5a539e2a1a121d11427e6c4c6d (diff) |
Respect age_limit when listing extractors (Fixes #4653)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index d4951c406..29739a483 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1560,3 +1560,13 @@ def urlhandle_detect_ext(url_handle): getheader = url_handle.info().getheader return getheader('Content-Type').split("/")[1] + + +def age_restricted(content_limit, age_limit): + """ Returns True iff the content should be blocked """ + + if age_limit is None: # No limit set + return False + if content_limit is None: + return False # Content available for everyone + return age_limit < content_limit |