From: Philipp Hagemeister Date: Sun, 23 Jun 2013 20:05:23 +0000 (+0200) Subject: Move FunnyOrDie into its own file X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=8f0578f0fc91ad8797777698c44cc5445bf111c2;p=youtube-dl Move FunnyOrDie into its own file --- diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index 6a04735fa..a168e9952 100755 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -27,6 +27,7 @@ from .extractor.dailymotion import DailymotionIE from .extractor.depositfiles import DepositFilesIE from .extractor.escapist import EscapistIE from .extractor.facebook import FacebookIE +from .extractor.funnyordie import FunnyOrDieIE from .extractor.gametrailers import GametrailersIE from .extractor.generic import GenericIE from .extractor.googleplus import GooglePlusIE @@ -197,34 +198,6 @@ class JustinTVIE(InfoExtractor): offset += limit return info -class FunnyOrDieIE(InfoExtractor): - _VALID_URL = r'^(?:https?://)?(?:www\.)?funnyordie\.com/videos/(?P[0-9a-f]+)/.*$' - - def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - if mobj is None: - raise ExtractorError(u'invalid URL: %s' % url) - - video_id = mobj.group('id') - webpage = self._download_webpage(url, video_id) - - video_url = self._html_search_regex(r']*>\s*]*>\s*(?P.*?)</h1>", - r'<title>(?P<title>[^<]+?)'), webpage, 'title', flags=re.DOTALL) - - video_description = self._html_search_regex(r'[0-9a-f]+)/.*$' + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + + video_id = mobj.group('id') + webpage = self._download_webpage(url, video_id) + + video_url = self._html_search_regex(r']*>\s*]*>\s*(?P.*?)</h1>", + r'<title>(?P<title>[^<]+?)'), webpage, 'title', flags=re.DOTALL) + + video_description = self._html_search_regex(r'