From a72b12b142841fb297948bdb66de7ac12548137a Mon Sep 17 00:00:00 2001 From: Gabriel Smith Date: Fri, 27 Apr 2018 00:58:03 -0500 Subject: [PATCH] Adding extactor for Ifunny and import for it in extractors.py --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/ifunny.py | 32 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 youtube_dl/extractor/ifunny.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index c9f60114d..9ae7af552 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -452,6 +452,7 @@ from .huajiao import HuajiaoIE from .huffpost import HuffPostIE from .hypem import HypemIE from .iconosquare import IconosquareIE +from .ifunny import IFunnyIE from .ign import ( IGNIE, OneUPIE, diff --git a/youtube_dl/extractor/ifunny.py b/youtube_dl/extractor/ifunny.py new file mode 100644 index 000000000..0a4063970 --- /dev/null +++ b/youtube_dl/extractor/ifunny.py @@ -0,0 +1,32 @@ +from .common import InfoExtractor + +class IFunnyIE(InfoExtractor): + _VALID_URL = r'(?:https?:\/\/)?(?:www\.)?ifunny\.co\/fun\/(?P\w+)' + + _TEST = { + u'url': u'https://ifunny.co/fun/pQ0qJYrT5', + u'file': u'Found on iFunny-pQ0qJYrT5.mp4', + u'md5': u'1e6486c492bbefe5fcc2291c9d891000', + u'info_dict': { + u"id": u"pQ0qJYrT5", + u"ext": u"mp4", + u"title": u"Found on IFunny" + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage_url = 'https://ifunny.co/fun/' + video_id + webpage = self._download_webpage(webpage_url, video_id) + + # Log that we are starting to parse the page + self.report_extraction(video_id) + + video_url = self._html_search_regex(r'