mirror of
https://github.com/Shineii86/AniKotoAPI.git
synced 2026-10-22 02:45:10 +00:00
fix: Full diagnostic sweep — bugs, dead code, unused imports, docs accuracy
Code fixes: - seasons/watchOrder: Remove dead ternary (both branches identical) - mirror.helper: Remove redundant ternary (both branches identical) - topAnimeRankings: Fix JSDoc (day/week/month, not top/newest) - apiRoutes: Fix proxy domain validation (exact match, not includes) - apiRoutes: Fix proxy .m3u8 check (pathname, not hostname) - pagination: Fix totalItems calculation (was overestimating) - server.js: Remove dead has404File variable - server.js: Remove duplicate /api/cache/stats route - server.js: Remove unused getCacheStats import Unused imports removed: - animeInfo: URLS from dataUrl.js - episodeList: headers from header.config.js - episodeListAjax: axios - trending: URLS from dataUrl.js - trendingSidebar: URLS from dataUrl.js - upcomingAnime: parseListItems - watchPage: URLS, BASE_URL from dataUrl.js Docs fixes: - README: 33->38 endpoints, 24->28 controllers, 26->28 extractors - README: Cache TTL 5min->per-endpoint, Timeout 15s->30s - docs/index.md: 33->38 endpoints - architecture.md: LRU cache strategy, remove stale cookie-parser - agents: compression version, extractor/controller counts - agents: domain typo, stale CORS dep, version badge
This commit is contained in:
@@ -138,7 +138,7 @@ flowchart TD
|
||||
### ⚡ Core
|
||||
- **Real-time scraping** from anikototv.to
|
||||
- **Smart caching** with LRU and configurable TTL per endpoint
|
||||
- **33 RESTful endpoints** covering all data
|
||||
- **38 RESTful endpoints** covering all data
|
||||
- **AJAX episode loading** for accurate data
|
||||
- **Mapper API integration** for extra servers
|
||||
- **Graceful error handling** per endpoint
|
||||
@@ -320,7 +320,7 @@ AniKotoAPI/
|
||||
│ │ ├── 📄 header.config.js # 📋 Request headers
|
||||
│ │ └── 📄 ids.config.js # 🏷️ Genre/Type/Status/Source/Season ID mappings
|
||||
│ │
|
||||
│ ├── 📂 controllers/ # 🎮 Route handlers (24 files)
|
||||
│ ├── 📂 controllers/ # 🎮 Route handlers (28 files)
|
||||
│ │ ├── 📄 homeInfo.controller.js
|
||||
│ │ ├── 📄 animeInfo.controller.js
|
||||
│ │ ├── 📄 search.controller.js
|
||||
@@ -332,7 +332,7 @@ AniKotoAPI/
|
||||
│ │ ├── 📄 watchPage.controller.js
|
||||
│ │ └── 📄 ... (15 more)
|
||||
│ │
|
||||
│ ├── 📂 extractors/ # 🔍 HTML scrapers (26 files)
|
||||
│ ├── 📂 extractors/ # 🔍 HTML scrapers (28 files)
|
||||
│ │ ├── 📄 homeInfo.extractor.js # 🏠 Home page data
|
||||
│ │ ├── 📄 search.extractor.js # 🔍 Search results
|
||||
│ │ ├── 📄 animeInfo.extractor.js # 📺 Anime details
|
||||
@@ -2298,8 +2298,8 @@ CMD ["node", "server.js"]
|
||||
|:---|:---|
|
||||
| ⚡ Cached response | ~200ms |
|
||||
| 🔄 Fresh fetch | ~1-3s |
|
||||
| 💾 Cache TTL | 5 minutes |
|
||||
| ⏱️ Timeout per request | 15 seconds |
|
||||
| 💾 Cache TTL | 3 min–1 hour (per-endpoint) |
|
||||
| ⏱️ Timeout per request | 30 seconds |
|
||||
| 🎬 Total anime indexed | 10,000+ |
|
||||
| 📦 Total codebase | ~120KB |
|
||||
|
||||
@@ -2390,7 +2390,7 @@ Yes! CORS is enabled for all origins (<code>*</code>). Just make fetch requests
|
||||
<details>
|
||||
<summary><b>🔄 How often does the data refresh?</b></summary>
|
||||
<br/>
|
||||
The cache TTL is 5 minutes. After that, the next request triggers a fresh scrape from anikototv.to. This keeps data relatively fresh while reducing load on the source site.
|
||||
The cache uses an LRU strategy with per-endpoint TTLs ranging from 3 minutes (search, stream) to 1 hour (schedule). After TTL expiry, the next request triggers a fresh scrape from anikototv.to.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
Reference in New Issue
Block a user