logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

fox9.py (1466B)


  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class FOX9IE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?fox9\.com/video/(?P<id>\d+)'
  6. def _real_extract(self, url):
  7. video_id = self._match_id(url)
  8. return self.url_result(
  9. 'anvato:anvato_epfox_app_web_prod_b3373168e12f423f41504f207000188daf88251b:' + video_id,
  10. 'Anvato', video_id)
  11. class FOX9NewsIE(InfoExtractor):
  12. _VALID_URL = r'https?://(?:www\.)?fox9\.com/news/(?P<id>[^/?&#]+)'
  13. _TEST = {
  14. 'url': 'https://www.fox9.com/news/black-bear-in-tree-draws-crowd-in-downtown-duluth-minnesota',
  15. 'md5': 'd6e1b2572c3bab8a849c9103615dd243',
  16. 'info_dict': {
  17. 'id': '314473',
  18. 'ext': 'mp4',
  19. 'title': 'Bear climbs tree in downtown Duluth',
  20. 'description': 'md5:6a36bfb5073a411758a752455408ac90',
  21. 'duration': 51,
  22. 'timestamp': 1478123580,
  23. 'upload_date': '20161102',
  24. 'uploader': 'EPFOX',
  25. 'categories': ['News', 'Sports'],
  26. 'tags': ['news', 'video'],
  27. },
  28. }
  29. def _real_extract(self, url):
  30. display_id = self._match_id(url)
  31. webpage = self._download_webpage(url, display_id)
  32. anvato_id = self._search_regex(
  33. r'anvatoId\s*:\s*[\'"](\d+)', webpage, 'anvato id')
  34. return self.url_result('https://www.fox9.com/video/' + anvato_id, 'FOX9')