Browse Source
[brightcove:new] Use referrer for formats' HTTP headers
master
Sergey M․
6 years ago
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with
6 additions and
2 deletions
-
youtube_dl/extractor/brightcove.py
|
@ -564,7 +564,7 @@ class BrightcoveNewIE(AdobePassIE): |
|
|
|
|
|
|
|
|
return entries |
|
|
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() |
|
|
title = json_data['name'].strip() |
|
|
|
|
|
|
|
|
formats = [] |
|
|
formats = [] |
|
@ -638,6 +638,9 @@ class BrightcoveNewIE(AdobePassIE): |
|
|
|
|
|
|
|
|
self._sort_formats(formats) |
|
|
self._sort_formats(formats) |
|
|
|
|
|
|
|
|
|
|
|
for f in formats: |
|
|
|
|
|
f.setdefault('http_headers', {}).update(headers) |
|
|
|
|
|
|
|
|
subtitles = {} |
|
|
subtitles = {} |
|
|
for text_track in json_data.get('text_tracks', []): |
|
|
for text_track in json_data.get('text_tracks', []): |
|
|
if text_track.get('src'): |
|
|
if text_track.get('src'): |
|
@ -724,4 +727,5 @@ class BrightcoveNewIE(AdobePassIE): |
|
|
'tveToken': tve_token, |
|
|
'tveToken': tve_token, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
return self._parse_brightcove_metadata(json_data, video_id) |
|
|
|
|
|
|
|
|
return self._parse_brightcove_metadata( |
|
|
|
|
|
json_data, video_id, headers=headers) |