summaryrefslogtreecommitdiff
path: root/pages/api/plex-thumb.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-03-05 09:42:52 +0100
committerMinteck <contact@minteck.org>2023-03-05 09:42:52 +0100
commita4d4376e857c21a2e21221a9b522e91c79740788 (patch)
treef816fabb69ea5d273820b822a365e5712a5fd1dd /pages/api/plex-thumb.php
parent27e0f1f5b61a11a816b42bb9fc8c9fd392260ffe (diff)
downloadpluralconnect-a4d4376e857c21a2e21221a9b522e91c79740788.tar.gz
pluralconnect-a4d4376e857c21a2e21221a9b522e91c79740788.tar.bz2
pluralconnect-a4d4376e857c21a2e21221a9b522e91c79740788.zip
Updated 2 files and added 3 files (automated)
Diffstat (limited to 'pages/api/plex-thumb.php')
-rw-r--r--pages/api/plex-thumb.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/pages/api/plex-thumb.php b/pages/api/plex-thumb.php
new file mode 100644
index 0000000..4a20159
--- /dev/null
+++ b/pages/api/plex-thumb.php
@@ -0,0 +1,11 @@
+<?php
+
+$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
+
+if (isset($_GET["library"]) && isset($_GET["id"]) && is_numeric($_GET["library"]) && is_numeric($_GET["id"])) {
+ header("Content-Type: image/jpg");
+ die(file_get_contents("https://plex.equestria.dev/library/metadata/" . $_GET["library"] . "/thumb/" . $_GET["id"] . "?X-Plex-Token=" . $app["plex"]));
+} else {
+ header("HTTP/1.1 400 Invalid request");
+ die("Invalid request");
+} \ No newline at end of file