This commit is contained in:
sky
2025-08-12 15:49:56 -04:00
parent e620ce4f85
commit 6d928df957

View File

@ -9,7 +9,7 @@ Bun.serve({
if(req.headers.get("X-Authentication") == process.env.PRIVATE_KEY) { if(req.headers.get("X-Authentication") == process.env.PRIVATE_KEY) {
let path = "tmp/" + Bun.randomUUIDv7(); let path = "tmp/" + Bun.randomUUIDv7();
let data = await req.json(); let data = await req.json();
await `yt-dlp '${data.url}' -q -o "${path}.mp4"` 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 $`ffmpeg -i ${path}.mp4 -map_metadata -1 -map 0 -map -0:v -b:a 64k ${path}.ogg`
await (Bun.file(path + ".mp4")).delete(); await (Bun.file(path + ".mp4")).delete();
let response = new Response(await Bun.file(path + ".ogg").bytes(), { let response = new Response(await Bun.file(path + ".ogg").bytes(), {
@ -27,4 +27,4 @@ Bun.serve({
} }
}); });
console.log("http://localhost:6001") console.log("http://localhost:6001")