mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-18 09:01: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
|
// get sub videos
|
||||||
|
if (subscription.name) {
|
||||||
let base_path = config_api.getConfigItem('ytdl_subscriptions_base_path');
|
let base_path = config_api.getConfigItem('ytdl_subscriptions_base_path');
|
||||||
let appended_base_path = path.join(base_path, subscription.isPlaylist ? 'playlists' : 'channels', subscription.name, '/');
|
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 = [];
|
var parsed_files = [];
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
let file = files[i];
|
let file = files[i];
|
||||||
@@ -932,6 +941,12 @@ app.post('/api/getSubscription', async (req, res) => {
|
|||||||
subscription: subscription,
|
subscription: subscription,
|
||||||
files: parsed_files
|
files: parsed_files
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
res.sendStatus(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post('/api/downloadVideosForSubscription', async (req, res) => {
|
app.post('/api/downloadVideosForSubscription', async (req, res) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user