summaryrefslogtreecommitdiff
path: root/pages/api/plex-thumb.php
blob: 400987143d1e8f35d0564b08f2d111b4ad3e7fec (plain)
1
2
3
4
5
6
7
8
9
10
11
<?php

$app = $GLOBALS["ColdHazeApp"];

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");
}