mediaite.py 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. from .common import InfoExtractor
  2. class MediaiteIE(InfoExtractor):
  3. _VALID_URL = r'https?://(?:www\.)?mediaite\.com(?!/category)(?:/[\w-]+){2}'
  4. _TESTS = [{
  5. 'url': 'https://www.mediaite.com/sports/bill-burr-roasts-nfl-for-promoting-black-lives-matter-while-scheduling-more-games-after-all-the-sht-they-know-about-cte/',
  6. 'info_dict': {
  7. 'id': 'vPHKITzy',
  8. 'ext': 'm4a',
  9. 'title': 'Bill Burr On NFL And Black Lives Matter',
  10. 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
  11. 'thumbnail': 'https://cdn.jwplayer.com/v2/media/vPHKITzy/poster.jpg?width=720',
  12. 'duration': 55,
  13. 'timestamp': 1631630185,
  14. 'upload_date': '20210914',
  15. },
  16. 'params': {'skip_download': True},
  17. }, {
  18. 'url': 'https://www.mediaite.com/tv/joe-scarborough-goes-off-on-tax-breaks-for-super-wealthy-largest-income-redistribution-scam-in-american-history/',
  19. 'info_dict': {
  20. 'id': 'eeFcK4Xm',
  21. 'ext': 'mp4',
  22. 'title': 'Morning Joe-6_16_52 am - 6_21_10 am-2021-09-14.mp4',
  23. 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
  24. 'thumbnail': 'https://cdn.jwplayer.com/v2/media/eeFcK4Xm/poster.jpg?width=720',
  25. 'duration': 258,
  26. 'timestamp': 1631618057,
  27. 'upload_date': '20210914',
  28. },
  29. 'params': {'skip_download': True},
  30. }, {
  31. 'url': 'https://www.mediaite.com/politics/watch-rudy-giuliani-impersonates-queen-elizabeth-calls-mark-milley-an-asshle-in-bizarre-9-11-speech/',
  32. 'info_dict': {
  33. 'id': 'EiyiXKcr',
  34. 'ext': 'mp4',
  35. 'title': 'Giuliani 1',
  36. 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
  37. 'thumbnail': 'https://cdn.jwplayer.com/v2/media/EiyiXKcr/poster.jpg?width=720',
  38. 'duration': 39,
  39. 'timestamp': 1631536476,
  40. 'upload_date': '20210913',
  41. },
  42. 'params': {'skip_download': True},
  43. }, {
  44. 'url': 'https://www.mediaite.com/podcasts/clarissa-ward-says-she-decided-to-become-a-journalist-on-9-11/',
  45. 'info_dict': {
  46. 'id': 'TxavoRTx',
  47. 'ext': 'mp4',
  48. 'title': 'clarissa-ward-3.mp4',
  49. 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
  50. 'thumbnail': 'https://cdn.jwplayer.com/v2/media/TxavoRTx/poster.jpg?width=720',
  51. 'duration': 83,
  52. 'timestamp': 1631311188,
  53. 'upload_date': '20210910',
  54. },
  55. 'params': {'skip_download': True},
  56. }, {
  57. 'url': 'https://www.mediaite.com/opinion/mainstream-media-ignores-rose-mcgowans-bombshell-allegation-that-newsoms-wife-tried-to-silence-her-on-weinstein/',
  58. 'info_dict': {
  59. 'id': 'sEIWvKR7',
  60. 'ext': 'mp4',
  61. 'title': 'KTTV_09-13-2021_05.34.21',
  62. 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
  63. 'thumbnail': 'https://cdn.jwplayer.com/v2/media/sEIWvKR7/poster.jpg?width=720',
  64. 'duration': 52,
  65. 'timestamp': 1631553328,
  66. 'upload_date': '20210913',
  67. },
  68. 'params': {'skip_download': True},
  69. }, {
  70. 'url': 'https://www.mediaite.com/news/watch-cnbcs-jim-cramer-says-nobody-wants-to-die-getting-infected-by-unvaccinated-coworker-even-for-22-an-hour/',
  71. 'info_dict': {
  72. 'id': 'nwpt1elX',
  73. 'ext': 'mp4',
  74. 'title': "CNBC's Jim Cramer Says Nobody Wants to Die Getting Infected by Unvaccinated Coworker 'Even for $22 an Hour'.mp4",
  75. 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
  76. 'thumbnail': 'https://cdn.jwplayer.com/v2/media/nwpt1elX/poster.jpg?width=720',
  77. 'duration': 60,
  78. 'timestamp': 1633014214,
  79. 'upload_date': '20210930',
  80. },
  81. 'params': {'skip_download': True},
  82. }, {
  83. 'url': 'https://www.mediaite.com/politics/i-cant-read-it-fast-enough-while-defending-trump-larry-kudlow-overwhelmed-by-volume-of-ex-presidents-legal-troubles/',
  84. 'info_dict': {
  85. 'id': 'E6EhDX5z',
  86. 'ext': 'mp4',
  87. 'title': 'Fox Business Network - 4:00 PM - 5:00 PM - 1:39:42 pm - 1:42:20 pm',
  88. 'description': '',
  89. 'thumbnail': 'https://cdn.jwplayer.com/v2/media/E6EhDX5z/poster.jpg?width=720',
  90. 'duration': 157,
  91. 'timestamp': 1691015535,
  92. 'upload_date': '20230802',
  93. },
  94. 'params': {'skip_download': True},
  95. }]
  96. def _real_extract(self, url):
  97. webpage = self._download_webpage(url, None)
  98. video_id = self._search_regex(
  99. [r'"https://cdn\.jwplayer\.com/players/(\w+)', r'data-video-id\s*=\s*\"([^\"]+)\"'], webpage, 'id')
  100. data_json = self._download_json(f'https://cdn.jwplayer.com/v2/media/{video_id}', video_id)
  101. return self._parse_jwplayer_data(data_json)