2023-02-07 22:39:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
function stripFirstLine($text)
|
|
|
|
{
|
|
|
|
return substr($text, strpos($text, "\n") + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!function_exists('str_contains')) {
|
|
|
|
function str_contains($haystack, $needle)
|
|
|
|
{
|
|
|
|
return strpos($haystack, $needle) !== false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$uri = $_SERVER['REQUEST_URI'];
|
|
|
|
$uri = str_replace('/channels/', '', $uri);
|
2023-02-07 22:42:24 +01:00
|
|
|
$uri = str_replace('/', '#', $uri);
|
2023-02-07 22:39:43 +01:00
|
|
|
$uri = "/mnt/HDD0/YouTube_captions_search_engine/channels/$uri";
|
2023-02-07 22:42:24 +01:00
|
|
|
header('Content-Type: application/json; charset=UTF-8');
|
|
|
|
$content = file_get_contents("zip://$uri");
|
|
|
|
echo stripFirstLine($content);
|
|
|
|
|
|
|
|
?>
|