]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[brightcove:new] Use referrer for formats' HTTP headers
authorSergey M․ <dstftw@gmail.com>
Mon, 19 Feb 2018 15:28:27 +0000 (22:28 +0700)
committerSergey M․ <dstftw@gmail.com>
Mon, 19 Feb 2018 15:28:27 +0000 (22:28 +0700)
youtube_dl/extractor/brightcove.py

index f3c0dc3fa438f25e521be7bf6e7ed3ff6c6beb6a..0e4eaef659105df0248d6ef5171f5f444660f1ee 100644 (file)
@@ -564,7 +564,7 @@ class BrightcoveNewIE(AdobePassIE):
 
         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 @@ class BrightcoveNewIE(AdobePassIE):
 
         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 @@ class BrightcoveNewIE(AdobePassIE):
                     'tveToken': tve_token,
                 })
 
-        return self._parse_brightcove_metadata(json_data, video_id)
+        return self._parse_brightcove_metadata(
+            json_data, video_id, headers=headers)