1 from .common
import InfoExtractor
9 class ProjectVeritasIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:www\.)?projectveritas\.com/(?P<type>news|video)/(?P<id>[^/?#]+)'
13 'url': 'https://www.projectveritas.com/news/exclusive-inside-the-new-york-and-new-jersey-hospitals-battling-coronavirus/',
15 'id': '51910aab-365a-5cf1-88f2-8eb1ca5fd3c6',
17 'title': 'Exclusive: Inside The New York and New Jersey Hospitals Battling Coronavirus',
18 'upload_date': '20200327',
19 'thumbnail': 'md5:6076477fe50b03eb8708be9415e18e1c',
22 'url': 'https://www.projectveritas.com/video/ilhan-omar-connected-ballot-harvester-in-cash-for-ballots-scheme-car-is-full/',
24 'id': 'c5aab304-a56b-54b1-9f0b-03b77bc5f2f6',
26 'title': 'Ilhan Omar connected Ballot Harvester in cash-for-ballots scheme: "Car is full" of absentee ballots',
27 'upload_date': '20200927',
28 'thumbnail': 'md5:194b8edf0e2ba64f25500ff4378369a4',
32 def _real_extract(self
, url
):
33 video_id
, video_type
= self
._match
_valid
_url
(url
).group('id', 'type')
34 api_url
= f
'https://www.projectveritas.com/page-data/{video_type}/{video_id}/page-data.json'
35 data_json
= self
._download
_json
(api_url
, video_id
)['result']['data']
36 main_data
= traverse_obj(data_json
, 'video', 'post')
37 video_id
= main_data
['id']
38 thumbnail
= traverse_obj(main_data
, ('image', 'ogImage', 'src'))
39 mux_asset
= traverse_obj(main_data
,
40 'muxAsset', ('body', 'json', 'content', ..., 'data', 'target', 'fields', 'muxAsset'),
41 get_all
=False, expected_type
=dict)
43 raise ExtractorError('No video on the provided url.', expected
=True)
44 playback_id
= traverse_obj(mux_asset
, 'playbackId', ('en-US', 'playbackId'))
45 formats
= self
._extract
_m
3u8_formats
(f
'https://stream.mux.com/{playback_id}.m3u8', video_id
)
48 'title': main_data
['title'],
49 'upload_date': unified_strdate(main_data
.get('date')),
50 'thumbnail': thumbnail
.replace('//', ''),