Integrations

Suwayomi and Kavita

Connect Suwayomi over GraphQL, import chapters as CBZ archives with embedded ComicInfo.xml, configure Kavita admin API keys, and sync reading progress.

Bunko connects Suwayomi (extension execution and chapter page fetching) and Kavita (library storage, indexing, and reading) without requiring the two containers to share a download directory.

Connecting Suwayomi

Bunko communicates with Suwayomi over its GraphQL API (tested against v2.4.2366):

  1. Open Settings › Connections › Suwayomi and enter the Suwayomi URL as reachable from inside the Bunko container (for example http://suwayomi:4567 on a shared Docker network).
  2. Add a username and password if Suwayomi has HTTP Basic authentication enabled.
  3. Open Sources › Repositories to register extension repositories you trust, then install and enable extensions under Sources. Bunko ships with no preinstalled repositories or extensions.

Under Sources, you can filter preferred languages, reorder source priority for automatic matching and global search, inspect per-source latency and error diagnostics (Cloudflare challenges, HTTP errors, login requirements), and browse source filters directly.

How the CBZ + ComicInfo.xml import pipeline works

Bunko never enqueues downloads inside Suwayomi's own downloader or modifies Suwayomi's download settings:

  1. When you enqueue chapters (or when automatic checks detect new releases), Bunko's durable worker calls fetchChapterPages on Suwayomi and fetches up to three pages in parallel (with a 20-second deadline and 20 MiB cap per page, up to 2,000 pages / 256 MiB per chapter).
  2. Bunko assembles a clean CBZ archive in memory with an embedded ComicInfo.xml containing series metadata, chapter/volume numbers, and <Format>Special</Format> for unnumbered specials.
  3. The archive is written atomically via temporary file, fsync, and exclusive hard-link publication into your selected Kavita library folder under /library. Existing files are never overwritten; crash recovery adopts a file only if its embedded Bunko fingerprint matches.
  4. New series folders use a sanitized title plus a stable [bunko-<12 hex>] suffix (Series [bunko-a1b2c3d4e5f6]/Series Ch. 0012.cbz). If the work is already linked to an existing Kavita folder inside the target library, Bunko reuses that exact folder.
  5. Finally, Bunko requests an asynchronous folder scan in Kavita so new chapters appear immediately.

Connecting Kavita

  1. In Kavita, copy the API key of an administrator account. Only Kavita administrators can trigger folder scans (scanKavitaFolder) and upload locked series covers (Upload/series). Non-admin keys report KAVITA_NOT_ADMIN on scans.
  2. Open Settings › Connections › Kavita in Bunko and enter Kavita's URL and administrator API key.
  3. Open Settings › Kavita libraries to pick your account's /library media root and assign a target Kavita library folder for each reading kind (manga, manhwa, manhua, comic, lightnovel, webnovel, novel, book).

Automatic folder detection and cover sync

  • Path mapping — Bunko automatically matches Kavita's configured library folder paths against subdirectories under /library using suffix matching and indexed series folders as verification. Only fill the manual Kavita path of the mounted folder override if automatic detection cannot resolve a unique match.
  • Write probes — Before allowing a library folder to be selected as a download target, Bunko verifies real create/remove write access as UID 1000.
  • Library indexing — Every 15 minutes (or on demand), Bunko incrementally indexes Kavita libraries, series aliases, chapter/volume stock, and reading status. With autoImportKavita enabled (default), unlinked Kavita series are imported into your library automatically; deleting an entry records a dismissal so it is not re-imported.
  • Cover sync — When enabled, Bunko writes missing cover.jpg files atomically and uploads retained artwork to Kavita via Upload/series without overwriting covers you set manually.

Missing target blocks downloads early

If a reading kind has no configured or uniquely detected writable target folder, Bunko rejects enqueue requests immediately with 409 TARGET_NOT_CONFIGURED rather than downloading chapters into the wrong directory.