mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[brightcove:new] Use referrer for formats' HTTP headers
This commit is contained in:
parent
b12cf31bb1
commit
18d7aa6efa
1 changed files with 6 additions and 2 deletions
|
@ -564,7 +564,7 @@ def _extract_urls(ie, webpage):
|
|||
|
||||
return entries
|
||||
|
||||
def _parse_brightcove_metadata(self, json_data, video_id):
|
||||
def _parse_brightcove_metadata(self, json_data, video_id, headers={}):
|
||||
title = json_data['name'].strip()
|
||||
|
||||
formats = []
|
||||
|
@ -638,6 +638,9 @@ def build_format_id(kind):
|
|||
|
||||
self._sort_formats(formats)
|
||||
|
||||
for f in formats:
|
||||
f.setdefault('http_headers', {}).update(headers)
|
||||
|
||||
subtitles = {}
|
||||
for text_track in json_data.get('text_tracks', []):
|
||||
if text_track.get('src'):
|
||||
|
@ -724,4 +727,5 @@ def _real_extract(self, url):
|
|||
'tveToken': tve_token,
|
||||
})
|
||||
|
||||
return self._parse_brightcove_metadata(json_data, video_id)
|
||||
return self._parse_brightcove_metadata(
|
||||
json_data, video_id, headers=headers)
|
||||
|
|
Loading…
Reference in a new issue