diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7139004 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM debian:latest + +WORKDIR /root/ + +RUN apt-get update && apt-get install -y ffmpeg curl php-cli php-xml +COPY start.sh /root/start.sh +COPY config.php /root/config.php +COPY start.php /root/start.php + +RUN chmod +x start.sh + +CMD ['bash', 'start.sh'] \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 66e2dc2..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Discord-RTML-Notice - diff --git a/config.php b/config.php new file mode 100644 index 0000000..fc79648 --- /dev/null +++ b/config.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/ffmpeg.exe b/ffmpeg.exe new file mode 100644 index 0000000..f073530 Binary files /dev/null and b/ffmpeg.exe differ diff --git a/message.json b/message.json new file mode 100644 index 0000000..cafb254 --- /dev/null +++ b/message.json @@ -0,0 +1,22 @@ +{ + "embeds": [ + { + "title": "RTMP Stream Online!", + "description": "Ein neuer RTMP Stream ist jetzt online! Wenn du ihn dir anschauen willst kannst du dies mit dem VLC Media Player tun.\nÖffne dazu den VLC Media Player, klicke oben links auf Medien und wähle Netzwerkstream. Trage dort dann folgene Adresse ein:\n\n%%adresse%%\n\n", + "color": 2139936, + "author": { + "name": "RTMP Noticer", + "url": "https://clatza.dev/Christopher/Discord-RTML-Notice.git", + "icon_url": "https://files.clatza.dev/Icons/git.png" + }, + "image": { + "url": "https://files.clatza.dev/output.jpg" + }, + "thumbnail": { + "url": "https://files.clatza.dev/Icons/vlc.png" + } + } + ], + "username": "RTMP Noticer", + "avatar_url": "https://files.clatza.dev/Icons/vlc.png" + } \ No newline at end of file diff --git a/start.php b/start.php new file mode 100644 index 0000000..1ba7162 --- /dev/null +++ b/start.php @@ -0,0 +1,41 @@ +embeds->description = str_replace("%%adresse%%", $StreamURL, $jsonMessage->embeds->description); + $jsonMessage->embeds->image = "https://files.clatza.dev/tmp/rtmp/".$fileName; + + $options = [ + 'http' => [ + 'method' => 'POST', + 'header' => 'Content-Type: application/json', + 'content' => json_encode($jsonMessage) + ] + ]; + + $result = file_get_contents($DiscordWebhook, false, stream_context_create($options)); + } + }else{ + sleep(5); + } +} + +?> \ No newline at end of file diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..96193ec --- /dev/null +++ b/start.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +sed -i "s|%%StreamURL%%|${StreamURL}|" config.php +sed -i "s|%%DiscordWebhook%%|${DiscordWebhook}|" config.php \ No newline at end of file