]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/rottentomatoes.py
[extractor/youtube] Extract DRC formats
[yt-dlp.git] / yt_dlp / extractor / rottentomatoes.py
CommitLineData
dae2a058 1from .common import InfoExtractor
100bd86a 2from .internetvideoarchive import InternetVideoArchiveIE
4b7b839f
JMF
3
4
dae2a058 5class RottenTomatoesIE(InfoExtractor):
92519402 6 _VALID_URL = r'https?://(?:www\.)?rottentomatoes\.com/m/[^/]+/trailers/(?P<id>\d+)'
4b7b839f
JMF
7
8 _TEST = {
924f47f7 9 'url': 'http://www.rottentomatoes.com/m/toy_story_3/trailers/11028566/',
924f47f7 10 'info_dict': {
62263851 11 'id': '11028566',
96aded8d 12 'ext': 'mp4',
dae2a058 13 'title': 'Toy Story 3',
100bd86a 14 'description': 'From the creators of the beloved TOY STORY films, comes a story that will reunite the gang in a whole new way.',
ec85ded8 15 'thumbnail': r're:^https?://.*\.jpg$',
4b7b839f
JMF
16 },
17 }
dae2a058
YCH
18
19 def _real_extract(self, url):
20 video_id = self._match_id(url)
21 webpage = self._download_webpage(url, video_id)
100bd86a 22 iva_id = self._search_regex(r'publishedid=(\d+)', webpage, 'internet video archive id')
dae2a058
YCH
23
24 return {
100bd86a
RA
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(),
62263851 28 'id': video_id,
dae2a058
YCH
29 'title': self._og_search_title(webpage),
30 }