Twitter works now yay
This commit is contained in:
parent
fdb7b59ea8
commit
7df6225669
1 changed files with 5 additions and 3 deletions
|
@ -80,7 +80,9 @@ expressManager.app.get("/download", async (req, res) => {
|
||||||
var downloadType = "attachment"
|
var downloadType = "attachment"
|
||||||
if (req.query.playInBrowser) downloadType = "inline";
|
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 = [
|
var baseArgs = [
|
||||||
// Remove ffmpeg's console spamming
|
// Remove ffmpeg's console spamming
|
||||||
'-loglevel', 'error',
|
'-loglevel', 'error',
|
||||||
|
@ -131,12 +133,12 @@ expressManager.app.get("/download", async (req, res) => {
|
||||||
|
|
||||||
ffmpegProcess.stdio[1].pipe(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])
|
Readable.fromWeb(audio.body).pipe(ffmpegProcess.stdio[4])
|
||||||
|
|
||||||
if (needsVideo) {
|
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])
|
Readable.fromWeb(video.body).pipe(ffmpegProcess.stdio[5])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue