mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-10 23:00:57 +03:00
Backend can kick off downloads without using deprecated node-youtube-dl library
Downloads can now be cancelled and better "paused"
This commit is contained in:
@@ -64,7 +64,7 @@ async function getSubscriptionInfo(sub) {
|
||||
}
|
||||
}
|
||||
|
||||
const {parsed_output, err} = await youtubedl_api.runYoutubeDL(sub.url, downloadConfig);
|
||||
const {parsed_output, err} = await youtubedl_api.runYoutubeDLMain(sub.url, downloadConfig);
|
||||
if (err) {
|
||||
logger.error(err.stderr);
|
||||
return false;
|
||||
@@ -226,7 +226,7 @@ exports.getVideosForSub = async (sub, user_uid = null) => {
|
||||
// get videos
|
||||
logger.verbose(`Subscription: getting list of videos to download for ${sub.name} with args: ${downloadConfig.join(',')}`);
|
||||
|
||||
const {parsed_output, err} = await youtubedl_api.runYoutubeDL(sub.url, downloadConfig);
|
||||
const {parsed_output, err} = await youtubedl_api.runYoutubeDLMain(sub.url, downloadConfig);
|
||||
updateSubscriptionProperty(sub, {downloading: false}, user_uid);
|
||||
if (!parsed_output) {
|
||||
logger.error('Subscription check failed!');
|
||||
@@ -482,7 +482,7 @@ async function checkVideoIfBetterExists(file_obj, sub, user_uid) {
|
||||
const metric_to_compare = sub.type === 'audio' ? 'abr' : 'height';
|
||||
if (output[metric_to_compare] > file_obj[metric_to_compare]) {
|
||||
// download new video as the simulated one is better
|
||||
const {parsed_output, err} = await youtubedl_api.runYoutubeDL(sub.url, downloadConfig);
|
||||
const {parsed_output, err} = await youtubedl_api.runYoutubeDLMain(sub.url, downloadConfig);
|
||||
if (err) {
|
||||
logger.verbose(`Failed to download better version of video ${file_obj['id']}`);
|
||||
} else if (parsed_output) {
|
||||
|
||||
Reference in New Issue
Block a user