fix: Use cookies provided by youtube-dl

Fixes #225
This commit is contained in:
Pierre Rudloff 2019-09-26 21:36:40 +02:00
parent 8bb838ef74
commit 6cd8eeed4a
2 changed files with 5 additions and 4 deletions

View File

@ -27,6 +27,7 @@ use Symfony\Component\Process\Process;
* @property-read array $rtmp_conn
* @property-read string|null $_type Object type (usually "playlist" or null)
* @property-read stdClass $downloader_options
* @property-read stdClass $http_headers
*/
class Video
{

View File

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