Compare commits
5 commits
538e606cf5
...
6c37eb6742
Author | SHA1 | Date | |
---|---|---|---|
6c37eb6742 | |||
05617a73cd | |||
f1d7b8453f | |||
da356b70ff | |||
f97314ab02 |
6 changed files with 52 additions and 28 deletions
1
app.js
1
app.js
|
@ -5,7 +5,6 @@ var cookieParser = require('cookie-parser');
|
|||
var logger = require('morgan');
|
||||
|
||||
var indexRouter = require('./routes/index');
|
||||
var usersRouter = require('./routes/users');
|
||||
|
||||
var app = express();
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "jeff-downloader2",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node ./bin/www"
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
var express = require('express');
|
||||
var router = express.Router();
|
||||
|
||||
/* GET users listing. */
|
||||
router.get('/', function(req, res, next) {
|
||||
res.send('respond with a resource');
|
||||
});
|
||||
|
||||
module.exports = router;
|
|
@ -1,3 +1,35 @@
|
|||
<h1><%= message %></h1>
|
||||
<h2><%= error.status %></h2>
|
||||
<pre><%= error.stack %></pre>
|
||||
<!DOCTYPE html>
|
||||
<html class="has-background-grey-dark" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="<%= error.status%>" />
|
||||
<meta property="og:description" content="A simple video downloader without any ad or tracking." />
|
||||
<meta property="og:url" content="https://namejeff.xyz/" />
|
||||
<meta property="og:image" content="https://namejeff.xyz/asset/jeff.png" />
|
||||
<meta name="theme-color" content="#3b2ccf" />
|
||||
<link rel="icon" href="/asset/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="shortcut icon" href="asset/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="stylesheets/index.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css">
|
||||
<title><%= error.status%></title>
|
||||
</head>
|
||||
<body class="has-text-light gradientBG">
|
||||
<section class="section has-text-centered">
|
||||
<div class="container">
|
||||
<img src="https://http.cat/<%= error.status %>">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer class="footer has-background-grey-dark has-text-light has-text-centered">
|
||||
<p>Uses SponsorBlock API from <a href="https://sponsor.ajay.app/">https://sponsor.ajay.app/</a></p>
|
||||
<p>I don't take any accountability for downloads made using this website.</p>
|
||||
<p>Credit to <a href="https://github.com/rg3/youtube-dl/">youtube-dl</a> - My other projects <a href="https://discordapp.com/oauth2/authorize?client_id=377563711927484418&scope=bot&permissions=0">Haha yes</a> & <a href="https://twitter.com/YTPB5k">YTP twitter bot</a> - Contact <a href="https://discord.gg/cNRh5JQ">Supositware#1616</a> on Discord if you have any issues</p>
|
||||
<p>You can also support me either on <a href="https://www.paypal.me/supositware">Paypal</a> Or by tipping <a href="https://basicattentiontoken.org/">BAT</a> on this website!</p>
|
||||
<p><a href="https://git.namejeff.xyz/Supositware/jeff-downloader">Source code</a></p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -65,16 +65,14 @@ Come take a look here https://git.namejeff.xyz/Supositware/jeff-downloader for a
|
|||
<option value="mp3">MP3</option>
|
||||
<option value="flac">FLAC</option>
|
||||
</select>
|
||||
|
||||
<label for="advanced" class="checkbox">
|
||||
<input class="checkbox" type="checkbox" name="advanced" id="advanced" title="Advanced" onclick="CheckFormat()">
|
||||
Advanced (Prone to errors!)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field has-addon">
|
||||
<div class="control">
|
||||
</div>
|
||||
<div class="control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="field is-horizontal level">
|
||||
<div class="field-body">
|
||||
<div class="field is-horizontal">
|
||||
|
@ -251,7 +249,7 @@ Come take a look here https://git.namejeff.xyz/Supositware/jeff-downloader for a
|
|||
|
||||
console.log(encodeURI(url.href));
|
||||
let xhttp = new XMLHttpRequest();
|
||||
xhttp.open("get", `/format?url=${url.href}`, true);
|
||||
xhttp.open("get", `/format?url=${url.href}&advanced=${document.getElementById("advanced").checked}`, true);
|
||||
xhttp.send();
|
||||
xhttp.addEventListener("load", function(event) {
|
||||
console.log(event.target.responseText);
|
||||
|
|
Loading…
Reference in a new issue