Commit Graph
69 Commits
Author SHA1 Message Date
Shinei Nouzen bdf7e96ce9 feat: Add streaming URL resolver, quality detection, and server normalization
New endpoints:
- GET /api/stream/resolve — Resolves actual m3u8/mp4 URLs from embed player URLs
  Follows chain: vidtube.site → megaplay API → m3u8 playlist
  Returns url, type, qualities, subtitles, skipData
- GET /api/stream/qualities — Parses M3U8 playlists for available quality options
  Returns sorted quality list with resolution, bandwidth, URLs

New extractors:
- streamResolver.extractor.js — Full stream resolution pipeline
  - resolveStreamUrl(): Resolves embed → actual video URL
  - parseM3u8Qualities(): Parses master playlists for qualities
  - normalizeServerName(): Maps VidPlay-1 → vidplay, HD-1 → hd
  - extractSubtitles(): Extracts subtitle tracks from API responses

Enhancements:
- streamInfo.extractor.js: Added session establishment before AJAX calls
- Server list now includes normalizedName field for each server
- Stream info now includes type (hls/mp4) and backup URL
- Server list includes typeLabel (SUB/HSUB/DUB)
- Session cookies properly maintained for AJAX stream endpoints

Architecture:
- Embed API domain mapping (vidtube.site → megaplay-1.buzz)
- M3U8 parser supports master and media playlists
- Subtitle extraction from multiple API response formats
- 36 total endpoints (was 34)
2026-07-28 20:40:17 +05:30
Shinei Nouzen e8c942a773 chore: Update test.js and agents to v2.2.0 with all 36 endpoints
- test.js: Add 9 new tests (upcoming, top-rankings, recently-updated, completed, cache/stats, mirrors, openapi, download, status)
- test.js: Fix slugs (one-piece-odmau, correct episode links)
- test.js: 36 total tests (was 26)
- agents/: Update all 6 agent files from v2.0.0 to v2.2.0
- agents/api-tester.md: Update endpoint table with new endpoints
- agents/backend-architect.md: Update file counts and endpoint list
- agents/technical-writer.md: Update documentation structure for 36 endpoints
2026-07-28 20:21:41 +05:30
Shinei Nouzen d0432e1654 fix: Bug fixes from full API diagnostic sweep — all 33 endpoints now 200 OK
- Fix /api/watch 500: correct URL path format (slug/ep-N -> slug/ep-N)
- Fix /api/info: accept both ?id= and ?slug= query params
- Fix /api/status/airing 500: map short status names (ongoing/airing/completed) to correct slugs
- Fix /api/top-rankings: correct selectors (#top-anime .scaff.side.items a.item) + extract rank from rankN class
- Fix /api/completed: correct selectors (section.top-table[data-name='completed'] a.item)
- Fix /api/recently-updated: correct selectors (#recent-update .ani.items .item) + client-side tab filtering
- Fix parseListItem: detect self-as-anchor (<a> elements) + fallback slug extraction
- Fix category extractor: add status name mapping (ongoing->currently-airing, etc.)
- Add /api/cache/stats endpoint for LRU cache diagnostics
- 33 endpoints verified: 0 errors, 0 timeouts
2026-07-28 20:17:58 +05:30
Shinei Nouzen fd29b02158 feat: Add new endpoints and enhance filter — v2.2.0
New Endpoints (4 new routes):
- GET /api/upcoming — upcoming anime releases from homepage
- GET /api/top-rankings?sort=top|newest — ranked anime with sort modes
- GET /api/recently-updated?tab=all|dub|sub — filtered recent updates
- GET /api/completed — finished anime series from homepage

Enhanced Filter (/api/filter):
- Added source parameter (18 source material types)
- Added epMin/epMax for episode range filtering
- Added excludeWatchlist parameter for logged-in users
- Added season parameter (spring/summer/fall/winter)

New Config IDs:
- SOURCE_IDS: 18 source material type mappings
- SEASON_IDS: 4 broadcast season mappings
- EXTENDED_TYPE_IDS: Added tv-short and tv-special types

Total endpoints: 34 (was 30)
OpenAPI spec updated with new endpoints
CHANGELOG.md updated with comprehensive change history
2026-07-28 19:45:25 +05:30
Shinei Nouzen a8f1917ce7 feat: v2.2.0 — Modularize codebase, unify mirror fallback, harden security
Major Changes:
- Add shared parseListItem.helper.js for unified list parsing (DRY)
- Migrate all 22 extractors to use fetchWithMirror() for consistent mirror fallback
- Remove unused cors dependency (custom CORS middleware handles it)
- Fix middleware ordering: timeout now registered before routes
- Fix CORS to allow POST for /api/mirrors/reset endpoint
- Remove redundant cache check in homeInfo extractor

New Features:
- Request ID tracking (X-Request-Id header) for debugging
- Graceful shutdown handling (SIGTERM/SIGINT) with 10s timeout
- CSP and HSTS security headers
- Rate limiter cleanup interval (every 5 min) to prevent memory leak
- Request body size limits (10kb) via express.json()

Security:
- Content-Security-Policy header for XSS protection
- Strict-Transport-Security for HTTPS enforcement
- X-Permitted-Cross-Domain-Policies: none
- Body size limits to prevent large payload attacks

Code Quality:
- All files follow strict documentation style (box headers, section separators,
  feature markers, JSDoc params/returns, inline notes, module footers)
- Eliminated ~200 lines of duplicated code across 8+ extractors
- Updated CHANGELOG.md with comprehensive change history
2026-07-28 19:28:21 +05:30
Shinei Nouzen 7f07833c14 Update README.md 2026-07-25 20:07:35 +05:30
Shinei Nouzen 9778cd368d docs: update changelog for v2.1.0 redesign, bump version v2.1.0 2026-07-05 17:34:53 +05:30
Shinei Nouzen 378f9b236a feat: redesign HTML pages with Claude/Anthropic design system
- Warm cream canvas (#faf9f5) with coral accent (#cc785c)
- Slab-serif headlines (Cormorant Garamond) + humanist sans body (Inter)
- Dark navy product surfaces (#181715) for code blocks
- Light cream feature cards (#efe9de)
- Editorial, literary aesthetic
- Removed ambient orbs and particles
- Minimal shadows, color-block depth
2026-07-05 17:31:17 +05:30
Shinei Nouzen 9d686390ee docs: bump version to 2.0.2, fix episodes endpoint docs 2026-07-05 17:17:41 +05:30
Shinei Nouzen d97d6bd883 docs: fix streaming flow parameter - use animeId instead of slug 2026-07-05 16:45:31 +05:30
Shinei Nouzen bc840f1373 docs: fix /api/servers parameter docs and add /api/stream reference 2026-07-05 16:15:56 +05:30
Shinei Nouzen 403b205625 docs: update all documentation with pagination and fixes
- Update CHANGELOG.md with pagination metadata and bug fixes
- Update README.md with pagination documentation and project structure
- Update docs/endpoints.md with pagination section
- Update docs/index.md with pagination feature
- Update docs/architecture.md with pagination helper
v2.0.0
2026-07-04 16:25:48 +05:30
Shinei Nouzen e8b63b5d16 feat: add pagination metadata to all list endpoints
- Add pagination.helper.js with addPaginationMeta function
- Add pagination info to: most-popular, search, new-release, newly-added, latest-updated, az-list, filter, category, status
- Pagination includes: currentPage, totalPages, totalItems, itemsPerPage, hasNext, hasPrev
- Fix creatorInfo middleware to include message field
2026-07-04 16:14:30 +05:30
Shinei Nouzen 646ef128a8 fix: extractPages URL handling for mirror fallback
- Fix bug where full URLs were passed to fetchWithMirror causing doubled URLs
- Extract path from full URL before passing to mirror fallback
- Fixes search, most-popular, new-release, newly-added, and az-list endpoints
2026-07-04 15:48:23 +05:30
Shinei Nouzen 5ca688ab45 feat: add creator info middleware from MiruroAPI
- Add src/middleware/creatorInfo.js (ESM adapted)
- Injects creator attribution (name, GitHub, Telegram, timestamp) into every JSON response
- Updates server.js to use addCreatorInfo middleware
- Updates CHANGELOG.md, README.md, and docs/architecture.md
2026-07-04 15:31:59 +05:30
Shinei Nouzen 5cf908fb1e docs: fix README references to old endpoint count and caching
- Update endpoint count from 30 to 33 in badge, stats, and descriptions
- Update caching description from 5-min TTL to LRU with configurable TTL
- Update timeout description from 15s to configurable
- Update mermaid diagram labels
2026-07-04 15:21:38 +05:30
Shinei Nouzen 7641a81976 docs: customize 6 AI agent prompts for AniKotoAPI
- backend-architect.md: Express scraper architecture, mirror fallback, LRU cache
- api-tester.md: 33 endpoints, streaming flow, test patterns
- security-architect.md: SSRF protection, rate limiting, CORS, headers
- performance-benchmarker.md: response times, cache hit rates, compression
- technical-writer.md: CHANGELOG format, docs structure, endpoint patterns
- devops-automator.md: Vercel deployment, git workflow, env vars
2026-07-04 15:15:28 +05:30
Shinei Nouzen fe51275db0 feat: upgrade to v2.0.0 with multi-mirror fallback, new endpoints, and LRU cache
- Add multi-mirror fallback system with 5 mirror domains
- Add LRU cache with configurable TTL per endpoint
- Add response compression (gzip)
- Add Seasons endpoint (/api/seasons/:id)
- Add Watch Order endpoint (/api/watch-order/:id)
- Add Latest Updated endpoint (/api/latest-updated)
- Add Download endpoint (/api/download)
- Add cache stats endpoint (/api/cache/stats)
- Add mirror status/reset endpoints (/api/mirrors, /api/mirrors/reset)
- Add configurable rate limiting with X-RateLimit headers
- Add request timeouts and entity too large handling
- Update documentation with all new endpoints
- Update CHANGELOG.md with v2.0.0 entry
- Update package.json version to 2.0.0
- Add 6 AI agent prompts for development
2026-07-04 15:07:07 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 30feda703a fix: CORS header missing when ALLOWED_ORIGINS env not set
Browser blocks cross-origin requests from AniKotoWeb because
Access-Control-Allow-Origin was never set when ALLOWED_ORIGINS
was undefined on Vercel. Changed condition to allow all origins
when env var is not configured.
2026-06-09 11:05:16 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 7d621e2e37 fix: Tech Stack table formatting, versions, remove cookie-parser 2026-06-09 10:08:51 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ e5dbe0c12e v1.9.2: Fix 3 endpoint bugs found in diagnostic sweep
- filter controller: Normalize array params to strings (genre[]=1 now works)
- status controller: Map short names to full slugs (airing → currently-airing)
- seasons extractor: Remove recursive API call, throw clear error
- watchOrder extractor: Remove recursive API call, throw clear error

Endpoint status: 27/31 passing (4 remaining: 2 source site issues, 1 AJAX issue, 1 expected behavior)
2026-06-09 06:41:10 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ f43522c4d5 v1.9.1: Fix require path for package.json
require('../package.json') resolved to src/package.json (wrong).
Changed to require('../../package.json') to reach project root.
2026-06-09 06:13:21 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ cc145c9acc v1.9.1: Fix 4 critical bugs from sed operations
- apiRoutes.js: Moved imports outside comment block (caused 500 on all endpoints)
- test.js: Deleted orphaned duplicate code after function close
- random.controller.js: Removed stray closing brace breaking try/catch
- cache.helper.js: Added missing MAX_CACHE_SIZE constant

These bugs were introduced by sed insert commands placing code in wrong positions.
The API was returning 500 FUNCTION_INVOCATION_FAILED on all endpoints.
2026-06-09 06:11:51 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 100b9f9414 v1.9.0: Full diagnostic sweep - 42 issues fixed
Critical fixes (7):
- Added global Express error handler (returns JSON instead of HTML)
- Removed caching from random endpoint (defeated purpose)
- Renamed share.jpg to share.png (MIME type mismatch)
- Fixed OG image dimensions (630 → 601)
- Fixed manifest.json icon sizes (192x192 → 512x512)
- Fixed implicit global event variable in console
- Added 9 missing endpoints to docs/endpoints.md

High fixes (12):
- Imported version from package.json (no hardcoded drift)
- Added dynamic endpoint count in stats
- Added input sanitization for mapper API (SSRF prevention)
- Added homepage caching (reduced 5 duplicate HTTP requests)
- Added rate limiting (100 requests/minute per IP)
- Added rel="noopener noreferrer" to all target="_blank" links
- Fixed trailing slash inconsistency in console
- Added noindex meta to 404.html
- Fixed docs/architecture.md controller filenames and dependency versions
- Fixed README.md dependency versions
- Added 12 missing endpoint tests

Medium fixes (22):
- Added escapeHtml helper for error messages
- Consistent favicon across all pages
- Added meta descriptions to privacy.html and tos.html
- Added OG/Twitter meta tags to privacy.html and tos.html
- Added aria-label to playground inputs
- Added aria-hidden to decorative SVGs
- Synced Twitter description with OG description
- Fixed robots.txt to disallow /api
- Added PWA fields to manifest.json
- Removed 5 unused imports
- Removed unused cookie-parser dependency
- Fixed inconsistent error handling in extractors
- Fixed resolvedSlug returning numeric ID
- Added /watch endpoint to streaming docs
- Improved test assertions and status code validation
- Deleted orphaned og-image.svg and logo.png

Low fixes (11):
- Removed redundant try/catch from extractPages
- Added max size eviction to cache
- Added cache key sorting in filter controller
- Added author meta tag
- Fixed favicon.svg font

Version bumped to 1.9.0
v1.9.0
2026-06-09 06:00:37 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 84c4877669 Add files via upload v1.5.4 v1.7.1 v1.5.1 v1.5.2 v1.5.3 v1.4.0 v1.5.5 v1.6.0 v1.7.0 v1.5.0 v1.7.2 v1.7.3 v1.8.0 v1.3.0 v1.2.0 v1.1.0 v1.0.0 2026-06-09 05:28:57 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 03663bd7de Delete public/logo.png 2026-06-09 05:26:59 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 049e252362 v1.8.0: Update all documentation to match current state
Fixed 19 outdated occurrences across 7 files:
- public/index.html: 27→30 endpoints (6 occurrences)
- public/manifest.json: 27→30 endpoints
- README.md: 27→30 and 24→30 endpoints (7 occurrences)
- docs/index.md: 27→30 endpoints
- docs/architecture.md: 27→30 endpoints
- package.json: axios ^1.7.0→^1.8.0
- CHANGELOG.md: Added documentation update entry
2026-06-09 05:25:49 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 5ad3189b8a 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)
2026-06-09 05:14:56 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 49243ccca1 fix: episodes endpoint accepts numeric ID, episodes-ajax returns parsed JSON 2026-06-09 04:55:26 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ e203761789 chore: bump version to 1.7.3 2026-06-09 04:52:07 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 0015e779ea fix: health endpoint typo and request counter middleware order 2026-06-09 04:51:26 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 154258629d feat: add anikototv.to images — favicon, share.jpg, logo
- favicon-origin.png — Original favicon from anikototv.to
- share.jpg — OG/Social sharing image (1MB)
- logo.png — Site logo
- Updated index.html to use share.jpg for OG/Twitter cards
- Updated manifest.json with new icons
- Updated favicon link to use original PNG
2026-06-08 22:18:59 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 1e65ccb709 feat: add favicon, full OG meta tags, JSON-LD structured data 2026-06-08 22:13:32 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ e9b0fba22b feat: add health, stats, OpenAPI, security headers, tests
- /api/health — uptime, version, memory usage
- /api/stats — request count, error rate, cache info
- /api/openapi — OpenAPI 3.0.3 specification
- Security headers: X-Frame-Options, X-Content-Type-Options, X-XSS-Protection
- Request counter middleware
- CONTRIBUTING.md — contribution guidelines
- test.js — integration test suite (18 endpoints)
2026-06-08 22:08:38 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 18e4a84a66 docs: add dub/sub switch documentation to README 2026-06-08 21:51:21 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 58c0e8be60 fix: console and explorer double /api/api URL issue
- BASE already includes /api, endpoints should not repeat it
- Fixes 'Unexpected token <' error (was fetching HTML instead of JSON)
2026-06-08 21:39:14 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ e6be25f793 fix: update endpoint count 24 → 27 in index.html 2026-06-08 21:33:41 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 640d817d93 fix: correct double slashes in sitemap.xml URLs 2026-06-08 21:25:23 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ a66bb477df fix: correct privacy/tos links (//privacy → /privacy) 2026-06-08 21:23:46 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 445b6f7c71 fix: clean URLs — /tos and /privacy instead of /tos.html and /privacy.html
- Added Express routes for /tos and /privacy
- Updated all internal links (index.html, privacy.html, tos.html)
- Updated sitemap.xml URLs
- Updated README and docs architecture
2026-06-08 21:21:55 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ ff802247f3 docs: update README project structure with all public files
- Added tos.html, privacy.html, manifest.json, robots.txt, sitemap.xml, og-image.svg
- Added docs/ folder structure
- Updated landing page description
2026-06-08 21:17:17 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 292b50f52a docs: update README with correct version, endpoint count, streaming flow
- Version badge: 1.5.0 → 1.7.2
- Endpoint count: 24 → 27
- Added streaming flow section (3-step process)
- Updated changelog highlights (v1.6.0-v1.7.2)
- Updated roadmap completed items
- Updated performance stats (80KB → 120KB)
2026-06-08 21:13:18 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ e125fe4646 docs: update all docs with real live API data
- All examples now use real responses from live API
- Streaming flow tested end-to-end (episodeList -> servers -> stream)
- All code examples verified working
- Real titles: Wistoria, Witch Hat Atelier, Road of Naruto, etc.
- Real stream URLs from megaplay.buzz
- Real CDN URLs from anipixcdn.co
- Fixed streaming endpoints: proper JSON/HTML parsing
2026-06-08 21:06:58 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 12aa1f5235 docs: complete API documentation folder
docs/index.md — Overview, quick start, features
docs/endpoints.md — Full API reference (27 endpoints)
docs/streaming.md — Streaming flow guide (3-step)
docs/examples.md — cURL, JavaScript, Python, Node.js examples
docs/architecture.md — Project structure, tech stack, design

Also fixes streaming endpoints:
- episodeList: Parse AJAX JSON, extract server_ids/timestamp/mal_id
- streamInfo: Parse server list HTML into structured objects
- streamInfo: Parse stream URL from JSON response
2026-06-08 20:58:39 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ e0e348682f fix: streaming endpoints - parse JSON responses, extract server HTML
- episodeList: Parse AJAX JSON response, extract server_ids/timestamp/mal_id
- streamInfo: Parse server list HTML into structured server objects
- streamInfo: Parse stream URL from JSON response properly
- Added cheerio import to streamInfo extractor
- Servers now return: type, link_id, cmid, sv_id, ep_id, name
2026-06-08 20:51:05 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 407c135a9f v1.7.1: Update Vercel URL to anikototvapi.vercel.app
- Changed anikoto.vercel.app → anikototvapi.vercel.app
- 80 references updated across all files
2026-06-08 19:50:02 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ b1eb899aa9 v1.7.0: Rebrand AniKatoAPI → AniKotoAPI
BREAKING: Complete project rebrand across 66 files
- AniKatoAPI → AniKotoAPI (project name)
- AniKato → AniKoto (brand references)
- anikato.vercel.app → anikoto.vercel.app (URLs)
- anikototv.to preserved (source website domain)
- Updated: README, package.json, server.js, all controllers,
  extractors, configs, routes, public pages, legal docs
2026-06-08 19:41:00 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 6f75bab281 fix: use process.cwd() for public dir + simplified routes
- Changed publicDir to use process.cwd() for Vercel compatibility
- Simplified vercel.json routes: API -> server.js, everything else -> server.js
- Express.static will serve files from public/ directory
2026-06-08 18:06:29 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 042ef430ef fix: try outputDirectory for static files 2026-06-08 18:05:15 +05:30
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ 3e50ec1ab9 fix: serve static files from public/ before server.js catch-all
- API routes (/api/*) still go to server.js
- All other routes serve from /public/ directory
- Fixes privacy.html, tos.html, manifest.json, robots.txt, sitemap.xml, og-image.svg
2026-06-08 18:03:47 +05:30