Merge branch '0.1.3'

This commit is contained in:
Pierre Rudloff 2021-05-13 12:37:41 +02:00
commit 2aa3a2ce05

View file

@ -470,17 +470,14 @@ class Downloader implements LoggerAwareInterface
* *
* @return ResponseInterface * @return ResponseInterface
* @throws AlltubeLibraryException * @throws AlltubeLibraryException
* @link https://github.com/guzzle/guzzle/issues/2640
*/ */
public function getHttpResponse(Video $video, array $headers = []): ResponseInterface public function getHttpResponse(Video $video, array $headers = []): ResponseInterface
{ {
// IDN conversion breaks with Google hosts like https://r3---sn-25glene6.googlevideo.com/. $client = new Client();
$client = new Client(['idn_conversion' => false]);
$urls = $video->getUrl();
return $client->request( return $client->request(
'GET', 'GET',
$urls[0], $video->url,
[ [
'stream' => true, 'stream' => true,
'headers' => array_merge((array)$video->http_headers, $headers) 'headers' => array_merge((array)$video->http_headers, $headers)