"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.rssFF14Sdo = exports.newsConfig = void 0;
const rss_parser_1 = __importDefault(require("rss-parser"));
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
exports.newsConfig = (() => {
    const defaultConfig = {
        url: `https://rsshub.app/ff14/zh/all.rss`,
        duration: 15 * 60 * 1000
    };
    try {
        if (!fs_1.default.existsSync(path_1.default.join(process.cwd(), "/data")))
            fs_1.default.mkdirSync(path_1.default.join(process.cwd(), "/data"));
        return {
            ...defaultConfig,
            ...JSON.parse(fs_1.default.readFileSync(path_1.default.join(process.cwd(), "/data/news_config.json"), "utf-8"))
        };
    }
    catch {
        return defaultConfig;
    }
})();
const rssParser = new rss_parser_1.default({});
const rssFF14Sdo = () => rssParser.parseURL(exports.newsConfig.url);
exports.rssFF14Sdo = rssFF14Sdo;
