Fix downloads being 0 bytes. better fix coming later
This commit is contained in:
parent
c211cfcc0b
commit
1d02aa3931
1 changed files with 7 additions and 3 deletions
|
@ -67,7 +67,8 @@ expressManager.app.get("/download", async (req, res) => {
|
|||
url,
|
||||
downloadMode,
|
||||
videoQuality: quality,
|
||||
localProcessing: true,
|
||||
localProcessing: "forced",
|
||||
|
||||
}, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -79,6 +80,7 @@ expressManager.app.get("/download", async (req, res) => {
|
|||
|
||||
res.setHeader("Content-Disposition", `${downloadType}; filename="${filename.replace(/[^a-z0-9 ]/gi, '')}.${format}"`)
|
||||
|
||||
// console.log(info.data.service)
|
||||
if (info.data.service == "youtube") {
|
||||
|
||||
var downloadType = "attachment"
|
||||
|
@ -134,7 +136,9 @@ 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( downloadMode == "auto" ? info.data.tunnel[1] : info.data.tunnel[0] )
|
||||
|
||||
// console.log(info)
|
||||
|
||||
Readable.fromWeb(audio.body).pipe(ffmpegProcess.stdio[4])
|
||||
|
||||
|
@ -156,7 +160,7 @@ expressManager.app.get("/download", async (req, res) => {
|
|||
}
|
||||
})
|
||||
|
||||
console.log(info)
|
||||
// console.log(info)
|
||||
var video = await fetch(info.data.url)
|
||||
|
||||
Readable.fromWeb(video.body).pipe(res)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue