Fixed issue where app would not wait for youtube-dl download to finish before proceeding

This commit is contained in:
Tzahi12345
2023-11-27 01:06:17 -05:00
parent 9d674c51ca
commit 30e485a653
2 changed files with 2 additions and 3 deletions

View File

@@ -657,9 +657,8 @@ describe('youtube-dl', async function() {
const downloader_api = require('../downloader');
const url = 'https://www.youtube.com/watch?v=hpigjnKl7nI';
const args = await downloader_api.generateArgs(url, 'video', {}, null, true);
const {child_process, callback} = await youtubedl_api.runYoutubeDL(url, args);
const {child_process} = await youtubedl_api.runYoutubeDL(url, args);
assert(child_process);
console.log(await callback);
});
});

View File

@@ -101,7 +101,7 @@ exports.checkForYoutubeDLUpdate = async () => {
// TODO: don't redownload if fork already exists
if (!fs.existsSync(output_file_path) || current_fork !== selected_fork || !current_version || current_version !== latest_version) {
logger.warn(`Updating ${selected_fork} binary to '${output_file_path}', downloading...`);
exports.updateYoutubeDL(latest_version);
await exports.updateYoutubeDL(latest_version);
}
}