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