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