From 46931596f0c73cfd23af98b3052098d625025ea2 Mon Sep 17 00:00:00 2001 From: Christopher Latza Date: Sun, 7 Jun 2020 18:47:46 +0200 Subject: [PATCH] dont parse json --- message.json | 2 +- start.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/message.json b/message.json index cafb254..8afbea7 100644 --- a/message.json +++ b/message.json @@ -10,7 +10,7 @@ "icon_url": "https://files.clatza.dev/Icons/git.png" }, "image": { - "url": "https://files.clatza.dev/output.jpg" + "url": "%%vorschau%%" }, "thumbnail": { "url": "https://files.clatza.dev/Icons/vlc.png" diff --git a/start.php b/start.php index c26a1e1..e7ed3ca 100644 --- a/start.php +++ b/start.php @@ -22,16 +22,16 @@ while(TRUE) copy($fileName, "tmp/rtmp/".$fileName); unlink($fileName); - $jsonMessage = json_decode(file_get_contents("message.json")); - - $jsonMessage['embeds']['description'] = str_replace("%%adresse%%", $StreamURL, $jsonMessage['embeds']['description']); - $jsonMessage['embeds']['image'] = "https://files.clatza.dev/tmp/rtmp/".$fileName; + $jsonMessage = file_get_contents("message.json"); + + $jsonMessage = str_replace("%%adresse%%", $StreamURL, $jsonMessage); + $jsonMessage = str_replace("%%vorschau%%", "https://files.clatza.dev/tmp/rtmp/".$fileName, $jsonMessage); $options = [ 'http' => [ 'method' => 'POST', 'header' => 'Content-Type: application/json', - 'content' => json_encode($jsonMessage) + 'content' => $jsonMessage ] ];