1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-17 15:55:56 +00:00

Allow to download videos with age check from Steam

Also move method report_age_confirmation to the base IE class.
This commit is contained in:
Jaime Marquínez Ferrándiz 2013-04-21 21:56:13 +02:00
parent c04bca6f60
commit e11eb11906

View file

@ -152,6 +152,10 @@ class InfoExtractor(object):
"""Report information extraction.""" """Report information extraction."""
self.to_screen(u'%s: Extracting information' % id_or_name) self.to_screen(u'%s: Extracting information' % id_or_name)
def report_age_confirmation(self):
"""Report attempt to confirm age."""
self.to_screen(u'Confirming age')
#Methods for following #608 #Methods for following #608
#They set the correct value of the '_type' key #They set the correct value of the '_type' key
def video_result(self, video_info): def video_result(self, video_info):
@ -250,10 +254,6 @@ class YoutubeIE(InfoExtractor):
"""Report attempt to log in.""" """Report attempt to log in."""
self.to_screen(u'Logging in') self.to_screen(u'Logging in')
def report_age_confirmation(self):
"""Report attempt to confirm age."""
self.to_screen(u'Confirming age')
def report_video_webpage_download(self, video_id): def report_video_webpage_download(self, video_id):
"""Report attempt to download video webpage.""" """Report attempt to download video webpage."""
self.to_screen(u'%s: Downloading video webpage' % video_id) self.to_screen(u'%s: Downloading video webpage' % video_id)
@ -690,10 +690,6 @@ class MetacafeIE(InfoExtractor):
"""Report disclaimer retrieval.""" """Report disclaimer retrieval."""
self.to_screen(u'Retrieving disclaimer') self.to_screen(u'Retrieving disclaimer')
def report_age_confirmation(self):
"""Report attempt to confirm age."""
self.to_screen(u'Confirming age')
def report_download_webpage(self, video_id): def report_download_webpage(self, video_id):
"""Report webpage download.""" """Report webpage download."""
self.to_screen(u'%s: Downloading webpage' % video_id) self.to_screen(u'%s: Downloading webpage' % video_id)
@ -3661,7 +3657,8 @@ class SteamIE(InfoExtractor):
m = re.match(self._VALID_URL, url, re.VERBOSE) m = re.match(self._VALID_URL, url, re.VERBOSE)
urlRE = r"'movie_(?P<videoID>\d+)': \{\s*FILENAME: \"(?P<videoURL>[\w:/\.\?=]+)\"(,\s*MOVIE_NAME: \"(?P<videoName>[\w:/\.\?=\+-]+)\")?\s*\}," urlRE = r"'movie_(?P<videoID>\d+)': \{\s*FILENAME: \"(?P<videoURL>[\w:/\.\?=]+)\"(,\s*MOVIE_NAME: \"(?P<videoName>[\w:/\.\?=\+-]+)\")?\s*\},"
gameID = m.group('gameID') gameID = m.group('gameID')
videourl = 'http://store.steampowered.com/video/%s/' % gameID videourl = 'http://store.steampowered.com/agecheck/video/%s/?snr=1_agecheck_agecheck__age-gate&ageDay=1&ageMonth=January&ageYear=1970' % gameID
self.report_age_confirmation()
webpage = self._download_webpage(videourl, gameID) webpage = self._download_webpage(videourl, gameID)
mweb = re.finditer(urlRE, webpage) mweb = re.finditer(urlRE, webpage)
namesRE = r'<span class="title">(?P<videoName>.+?)</span>' namesRE = r'<span class="title">(?P<videoName>.+?)</span>'