mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-18 09:17:49 +01:00
[viceland] improve info extraction and update test
This commit is contained in:
parent
28e35f5070
commit
70bcc444a9
@ -70,10 +70,10 @@ def _extract_preplay_video(self, url, webpage):
|
|||||||
'url': uplynk_preplay_url,
|
'url': uplynk_preplay_url,
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': base.get('body'),
|
'description': base.get('body') or base.get('display_body'),
|
||||||
'thumbnail': watch_hub_data.get('cover-image') or watch_hub_data.get('thumbnail'),
|
'thumbnail': watch_hub_data.get('cover-image') or watch_hub_data.get('thumbnail'),
|
||||||
'duration': parse_duration(video_data.get('video_duration') or watch_hub_data.get('video-duration')),
|
'duration': int_or_none(video_data.get('video_duration')) or parse_duration(watch_hub_data.get('video-duration')),
|
||||||
'timestamp': int_or_none(video_data.get('created_at')),
|
'timestamp': int_or_none(video_data.get('created_at'), 1000),
|
||||||
'age_limit': parse_age_limit(video_data.get('video_rating')),
|
'age_limit': parse_age_limit(video_data.get('video_rating')),
|
||||||
'series': video_data.get('show_title') or watch_hub_data.get('show-title'),
|
'series': video_data.get('show_title') or watch_hub_data.get('show-title'),
|
||||||
'episode_number': int_or_none(episode.get('episode_number') or watch_hub_data.get('episode')),
|
'episode_number': int_or_none(episode.get('episode_number') or watch_hub_data.get('episode')),
|
||||||
|
@ -7,16 +7,16 @@
|
|||||||
class VicelandIE(ViceBaseIE):
|
class VicelandIE(ViceBaseIE):
|
||||||
_VALID_URL = r'https?://(?:www\.)?viceland\.com/[^/]+/video/[^/]+/(?P<id>[a-f0-9]+)'
|
_VALID_URL = r'https?://(?:www\.)?viceland\.com/[^/]+/video/[^/]+/(?P<id>[a-f0-9]+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'https://www.viceland.com/en_us/video/cyberwar-trailer/57608447973ee7705f6fbd4e',
|
'url': 'https://www.viceland.com/en_us/video/trapped/588a70d0dba8a16007de7316',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '57608447973ee7705f6fbd4e',
|
'id': '588a70d0dba8a16007de7316',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'CYBERWAR (Trailer)',
|
'title': 'TRAPPED (Series Trailer)',
|
||||||
'description': 'Tapping into the geopolitics of hacking and surveillance, Ben Makuch travels the world to meet with hackers, government officials, and dissidents to investigate the ecosystem of cyberwarfare.',
|
'description': 'md5:7a8e95c2b6cd86461502a2845e581ccf',
|
||||||
'age_limit': 14,
|
'age_limit': 14,
|
||||||
'timestamp': 1466008539,
|
'timestamp': 1485474122,
|
||||||
'upload_date': '20160615',
|
'upload_date': '20170126',
|
||||||
'uploader_id': '11',
|
'uploader_id': '57a204098cb727dec794c6a3',
|
||||||
'uploader': 'Viceland',
|
'uploader': 'Viceland',
|
||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
|
Loading…
Reference in New Issue
Block a user