You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. from ..utils import ExtractorError
  4. class FreeVideoIE(InfoExtractor):
  5. _VALID_URL = r'^http://www.freevideo.cz/vase-videa/(?P<id>[^.]+)\.html(?:$|[?#])'
  6. _TEST = {
  7. 'url': 'http://www.freevideo.cz/vase-videa/vysukany-zadecek-22033.html',
  8. 'info_dict': {
  9. 'id': 'vysukany-zadecek-22033',
  10. 'ext': 'mp4',
  11. "title": "vysukany-zadecek-22033",
  12. "age_limit": 18,
  13. },
  14. 'skip': 'Blocked outside .cz',
  15. }
  16. def _real_extract(self, url):
  17. video_id = self._match_id(url)
  18. webpage, handle = self._download_webpage_handle(url, video_id)
  19. if '//www.czechav.com/' in handle.geturl():
  20. raise ExtractorError(
  21. 'Access to freevideo is blocked from your location',
  22. expected=True)
  23. video_url = self._search_regex(
  24. r'\s+url: "(http://[a-z0-9-]+.cdn.freevideo.cz/stream/.*?/video.mp4)"',
  25. webpage, 'video URL')
  26. return {
  27. 'id': video_id,
  28. 'url': video_url,
  29. 'title': video_id,
  30. 'age_limit': 18,
  31. }