1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
6 from .common import InfoExtractor
11 compat_urllib_request,
15 class GorillaVidIE(InfoExtractor):
16 IE_DESC = 'GorillaVid.in, daclips.in and movpod.in'
18 https?://(?P<host>(?:www\.)?
19 (?:daclips\.in|gorillavid\.in|movpod\.in))/
20 (?:embed-)?(?P<id>[0-9a-zA-Z]+)(?:-[0-9]+x[0-9]+\.html)?
24 'url': 'http://gorillavid.in/06y9juieqpmi',
25 'md5': '5ae4a3580620380619678ee4875893ba',
29 'title': 'Rebecca Black My Moment Official Music Video Reaction-6GK87Rc8bzQ',
30 'thumbnail': 're:http://.*\.jpg',
33 'url': 'http://gorillavid.in/embed-z08zf8le23c6-960x480.html',
34 'md5': 'c9e293ca74d46cad638e199c3f3fe604',
38 'title': 'Say something nice',
39 'thumbnail': 're:http://.*\.jpg',
42 'url': 'http://daclips.in/3rso4kdn6f9m',
43 'md5': '1ad8fd39bb976eeb66004d3a4895f106',
47 'title': 'Micro Pig piglets ready on 16th July 2009',
48 'thumbnail': 're:http://.*\.jpg',
51 'url': 'http://movpod.in/0wguyyxi1yca',
52 'only_matching': True,
55 def _real_extract(self, url):
56 mobj = re.match(self._VALID_URL, url)
57 video_id = mobj.group('id')
59 webpage = self._download_webpage('http://%s/%s' % (mobj.group('host'), video_id), video_id)
61 fields = dict(re.findall(r'''(?x)<input\s+
68 if fields['op'] == 'download1':
69 post = compat_urllib_parse.urlencode(fields)
71 req = compat_urllib_request.Request(url, post)
72 req.add_header('Content-type', 'application/x-www-form-urlencoded')
74 webpage = self._download_webpage(req, video_id, 'Downloading video page')
76 title = self._search_regex(r'style="z-index: [0-9]+;">([^<]+)</span>', webpage, 'title')
77 video_url = self._search_regex(r'file\s*:\s*\'(http[^\']+)\',', webpage, 'file url')
78 thumbnail = self._search_regex(r'image\s*:\s*\'(http[^\']+)\',', webpage, 'thumbnail', fatal=False)
83 'ext': determine_ext(video_url),
90 'thumbnail': thumbnail,