From 8f0578f0fc91ad8797777698c44cc5445bf111c2 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Sun, 23 Jun 2013 22:05:23 +0200 Subject: [PATCH] Move FunnyOrDie into its own file --- youtube_dl/InfoExtractors.py | 29 +------------------------ youtube_dl/extractor/funnyordie.py | 34 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 28 deletions(-) create mode 100644 youtube_dl/extractor/funnyordie.py 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'