moviepilot.py 3.5 KB

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