Respect age_limit when listing extractors (Fixes #4653)
This commit is contained in:
parent
76b3c61012
commit
0590062925
8 changed files with 71 additions and 24 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue