From 62c703f1a95927798aebb2aa080d7e9611ea431e Mon Sep 17 00:00:00 2001 From: octt <6083316-octospacc@users.noreply.gitlab.com> Date: Mon, 19 May 2025 01:16:22 +0200 Subject: [PATCH] Replace Proxatore.php --- Proxatore.php | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/Proxatore.php b/Proxatore.php index 401bd04..24fb59e 100644 --- a/Proxatore.php +++ b/Proxatore.php @@ -57,6 +57,7 @@ define('HISTORY_FILE', './Proxatore.history.jsonl'); const PLATFORMS = [ 'spaccbbs' => ['bbs.spacc.eu.org'], + 'bilibili' => ['bilibili.com'], 'bluesky' => ['bsky.app'], 'facebook' => ['facebook.com', 'm.facebook.com'], 'instagram' => ['instagram.com'], @@ -109,7 +110,7 @@ const PLATFORMS_API = [ ], ]; -const PLATFORMS_COBALT = ['instagram']; +const PLATFORMS_COBALT = ['instagram', 'bilibili']; const PLATFORMS_FAKE404 = ['telegram']; @@ -117,7 +118,7 @@ const PLATFORMS_HACKS = ['bluesky', 'threads', 'twitter', 'x']; const PLATFORMS_ORDERED = ['telegram']; -//const PLATFORMS_VIDEO = ['facebook', 'instagram']; +// const PLATFORMS_VIDEO = ['youtube', 'bilibili']; // ['facebook', 'instagram']; const PLATFORMS_WEBVIDEO = ['raiplay']; @@ -472,6 +473,8 @@ function getCobaltVideo(string $url) { ])); if ($cobaltData->status === 'redirect' && strpos($cobaltData->url, '.mp4')) { return $cobaltData->url; + } else if ($cobaltData->status === 'tunnel' && strpos($cobaltData->filename, '.mp4')) { + return SCRIPT_NAME . '__cobaltproxy__/_/' . lstrip($cobaltData->url, '/', 3); } } @@ -567,6 +570,9 @@ function handleApiRequest(array $segments): void { default: ffmpegStream('https://' . PLATFORMS[$platform][0] . '/' . lstrip($relativeUrl, '/', 3)); } + } else if ($api === 'cobaltproxy') { + header('Content-Type: video/mp4'); + readfile(COBALT_API . $relativeUrl); } else if ($api === 'embed') { header('Location: ' . makeEmbedUrl($platform, $relativeUrl)); } @@ -584,18 +590,27 @@ function iframeHtml($result): void { ?> ➡️ Next - + A dedicated domain name
Made with 🕸️ and 🧨 by OctoSpacc.
@@ -1021,7 +1036,7 @@ ul.platforms a {
-
+ >