logo

youtube-dl

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

rottentomatoes.py (1281B)


  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. from .internetvideoarchive import InternetVideoArchiveIE
  4. class RottenTomatoesIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?rottentomatoes\.com/m/[^/]+/trailers/(?P<id>\d+)'
  6. _TEST = {
  7. 'url': 'http://www.rottentomatoes.com/m/toy_story_3/trailers/11028566/',
  8. 'info_dict': {
  9. 'id': '11028566',
  10. 'ext': 'mp4',
  11. 'title': 'Toy Story 3',
  12. 'description': 'From the creators of the beloved TOY STORY films, comes a story that will reunite the gang in a whole new way.',
  13. 'thumbnail': r're:^https?://.*\.jpg$',
  14. },
  15. }
  16. def _real_extract(self, url):
  17. video_id = self._match_id(url)
  18. webpage = self._download_webpage(url, video_id)
  19. iva_id = self._search_regex(r'publishedid=(\d+)', webpage, 'internet video archive id')
  20. return {
  21. '_type': 'url_transparent',
  22. 'url': 'http://video.internetvideoarchive.net/player/6/configuration.ashx?domain=www.videodetective.com&customerid=69249&playerid=641&publishedid=' + iva_id,
  23. 'ie_key': InternetVideoArchiveIE.ie_key(),
  24. 'id': video_id,
  25. 'title': self._og_search_title(webpage),
  26. }