1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-16 14:34:31 +01:00
youtube-dl/youtube_dl/extractor/viceland.py

39 lines
1.2 KiB
Python
Raw Normal View History

2016-08-14 19:03:42 +02:00
# coding: utf-8
from __future__ import unicode_literals
import re
from .vice import ViceBaseIE
2016-08-14 19:03:42 +02:00
class VicelandIE(ViceBaseIE):
_VALID_URL = r'https?://(?:www\.)?viceland\.com/(?P<locale>[^/]+)/video/[^/]+/(?P<id>[a-f0-9]+)'
2016-08-14 19:03:42 +02:00
_TEST = {
'url': 'https://www.viceland.com/en_us/video/trapped/588a70d0dba8a16007de7316',
2016-08-14 19:03:42 +02:00
'info_dict': {
'id': '588a70d0dba8a16007de7316',
2016-08-14 19:03:42 +02:00
'ext': 'mp4',
'title': 'TRAPPED (Series Trailer)',
'description': 'md5:7a8e95c2b6cd86461502a2845e581ccf',
'age_limit': 14,
'timestamp': 1485474122,
'upload_date': '20170126',
'uploader_id': '57a204098cb727dec794c6a3',
'uploader': 'Viceland',
2016-08-14 19:03:42 +02:00
},
'params': {
# m3u8 download
'skip_download': True,
},
'add_ie': ['UplynkPreplay'],
'skip': '404',
2016-08-14 19:03:42 +02:00
}
_PREPLAY_HOST = 'www.viceland'
2016-08-14 19:03:42 +02:00
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
locale = mobj.group('locale')
2016-08-14 19:03:42 +02:00
webpage = self._download_webpage(url, video_id)
return self._extract_preplay_video(url, locale, webpage)