From e620ce4f85c76c42b8be982aa3d319c1d11f9120 Mon Sep 17 00:00:00 2001 From: sky Date: Tue, 12 Aug 2025 15:46:39 -0400 Subject: [PATCH] fix processing server, apparently you just cant get query params --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index d445c4d..f0dd46e 100644 --- a/index.js +++ b/index.js @@ -5,10 +5,11 @@ Bun.serve({ routes: { "/status": new Response("OK"), "/process": { - GET: async req => { + POST: async req => { if(req.headers.get("X-Authentication") == process.env.PRIVATE_KEY) { let path = "tmp/" + Bun.randomUUIDv7(); - await `yt-dlp '${req.query.url}' -q -o "${path}.mp4"` + let data = await req.json(); + await `yt-dlp '${data.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(), {