Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MangaScrapeAPI

Unified API to search, browse, and get manga chapter page images and anime streams from multiple providers.

The Point

Get raw page images for entire manga chapters. Get M3U8/MP4 stream URLs for anime episodes with subtitle support. That's it.


Manga Providers

Provider ID Method Status
MangaDex mangadex REST API (at-home server) Working
WeebCentral weebcentral HTML scraping (direct img tags) Issues — chapters show "0000"
MangaTaro mangataro WordPress REST API Issues — not getting all chapters
MangaFire mangafire HTML scraping (Cloudflare) Working
Comix comix HTML scraping + SSR data (Cloudflare) Working
VortexScans vortexscans Reference API (primary) + cfFetch fallback Working
AsuraScans asurascans HTML scraping Issues — .map is not a function
MangaGo mangago HTML scraping Issues — encrypted image URLs

Manga API Endpoints

List Providers

GET /api/scrape/providers

Search Manga

GET /api/scrape/search?query=Naruto&provider=mangadex

Get Manga Info

GET /api/scrape/info?id={mangaId}&provider=mangadex

Get Chapters

GET /api/scrape/chapters?id={mangaId}&provider=mangadex

Get Chapter Pages (THE MAIN ONE)

GET /api/scrape/pages?id={mangaId}&chapterNumber=1&provider=mangadex
GET /api/scrape/pages?chapterId={chapterId}&provider=mangadex

Image Proxy

GET /api/proxy/image?url={imageUrl}

Anime Providers

Provider ID Method Status
OtakuTsu otakutsu AniList GraphQL (search/info) + RSC scraping (episodes/streams) + M3U8 proxy Working
Reanime reanime reanime.to JSON API (search/info/episodes) + flixcloud.cc WASM decryption (streams) + M3U8 proxy Working

OtakuTsu Architecture

Search/Info: Uses the public AniList GraphQL API (graphql.anilist.co). No Cloudflare protection needed. Returns anime with AniList IDs.

ID Resolution: OtakuTsu uses internal 24-char hex MongoDB IDs (e.g., 6989b89f29cf95f4eb03b4ef) while AniList uses numeric IDs (e.g., 20 for Naruto). Resolution strategy:

  1. Homepage RSC data scrape → builds anilist_id → otakutsu_id mapping (~130 anime cached for 30 min)
  2. Fallback: AniList title lookup → otakutsu search → extract internal ID from RSC data
  3. Last resort: Direct watch page with AniList ID (only works if the site accepts it)

Episodes/Streams: Scrapes otakutsu.cc watch pages via cfFetch (Cloudflare bypass using got-scraping + curl fallback). Extracts:

  • streamToken: JWT (HS256, 10 min expiry) for server action authentication
  • initialEpisodes: Full episode list with metadata
  • Stream sources via loadStreamSourcesAction server action call

Servers: The site supports multiple streaming servers:

  • kiwi — Primary server (default)
  • megaplay — Fallback server
  • ally — Alternative server
  • bee — Alternative server
  • bonk — Alternative server

Reanime Architecture

Search/Info/Episodes: Uses reanime.to's public JSON API (SvelteKit SSR endpoints, Cloudflare-protected). All requests go through cfFetch for CF bypass.

ID Scheme: Uses URL slugs (e.g., one-piece-xamk74) instead of AniList IDs. Search returns slug-based IDs used for all subsequent calls.

Streams — Flixcloud Decryption Pipeline: Reanime uses flixcloud.cc as its video provider, which encrypts stream URLs with a multi-layer decryption scheme:

  1. Get server links: GET /api/watch/{slug}/{ep} + GET /api/flix/{anilist_id}/{ep} → returns flixcloud embed URLs (flixcloud.cc/e/{access_id}?v=2)
  2. Fetch embed page: GET flixcloud.cc/e/{access_id}?v=2 → HTML with SvelteKit SSR data containing encrypted stream info + WASM binary
  3. Parse SSR data: Extract JavaScript object literal from HTML, derive 7 obfuscated field names from obfuscation_seed via 6 rounds of SHA-256
  4. Extract crypto material: frag1, iv from nested obfuscated_crypto_data; keyFrag2, token from top-level data; w_payload (WASM binary)
  5. Fetch one-time token: GET flixcloud.cc/api/m3u8/{token} → returns v_bytes (encrypted URL) and T_bytes (key material). Token is single-use (410 Gone on replay)
  6. Run WASM: WebAssembly.instantiate(w_payload) → executes _s(seedInt) + _r(frag1, keyFrag2, T, out, len) → produces intermediate key material
  7. PBKDF2: Derive 32-byte key from WASM output (1000 iterations, SHA-256, salt=seed)
  8. XOR with seed: key_material[i] ^= seed[i % len(seed)]
  9. SHA-256 → AES key: Final AES-256-CBC key
  10. AES-256-CBC decrypt: Decrypt v_bytes with AES key + IV → plaintext m3u8 URL

Servers: Each episode has multiple servers returned:

  • HD-2 (preferred, sorted first)
  • HD-1 (secondary)
  • Each with sub and dub variants

All servers are decrypted in parallel using Promise.all. If decryption fails for a server, the raw flixcloud embed URL is returned as a fallback.

Stream Response Format (same for both providers): Each server returns streams with:

  • url: M3U8 or MP4 stream URL
  • server: Server name (e.g., "HD-2", "kiwi")
  • subType: sub or dub
  • quality: 1080p, 720p, 360p, etc.
  • isHls: Whether the stream is HLS/M3U8 format
  • tracks[]: Subtitle tracks with url, kind, lang, label, default

M3U8 Proxy: All HLS streams are proxied through /api/anime/proxy/m3u8 which:

  • Fetches the M3U8 playlist from the CDN
  • Rewrites all segment/key URLs to also go through the proxy
  • Adds proper Referer and Origin headers the CDN requires
  • Bypasses CORS restrictions
  • Supports both otakutsu.cc and flixcloud.cc CDN URLs

Subtitle Proxy: Subtitle files are proxied through /api/anime/proxy/subtitle which:

  • Uses cfFetch to bypass Cloudflare on subtitle CDN URLs
  • Auto-detects subtitle format (VTT, SRT, JSON)
  • Returns with proper Content-Type headers
  • Supports both otakutsu.cc and flixcloud.cc URLs

Anime API Endpoints

List Anime Providers

GET /api/anime/providers

Search Anime

GET /api/anime/search?query=Naruto&provider=otakutsu
GET /api/anime/search?query=Naruto&provider=reanime

OtakuTsu returns AniList-based search results with id (AniList ID). Reanime returns slug-based search results with id (URL slug like one-piece-xamk74).

Get Anime Info

GET /api/anime/info?id={anilistId}&provider=otakutsu
GET /api/anime/info?id={slug}&provider=reanime

Get Episodes

GET /api/anime/episodes?id={anilistId}&provider=otakutsu
GET /api/anime/episodes?id={slug}&provider=reanime

Get Stream Sources

GET /api/anime/streams?id={anilistId}&episodeNumber=1&provider=otakutsu
GET /api/anime/streams?id={slug}&episodeNumber=1&provider=reanime

Returns:

{
  "episode": 1,
  "streams": [
    {
      "url": "https://.../master.m3u8",
      "server": "HD-2",
      "subType": "sub",
      "quality": "1080p",
      "isHls": true,
      "proxyUrl": "https://your-domain/api/anime/proxy/m3u8?url=...",
      "tracks": [
        {
          "url": "https://.../subtitles/en.vtt",
          "kind": "subtitles",
          "lang": "en",
          "label": "English",
          "default": true,
          "proxyUrl": "https://your-domain/api/anime/proxy/subtitle?url=..."
        }
      ]
    }
  ],
  "skips": { "intro": [15, 90], "outro": [1320, 1400] },
  "rawUrl": "https://.../master.m3u8",
  "proxyUrl": "https://your-domain/api/anime/proxy/m3u8?url=..."
}

M3U8 Proxy

GET /api/anime/proxy/m3u8?url={encoded_m3u8_url}

Proxies and rewrites M3U8 playlists. All segment/key URLs are rewritten to also pass through the proxy. Supports both otakutsu.cc and flixcloud.cc CDN URLs.

Subtitle Proxy

GET /api/anime/proxy/subtitle?url={encoded_subtitle_url}

Proxies subtitle files from otakutsu.cc and flixcloud.cc CDNs via cfFetch (Cloudflare bypass).


Live Test

  • /test — Manga provider interactive playground
  • /anime-test — Anime stream testing with HLS video player, provider selector (OtakuTsu/Reanime), proxy/raw toggle, subtitle tracks

Deploy

Push to GitHub → Vercel auto-deploys.

License

MIT

About

Ultimate Manga/Manhwa/Manhua Scraper API — Multi-provider manga reading scraper with Cloudflare bypass, signed token handling, and image proxy. Built with Next.js 16 + TypeScript.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages