diff --git a/classes/Video.php b/classes/Video.php index 8b67ae0..1a53a9b 100644 --- a/classes/Video.php +++ b/classes/Video.php @@ -622,12 +622,22 @@ class Video { $client = new Client(); $urls = $this->getUrl(); + $stream_context_options = []; + + if (array_key_exists('Referer', (array)$this->http_headers)) { + $stream_context_options = [ + 'http' => [ + 'header' => 'Referer: ' . $this->http_headers->Referer + ] + ]; + } return $client->request( 'GET', $urls[0], [ 'stream' => true, + 'stream_context' => $stream_context_options, 'headers' => array_merge((array)$this->http_headers, $headers) ] );