mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-09 21:31:27 +03:00
Added the ability to view logs from the settings menu
This commit is contained in:
@@ -1830,6 +1830,21 @@ app.get('/api/using-encryption', function(req, res) {
|
||||
res.send(usingEncryption);
|
||||
});
|
||||
|
||||
app.get('/api/logs', function(req, res) {
|
||||
let logs = null;
|
||||
logs_path = path.join('appdata', 'logs', 'combined.log')
|
||||
if (fs.existsSync(logs_path))
|
||||
logs = fs.readFileSync(logs_path, 'utf8');
|
||||
else
|
||||
logger.error(`Failed to find logs file at the expected location: ${logs_path}`)
|
||||
|
||||
console.log(logs)
|
||||
res.send({
|
||||
logs: logs,
|
||||
success: !!logs
|
||||
});
|
||||
});
|
||||
|
||||
app.post('/api/tomp3', optionalJwt, async function(req, res) {
|
||||
var url = req.body.url;
|
||||
var options = {
|
||||
|
||||
Reference in New Issue
Block a user