* Fix xhamster support * Send http headers properly * added spaces * convert stdObject to array for comparison Co-authored-by: Pierre Rudloff <contact@rudloff.pro>
This commit is contained in:
parent
6a3bc97219
commit
8f7601edd8
1 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
]
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue