Multiple binaries can now exist, and if the needed one is missing it will be downloaded at runtime

This commit is contained in:
Tzahi12345
2023-11-26 19:10:22 -05:00
parent 7bf2fb5fef
commit 9ca6563b36
5 changed files with 30 additions and 62 deletions

View File

@@ -20,9 +20,6 @@ const ps = require('ps-node');
const Feed = require('feed').Feed;
const session = require('express-session');
// needed if bin/details somehow gets deleted
if (!fs.existsSync(CONSTS.DETAILS_BIN_PATH)) fs.writeJSONSync(CONSTS.DETAILS_BIN_PATH, {"version":"2000.06.06","path":"node_modules\\youtube-dl\\bin\\youtube-dl.exe","exec":"youtube-dl.exe","downloader":"youtube-dl"})
const logger = require('./logger');
const config_api = require('./config.js');
const downloader_api = require('./downloader');
@@ -668,9 +665,7 @@ async function getUrlInfos(url) {
async function startYoutubeDL() {
// auto update youtube-dl
youtubedl_api.verifyBinaryExists();
const update_available = await youtubedl_api.checkForYoutubeDLUpdate();
if (update_available) await youtubedl_api.updateYoutubeDL(update_available);
await youtubedl_api.checkForYoutubeDLUpdate();
}
app.use(function(req, res, next) {