aboutsummaryrefslogtreecommitdiff
path: root/yt.php
diff options
context:
space:
mode:
Diffstat (limited to 'yt.php')
-rw-r--r--yt.php27
1 files changed, 0 insertions, 27 deletions
diff --git a/yt.php b/yt.php
deleted file mode 100644
index ec5107e..0000000
--- a/yt.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-ini_set('max_execution_time', 300);
-ini_set('request_terminate_timeout', 300);
-require_once $_SERVER['DOCUMENT_ROOT'] . "/private/session.php";
-
-if (!isset($_GET['i'])) {
- die();
-}
-
-if (strpos($_GET['i'], ".") !== false || strpos($_GET['i'], "/") !== false) {
- die();
-}
-
-$film = $_GET['i'];
-$id = bin2hex(random_bytes(96));
-
-exec("bash -c \"rm -Rfvd /tmp/ytphp-*\"");
-mkdir("/tmp/ytphp-" . $id);
-exec("bash -c \"cd /tmp/ytphp-" . $id . " && yt-dlp -f 'bestaudio[ext=m4a]' -x -o 'audio.m4a' --audio-format m4a \\\"" . $film . "\\\"\"", $out);
-
-$fp = fopen("/tmp/ytphp-" . $id . "/audio.m4a", 'rb');
-header("Content-Type: " . mime_content_type("/tmp/ytphp-" . $id . "/audio.m4a"));
-header("Content-Length: " . filesize("/tmp/ytphp-" . $id . "/audio.m4a"));
-fpassthru($fp);
-exec("bash -c \"rm -Rfvd /tmp/ytphp-*\"");
-exit;