From 617c0b2239f565d512a175d7fce4b5a6b3835b4c Mon Sep 17 00:00:00 2001 From: marcwebbie Date: Sat, 7 Jun 2014 23:09:45 -0300 Subject: [PATCH 1/2] [GorillaVid] Added GorillaVid extractor --- youtube_dl/extractor/__init__.py | 1 + youtube_dl/extractor/gorillavid.py | 38 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 youtube_dl/extractor/gorillavid.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 15a42ce44..6c9a7593a 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -109,6 +109,7 @@ from .gdcvault import GDCVaultIE from .generic import GenericIE from .googleplus import GooglePlusIE from .googlesearch import GoogleSearchIE +from .gorillavid import GorillaVidIE from .hark import HarkIE from .helsinki import HelsinkiIE from .hentaistigma import HentaiStigmaIE diff --git a/youtube_dl/extractor/gorillavid.py b/youtube_dl/extractor/gorillavid.py new file mode 100644 index 000000000..bdf6e30c2 --- /dev/null +++ b/youtube_dl/extractor/gorillavid.py @@ -0,0 +1,38 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor + +class GorillaVidIE(InfoExtractor): + _VALID_URL = r'https?://(?:www.)?gorillavid.in/(?:embed-)?(?P\w+)(?:\-\d+x\d+)?.html' + _TEST = { + 'url': "http://gorillavid.in/kdk7i5r1p5ye.html", + 'md5': '5a01b05ed3da82a10c6659e954b80108', + 'info_dict': { + 'id': 'kdk7i5r1p5ye', + 'ext': 'flv', + 'title': 'Full House 1x16 - But Seriously, Folks.avi', + } + } + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + video_id = mobj.group('id') + + webpage = self._download_webpage(url, video_id) + title = self._html_search_regex(r"name=['\"]fname['\"]\s+value=['\"](.*?)['\"]", webpage, u"video title") + + # download embed page again with cookies to get url + embed_url = "http://gorillavid.in/embed-{0}-960x480.html".format(video_id) + webpage = self._download_webpage(embed_url, video_id, note=u'Downloading webpage again (with cookie)') + url = self._html_search_regex(r'file:\s+["\'](http://.*?video.\w{3})["\']', webpage, url) + + info_dict = { + 'id': video_id, + 'title': title, + 'url': url, + } + + return info_dict From 77abae55df363fc005ad664a7fd1946e8866b43f Mon Sep 17 00:00:00 2001 From: marcwebbie Date: Sun, 8 Jun 2014 03:13:45 -0300 Subject: [PATCH 2/2] Changed video url to a public video --- youtube_dl/extractor/gorillavid.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/gorillavid.py b/youtube_dl/extractor/gorillavid.py index bdf6e30c2..7e8b9f706 100644 --- a/youtube_dl/extractor/gorillavid.py +++ b/youtube_dl/extractor/gorillavid.py @@ -6,14 +6,14 @@ import re from .common import InfoExtractor class GorillaVidIE(InfoExtractor): - _VALID_URL = r'https?://(?:www.)?gorillavid.in/(?:embed-)?(?P\w+)(?:\-\d+x\d+)?.html' + _VALID_URL = r'https?://(?:www.)?gorillavid.in/(?:embed-)?(?P\w+)(?:\-\d+x\d+)?(?:.html)?' _TEST = { - 'url': "http://gorillavid.in/kdk7i5r1p5ye.html", - 'md5': '5a01b05ed3da82a10c6659e954b80108', + 'url': "http://gorillavid.in/z08zf8le23c6", + 'md5': 'c9e293ca74d46cad638e199c3f3fe604', 'info_dict': { - 'id': 'kdk7i5r1p5ye', - 'ext': 'flv', - 'title': 'Full House 1x16 - But Seriously, Folks.avi', + 'id': 'z08zf8le23c6', + 'ext': 'mp4', + 'title': 'Say something nice', } }