- mgid = super(SpikeIE, self)._extract_mgid(webpage, default=None)
- if mgid is None:
- url_parts = self._search_regex(self._CUSTOM_URL_REGEX, webpage, 'episode_id')
- video_type, episode_id = url_parts.split('/', 1)
- mgid = 'mgid:arc:{0}:spike.com:{1}'.format(video_type, episode_id)
- return mgid
+ root_data = self._parse_json(self._search_regex(
+ r'window\.__DATA__\s*=\s*({.+})',
+ webpage, 'data'), None)
+
+ def find_sub_data(data, data_type):
+ return next(c for c in data['children'] if c.get('type') == data_type)
+
+ c = find_sub_data(find_sub_data(root_data, 'MainContainer'), 'VideoPlayer')
+ return c['props']['media']['video']['config']['uri']