]>
Commit | Line | Data |
---|---|---|
da1ffde1 | 1 | from .dailymotion import DailymotionIE |
2 | from .common import InfoExtractor | |
da1ffde1 | 3 | |
4 | ||
5 | class MoviepilotIE(InfoExtractor): | |
6 | _IE_NAME = 'moviepilot' | |
7 | _IE_DESC = 'Moviepilot trailer' | |
8 | _VALID_URL = r'https?://(?:www\.)?moviepilot\.de/movies/(?P<id>[^/]+)' | |
9 | ||
10 | _TESTS = [{ | |
11 | 'url': 'https://www.moviepilot.de/movies/interstellar-2/', | |
12 | 'info_dict': { | |
c62e64cf | 13 | 'id': 'x7xdpkk', |
da1ffde1 | 14 | 'display_id': 'interstellar-2', |
15 | 'ext': 'mp4', | |
16 | 'title': 'Interstellar', | |
c62e64cf | 17 | 'thumbnail': r're:https://\w+\.dmcdn\.net/v/SaV-q1ZganMw4HVXg/x1080', |
18 | 'timestamp': 1605010596, | |
19 | 'description': 'md5:0ae9cb452af52610c9ffc60f2fd0474c', | |
da1ffde1 | 20 | 'uploader': 'Moviepilot', |
21 | 'like_count': int, | |
22 | 'view_count': int, | |
23 | 'uploader_id': 'x6nd9k', | |
c62e64cf | 24 | 'upload_date': '20201110', |
25 | 'duration': 97, | |
da1ffde1 | 26 | 'age_limit': 0, |
c62e64cf | 27 | 'tags': ['Alle Trailer', 'Movie', 'Verleih'], |
da1ffde1 | 28 | }, |
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', | |
c62e64cf | 42 | 'thumbnail': r're:https://\w+\.dmcdn\.net/v/SbUM71ZeG2N975lf2/x1080', |
43 | 'timestamp': 1605555825, | |
44 | 'description': 'md5:83228bb86f5367dd181447fdc4873989', | |
da1ffde1 | 45 | 'uploader': 'Moviepilot', |
46 | 'like_count': int, | |
47 | 'view_count': int, | |
48 | 'uploader_id': 'x6nd9k', | |
c62e64cf | 49 | 'upload_date': '20201116', |
da1ffde1 | 50 | 'duration': 138, |
51 | 'age_limit': 0, | |
52 | 'tags': ['Movie', 'Verleih', 'Neue Trailer'], | |
53 | }, | |
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', | |
60 | }, | |
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', | |
c62e64cf | 69 | 'description': 'md5:4d23a8f4ca035196cd4523863c4fe5a4', |
70 | 'timestamp': 1604958457, | |
da1ffde1 | 71 | 'age_limit': 0, |
72 | 'duration': 82, | |
c62e64cf | 73 | 'upload_date': '20201109', |
74 | 'thumbnail': r're:https://\w+\.dmcdn\.net/v/SaMes1Zg3lxLv9j5u/x1080', | |
da1ffde1 | 75 | 'uploader': 'Moviepilot', |
76 | 'like_count': int, | |
77 | 'view_count': int, | |
78 | 'tags': ['Alle Trailer', 'Movie', 'Verleih'], | |
79 | 'uploader_id': 'x6nd9k', | |
80 | }, | |
81 | }] | |
82 | ||
83 | def _real_extract(self, url): | |
84 | video_id = self._match_id(url) | |
85 | ||
86 | webpage = self._download_webpage(f'https://www.moviepilot.de/movies/{video_id}/trailer', video_id) | |
87 | ||
c62e64cf | 88 | clip = self._search_nextjs_data(webpage, video_id)['props']['initialProps']['pageProps'] |
da1ffde1 | 89 | |
90 | return { | |
91 | '_type': 'url_transparent', | |
92 | 'ie_key': DailymotionIE.ie_key(), | |
93 | 'display_id': video_id, | |
c62e64cf | 94 | 'title': clip.get('title'), |
95 | 'url': f'https://www.dailymotion.com/video/{clip["videoRemoteId"]}', | |
96 | 'description': clip.get('summary'), | |
da1ffde1 | 97 | } |