Browse Source

Call extracted property age_limit everywhere

master
Philipp Hagemeister 11 years ago
parent
commit
cfadd183c4
4 changed files with 4 additions and 4 deletions
  1. 2
      youtube_dl/YoutubeDL.py
  2. 2
      youtube_dl/extractor/pornotube.py
  3. 2
      youtube_dl/extractor/youporn.py
  4. 2
      youtube_dl/extractor/youtube.py

2
youtube_dl/YoutubeDL.py

@ -313,7 +313,7 @@ class YoutubeDL(object):
return u'[download] %s upload date is not in range %s' % (date_from_str(date).isoformat(), dateRange)
age_limit = self.params.get('age_limit')
if age_limit is not None:
if age_limit < info_dict.get('age_restriction', 0):
if age_limit < info_dict.get('age_limit', 0):
return u'Skipping "' + title + '" because it is age restricted'
return None

2
youtube_dl/extractor/pornotube.py

@ -47,6 +47,6 @@ class PornotubeIE(InfoExtractor):
'title': video_title,
'ext': 'flv',
'format': 'flv',
'age_restriction': age_limit}
'age_limit': age_limit}
return [info]

2
youtube_dl/extractor/youporn.py

@ -117,7 +117,7 @@ class YouPornIE(InfoExtractor):
'format': format,
'thumbnail': thumbnail,
'description': video_description,
'age_restriction': age_limit,
'age_limit': age_limit,
})
if self._downloader.params.get('listformats', None):

2
youtube_dl/extractor/youtube.py

@ -1496,7 +1496,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
'player_url': player_url,
'subtitles': video_subtitles,
'duration': video_duration,
'age_restriction': 18 if age_gate else 0,
'age_limit': 18 if age_gate else 0,
})
return results

Loading…
Cancel
Save