+ def _extract_new_triforce_mgid(self, webpage, url='', video_id=None):
+ if url == '':
+ return
+ domain = get_domain(url)
+ if domain is None:
+ raise ExtractorError(
+ '[%s] could not get domain' % self.IE_NAME,
+ expected=True)
+ url = url.replace("https://", "http://")
+ enc_url = compat_urlparse.quote(url, safe='')
+ _TRIFORCE_V8_TEMPLATE = 'https://%s/feeds/triforce/manifest/v8?url=%s'
+ triforce_manifest_url = _TRIFORCE_V8_TEMPLATE % (domain, enc_url)
+
+ manifest = self._download_json(triforce_manifest_url, video_id, fatal=False)
+ if manifest:
+ if manifest.get('manifest').get('type') == 'redirect':
+ self.to_screen('Found a redirect. Downloading manifest from new location')
+ new_loc = manifest.get('manifest').get('newLocation')
+ new_loc = new_loc.replace("https://", "http://")
+ enc_new_loc = compat_urlparse.quote(new_loc, safe='')
+ triforce_manifest_new_loc = _TRIFORCE_V8_TEMPLATE % (domain, enc_new_loc)
+ manifest = self._download_json(triforce_manifest_new_loc, video_id, fatal=False)
+
+ item_id = try_get(manifest, lambda x: x['manifest']['reporting']['itemId'], compat_str)
+ if not item_id:
+ self.to_screen('No id found!')
+ return
+
+ # 'episode' can be anything. 'content' is used often as well
+ _MGID_TEMPLATE = 'mgid:arc:episode:%s:%s'
+ mgid = _MGID_TEMPLATE % (domain, item_id)
+
+ return mgid
+
+ def _extract_mgid(self, webpage, url, title=None, data_zone=None):