comedycentral.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. from .mtv import MTVServicesInfoExtractor
  2. class ComedyCentralIE(MTVServicesInfoExtractor):
  3. _VALID_URL = r'https?://(?:www\.)?cc\.com/(?:episodes|video(?:-clips)?|collection-playlist|movies)/(?P<id>[0-9a-z]{6})'
  4. _FEED_URL = 'http://comedycentral.com/feeds/mrss/'
  5. _TESTS = [{
  6. 'url': 'http://www.cc.com/video-clips/5ke9v2/the-daily-show-with-trevor-noah-doc-rivers-and-steve-ballmer---the-nba-player-strike',
  7. 'md5': 'b8acb347177c680ff18a292aa2166f80',
  8. 'info_dict': {
  9. 'id': '89ccc86e-1b02-4f83-b0c9-1d9592ecd025',
  10. 'ext': 'mp4',
  11. 'title': 'The Daily Show with Trevor Noah|August 28, 2020|25|25149|Doc Rivers and Steve Ballmer - The NBA Player Strike',
  12. 'description': 'md5:5334307c433892b85f4f5e5ac9ef7498',
  13. 'timestamp': 1598670000,
  14. 'upload_date': '20200829',
  15. },
  16. }, {
  17. 'url': 'http://www.cc.com/episodes/pnzzci/drawn-together--american-idol--parody-clip-show-season-3-ep-314',
  18. 'only_matching': True,
  19. }, {
  20. 'url': 'https://www.cc.com/video/k3sdvm/the-daily-show-with-jon-stewart-exclusive-the-fourth-estate',
  21. 'only_matching': True,
  22. }, {
  23. 'url': 'https://www.cc.com/collection-playlist/cosnej/stand-up-specials/t6vtjb',
  24. 'only_matching': True,
  25. }, {
  26. 'url': 'https://www.cc.com/movies/tkp406/a-cluesterfuenke-christmas',
  27. 'only_matching': True,
  28. }]
  29. class ComedyCentralTVIE(MTVServicesInfoExtractor):
  30. _VALID_URL = r'https?://(?:www\.)?comedycentral\.tv/folgen/(?P<id>[0-9a-z]{6})'
  31. _TESTS = [{
  32. 'url': 'https://www.comedycentral.tv/folgen/pxdpec/josh-investigates-klimawandel-staffel-1-ep-1',
  33. 'info_dict': {
  34. 'id': '15907dc3-ec3c-11e8-a442-0e40cf2fc285',
  35. 'ext': 'mp4',
  36. 'title': 'Josh Investigates',
  37. 'description': 'Steht uns das Ende der Welt bevor?',
  38. },
  39. }]
  40. _FEED_URL = 'http://feeds.mtvnservices.com/od/feed/intl-mrss-player-feed'
  41. _GEO_COUNTRIES = ['DE']
  42. def _get_feed_query(self, uri):
  43. return {
  44. 'accountOverride': 'intl.mtvi.com',
  45. 'arcEp': 'web.cc.tv',
  46. 'ep': 'b9032c3a',
  47. 'imageEp': 'web.cc.tv',
  48. 'mgid': uri,
  49. }