]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/southparkstudios.py
Clarify a couple of calls
[yt-dlp.git] / youtube_dl / extractor / southparkstudios.py
CommitLineData
5a6fecc3
JMF
1import re
2
3from .mtv import MTVIE, _media_xml_tag
4
5
6class SouthParkStudiosIE(MTVIE):
7 IE_NAME = u'southparkstudios.com'
69b227a9 8 _VALID_URL = r'https?://www\.southparkstudios\.com/(clips|full-episodes)/(?P<id>.+?)(\?|#|$)'
5a6fecc3
JMF
9
10 _FEED_URL = 'http://www.southparkstudios.com/feeds/video-player/mrss'
11
12 _TEST = {
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',
0fd49457 17 u'description': u'Randy finally gets the chance to fight Bat Dad and gets the boys disqualified from the season championships.',
5a6fecc3
JMF
18 },
19 }
20
21 # Overwrite MTVIE properties we don't want
22 _TESTS = []
23
24 def _get_thumbnail_url(self, uri, itemdoc):
25 search_path = '%s/%s' % (_media_xml_tag('group'), _media_xml_tag('thumbnail'))
69b227a9
JMF
26 thumb_node = itemdoc.find(search_path)
27 if thumb_node is None:
28 return None
29 else:
30 return thumb_node.attrib['url']
5a6fecc3
JMF
31
32 def _real_extract(self, url):
33 mobj = re.match(self._VALID_URL, url)
34 video_id = mobj.group('id')
35 webpage = self._download_webpage(url, video_id)
0fd49457 36 mgid = self._search_regex(r'data-mgid="(mgid:.*?)"',
5a6fecc3
JMF
37 webpage, u'mgid')
38 return self._get_videos_info(mgid)