0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-15 01:15:06 +00:00
yt-dlp/yt_dlp/extractor/fox9.py

39 lines
1.4 KiB
Python
Raw Normal View History

2019-10-29 08:43:17 +00:00
from .common import InfoExtractor
2016-11-04 14:32:30 +00:00
2019-10-29 08:43:17 +00:00
class FOX9IE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?fox9\.com/video/(?P<id>\d+)'
def _real_extract(self, url):
video_id = self._match_id(url)
return self.url_result(
'anvato:anvato_epfox_app_web_prod_b3373168e12f423f41504f207000188daf88251b:' + video_id,
'Anvato', video_id)
class FOX9NewsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?fox9\.com/news/(?P<id>[^/?&#]+)'
_TEST = {
'url': 'https://www.fox9.com/news/black-bear-in-tree-draws-crowd-in-downtown-duluth-minnesota',
2016-11-04 14:32:30 +00:00
'md5': 'd6e1b2572c3bab8a849c9103615dd243',
'info_dict': {
'id': '314473',
'ext': 'mp4',
'title': 'Bear climbs tree in downtown Duluth',
'description': 'md5:6a36bfb5073a411758a752455408ac90',
'duration': 51,
'timestamp': 1478123580,
'upload_date': '20161102',
'uploader': 'EPFOX',
'categories': ['News', 'Sports'],
'tags': ['news', 'video'],
},
2019-10-29 08:43:17 +00:00
}
2016-11-04 14:32:30 +00:00
def _real_extract(self, url):
2019-10-29 08:43:17 +00:00
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
anvato_id = self._search_regex(
r'anvatoId\s*:\s*[\'"](\d+)', webpage, 'anvato id')
return self.url_result('https://www.fox9.com/video/' + anvato_id, 'FOX9')