[kaltura] add referrer to m3u8 url
authorremitamine <remitamine@gmail.com>
Sun, 27 Dec 2015 09:19:44 +0000 (10:19 +0100)
committerremitamine <remitamine@gmail.com>
Sun, 27 Dec 2015 09:19:44 +0000 (10:19 +0100)
youtube_dl/extractor/kaltura.py

index 353e960b0c197718d8c7601d11a2689ee0b59333..4807c81101d0f254c0263c37fd831896b6f5555b 100644 (file)
@@ -160,10 +160,11 @@ class KalturaIE(InfoExtractor):
                 'width': int_or_none(f.get('width')),
                 'url': video_url,
             })
-
+        m3u8_url = info['dataUrl'].replace('format/url', 'format/applehttp')
+        if referrer:
+            m3u8_url += '?referrer=%s' % referrer
         m3u8_formats = self._extract_m3u8_formats(
-            info['dataUrl'].replace('format/url', 'format/applehttp'),
-            entry_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False)
+            m3u8_url, entry_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False)
         if m3u8_formats:
             formats.extend(m3u8_formats)