我正在推动一个YouTube下载程序,它将视频存储到here的服务器上。我修改了在服务器而不是计算机上下载YouTube视频的代码。这是我的download.php代码:
include_once('config.php');
// Check download token
if (empty($_GET['mime']) OR empty($_GET['token']))
{
exit('Invalid download token 8{');
}
// Set operation params
$mime = filter_var($_GET['mime']);
$ext = str_replace(array('/', 'x-'), '', strstr($mime, '/'));
$url = base64_decode(filter_var($_GET['token']));
$name = urldecode($_GET['title']). '.' .$ext;
// Fetch and serve
if ($url)
{
$size=get_size($url);
$file_path ="localhost/video/";
$download_video_file = file_put_contents($file_path, fopen($url, 'r'));
exit;
}
// Not found
exit('File not found 8{');
它给我一个错误(警告)
Warning: file_put_contents(localhost/video/): failed to open stream: No such file or directory in C:\wamp\www\Yoyo\download.php on line 43
我验证是否存在localhost / video。我还删除了localhost:
$file_path ="/video/";
并检查了它,但仍然发出相同的警告。有什么问题?