diff --git a/index.js b/index.js index fc04b92..a38b065 100644 --- a/index.js +++ b/index.js @@ -28,9 +28,10 @@ app.use(bodyParser.urlencoded({ extended: false })) app.get("/download", async (req, res) => { const url = req.query.url - const format = req.query.format - const quality = req.query.quality - const defin = req.query.definition + const format = req.query.format || 'mp4' + const quality = req.query.quality || 'highest' + const defin = req.query.definition || 'hd' + const preset = 'medium' res.setHeader("X-Accel-Buffering", "no") @@ -54,7 +55,6 @@ app.get("/download", async (req, res) => { } if ("mp3 ogg wav".includes(format)) { - console.log('audio') var audio = ytdl(url, { filter: 'audioonly', quality: quality }) const ffmpegProcess = cp.spawn(ffmpeg, [ @@ -62,7 +62,7 @@ app.get("/download", async (req, res) => { '-c:v', 'copy', '-c:a', 'libmp3lame', '-crf','27', - '-preset','veryfast', + '-preset',preset, '-movflags','frag_keyframe+empty_moov', '-f', format, '-loglevel','error', @@ -91,7 +91,7 @@ app.get("/download", async (req, res) => { '-c:v', 'copy', '-c:a', 'libmp3lame', '-crf','27', - '-preset','veryfast', + '-preset',preset, '-movflags','frag_keyframe+empty_moov', '-f', format, '-loglevel','error', @@ -116,7 +116,7 @@ app.get("/download", async (req, res) => { '-c:v', 'copy', '-c:a', 'libmp3lame', '-crf','27', - '-preset','veryfast', + '-preset',preset, '-movflags','frag_keyframe+empty_moov', '-f', format, '-loglevel','error', diff --git a/package.json b/package.json index 0b0f8c0..c50b5ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "univerter", - "version": "3.1.0", + "version": "3.2.0", "description": "A web youtube converter for converting videos to mp4, mp3, and other supported formats", "main": "index.js", "scripts": { diff --git a/static/index.html b/static/index.html index f6af3d5..f12b737 100644 --- a/static/index.html +++ b/static/index.html @@ -12,7 +12,7 @@ -

Univerter

v3.1

+

Univerter

v3.1.1

And still javascript free...


@@ -31,9 +31,10 @@ +
@@ -46,14 +47,15 @@ - +

-

The SD option only supports 720p and below, HD supports all qualities. HD is experimental, so please report - issues :D

+

Notes:

+

SD is 720p max, HD supports all qualities (even 4k!)

+

Please consider donating or host the website yourself! Anything helps! (Check Codeberg for more info)