Minor changes
This commit is contained in:
parent
9583f70c7c
commit
63dd7b3bc7
3 changed files with 15 additions and 13 deletions
14
index.js
14
index.js
|
@ -28,9 +28,10 @@ app.use(bodyParser.urlencoded({ extended: false }))
|
||||||
|
|
||||||
app.get("/download", async (req, res) => {
|
app.get("/download", async (req, res) => {
|
||||||
const url = req.query.url
|
const url = req.query.url
|
||||||
const format = req.query.format
|
const format = req.query.format || 'mp4'
|
||||||
const quality = req.query.quality
|
const quality = req.query.quality || 'highest'
|
||||||
const defin = req.query.definition
|
const defin = req.query.definition || 'hd'
|
||||||
|
const preset = 'medium'
|
||||||
|
|
||||||
res.setHeader("X-Accel-Buffering", "no")
|
res.setHeader("X-Accel-Buffering", "no")
|
||||||
|
|
||||||
|
@ -54,7 +55,6 @@ app.get("/download", async (req, res) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("mp3 ogg wav".includes(format)) {
|
if ("mp3 ogg wav".includes(format)) {
|
||||||
console.log('audio')
|
|
||||||
var audio = ytdl(url, { filter: 'audioonly', quality: quality })
|
var audio = ytdl(url, { filter: 'audioonly', quality: quality })
|
||||||
|
|
||||||
const ffmpegProcess = cp.spawn(ffmpeg, [
|
const ffmpegProcess = cp.spawn(ffmpeg, [
|
||||||
|
@ -62,7 +62,7 @@ app.get("/download", async (req, res) => {
|
||||||
'-c:v', 'copy',
|
'-c:v', 'copy',
|
||||||
'-c:a', 'libmp3lame',
|
'-c:a', 'libmp3lame',
|
||||||
'-crf','27',
|
'-crf','27',
|
||||||
'-preset','veryfast',
|
'-preset',preset,
|
||||||
'-movflags','frag_keyframe+empty_moov',
|
'-movflags','frag_keyframe+empty_moov',
|
||||||
'-f', format,
|
'-f', format,
|
||||||
'-loglevel','error',
|
'-loglevel','error',
|
||||||
|
@ -91,7 +91,7 @@ app.get("/download", async (req, res) => {
|
||||||
'-c:v', 'copy',
|
'-c:v', 'copy',
|
||||||
'-c:a', 'libmp3lame',
|
'-c:a', 'libmp3lame',
|
||||||
'-crf','27',
|
'-crf','27',
|
||||||
'-preset','veryfast',
|
'-preset',preset,
|
||||||
'-movflags','frag_keyframe+empty_moov',
|
'-movflags','frag_keyframe+empty_moov',
|
||||||
'-f', format,
|
'-f', format,
|
||||||
'-loglevel','error',
|
'-loglevel','error',
|
||||||
|
@ -116,7 +116,7 @@ app.get("/download", async (req, res) => {
|
||||||
'-c:v', 'copy',
|
'-c:v', 'copy',
|
||||||
'-c:a', 'libmp3lame',
|
'-c:a', 'libmp3lame',
|
||||||
'-crf','27',
|
'-crf','27',
|
||||||
'-preset','veryfast',
|
'-preset',preset,
|
||||||
'-movflags','frag_keyframe+empty_moov',
|
'-movflags','frag_keyframe+empty_moov',
|
||||||
'-f', format,
|
'-f', format,
|
||||||
'-loglevel','error',
|
'-loglevel','error',
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "univerter",
|
"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",
|
"description": "A web youtube converter for converting videos to mp4, mp3, and other supported formats",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Univerter <p>v3.1</p>
|
<h1>Univerter <p>v3.1.1</p>
|
||||||
<p style="color: lightgray">And still javascript free...</p>
|
<p style="color: lightgray">And still javascript free...</p>
|
||||||
<hr>
|
<hr>
|
||||||
</h1>
|
</h1>
|
||||||
|
@ -31,9 +31,10 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select required id="definition" name="definition">
|
<select required id="definition" name="definition">
|
||||||
<option value="sd">SD (Standard Definition)</option>
|
|
||||||
<option value="hd">HD (High Definition)</option>
|
<option value="hd">HD (High Definition)</option>
|
||||||
|
<option value="sd">SD (Standard Definition)</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
|
@ -46,14 +47,15 @@
|
||||||
<option value="avi">.avi</option>
|
<option value="avi">.avi</option>
|
||||||
<option value="mov">.mov</option>
|
<option value="mov">.mov</option>
|
||||||
<option disabled>Audio Formats</option>
|
<option disabled>Audio Formats</option>
|
||||||
<option value="mp3">.mp3</option>
|
<option value="mp3" selected>.mp3</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<input type="submit">
|
<input type="submit">
|
||||||
</form>
|
</form>
|
||||||
<br>
|
<br>
|
||||||
<p>The SD option only supports 720p and below, HD supports all qualities. HD is experimental, so please report
|
<p>Notes: </p>
|
||||||
issues :D</p>
|
<p>SD is 720p max, HD supports all qualities (even 4k!)</p>
|
||||||
|
<hr>
|
||||||
<p><a href="https://ko-fi.com/bingus_violet">Please consider donating</a> or host the website yourself! Anything
|
<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>
|
helps! (Check <a href="https://codeberg.org/Bingus_Violet/Univerter">Codeberg</a> for more info)</p>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in a new issue