* 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();
|
$client = new Client();
|
||||||
$urls = $this->getUrl();
|
$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(
|
return $client->request(
|
||||||
'GET',
|
'GET',
|
||||||
$urls[0],
|
$urls[0],
|
||||||
[
|
[
|
||||||
'stream' => true,
|
'stream' => true,
|
||||||
|
'stream_context' => $stream_context_options,
|
||||||
'headers' => array_merge((array)$this->http_headers, $headers)
|
'headers' => array_merge((array)$this->http_headers, $headers)
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue