prepare("SELECT * FROM canales WHERE id = ?"); $stmt->bindParam(1, $channelId); $stmt->execute(); $channel = $stmt->fetch(PDO::FETCH_ASSOC); if (!$channel) { echo "Channel are not in the DB."; exit;} if ($_SERVER["REQUEST_METHOD"] == "POST") { $name = $_POST['name']; $m3u8Dir = $_POST['m3u8Dir']; $tmpDir = $_POST['tmpDir']; $keyU = $_POST['keyU']; $keyID = $_POST['keyID']; $proxy = empty($_POST['proxy']) ? null : $_POST['proxy']; $useProxy = $_POST['useProxy']; $url = $_POST['url']; $pidm3u8 = empty($_POST['pidm3u8']) ? null : $_POST['pidm3u8']; $time_started = empty($_POST['time_started']) ? null : $_POST['time_started']; $video = $_POST['video']; $audio = $_POST['audio']; $subtitle = $_POST['subtitle']; $stmt = $db->prepare("UPDATE canales SET name=?, m3u8Dir=?, tmpDir=?, keyU=?, keyID=?, proxy=?, useProxy=?, url=?, pidm3u8=?, time_started=?, video=?, audio=?, subtitle=? WHERE id=?"); $stmt->execute([$name, $m3u8Dir, $tmpDir, $keyU, $keyID, $proxy, $useProxy, $url, $pidm3u8, $time_started, $video, $audio, $subtitle, $channelId]); header("Location: all_channel.php"); error_reporting(E_ALL); ini_set('display_errors', 1); exit; } if($channel['useProxy'] === 'true'){ $command = './bin/yt-dlp --list-formats --allow-unplayable-formats --proxy ' . $channel['proxy'] .' ' . $channel['url'] ; }else{ $command = './bin/yt-dlp --list-formats --allow-unplayable-formats ' . $channel['url'] ; } $output = shell_exec($command); $matches = []; $pattern = '/(\w+)\s+(\w+)\s+(\w+)\s+(\w+)\s+\|\s+(\d+k)\s+(dash)/'; preg_match_all($pattern, $output, $matches, PREG_SET_ORDER); ?>
Edit Channel>
Name:
m3u8Dir:
tmpDir:
keyU:
keyID:
Proxy:
Use Proxy:
>True
>False
URL:
pidm3u8:
Time Started:
Video:
Audio:
Subtitle:
Save
Channel Details
ID
EXT
RESOLUTION
TBR
Action
{$match[1]}
{$match[2]}
{$match[3]}
{$match[5]}
"; if (strtolower($match[3]) === 'audio') { echo "
SEND
"; } else { echo "
SEND
"; } echo "
"; } } else { echo "
No data find - check proxy or url.
"; }?>