aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-01-07 07:30:57 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2015-01-07 07:30:57 +0100
commite4a8eae701f22395dae607ed000d39f7a57e80a0 (patch)
treeff33173e1320f25a6af60140c3cd4ff98346d2c3 /youtube_dl/utils.py
parent75e51819d010b38d9a3464f8749688c8d53fc123 (diff)
parent8ee341500dea885c79316fb8f12adde2028c55a5 (diff)
Merge commit '8ee3415'
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py10
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