1
0
mirror of https://github.com/Rudloff/alltube.git synced 2024-06-29 07:50:53 +02:00

fix: always use headers provided by youtube-dl when streaming

This commit is contained in:
Pierre Rudloff 2019-10-16 23:00:05 +02:00
parent 7020c7516f
commit 9fc21b2419
2 changed files with 9 additions and 2 deletions

View File

@ -592,6 +592,13 @@ class Video
$client = new Client(); $client = new Client();
$urls = $this->getUrl(); $urls = $this->getUrl();
return $client->request('GET', $urls[0], ['stream' => true, 'headers' => $headers]); return $client->request(
'GET',
$urls[0],
[
'stream' => true,
'headers' => array_merge((array) $this->http_headers, $headers)
]
);
} }
} }

View File

@ -166,7 +166,7 @@ class DownloadController extends BaseController
$response = $response->withHeader('Content-Type', 'video/' . $this->video->ext); $response = $response->withHeader('Content-Type', 'video/' . $this->video->ext);
$body = new Stream($this->video->getM3uStream()); $body = new Stream($this->video->getM3uStream());
} else { } else {
$headers = (array) $this->video->http_headers; $headers = [];
$range = $request->getHeader('Range'); $range = $request->getHeader('Range');
if (!empty($range)) { if (!empty($range)) {