logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

normalboots.py (2181B)


  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. from .jwplatform import JWPlatformIE
  5. from ..utils import (
  6. unified_strdate,
  7. )
  8. class NormalbootsIE(InfoExtractor):
  9. _VALID_URL = r'https?://(?:www\.)?normalboots\.com/video/(?P<id>[0-9a-z-]*)/?$'
  10. _TEST = {
  11. 'url': 'http://normalboots.com/video/home-alone-games-jontron/',
  12. 'info_dict': {
  13. 'id': 'home-alone-games-jontron',
  14. 'ext': 'mp4',
  15. 'title': 'Home Alone Games - JonTron - NormalBoots',
  16. 'description': 'Jon is late for Christmas. Typical. Thanks to: Paul Ritchey for Co-Writing/Filming: http://www.youtube.com/user/ContinueShow Michael Azzi for Christmas Intro Animation: http://michafrar.tumblr.com/ Jerrod Waters for Christmas Intro Music: http://www.youtube.com/user/xXJerryTerryXx Casey Ormond for ‘Tense Battle Theme’:\xa0http://www.youtube.com/Kiamet/',
  17. 'uploader': 'JonTron',
  18. 'upload_date': '20140125',
  19. },
  20. 'params': {
  21. # m3u8 download
  22. 'skip_download': True,
  23. },
  24. 'add_ie': ['JWPlatform'],
  25. }
  26. def _real_extract(self, url):
  27. video_id = self._match_id(url)
  28. webpage = self._download_webpage(url, video_id)
  29. video_uploader = self._html_search_regex(
  30. r'Posted\sby\s<a\shref="[A-Za-z0-9/]*">(?P<uploader>[A-Za-z]*)\s</a>',
  31. webpage, 'uploader', fatal=False)
  32. video_upload_date = unified_strdate(self._html_search_regex(
  33. r'<span style="text-transform:uppercase; font-size:inherit;">[A-Za-z]+, (?P<date>.*)</span>',
  34. webpage, 'date', fatal=False))
  35. jwplatform_url = JWPlatformIE._extract_url(webpage)
  36. return {
  37. '_type': 'url_transparent',
  38. 'id': video_id,
  39. 'url': jwplatform_url,
  40. 'ie_key': JWPlatformIE.ie_key(),
  41. 'title': self._og_search_title(webpage),
  42. 'description': self._og_search_description(webpage),
  43. 'thumbnail': self._og_search_thumbnail(webpage),
  44. 'uploader': video_uploader,
  45. 'upload_date': video_upload_date,
  46. }