Open
Description
I need help to resolve this issue.
I am getting:
Array ( [ok] => [status] => 200 [message] => Video info not found. )
and below is my code.
function downloadYouTubeVideo($videoUrl = null) {
if (!$videoUrl) {
echo "Error: No video URL provided.";
return;
}
include 'YouTube.php';
$youtube = new YouTube();
$id = $youtube->extractVideoId($videoUrl);
$info = $youtube->extractVideoInfo($id, 'android');
echo '<pre>';
print_r($info); // print response for debuging
echo '</pre>';
// Get the highest quality MP4 download URL
$downloadUrl = $info['medias']['video'][0]['url'];
// Download the video as "video.mp4"
$youtube->download('video.mp4', $downloadUrl);
}
// Handle the download request (if URL is passed in GET)
if (isset($_GET['videoUrl'])) {
$videoUrl = $_GET['videoUrl'];
downloadYouTubeVideo($videoUrl);
}
Metadata
Metadata
Assignees
Labels
No labels