2014-11-08 07:19:26 +09:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from .common import InfoExtractor
|
2014-11-13 23:59:22 +09:00
|
|
|
from ..utils import ExtractorError
|
2014-11-08 07:19:26 +09:00
|
|
|
|
|
|
|
|
|
|
|
class FreeVideoIE(InfoExtractor):
|
2014-11-13 23:59:22 +09:00
|
|
|
_VALID_URL = r'^http://www.freevideo.cz/vase-videa/(?P<id>[^.]+)\.html(?:$|[?#])'
|
2014-11-08 07:19:26 +09:00
|
|
|
|
|
|
|
_TEST = {
|
|
|
|
'url': 'http://www.freevideo.cz/vase-videa/vysukany-zadecek-22033.html',
|
|
|
|
'info_dict': {
|
2014-11-13 23:59:22 +09:00
|
|
|
'id': 'vysukany-zadecek-22033',
|
|
|
|
'ext': 'mp4',
|
2016-02-14 18:37:17 +09:00
|
|
|
'title': 'vysukany-zadecek-22033',
|
|
|
|
'age_limit': 18,
|
2014-11-13 23:59:22 +09:00
|
|
|
},
|
|
|
|
'skip': 'Blocked outside .cz',
|
2014-11-08 07:19:26 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2014-11-13 23:59:22 +09:00
|
|
|
video_id = self._match_id(url)
|
|
|
|
webpage, handle = self._download_webpage_handle(url, video_id)
|
|
|
|
if '//www.czechav.com/' in handle.geturl():
|
|
|
|
raise ExtractorError(
|
|
|
|
'Access to freevideo is blocked from your location',
|
|
|
|
expected=True)
|
2014-11-08 07:19:26 +09:00
|
|
|
|
2014-11-13 23:59:22 +09:00
|
|
|
video_url = self._search_regex(
|
|
|
|
r'\s+url: "(http://[a-z0-9-]+.cdn.freevideo.cz/stream/.*?/video.mp4)"',
|
|
|
|
webpage, 'video URL')
|
2014-11-08 07:19:26 +09:00
|
|
|
|
|
|
|
return {
|
|
|
|
'id': video_id,
|
2014-11-13 23:59:22 +09:00
|
|
|
'url': video_url,
|
2014-11-08 07:19:26 +09:00
|
|
|
'title': video_id,
|
2014-11-13 23:59:22 +09:00
|
|
|
'age_limit': 18,
|
2014-11-08 07:19:26 +09:00
|
|
|
}
|