Added support for RedGifs and Reddit albums. Improved command line logger. Added rate limiters for reddit and host URLs.

This commit is contained in:
2024-09-11 05:16:58 +02:00
parent bb06fe9763
commit de50d609f3
33 changed files with 586 additions and 256 deletions
+3 -2
View File
@@ -4,7 +4,8 @@ const config = require('config');
const fs = require('fs-extra');
const yaml = require('js-yaml');
const interpolate = require('../interpolate.js');
const logger = require('../logger')(__filename);
const interpolate = require('../interpolate');
async function getIndex(user) {
const indexFilePath = interpolate(config.library.index.file, null, null, null, null, user, false);
@@ -14,7 +15,7 @@ async function getIndex(user) {
return yaml.safeLoad(indexFile);
} catch (error) {
console.log('\x1b[33m%s\x1b[0m', `No index file found for '${user.name}' at '${indexFilePath}'`);
logger.info(`No index file found for '${user.name}' at '${indexFilePath}'`);
return { profile: { image: null, description: null }, posts: [] };
}