1
0
Fork 0

dont parse json

This commit is contained in:
Christopher Latza 2020-06-07 18:47:46 +02:00
parent 824aa13725
commit 46931596f0
2 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@
"icon_url": "https://files.clatza.dev/Icons/git.png" "icon_url": "https://files.clatza.dev/Icons/git.png"
}, },
"image": { "image": {
"url": "https://files.clatza.dev/output.jpg" "url": "%%vorschau%%"
}, },
"thumbnail": { "thumbnail": {
"url": "https://files.clatza.dev/Icons/vlc.png" "url": "https://files.clatza.dev/Icons/vlc.png"

View File

@ -22,16 +22,16 @@ while(TRUE)
copy($fileName, "tmp/rtmp/".$fileName); copy($fileName, "tmp/rtmp/".$fileName);
unlink($fileName); unlink($fileName);
$jsonMessage = json_decode(file_get_contents("message.json")); $jsonMessage = file_get_contents("message.json");
$jsonMessage['embeds']['description'] = str_replace("%%adresse%%", $StreamURL, $jsonMessage['embeds']['description']); $jsonMessage = str_replace("%%adresse%%", $StreamURL, $jsonMessage);
$jsonMessage['embeds']['image'] = "https://files.clatza.dev/tmp/rtmp/".$fileName; $jsonMessage = str_replace("%%vorschau%%", "https://files.clatza.dev/tmp/rtmp/".$fileName, $jsonMessage);
$options = [ $options = [
'http' => [ 'http' => [
'method' => 'POST', 'method' => 'POST',
'header' => 'Content-Type: application/json', 'header' => 'Content-Type: application/json',
'content' => json_encode($jsonMessage) 'content' => $jsonMessage
] ]
]; ];