rottentomatoes.py 1.2 KB

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