1 from __future__ import unicode_literals
5 from .common import InfoExtractor
11 class FreeVideoIE(InfoExtractor):
12 _VALID_URL = r'^http://www.freevideo.cz/vase-videa/(?P<videoid>[^.]+)\.html$'
15 'url': 'http://www.freevideo.cz/vase-videa/vysukany-zadecek-22033.html',
16 'file': 'vysukany-zadecek-22033.mp4',
18 "title": "vysukany-zadecek-22033",
23 def _real_extract(self, url):
24 mobj = re.match(self._VALID_URL, url)
26 raise ExtractorError('Invalid search query "%s"' % query)
28 video_id = mobj.group('videoid')
31 webpage = self._download_webpage(url, video_id)
33 age_limit = self._rta_search(webpage)
35 # interpret 0 as mis-detection since this site is adult-content only.
36 # However, if we get non-0, assume the rtalabel started giving proper
40 url = re.search(r'\s+url: "(http://[a-z0-9-]+.cdn.freevideo.cz/stream/.*/video.mp4)"', webpage)
42 raise ExtractorError('ERROR: unable to extract video url')
46 'url': url.groups()[0],
48 'age_limit': age_limit,