diff options
author | M.Yasoob Ullah Khalid <yasoob.khld@gmail.com> | 2013-05-03 22:44:34 +0600 |
---|---|---|
committer | M.Yasoob Ullah Khalid <yasoob.khld@gmail.com> | 2013-05-03 22:44:34 +0600 |
commit | ecd5fb49c572d2fbf21f75d4513e80524b10750b (patch) | |
tree | 31403c3d43ac74636844de05b64f9b5d10ea962d /youtube_dl | |
parent | b86174e7a38cebf9deb8e4e08d89849c2cc1b9bd (diff) |
added redtube.com in InfoExtractors (2nd pull request with the required amindments)
added redtube.com in InfoExtractors (2nd pull request with the required amindments). Now this script can also download redtube.com videos
Diffstat (limited to 'youtube_dl')
-rwxr-xr-x | youtube_dl/InfoExtractors.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index 33dbaa3de..79c4f4b9e 100755 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -779,6 +779,38 @@ class MetacafeIE(InfoExtractor): 'ext': video_extension.decode('utf-8'), }] +class RedtubeIE(InfoExtractor): + """Information Extractor for redtube""" + _VALID_URL = r'(?:http://)?(?:www\.)?redtube\.com/(?P<id>[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'<source src="'+'(.+)'+'" type="video/mp4">',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('<h1 class="videoTitle slidePanelMovable">'+r'(.+)'+r'</h1>',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, + }] class DailymotionIE(InfoExtractor): """Information Extractor for Dailymotion""" @@ -4236,6 +4268,7 @@ def gen_extractors(): TEDIE(), MySpassIE(), SpiegelIE(), + RedtubeIE(), LiveLeakIE(), ARDIE(), TumblrIE(), |