[YouTubeDL] Correct handling of age_limit = None in result
authorPhilipp Hagemeister <phihag@phihag.de>
Fri, 22 Aug 2014 15:46:57 +0000 (17:46 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Fri, 22 Aug 2014 15:46:57 +0000 (17:46 +0200)
youtube_dl/YoutubeDL.py

index e7194f3e314b78bd44cb71b755e2de9c666829fe..a671d6450469167381f1649f54108d1ea6ab5533 100755 (executable)
@@ -480,7 +480,10 @@ class YoutubeDL(object):
                 return 'Skipping %s, because it has exceeded the maximum view count (%d/%d)' % (video_title, view_count, max_views)
         age_limit = self.params.get('age_limit')
         if age_limit is not None:
-            if age_limit < info_dict.get('age_limit', 0):
+            actual_age_limit = info_dict.get('age_limit')
+            if actual_age_limit is None:
+                actual_age_limit = 0
+            if age_limit < actual_age_limit:
                 return 'Skipping "' + title + '" because it is age restricted'
         if self.in_download_archive(info_dict):
             return '%s has already been recorded in archive' % video_title