mirror of
https://github.com/Shineii86/AniKotoAPI.git
synced 2026-10-22 19:05:11 +00:00
fix: update extractors to match actual anikototv.to structure
- Analyzed actual HTML structure of anikototv.to - Updated all extractors with correct CSS selectors - Changed ID-based to slug-based lookups - Updated URL patterns to match actual website - Fixed stream info to use AJAX server list - Improved error handling
This commit is contained in:
@@ -3,19 +3,19 @@ import { getCache, setCache } from "../helper/cache.helper.js";
|
||||
|
||||
const getStreamInfo = async (req, res, next) => {
|
||||
try {
|
||||
const { id, server = "hd-1", type = "sub" } = req.query;
|
||||
const { id } = req.query;
|
||||
|
||||
if (!id) {
|
||||
return res.status(400).json({ success: false, message: "Episode ID is required" });
|
||||
}
|
||||
|
||||
const cacheKey = `stream_${id}_${server}_${type}`;
|
||||
const cacheKey = `stream_${id}`;
|
||||
const cached = getCache(cacheKey);
|
||||
if (cached) {
|
||||
return res.json({ success: true, results: cached });
|
||||
}
|
||||
|
||||
const data = await extractStreamInfo(id, server, type);
|
||||
const data = await extractStreamInfo(id);
|
||||
setCache(cacheKey, data);
|
||||
res.json({ success: true, results: data });
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user