mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-13 01:21:29 +03:00
Added the ability to download (export) archives from subscriptions
This commit is contained in:
@@ -192,7 +192,7 @@ function watchSubscriptions() {
|
||||
let current_delay = 0;
|
||||
for (let i = 0; i < subscriptions.length; i++) {
|
||||
let sub = subscriptions[i];
|
||||
console.log('watching ' + sub.name + ' with delay interval of ' + delay_interval);
|
||||
if (debugMode) console.log('watching ' + sub.name + ' with delay interval of ' + delay_interval);
|
||||
setTimeout(() => {
|
||||
subscriptions_api.getVideosForSub(sub);
|
||||
}, current_delay);
|
||||
@@ -1145,6 +1145,20 @@ app.post('/api/deleteFile', async (req, res) => {
|
||||
res.send()
|
||||
});
|
||||
|
||||
app.post('/api/downloadArchive', async (req, res) => {
|
||||
let sub = req.body.sub;
|
||||
let archive_dir = sub.archive;
|
||||
|
||||
let full_archive_path = path.join(__dirname, archive_dir, 'archive.txt');
|
||||
|
||||
if (fs.existsSync(full_archive_path)) {
|
||||
res.sendFile(full_archive_path);
|
||||
} else {
|
||||
res.sendStatus(404);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
app.get('/api/video/:id', function(req , res){
|
||||
var head;
|
||||
let optionalParams = url_api.parse(req.url,true).query;
|
||||
|
||||
Reference in New Issue
Block a user