Twitter works now yay

This commit is contained in:
bingus_violet 2025-07-27 20:24:30 -05:00
parent fdb7b59ea8
commit 7df6225669

View file

@ -80,7 +80,9 @@ expressManager.app.get("/download", async (req, res) => {
var downloadType = "attachment"
if (req.query.playInBrowser) downloadType = "inline";
res.setHeader("Content-Disposition", `${downloadType}; filename="${info.data.output.filename.replace(/[^a-z0-9 ]/gi, '')}.${format}"`)
var filename = info.data.filename || info.data.output.filename
res.setHeader("Content-Disposition", `${downloadType}; filename="${filename.replace(/[^a-z0-9 ]/gi, '')}.${format}"`)
var baseArgs = [
// Remove ffmpeg's console spamming
'-loglevel', 'error',
@ -131,12 +133,12 @@ expressManager.app.get("/download", async (req, res) => {
ffmpegProcess.stdio[1].pipe(res)
var audio = await fetch(info.data.tunnel[1] || info.data.tunnel[0])
var audio = await fetch(info.data.url || info.data.tunnel[1] || info.data.tunnel[0])
Readable.fromWeb(audio.body).pipe(ffmpegProcess.stdio[4])
if (needsVideo) {
var video = await fetch(info.data.tunnel[0])
var video = await fetch(info.data.url || info.data.tunnel[0])
Readable.fromWeb(video.body).pipe(ffmpegProcess.stdio[5])
}