You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. import re
  4. from .vice import ViceBaseIE
  5. class VicelandIE(ViceBaseIE):
  6. _VALID_URL = r'https?://(?:www\.)?viceland\.com/(?P<locale>[^/]+)/video/[^/]+/(?P<id>[a-f0-9]+)'
  7. _TEST = {
  8. 'url': 'https://www.viceland.com/en_us/video/trapped/588a70d0dba8a16007de7316',
  9. 'info_dict': {
  10. 'id': '588a70d0dba8a16007de7316',
  11. 'ext': 'mp4',
  12. 'title': 'TRAPPED (Series Trailer)',
  13. 'description': 'md5:7a8e95c2b6cd86461502a2845e581ccf',
  14. 'age_limit': 14,
  15. 'timestamp': 1485474122,
  16. 'upload_date': '20170126',
  17. 'uploader_id': '57a204098cb727dec794c6a3',
  18. 'uploader': 'Viceland',
  19. },
  20. 'params': {
  21. # m3u8 download
  22. 'skip_download': True,
  23. },
  24. 'add_ie': ['UplynkPreplay'],
  25. 'skip': '404',
  26. }
  27. _PREPLAY_HOST = 'www.viceland'
  28. def _real_extract(self, url):
  29. mobj = re.match(self._VALID_URL, url)
  30. video_id = mobj.group('id')
  31. locale = mobj.group('locale')
  32. webpage = self._download_webpage(url, video_id)
  33. return self._extract_preplay_video(url, locale, webpage)