Get the file from the url$video = file_get_contents($url['url'], false, stream_context_create($arrContextOptions));
Send the video back to front endreturn view('convert', [ 'url' => $url['url'], 'quality' => $url['format'], ]);
Expected behavior:
The video gets downloaded on my disk
Actual behavior:
I get this error:
file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14095126:SSL routines:ssl3_read_n:unexpected eof while reading
Description
returns when:
$file = file_get_contents($url['url'], false, stream_context_create($arrContextOptions));
Steps to Reproduce
https://www.youtube.com/watch?v=r5NzAksjfDI
$video_id = $yt->extractVideoId(implode($url));
$links = $yt->getDownloadLinks($video_id, $selector = 'video');
$arrayindex = array_search('mp4, video, 1080p, audio', array_column($links, 'format'));
$url = $links[$arrayindex];
$arrContextOptions=array( "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ), );
$video = file_get_contents($url['url'], false, stream_context_create($arrContextOptions));
return view('convert', [ 'url' => $url['url'], 'quality' => $url['format'], ]);
Expected behavior: The video gets downloaded on my disk Actual behavior:
I get this error: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14095126:SSL routines:ssl3_read_n:unexpected eof while reading
The code stops executing on that line aswell.
Version
The latest version of: https://github.com/Athlon1600/youtube-downloader
Additional Information
I'm running this on Laravel 7, with php artisan serve.