mirror of
https://github.com/Shineii86/AniKotoAPI.git
synced 2026-10-22 02:45:10 +00:00
- 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
26 lines
680 B
JavaScript
26 lines
680 B
JavaScript
import { extractSeasons } from "../extractors/seasons.extractor.js";
|
|
import { getCache, setCache } from "../helper/cache.helper.js";
|
|
|
|
const getSeasons = async (req, res, next) => {
|
|
try {
|
|
const { id } = req.params;
|
|
|
|
if (!id) {
|
|
return res.status(400).json({ success: false, message: "Anime ID is required" });
|
|
}
|
|
|
|
const cacheKey = `seasons_${id}`;
|
|
const cached = getCache(cacheKey);
|
|
if (cached) {
|
|
return res.json({ success: true, results: cached });
|
|
}
|
|
|
|
const data = await extractSeasons(id);
|
|
setCache(cacheKey, data);
|
|
res.json({ success: true, results: data });
|
|
} catch (error) {
|
|
next(error);
|
|
}
|
|
};
|
|
|
|
export { getSeasons }; |