diff --git a/routes/index.js b/routes/index.js index a693901..ee29520 100644 --- a/routes/index.js +++ b/routes/index.js @@ -88,7 +88,6 @@ router.get('/status/:uuid', function (req, res ,next) { router.get('/format', function (req, res ,next) { let url; - let i = 0; try { url = new URL(req.query.url); } catch (e) { @@ -100,17 +99,22 @@ router.get('/format', function (req, res ,next) { youtubedl.exec(url.href, ['--dump-json'], {}, function(err, output) { if (err) throw err let json = JSON.parse(output); + console.log(req.query.advanced); json.formats.forEach(format => { - if (format.vcodec === 'none' || format.acodec === 'none') + if (req.query.advanced === 'false' && (format.vcodec === 'none' || format.acodec === 'none')) return; - i++; - formats.push({ext: format.ext, id: format.format_id, note: `${format.width}x${format.height}`}); + let note = `${format.width}x${format.height}`; + + if (req.query.advanced === 'true') { + note = format.format + } + + formats.push({ext: format.ext, id: format.format_id, note: note}); }); return res.send(formats); }); - return; }); router.post('/', async function(req, res, next) { diff --git a/views/index.ejs b/views/index.ejs index 26e1409..9751c45 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -65,16 +65,14 @@ Come take a look here https://git.namejeff.xyz/Supositware/jeff-downloader for a - - -