From de79c682c8814b776f273a3f6061aed518e27849 Mon Sep 17 00:00:00 2001 From: sky Date: Tue, 12 Aug 2025 15:39:52 -0400 Subject: [PATCH] processing server update --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index af6e93b..de75dd6 100644 --- a/index.js +++ b/index.js @@ -5,10 +5,10 @@ Bun.serve({ routes: { "/status": new Response("OK"), "/process": { - POST: async req => { + GET: async req => { if(req.headers.get("X-Authentication") == process.env.PRIVATE_KEY) { let path = "tmp/" + Bun.randomUUIDv7(); - await Bun.write(path + ".mp4", await req.body.blob()); + await `yt-dlp '${req.query.url}' -q -o "${path.mp4}"` await $`ffmpeg -i ${path}.mp4 -map_metadata -1 -map 0 -map -0:v -b:a 64k ${path}.ogg` await (Bun.file(path + ".mp4")).delete(); let response = new Response(await Bun.file(path + ".ogg").bytes(), {