diff options
author | pulpe <Pulpan3@gmail.com> | 2014-06-17 15:14:18 +0200 |
---|---|---|
committer | pulpe <Pulpan3@gmail.com> | 2014-06-17 15:14:18 +0200 |
commit | 25e9953c6f28521b474e32c4269ebd7b00afca08 (patch) | |
tree | 62db293779ca7cff72e29b7dc2094cc9b281f7ff /youtube_dl/extractor/gorillavid.py | |
parent | f9df094ca51db94ee63d138f3fe8f2d226f30655 (diff) | |
parent | 77abae55df363fc005ad664a7fd1946e8866b43f (diff) |
Merge pull request #3059 from marcwebbie/gorillavid
* marcwebbie/gorillavid:
Changed video url to a public video
[GorillaVid] Added GorillaVid extractor
Diffstat (limited to 'youtube_dl/extractor/gorillavid.py')
-rw-r--r-- | youtube_dl/extractor/gorillavid.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/youtube_dl/extractor/gorillavid.py b/youtube_dl/extractor/gorillavid.py new file mode 100644 index 000000000..7e8b9f706 --- /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<id>\w+)(?:\-\d+x\d+)?(?:.html)?' + _TEST = { + 'url': "http://gorillavid.in/z08zf8le23c6", + 'md5': 'c9e293ca74d46cad638e199c3f3fe604', + 'info_dict': { + 'id': 'z08zf8le23c6', + 'ext': 'mp4', + 'title': 'Say something nice', + } + } + + 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 |