X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2FInfoExtractors.py;h=8b2442bacc21e86db7ffdc920116b51e79fd3820;hb=5e34d2ebbf9906bded4201d7bd8bb82e9353de9f;hp=33dbaa3de4fa0de4c9e6350970c2f4fa31a95589;hpb=2e2038dc352de8a10525eb103bd9f6a6ae5b43f9;p=youtube-dl diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index 33dbaa3de..8b2442bac 100755 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -779,7 +779,6 @@ class MetacafeIE(InfoExtractor): 'ext': video_extension.decode('utf-8'), }] - class DailymotionIE(InfoExtractor): """Information Extractor for Dailymotion""" @@ -4184,6 +4183,39 @@ class BandcampIE(InfoExtractor): return [track_info] +class RedtubeIE(InfoExtractor): + """Information Extractor for redtube""" + _VALID_URL = r'(?:http://)?(?:www\.)?redtube\.com/(?P[0-9]+)' + IE_NAME = u'redtube' + + def _real_extract(self,url): + mobj = re.match(self._VALID_URL, url) + if mobj is None: + self._downloader.report_error(u'invalid URL: %s' % url) + return + video_id = mobj.group('id') + video_extension = 'mp4' + webpage = self._download_webpage(url, video_id) + self.report_extraction(video_id) + mobj = re.search(r'',webpage) + if mobj is not None: + video_url = mobj.group(1) + else: + self._downloader.report_error(u'unable to extract media URL') + return + mobj = re.search('

'+r'(.+)'+r'

',webpage) + if mobj is not None: + video_title = mobj.group(1) + else: + video_title = 'Redtube - %s' % time.ctime() + + return [{ + 'id': video_id, + 'url': video_url, + 'ext': video_extension, + 'title': video_title, + }] + def gen_extractors(): """ Return a list of an instance of every supported extractor. @@ -4240,6 +4272,7 @@ def gen_extractors(): ARDIE(), TumblrIE(), BandcampIE(), + RedtubeIE(), GenericIE() ]