add files
This commit is contained in:
parent
50c8ef8907
commit
84b1697ec6
|
@ -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']
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?php
|
||||||
|
$StreamURL = "%%StreamURL%%";
|
||||||
|
$DiscordWebhook = "%%DiscordWebhook%%";
|
||||||
|
|
||||||
|
?>
|
Binary file not shown.
|
@ -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"
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?php
|
||||||
|
include "config.php";
|
||||||
|
|
||||||
|
$lastOnlineTime = time();
|
||||||
|
|
||||||
|
while(TRUE)
|
||||||
|
{
|
||||||
|
if(($lastOnlineTime + 500) < time())
|
||||||
|
{
|
||||||
|
$fileName = "output-".time().".jpg";
|
||||||
|
|
||||||
|
system("ffmpeg -i ".$StreamURL." -vframes 1 -q:v 2 -vf scale=535:346 ".$fileName);
|
||||||
|
|
||||||
|
if(is_file($fileName))
|
||||||
|
{
|
||||||
|
$lastOnlineTime = time();
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in New Issue