aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2017-02-18 09:52:43 +0100
committerRemita Amine <remitamine@gmail.com>2017-02-18 09:52:43 +0100
commit70bcc444a990ee9ca3daab6f3dc2d5d58a948ba4 (patch)
treeb80a19fdd4ebdfc350a8c930adf5f587120f29d4
parent28e35f50702a8841b4caf072a546ff06ca63db96 (diff)
downloadyoutube-dl-70bcc444a990ee9ca3daab6f3dc2d5d58a948ba4.zip
youtube-dl-70bcc444a990ee9ca3daab6f3dc2d5d58a948ba4.tar.gz
youtube-dl-70bcc444a990ee9ca3daab6f3dc2d5d58a948ba4.tar.bz2
[viceland] improve info extraction and update test
-rw-r--r--youtube_dl/extractor/vice.py6
-rw-r--r--youtube_dl/extractor/viceland.py14
2 files changed, 10 insertions, 10 deletions
diff --git a/youtube_dl/extractor/vice.py b/youtube_dl/extractor/vice.py
index 8a00c8f..f0a7fd7 100644
--- a/youtube_dl/extractor/vice.py
+++ b/youtube_dl/extractor/vice.py
@@ -70,10 +70,10 @@ class ViceBaseIE(AdobePassIE):
'url': uplynk_preplay_url,
'id': video_id,
'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'),
- 'duration': parse_duration(video_data.get('video_duration') or watch_hub_data.get('video-duration')),
- 'timestamp': int_or_none(video_data.get('created_at')),
+ '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'), 1000),
'age_limit': parse_age_limit(video_data.get('video_rating')),
'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')),
diff --git a/youtube_dl/extractor/viceland.py b/youtube_dl/extractor/viceland.py
index 0eff055..87f9216 100644
--- a/youtube_dl/extractor/viceland.py
+++ b/youtube_dl/extractor/viceland.py
@@ -7,16 +7,16 @@ from .vice import ViceBaseIE
class VicelandIE(ViceBaseIE):
_VALID_URL = r'https?://(?:www\.)?viceland\.com/[^/]+/video/[^/]+/(?P<id>[a-f0-9]+)'
_TEST = {
- 'url': 'https://www.viceland.com/en_us/video/cyberwar-trailer/57608447973ee7705f6fbd4e',
+ 'url': 'https://www.viceland.com/en_us/video/trapped/588a70d0dba8a16007de7316',
'info_dict': {
- 'id': '57608447973ee7705f6fbd4e',
+ 'id': '588a70d0dba8a16007de7316',
'ext': 'mp4',
- 'title': 'CYBERWAR (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.',
+ 'title': 'TRAPPED (Series Trailer)',
+ 'description': 'md5:7a8e95c2b6cd86461502a2845e581ccf',
'age_limit': 14,
- 'timestamp': 1466008539,
- 'upload_date': '20160615',
- 'uploader_id': '11',
+ 'timestamp': 1485474122,
+ 'upload_date': '20170126',
+ 'uploader_id': '57a204098cb727dec794c6a3',
'uploader': 'Viceland',
},
'params': {