[cleanup] Make more playlist entries lazy (#11763)
[yt-dlp.git] / yt_dlp / extractor / moviepilot.py
blobed5be4fa65de446da0a95068a94e60afd71991db
1 from .common import InfoExtractor
2 from .dailymotion import DailymotionIE
5 class MoviepilotIE(InfoExtractor):
6 _IE_NAME = 'moviepilot'
7 _IE_DESC = 'Moviepilot trailer'
8 _VALID_URL = r'https?://(?:www\.)?moviepilot\.de/movies/(?P<id>[^/]+)'
10 _TESTS = [{
11 'url': 'https://www.moviepilot.de/movies/interstellar-2/',
12 'info_dict': {
13 'id': 'x7xdpkk',
14 'display_id': 'interstellar-2',
15 'ext': 'mp4',
16 'title': 'Interstellar',
17 'thumbnail': r're:https://\w+\.dmcdn\.net/v/SaV-q1.*/x1080',
18 'timestamp': 1605010596,
19 'description': 'md5:0ae9cb452af52610c9ffc60f2fd0474c',
20 'uploader': 'Moviepilot',
21 'like_count': int,
22 'view_count': int,
23 'uploader_id': 'x6nd9k',
24 'upload_date': '20201110',
25 'duration': 97,
26 'age_limit': 0,
27 'tags': ['Alle Trailer', 'Movie', 'Verleih'],
29 }, {
30 'url': 'https://www.moviepilot.de/movies/interstellar-2/trailer',
31 'only_matching': True,
32 }, {
33 'url': 'https://www.moviepilot.de/movies/interstellar-2/kinoprogramm/berlin',
34 'only_matching': True,
35 }, {
36 'url': 'https://www.moviepilot.de/movies/queen-slim/trailer',
37 'info_dict': {
38 'id': 'x7xj6o7',
39 'display_id': 'queen-slim',
40 'title': 'Queen & Slim',
41 'ext': 'mp4',
42 'thumbnail': r're:https://\w+\.dmcdn\.net/v/SbUM71ZeG2N975lf2/x1080',
43 'timestamp': 1605555825,
44 'description': 'md5:83228bb86f5367dd181447fdc4873989',
45 'uploader': 'Moviepilot',
46 'like_count': int,
47 'view_count': int,
48 'uploader_id': 'x6nd9k',
49 'upload_date': '20201116',
50 'duration': 138,
51 'age_limit': 0,
52 'tags': ['Movie', 'Verleih', 'Neue Trailer'],
54 }, {
55 'url': 'https://www.moviepilot.de/movies/der-geiger-von-florenz/trailer',
56 'info_dict': {
57 'id': 'der-geiger-von-florenz',
58 'title': 'Der Geiger von Florenz',
59 'ext': 'mp4',
61 'skip': 'No trailer for this movie.',
62 }, {
63 'url': 'https://www.moviepilot.de/movies/muellers-buero/',
64 'info_dict': {
65 'id': 'x7xcw1i',
66 'display_id': 'muellers-buero',
67 'title': 'Müllers Büro',
68 'ext': 'mp4',
69 'description': 'md5:4d23a8f4ca035196cd4523863c4fe5a4',
70 'timestamp': 1604958457,
71 'age_limit': 0,
72 'duration': 82,
73 'upload_date': '20201109',
74 'thumbnail': r're:https://\w+\.dmcdn\.net/v/SaMes1Z.*/x1080',
75 'uploader': 'Moviepilot',
76 'like_count': int,
77 'view_count': int,
78 'tags': ['Alle Trailer', 'Movie', 'Verleih'],
79 'uploader_id': 'x6nd9k',
83 def _real_extract(self, url):
84 video_id = self._match_id(url)
86 webpage = self._download_webpage(f'https://www.moviepilot.de/movies/{video_id}/trailer', video_id)
88 clip = self._search_nextjs_data(webpage, video_id)['props']['initialProps']['pageProps']
90 return {
91 '_type': 'url_transparent',
92 'ie_key': DailymotionIE.ie_key(),
93 'display_id': video_id,
94 'title': clip.get('title'),
95 'url': f'https://www.dailymotion.com/video/{clip["video"]["remoteId"]}',
96 'description': clip.get('summary'),