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.

42 lines
1.3 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .anvato import AnvatoIE
  4. class FOX9IE(AnvatoIE):
  5. _VALID_URL = r'https?://(?:www\.)?fox9\.com/(?:[^/]+/)+(?P<id>\d+)-story'
  6. _TESTS = [{
  7. 'url': 'http://www.fox9.com/news/215123287-story',
  8. 'md5': 'd6e1b2572c3bab8a849c9103615dd243',
  9. 'info_dict': {
  10. 'id': '314473',
  11. 'ext': 'mp4',
  12. 'title': 'Bear climbs tree in downtown Duluth',
  13. 'description': 'md5:6a36bfb5073a411758a752455408ac90',
  14. 'duration': 51,
  15. 'timestamp': 1478123580,
  16. 'upload_date': '20161102',
  17. 'uploader': 'EPFOX',
  18. 'categories': ['News', 'Sports'],
  19. 'tags': ['news', 'video'],
  20. },
  21. }, {
  22. 'url': 'http://www.fox9.com/news/investigators/214070684-story',
  23. 'only_matching': True,
  24. }]
  25. def _real_extract(self, url):
  26. video_id = self._match_id(url)
  27. webpage = self._download_webpage(url, video_id)
  28. video_id = self._parse_json(
  29. self._search_regex(
  30. r"this\.videosJson\s*=\s*'(\[.+?\])';",
  31. webpage, 'anvato playlist'),
  32. video_id)[0]['video']
  33. return self._get_anvato_videos(
  34. 'anvato_epfox_app_web_prod_b3373168e12f423f41504f207000188daf88251b',
  35. video_id)