v1.8.0: Full diagnostic sweep - 20 bugs fixed

Critical fixes:
- extractPages.helper.js: Pagination URL bug (?page → &page)
- package.json: Fixed invalid dep versions (axios, dotenv, express)
- privacy.html + tos.html: Broken footer links (//tos → /tos)
- manifest.json: Invalid icon purpose (any maskable → maskable)

High fixes:
- server.js: Removed duplicate CORS middleware (triple → single)
- search.controller.js: Cache key collision with suggestion controller
- apiRoutes.js: Dynamic endpoint count (was hardcoded 27)
- vercel.json: Removed duplicate CORS header

Medium fixes:
- header.config.js: Updated User-Agent to Chrome 130
- dataUrl.js: Removed redundant domain from ALT_DOMAINS
- category.extractor.js: Removed unused cheerio import
- server.js: Added __dirname, removed unused cors import

Documentation:
- CHANGELOG.md: Added v1.8.0 entry
- README.md: Updated version badges (1.8.0, Express 4.21)
- test.js: Fixed status endpoint (currently-airing → airing)
This commit is contained in:
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
2026-06-09 05:14:56 +05:30
parent 49243ccca1
commit 5ad3189b8a
15 changed files with 55 additions and 50 deletions
-1
View File
@@ -45,7 +45,6 @@ const BASE_URL = "https://anikototv.to";
const ALT_DOMAINS = [
"https://anikoto.cz",
"https://anikoto.me",
"https://anikototv.to",
"https://anikoto.net",
"https://anikoto.se"
];
+1 -1
View File
@@ -39,7 +39,7 @@
* axios.get(url, { headers })
*/
const headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate, br",
+1 -1
View File
@@ -85,7 +85,7 @@ const getSearchSuggestions = async (req, res, next) => {
if (!keyword) {
return res.status(400).json({ success: false, message: "Keyword is required" });
}
const cacheKey = `suggest_${keyword}`;
const cacheKey = `search_suggest_${keyword}`;
const cached = getCache(cacheKey);
if (cached) {
return res.json({ success: true, results: cached });
-1
View File
@@ -15,7 +15,6 @@
* ======= • ======= • ======= • ======= • =======• =======
*/
import * as cheerio from "cheerio";
import { headers } from "../configs/header.config.js";
import { URLS } from "../configs/dataUrl.js";
import { countPages } from "../helper/countPages.helper.js";
+2 -1
View File
@@ -80,7 +80,8 @@ import { headers } from "../configs/header.config.js";
*/
const extractPages = async (url, page = 1) => {
try {
const finalUrl = page > 1 ? `${url}?page=${page}` : url;
const separator = url.includes("?") ? "&" : "?";
const finalUrl = page > 1 ? `${url}${separator}page=${page}` : url;
const { data } = await axios.get(finalUrl, { headers });
const $ = cheerio.load(data);
return $;
+3 -3
View File
@@ -361,7 +361,7 @@ app.get("/api/health", (req, res) => {
success: true,
results: {
status: "healthy",
version: "1.7.3",
version: "1.8.0",
uptime: `${hours}h ${minutes}m ${seconds}s`,
uptimeSeconds: uptime,
timestamp: new Date().toISOString(),
@@ -394,7 +394,7 @@ app.get("/api/stats", (req, res) => {
ttl: "5 minutes",
description: "Map-based cache with TTL expiration",
},
endpoints: 27,
endpoints: 30,
timestamp: new Date().toISOString(),
},
});
@@ -407,7 +407,7 @@ app.get("/api/openapi", (req, res) => {
info: {
title: "AniKotoAPI",
description: "Free REST API for anime data from anikototv.to",
version: "1.7.3",
version: "1.8.0",
contact: {
name: "Shinei Nouzen",
url: "https://github.com/Shineii86/AniKotoAPI",