mirror of
https://github.com/Shineii86/AniKotoAPI.git
synced 2026-10-22 19:05:11 +00:00
fix: critical fixes for 14 broken endpoints
- Fixed ALL CSS selectors to match actual anikototv.to HTML - Fixed search results returning empty data array - Fixed anime info returning empty fields - Fixed episode list returning 0 episodes - Fixed most-popular returning empty data - Fixed random endpoint 500 error - Fixed filter endpoint 500 error - Fixed suggestions returning empty array - Added /api/genre/:name and /api/type/:name routes - Fixed watch page server/episode extraction - Fixed rating field to return clean value
This commit is contained in:
@@ -214,14 +214,6 @@ const createApiRoutes = (app, jsonResponse, jsonError) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/api/status/:status", async (req, res, next) => {
|
||||
try {
|
||||
await getStatus(req, res, next);
|
||||
} catch (error) {
|
||||
jsonError(res, error.message);
|
||||
}
|
||||
});
|
||||
|
||||
categoryRoutes(app, jsonResponse, jsonError);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,26 @@
|
||||
import { getCategory } from "../controllers/category.controller.js";
|
||||
|
||||
const categoryRoutes = (app, jsonResponse, jsonError) => {
|
||||
app.get("/api/:category", async (req, res, next) => {
|
||||
app.get("/api/genre/:genre", async (req, res, next) => {
|
||||
req.params.category = `genre/${req.params.genre}`;
|
||||
try {
|
||||
await getCategory(req, res, next);
|
||||
} catch (error) {
|
||||
jsonError(res, error.message);
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/api/type/:type", async (req, res, next) => {
|
||||
req.params.category = `type/${req.params.type}`;
|
||||
try {
|
||||
await getCategory(req, res, next);
|
||||
} catch (error) {
|
||||
jsonError(res, error.message);
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/api/status/:status", async (req, res, next) => {
|
||||
req.params.category = `status/${req.params.status}`;
|
||||
try {
|
||||
await getCategory(req, res, next);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user