aboutsummaryrefslogtreecommitdiff
path: root/tv/watch.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2021-12-23 19:41:25 +0100
committerMinteck <contact@minteck.org>2021-12-23 19:41:25 +0100
commited531165841a1de9200782b00b99b174bf2289cd (patch)
tree576c5c72c1d991491c1a43627f527c110fb31164 /tv/watch.php
parent25ba1e272636dbcda3c755094a7c31c5d67209a6 (diff)
downloadmovies-ed531165841a1de9200782b00b99b174bf2289cd.tar.gz
movies-ed531165841a1de9200782b00b99b174bf2289cd.tar.bz2
movies-ed531165841a1de9200782b00b99b174bf2289cd.zip
Commit
Diffstat (limited to 'tv/watch.php')
-rw-r--r--tv/watch.php52
1 files changed, 26 insertions, 26 deletions
diff --git a/tv/watch.php b/tv/watch.php
index def8da7..de831af 100644
--- a/tv/watch.php
+++ b/tv/watch.php
@@ -1,27 +1,27 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/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));
-
-if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/films/video/" . $film . '@4K.mp4')) {
- $source4k = $_SERVER['DOCUMENT_ROOT'] . "/data/films/video/" . $film . '@4K.mp4';
- $dest4k = $_SERVER['DOCUMENT_ROOT'] . "/cdn/video/" . $id . ".mp4";
- symlink($source4k, $dest4k);
-} else {
- $source = $_SERVER['DOCUMENT_ROOT'] . "/data/films/video/" . $film . '.mp4';
- $dest = $_SERVER['DOCUMENT_ROOT'] . "/cdn/video/" . $id . ".mp4";
- symlink($source, $dest);
-}
-
-header("Location: /cdn/video/" . $id . ".mp4");
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/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));
+
+if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/films/video/" . $film . '@4K.mp4')) {
+ $source4k = $_SERVER['DOCUMENT_ROOT'] . "/data/films/video/" . $film . '@4K.mp4';
+ $dest4k = $_SERVER['DOCUMENT_ROOT'] . "/cdn/video/" . $id . ".mp4";
+ symlink($source4k, $dest4k);
+} else {
+ $source = $_SERVER['DOCUMENT_ROOT'] . "/data/films/video/" . $film . '.mp4';
+ $dest = $_SERVER['DOCUMENT_ROOT'] . "/cdn/video/" . $id . ".mp4";
+ symlink($source, $dest);
+}
+
+header("Location: /cdn/video/" . $id . ".mp4");
exit; \ No newline at end of file