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