Restore ability to download whole archives
As API keys aren't written in the first line of JSON files.
This commit is contained in:
parent
a0ba474fcc
commit
4fa433495b
@ -14,10 +14,17 @@
|
|||||||
|
|
||||||
$uri = $_SERVER['REQUEST_URI'];
|
$uri = $_SERVER['REQUEST_URI'];
|
||||||
$uri = str_replace('/channels/', '', $uri);
|
$uri = str_replace('/channels/', '', $uri);
|
||||||
$uri = str_replace('/', '#', $uri);
|
$prefix = '/mnt/HDD0/YouTube_captions_search_engine/channels/';
|
||||||
$uri = "/mnt/HDD0/YouTube_captions_search_engine/channels/$uri";
|
if (str_contains($uri, '/')) {
|
||||||
header('Content-Type: application/json; charset=UTF-8');
|
$uri = str_replace('/', '#', $uri);
|
||||||
$content = file_get_contents("zip://$uri");
|
$uri = $prefix . $uri;
|
||||||
echo stripFirstLine($content);
|
header('Content-Type: application/json; charset=UTF-8');
|
||||||
|
$content = file_get_contents("zip://$uri");
|
||||||
|
echo stripFirstLine($content);
|
||||||
|
} else {
|
||||||
|
$uri = $prefix . $uri;
|
||||||
|
header("Content-Type: application/zip");
|
||||||
|
echo readfile($uri);
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user