I try to download a song via php and add it to a playlist.
But I get a wrong uuid from script by adding the song
PHP Output:
But on webinterface the song has uuid: "2a27c7a5-242a-45ee-bba3-aeb37f7adb40"
But I get a wrong uuid from script by adding the song
PHP:
//set_time_limit(0);
include("sinusbot.class.php");
include("config.php");
//include("getYTfile.php");
echo "<pre>";
$sinusbot = new SinusBot($ipport);
$sinusbot->login($user, $pass);
$instances = $sinusbot->selectInstance($instanceIDS[$defaultInstance]); // Alle Instanzen
$status = $sinusbot->getStatus($instanceIDS[$defaultInstance]);
$playlistname = "Test";
$yturl = "https://www.youtube.com/watch?v=TYCjNJszTmE"; // "[Chillout] Uppermost - Under Control"
// Downloading yt vid
$addjob = $sinusbot->addJob($yturl);
print_r($addjob);
If($addjob['success'] == 1 ) {
echo "Download succesful..$addjob[uuid] <br>";
$createPL = $sinusbot->createPlaylist($playlistname);
sleep(5);
If($createPL['success'] == 1 ) {
echo "Created Playlist '$playlistname' succesful..<br>";
$addTrackToPL = $sinusbot->addPlaylistTrack($addjob['uuid'], $createPL['uuid']);
If($addTrackToPL['success'] == 1 ) {
echo "Added Track succesful..<br>";
} else {
exit("Error adding Track to Playlist!");
}
} else {
exit("Error creating Playlist!");
}
} else {
exit("Error downloading Track!");
}
PHP Output:
Code:
Array
(
[success] => 1
[uuid] => b3f06003-2d37-4821-9fc8-8f820dd7a8df
)
Download succesful..b3f06003-2d37-4821-9fc8-8f820dd7a8df
Created Playlist 'Test' succesful..
Error adding Track to Playlist!
But on webinterface the song has uuid: "2a27c7a5-242a-45ee-bba3-aeb37f7adb40"