[extractor/foxnews] Add FoxNewsVideo extractor

Closes #5133
This commit is contained in:
pukkandan 2022-11-07 02:59:53 +05:30
parent 5da08bde9e
commit e9ce4e9250
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39
2 changed files with 24 additions and 0 deletions

View file

@ -588,6 +588,7 @@ from .foxgay import FoxgayIE
from .foxnews import (
FoxNewsIE,
FoxNewsArticleIE,
FoxNewsVideoIE,
)
from .foxsports import FoxSportsIE
from .fptplay import FptplayIE

View file

@ -75,6 +75,29 @@ class FoxNewsIE(AMPIE):
return info
class FoxNewsVideoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?foxnews\.com/video/(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.foxnews.com/video/6313058664112',
'info_dict': {
'id': '6313058664112',
'ext': 'mp4',
'thumbnail': r're:https://.+/1280x720/match/image\.jpg',
'upload_date': '20220930',
'description': 'New York City, Kids Therapy, Biden',
'duration': 2415,
'title': 'Gutfeld! - Thursday, September 29',
'timestamp': 1664527538,
},
'expected_warnings': ['Ignoring subtitle tracks'],
'params': {'skip_download': 'm3u8'},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
return self.url_result(f'https://video.foxnews.com/v/{video_id}', FoxNewsIE, video_id)
class FoxNewsArticleIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:insider\.)?foxnews\.com/(?!v)([^/]+/)+(?P<id>[a-z-]+)'
IE_NAME = 'foxnews:article'