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:
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
2026-06-08 15:54:22 +05:30
parent 8e201ccb10
commit 8269dcea8b
12 changed files with 202 additions and 198 deletions
-8
View File
@@ -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);
};
+20 -1
View File
@@ -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) {