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.

48 lines
1.7 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. from .jwplatform import JWPlatformIE
  5. from ..utils import unified_strdate
  6. class TeamFourStarIE(InfoExtractor):
  7. _VALID_URL = r'https?://(?:www\.)?teamfourstar\.com/(?P<id>[a-z0-9\-]+)'
  8. _TEST = {
  9. 'url': 'http://teamfourstar.com/tfs-abridged-parody-episode-1-2/',
  10. 'info_dict': {
  11. 'id': '0WdZO31W',
  12. 'title': 'TFS Abridged Parody Episode 1',
  13. 'description': 'md5:d60bc389588ebab2ee7ad432bda953ae',
  14. 'ext': 'mp4',
  15. 'timestamp': 1394168400,
  16. 'upload_date': '20080508',
  17. },
  18. }
  19. def _real_extract(self, url):
  20. display_id = self._match_id(url)
  21. webpage = self._download_webpage(url, display_id)
  22. jwplatform_url = JWPlatformIE._extract_url(webpage)
  23. video_title = self._html_search_regex(
  24. r'<h1[^>]+class="entry-title"[^>]*>(?P<title>.+?)</h1>',
  25. webpage, 'title')
  26. video_date = unified_strdate(self._html_search_regex(
  27. r'<span[^>]+class="meta-date date updated"[^>]*>(?P<date>.+?)</span>',
  28. webpage, 'date', fatal=False))
  29. video_description = self._html_search_regex(
  30. r'(?s)<div[^>]+class="content-inner"[^>]*>.*?(?P<description><p>.+?)</div>',
  31. webpage, 'description', fatal=False)
  32. video_thumbnail = self._og_search_thumbnail(webpage)
  33. return {
  34. '_type': 'url_transparent',
  35. 'display_id': display_id,
  36. 'title': video_title,
  37. 'description': video_description,
  38. 'upload_date': video_date,
  39. 'thumbnail': video_thumbnail,
  40. 'url': jwplatform_url,
  41. }