mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-18 14:11:29 +03:00
Fixed bug where subscribing to a private playlist failed
This commit is contained in:
@@ -81,7 +81,15 @@ async function getSubscriptionInfo(sub, user_uid = null) {
|
|||||||
|
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
// get videos
|
// get videos
|
||||||
let downloadConfig = ['--dump-json', '--playlist-end', '1']
|
let downloadConfig = ['--dump-json', '--playlist-end', '1'];
|
||||||
|
let useCookies = config_api.getConfigItem('ytdl_use_cookies');
|
||||||
|
if (useCookies) {
|
||||||
|
if (fs.existsSync(path.join(__dirname, 'appdata', 'cookies.txt'))) {
|
||||||
|
downloadConfig.push('--cookies', path.join('appdata', 'cookies.txt'));
|
||||||
|
} else {
|
||||||
|
logger.warn('Cookies file could not be found. You can either upload one, or disable \'use cookies\' in the Advanced tab in the settings.');
|
||||||
|
}
|
||||||
|
}
|
||||||
youtubedl.exec(sub.url, downloadConfig, {}, function(err, output) {
|
youtubedl.exec(sub.url, downloadConfig, {}, function(err, output) {
|
||||||
if (debugMode) {
|
if (debugMode) {
|
||||||
logger.info('Subscribe: got info for subscription ' + sub.id);
|
logger.info('Subscribe: got info for subscription ' + sub.id);
|
||||||
@@ -158,6 +166,11 @@ async function unsubscribe(sub, deleteMode, user_uid = null) {
|
|||||||
else
|
else
|
||||||
db.get('subscriptions').remove({id: id}).write();
|
db.get('subscriptions').remove({id: id}).write();
|
||||||
|
|
||||||
|
// failed subs have no name, on unsubscribe they shouldn't error
|
||||||
|
if (!sub.name) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const appendedBasePath = getAppendedBasePath(sub, basePath);
|
const appendedBasePath = getAppendedBasePath(sub, basePath);
|
||||||
if (deleteMode && fs.existsSync(appendedBasePath)) {
|
if (deleteMode && fs.existsSync(appendedBasePath)) {
|
||||||
if (sub.archive && fs.existsSync(sub.archive)) {
|
if (sub.archive && fs.existsSync(sub.archive)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user