You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.7 KiB

  1. import re
  2. from .mtv import MTVServicesInfoExtractor
  3. class SouthParkStudiosIE(MTVServicesInfoExtractor):
  4. IE_NAME = u'southparkstudios.com'
  5. _VALID_URL = r'(https?://)?(www\.)?(?P<url>southparkstudios\.com/(clips|full-episodes)/(?P<id>.+?)(\?|#|$))'
  6. _FEED_URL = 'http://www.southparkstudios.com/feeds/video-player/mrss'
  7. _TESTS = [{
  8. u'url': u'http://www.southparkstudios.com/clips/104437/bat-daded#tab=featured',
  9. u'file': u'a7bff6c2-ed00-11e0-aca6-0026b9414f30.mp4',
  10. u'info_dict': {
  11. u'title': u'Bat Daded',
  12. u'description': u'Randy disqualifies South Park by getting into a fight with Bat Dad.',
  13. },
  14. }]
  15. def _real_extract(self, url):
  16. mobj = re.match(self._VALID_URL, url)
  17. url = u'http://www.' + mobj.group(u'url')
  18. video_id = mobj.group('id')
  19. webpage = self._download_webpage(url, video_id)
  20. mgid = self._search_regex(r'swfobject.embedSWF\(".*?(mgid:.*?)"',
  21. webpage, u'mgid')
  22. return self._get_videos_info(mgid)
  23. class SouthparkDeIE(SouthParkStudiosIE):
  24. IE_NAME = u'southpark.de'
  25. _VALID_URL = r'(https?://)?(www\.)?(?P<url>southpark\.de/(clips|alle-episoden)/(?P<id>.+?)(\?|#|$))'
  26. _FEED_URL = 'http://www.southpark.de/feeds/video-player/mrss/'
  27. _TESTS = [{
  28. u'url': u'http://www.southpark.de/clips/uygssh/the-government-wont-respect-my-privacy#tab=featured',
  29. u'file': u'85487c96-b3b9-4e39-9127-ad88583d9bf2.mp4',
  30. u'info_dict': {
  31. u'title': u'The Government Won\'t Respect My Privacy',
  32. u'description': u'Cartman explains the benefits of "Shitter" to Stan, Kyle and Craig.',
  33. },
  34. }]