- try:
- json_data = self._download_json(api_url, video_id, headers={
- 'Accept': 'application/json;pk=%s' % policy_key
+ headers = {
+ 'Accept': 'application/json;pk=%s' % policy_key,
+ }
+ referrer = smuggled_data.get('referrer')
+ if referrer:
+ headers.update({
+ 'Referer': referrer,
+ 'Origin': re.search(r'https?://[^/]+', referrer).group(0),