Files
AniKotoAPI/src/controllers/episodeListAjax.controller.js
T
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 8e201ccb10 feat: complete streaming and AJAX endpoint support
- Add stream URL extraction via /ajax/server?get={linkId}
- Add mapper API integration for gogoanime/anivibe servers
- Add /api/seasons/:id endpoint
- Add /api/watch-order/:id endpoint
- Add /api/episodes-ajax/:id endpoint
- Add /api/servers endpoint
- Add genre/type/status/rating ID mappings
- Fix filter to use correct numeric IDs
- Fix watch page data attribute extraction
2026-06-08 15:44:30 +05:30

27 lines
804 B
JavaScript

import { extractEpisodeListAjax } from "../extractors/episodeListAjax.extractor.js";
import { getCache, setCache } from "../helper/cache.helper.js";
const getEpisodeListAjax = async (req, res, next) => {
try {
const { id } = req.params;
const { style, vrf } = req.query;
if (!id) {
return res.status(400).json({ success: false, message: "Anime ID is required" });
}
const cacheKey = `episodes_ajax_${id}_${style || ""}_${vrf || ""}`;
const cached = getCache(cacheKey);
if (cached) {
return res.json({ success: true, results: cached });
}
const data = await extractEpisodeListAjax(id, style, vrf);
setCache(cacheKey, data);
res.json({ success: true, results: data });
} catch (error) {
next(error);
}
};
export { getEpisodeListAjax };