southpark.py 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. from .mtv import MTVServicesInfoExtractor
  2. class SouthParkIE(MTVServicesInfoExtractor):
  3. IE_NAME = 'southpark.cc.com'
  4. _VALID_URL = r'https?://(?:www\.)?(?P<url>southpark(?:\.cc|studios)\.com/((?:video-)?clips|(?:full-)?episodes|collections)/(?P<id>.+?)(\?|#|$))'
  5. _FEED_URL = 'http://feeds.mtvnservices.com/od/feed/intl-mrss-player-feed'
  6. _TESTS = [{
  7. 'url': 'https://southpark.cc.com/video-clips/d7wr06/south-park-you-all-agreed-to-counseling',
  8. 'info_dict': {
  9. 'ext': 'mp4',
  10. 'title': 'You All Agreed to Counseling',
  11. 'description': 'Kenny, Cartman, Stan, and Kyle visit Mr. Mackey and ask for his help getting Mrs. Nelson to come back. Mr. Mackey reveals the only way to get things back to normal is to get the teachers vaccinated.',
  12. 'timestamp': 1615352400,
  13. 'upload_date': '20210310',
  14. },
  15. }, {
  16. 'url': 'http://southpark.cc.com/collections/7758/fan-favorites/1',
  17. 'only_matching': True,
  18. }, {
  19. 'url': 'https://www.southparkstudios.com/episodes/h4o269/south-park-stunning-and-brave-season-19-ep-1',
  20. 'only_matching': True,
  21. }]
  22. def _get_feed_query(self, uri):
  23. return {
  24. 'accountOverride': 'intl.mtvi.com',
  25. 'arcEp': 'shared.southpark.global',
  26. 'ep': '90877963',
  27. 'imageEp': 'shared.southpark.global',
  28. 'mgid': uri,
  29. }
  30. class SouthParkEsIE(SouthParkIE): # XXX: Do not subclass from concrete IE
  31. IE_NAME = 'southpark.cc.com:español'
  32. _VALID_URL = r'https?://(?:www\.)?(?P<url>southpark\.cc\.com/es/episodios/(?P<id>.+?)(\?|#|$))'
  33. _LANG = 'es'
  34. _TESTS = [{
  35. 'url': 'http://southpark.cc.com/es/episodios/s01e01-cartman-consigue-una-sonda-anal#source=351c1323-0b96-402d-a8b9-40d01b2e9bde&position=1&sort=!airdate',
  36. 'info_dict': {
  37. 'title': 'Cartman Consigue Una Sonda Anal',
  38. 'description': 'Cartman Consigue Una Sonda Anal',
  39. },
  40. 'playlist_count': 4,
  41. 'skip': 'Geo-restricted',
  42. }]
  43. class SouthParkDeIE(SouthParkIE): # XXX: Do not subclass from concrete IE
  44. IE_NAME = 'southpark.de'
  45. _VALID_URL = r'https?://(?:www\.)?(?P<url>southpark\.de/(?:(en/(videoclip|collections|episodes|video-clips))|(videoclip|collections|folgen))/(?P<id>(?P<unique_id>.+?)/.+?)(?:\?|#|$))'
  46. _TESTS = [{
  47. 'url': 'https://www.southpark.de/videoclip/rsribv/south-park-rueckzug-zum-gummibonbon-wald',
  48. 'only_matching': True,
  49. }, {
  50. 'url': 'https://www.southpark.de/folgen/jiru42/south-park-verkabelung-staffel-23-ep-9',
  51. 'only_matching': True,
  52. }, {
  53. 'url': 'https://www.southpark.de/collections/zzno5a/south-park-good-eats/7q26gp',
  54. 'only_matching': True,
  55. }, {
  56. # clip
  57. 'url': 'https://www.southpark.de/en/video-clips/ct46op/south-park-tooth-fairy-cartman',
  58. 'info_dict': {
  59. 'id': 'e99d45ea-ed00-11e0-aca6-0026b9414f30',
  60. 'ext': 'mp4',
  61. 'title': 'Tooth Fairy Cartman',
  62. 'description': 'md5:db02e23818b4dc9cb5f0c5a7e8833a68',
  63. },
  64. }, {
  65. # episode
  66. 'url': 'https://www.southpark.de/en/episodes/yy0vjs/south-park-the-pandemic-special-season-24-ep-1',
  67. 'info_dict': {
  68. 'id': 'f5fbd823-04bc-11eb-9b1b-0e40cf2fc285',
  69. 'ext': 'mp4',
  70. 'title': 'South Park',
  71. 'description': 'md5:ae0d875eff169dcbed16b21531857ac1',
  72. },
  73. }, {
  74. # clip
  75. 'url': 'https://www.southpark.de/videoclip/ct46op/south-park-zahnfee-cartman',
  76. 'info_dict': {
  77. 'id': 'e99d45ea-ed00-11e0-aca6-0026b9414f30',
  78. 'ext': 'mp4',
  79. 'title': 'Zahnfee Cartman',
  80. 'description': 'md5:b917eec991d388811d911fd1377671ac',
  81. },
  82. }, {
  83. # episode
  84. 'url': 'https://www.southpark.de/folgen/242csn/south-park-her-mit-dem-hirn-staffel-1-ep-7',
  85. 'info_dict': {
  86. 'id': '607115f3-496f-40c3-8647-2b0bcff486c0',
  87. 'ext': 'mp4',
  88. 'title': 'md5:South Park | Pink Eye | E 0107 | HDSS0107X deu | Version: 634312 | Comedy Central S1',
  89. },
  90. }]
  91. def _get_feed_url(self, uri, url=None):
  92. video_id = self._id_from_uri(uri)
  93. config = self._download_json(
  94. f'http://media.mtvnservices.com/pmt/e1/access/index.html?uri={uri}&configtype=edge&ref={url}', video_id)
  95. return self._remove_template_parameter(config['feedWithQueryParams'])
  96. def _get_feed_query(self, uri):
  97. return
  98. class SouthParkLatIE(SouthParkIE): # XXX: Do not subclass from concrete IE
  99. IE_NAME = 'southpark.lat'
  100. _VALID_URL = r'https?://(?:www\.)?southpark\.lat/(?:en/)?(?:video-?clips?|collections|episod(?:e|io)s)/(?P<id>[^/?#&]+)'
  101. _TESTS = [{
  102. 'url': 'https://www.southpark.lat/en/video-clips/ct46op/south-park-tooth-fairy-cartman',
  103. 'only_matching': True,
  104. }, {
  105. 'url': 'https://www.southpark.lat/episodios/9h0qbg/south-park-orgia-gatuna-temporada-3-ep-7',
  106. 'only_matching': True,
  107. }, {
  108. 'url': 'https://www.southpark.lat/en/collections/29ve08/south-park-heating-up/lydbrc',
  109. 'only_matching': True,
  110. }, {
  111. # clip
  112. 'url': 'https://www.southpark.lat/en/video-clips/ct46op/south-park-tooth-fairy-cartman',
  113. 'info_dict': {
  114. 'id': 'e99d45ea-ed00-11e0-aca6-0026b9414f30',
  115. 'ext': 'mp4',
  116. 'title': 'Tooth Fairy Cartman',
  117. 'description': 'md5:db02e23818b4dc9cb5f0c5a7e8833a68',
  118. },
  119. }, {
  120. # episode
  121. 'url': 'https://www.southpark.lat/episodios/9h0qbg/south-park-orgia-gatuna-temporada-3-ep-7',
  122. 'info_dict': {
  123. 'id': 'f5fbd823-04bc-11eb-9b1b-0e40cf2fc285',
  124. 'ext': 'mp4',
  125. 'title': 'South Park',
  126. 'description': 'md5:ae0d875eff169dcbed16b21531857ac1',
  127. },
  128. }]
  129. def _get_feed_url(self, uri, url=None):
  130. video_id = self._id_from_uri(uri)
  131. config = self._download_json(
  132. f'http://media.mtvnservices.com/pmt/e1/access/index.html?uri={uri}&configtype=edge&ref={url}',
  133. video_id)
  134. return self._remove_template_parameter(config['feedWithQueryParams'])
  135. def _get_feed_query(self, uri):
  136. return
  137. class SouthParkNlIE(SouthParkIE): # XXX: Do not subclass from concrete IE
  138. IE_NAME = 'southpark.nl'
  139. _VALID_URL = r'https?://(?:www\.)?(?P<url>southpark\.nl/(?:clips|(?:full-)?episodes|collections)/(?P<id>.+?)(\?|#|$))'
  140. _FEED_URL = 'http://www.southpark.nl/feeds/video-player/mrss/'
  141. _TESTS = [{
  142. 'url': 'http://www.southpark.nl/full-episodes/s18e06-freemium-isnt-free',
  143. 'info_dict': {
  144. 'title': 'Freemium Isn\'t Free',
  145. 'description': 'Stan is addicted to the new Terrance and Phillip mobile game.',
  146. },
  147. 'playlist_mincount': 3,
  148. }]
  149. class SouthParkDkIE(SouthParkIE): # XXX: Do not subclass from concrete IE
  150. IE_NAME = 'southparkstudios.dk'
  151. _VALID_URL = r'https?://(?:www\.)?(?P<url>southparkstudios\.(?:dk|nu)/(?:clips|full-episodes|collections)/(?P<id>.+?)(\?|#|$))'
  152. _FEED_URL = 'http://www.southparkstudios.dk/feeds/video-player/mrss/'
  153. _TESTS = [{
  154. 'url': 'http://www.southparkstudios.dk/full-episodes/s18e07-grounded-vindaloop',
  155. 'info_dict': {
  156. 'title': 'Grounded Vindaloop',
  157. 'description': 'Butters is convinced he\'s living in a virtual reality.',
  158. },
  159. 'playlist_mincount': 3,
  160. }, {
  161. 'url': 'http://www.southparkstudios.dk/collections/2476/superhero-showdown/1',
  162. 'only_matching': True,
  163. }, {
  164. 'url': 'http://www.southparkstudios.nu/collections/2476/superhero-showdown/1',
  165. 'only_matching': True,
  166. }]