fix: Fix YoutubeStream range condition

This commit is contained in:
Pierre Rudloff 2019-04-28 21:11:08 +02:00
parent 922c1bf769
commit 296a5f96b4

View file

@ -29,7 +29,7 @@ class YoutubeStream extends AppendStream
while ($rangeStart < $contentLenghtHeader[0]) { while ($rangeStart < $contentLenghtHeader[0]) {
$rangeEnd = $rangeStart + $video->downloader_options->http_chunk_size; $rangeEnd = $rangeStart + $video->downloader_options->http_chunk_size;
if ($rangeEnd > $contentLenghtHeader[0]) { if ($rangeEnd >= $contentLenghtHeader[0]) {
$rangeEnd = $contentLenghtHeader[0] - 1; $rangeEnd = $contentLenghtHeader[0] - 1;
} }
$response = $video->getHttpResponse(['Range' => 'bytes='.$rangeStart.'-'.$rangeEnd]); $response = $video->getHttpResponse(['Range' => 'bytes='.$rangeStart.'-'.$rangeEnd]);