- mobj = re.match(self._VALID_URL, url)
- video_id = mobj.group('id')
-
- webpage = self._download_webpage(url, video_id, u'Downloading trailer page')
-
- if re.search(r'>Missing Media<', webpage) is not None:
- raise ExtractorError(u'Trailer %s does not exist' % video_id, expected=True)
-
- mobj = re.search(r'<title>MacGameStore: (?P<title>.*?) Trailer</title>', webpage)
- video_title = mobj.group('title')
-
- mobj = re.search(r'(?s)<div\s+id="video-player".*?href="(?P<video>[^"]+)"\s*>', webpage)
- video_url = mobj.group('video')
-
+ video_id = self._match_id(url)
+ webpage = self._download_webpage(
+ url, video_id, 'Downloading trailer page')
+
+ if '>Missing Media<' in webpage:
+ raise ExtractorError(
+ 'Trailer %s does not exist' % video_id, expected=True)
+
+ video_title = self._html_search_regex(
+ r'<title>MacGameStore: (.*?) Trailer</title>', webpage, 'title')
+
+ video_url = self._html_search_regex(
+ r'(?s)<div\s+id="video-player".*?href="([^"]+)"\s*>',
+ webpage, 'video URL')
+