mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-06-30 11:02:54 -05:00
Respect age_limit when listing extractors (Fixes #4653)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user