2 from __future__ import unicode_literals
6 from .common import InfoExtractor
13 class AllmyvideosIE(InfoExtractor):
14 IE_NAME = 'allmyvideos.net'
15 _VALID_URL = r'https?://allmyvideos\.net/(?P<id>[a-zA-Z0-9_-]+)'
18 'url': 'http://allmyvideos.net/jih3nce3x6wn',
19 'md5': '8f26c1e7102556a0d7f24306d32c2092',
23 'title': 'youtube-dl test video',
27 def _real_extract(self, url):
28 mobj = re.match(self._VALID_URL, url)
29 video_id = mobj.group('id')
31 orig_webpage = self._download_webpage(url, video_id)
32 fields = re.findall(r'type="hidden" name="(.+?)"\s* value="?(.+?)">', orig_webpage)
34 for name, value in fields:
37 post = compat_urllib_parse.urlencode(data)
39 b'Content-Type': b'application/x-www-form-urlencoded',
41 req = compat_urllib_request.Request(url, post, headers)
42 webpage = self._download_webpage(req, video_id, note='Downloading video page ...')
44 #Could be several links with different quality
45 links = re.findall(r'"file" : "?(.+?)",', webpage)
49 'title': data['fname'][:len(data['fname'])-4], #Remove .mp4 extension
50 'url': links[len(links)-1] #Choose the higher quality link