mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-19 07:31:30 +03:00
subscriptions without names will not have files retrieved any longer
This commit is contained in:
@@ -909,9 +909,18 @@ app.post('/api/getSubscription', async (req, res) => {
|
||||
}
|
||||
|
||||
// get sub videos
|
||||
if (subscription.name) {
|
||||
let base_path = config_api.getConfigItem('ytdl_subscriptions_base_path');
|
||||
let appended_base_path = path.join(base_path, subscription.isPlaylist ? 'playlists' : 'channels', subscription.name, '/');
|
||||
var files = recFindByExt(appended_base_path, 'mp4');
|
||||
let files;
|
||||
try {
|
||||
files = recFindByExt(appended_base_path, 'mp4');
|
||||
} catch(e) {
|
||||
files = null;
|
||||
console.log('Failed to get folder for subscription: ' + subscription.name);
|
||||
res.sendStatus(500);
|
||||
return;
|
||||
}
|
||||
var parsed_files = [];
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
let file = files[i];
|
||||
@@ -932,6 +941,12 @@ app.post('/api/getSubscription', async (req, res) => {
|
||||
subscription: subscription,
|
||||
files: parsed_files
|
||||
});
|
||||
} else {
|
||||
res.sendStatus(500);
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
app.post('/api/downloadVideosForSubscription', async (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user