<!DOCTYPE html>
<html>
<head>
<title>YouTube Live Stream Restream</title>
</head>
<body>
<h1>YouTube Live Stream Restream</h1>
<form method="post">
<label for="youtube-url">YouTube URL:</label><br>
<input type="text" id="youtube-url" name="youtube-url" size="50" placeholder="Enter a YouTube URL here"><br>
<input type="submit" value="Submit">
</form>
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$url = $_POST['youtube-url'];
$rtmp_url = shell_exec("youtube-dl --skip-download --write-info-json --print-json --all-subs $url | grep 'rtmp' | head -n 1 | cut -d ':' -f 2");
$command = "ffmpeg -i $rtmp_url -c:v copy -c:a aac -strict -2 -f flv rtmp://YOUR_SERVER_URL/live/STREAM_KEY";
$output = shell_exec($command);
echo "<h2>Console output:</h2>";
echo "<pre>$output</pre>";
}
?>
</body>
</html>
但它不起作用