Respect age_limit when listing extractors (Fixes #4653)

This commit is contained in:
Philipp Hagemeister 2015-01-07 07:20:20 +01:00
parent 76b3c61012
commit 0590062925
8 changed files with 71 additions and 24 deletions

View file

@ -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