normalboots.py 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. from .common import InfoExtractor
  2. from .jwplatform import JWPlatformIE
  3. from ..utils import (
  4. unified_strdate,
  5. )
  6. class NormalbootsIE(InfoExtractor):
  7. _VALID_URL = r'https?://(?:www\.)?normalboots\.com/video/(?P<id>[0-9a-z-]*)/?$'
  8. _TEST = {
  9. 'url': 'http://normalboots.com/video/home-alone-games-jontron/',
  10. 'info_dict': {
  11. 'id': 'home-alone-games-jontron',
  12. 'ext': 'mp4',
  13. 'title': 'Home Alone Games - JonTron - NormalBoots',
  14. '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/',
  15. 'uploader': 'JonTron',
  16. 'upload_date': '20140125',
  17. },
  18. 'params': {
  19. # m3u8 download
  20. 'skip_download': True,
  21. },
  22. 'add_ie': ['JWPlatform'],
  23. }
  24. def _real_extract(self, url):
  25. video_id = self._match_id(url)
  26. webpage = self._download_webpage(url, video_id)
  27. video_uploader = self._html_search_regex(
  28. r'Posted\sby\s<a\shref="[A-Za-z0-9/]*">(?P<uploader>[A-Za-z]*)\s</a>',
  29. webpage, 'uploader', fatal=False)
  30. video_upload_date = unified_strdate(self._html_search_regex(
  31. r'<span style="text-transform:uppercase; font-size:inherit;">[A-Za-z]+, (?P<date>.*)</span>',
  32. webpage, 'date', fatal=False))
  33. jwplatform_url = JWPlatformIE._extract_url(webpage)
  34. return {
  35. '_type': 'url_transparent',
  36. 'id': video_id,
  37. 'url': jwplatform_url,
  38. 'ie_key': JWPlatformIE.ie_key(),
  39. 'title': self._og_search_title(webpage),
  40. 'description': self._og_search_description(webpage),
  41. 'thumbnail': self._og_search_thumbnail(webpage),
  42. 'uploader': video_uploader,
  43. 'upload_date': video_upload_date,
  44. }