Forgot to remove more unnessacary
This commit is contained in:
parent
583dfc4608
commit
44890c02ea
2 changed files with 1 additions and 8 deletions
6
index.js
6
index.js
|
@ -35,11 +35,8 @@ app.use(bodyParser.urlencoded({ extended: false }))
|
|||
|
||||
app.post("/convert", uploads.single("files"), (req, res) => {
|
||||
var file = req.file
|
||||
var preset = req.body.preset || 'veryfast'
|
||||
var format = req.body.format || 'mp4'
|
||||
|
||||
console.log(file)
|
||||
|
||||
const ffmpegProcess = cp.spawn(ffmpeg, [
|
||||
'-i', file.path,
|
||||
'-f', format,
|
||||
|
@ -53,12 +50,11 @@ app.post("/convert", uploads.single("files"), (req, res) => {
|
|||
'pipe', 'pipe', 'pipe', 'pipe', 'pipe',
|
||||
],
|
||||
})
|
||||
console.log(fs.statSync(file.path).size)
|
||||
|
||||
res.setHeader('Content-Disposition', `attachment; filename="${file.originalname.substring(0, file.originalname.lastIndexOf('.'))}.${formats[format] || format}"`);
|
||||
ffmpegProcess.stdio[1].pipe(res)
|
||||
|
||||
.on("close", () => {
|
||||
console.log("A")
|
||||
fs.rmSync(file.path)
|
||||
})
|
||||
})
|
||||
|
|
|
@ -54,9 +54,6 @@
|
|||
</div>
|
||||
<input type="submit">
|
||||
</form>
|
||||
<br>
|
||||
<p>Notes: </p>
|
||||
<p>Faster presets convert faster but have less quality, vice versa.</p>
|
||||
<hr>
|
||||
<p><a href="https://ko-fi.com/bingus_violet">Please consider donating</a> or host the website yourself! Anything
|
||||
helps! (Check <a href="https://codeberg.org/Bingus_Violet/Univerter">Codeberg</a> for more info)</p>
|
||||
|
|
Loading…
Reference in a new issue