[GH-ISSUE #7480] [Feature]: Browse and import PlotLight characters and personas in the Card Browser #4167

Closed
opened 2026-10-21 06:12:02 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @SpicyMarinara on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7480

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

The Card Browser (Download Cards) lets you search ChubAI, JannyAI, Pygmalion, Wyvern and DataCat, then import a card as a character or persona. PlotLight now has a public, read-only content API, but its cards and personas can only be added by downloading the file on the website and uploading it into Marinara.

Proposed solution

Add PlotLight as a Card Browser source, for both characters and personas, using its public content API: https://plotlightstudios.com/docs/api/public-content

What the API offers:

  • No key or account needed. It is guest read-only, CORS is allowed (credentials: 'omit'), and it uses no inference tokens.
  • Search: GET /api/v1/content/{type}, with type cards (or characters) or personas.
    • Parameters:
      • q (up to 200 characters);
      • mode: for cards names, creators, tags, fandoms or genres; for personas names or creators;
      • tags (all must match) and exclude_tags (any removes), at most 10 slugs each;
      • sort: recent, popular or rating;
      • limit, 1–100;
      • offset, 0–10000.
    • Card-only filters: min_rating (0–5) and has_vn. Personas accept min_favorites.
    • Response: a data array of { id, type, name, description, image_url, updated_at, creator { name, username }, tags[], detail_url, downloads { format: relative URL } }, plus pagination { limit, offset, has_more, next_offset }.
    • There is no total count. Page until next_offset is null; a short or empty page doesn't mean the end.
  • Tag catalog: GET /api/v1/content/tags?type=…&category=… returns slugs. Use the slugs exactly, never derive them from display names.
  • Download: GET /api/v1/content/{type}/{id}?format=….
    • Cards: png3 (V3 with V2 compatibility, portrait embedded), png (V2), json3 (V3), json (V2) or backyard.
    • Personas: json.
    • Lorebooks the author allows are merged into character_book. V3 cards may reference sprites that have to be fetched separately.
  • Errors and limits:
    • 400: invalid query; unknown or repeated parameters are rejected.
    • 401/403: not exportable to guests.
    • 404: unavailable.
    • 429: rate limited.
    • Honor Retry-After and X-RateLimit-*, debounce searches, and avoid parallel bulk downloads.
  • Adult content: the API follows the native guest rules ("After Dark" restrictions). include_after_dark on the tag catalog doesn't unlock adult content, so the source's adult-content toggle should reflect what guests can actually get.
  • Attribution: public availability doesn't grant permission to republish. Keep the creator's name and a View on PlotLight link (detail_url) on the detail page, as the other sources do.

Implementation notes:

  • Follow the existing providers: a provider config in packages/client/src/components/bot-browser/BotBrowserView.tsx. If proxying is needed for image or download URLs, add a server route like packages/server/src/routes/bot-browser-*.routes.ts.
  • Prefer png3, falling back to json3 or json, so the import keeps the portrait and any embedded book.
  • Treat every downloaded field as untrusted data.
  • Update docs/characters/bot-browser.md, which lists the sources, and the docs-i18n packs (or open a [docs-i18n] follow-up).
  • Localize the new UI copy.

Alternatives considered

  • Keep downloading files from the website by hand and uploading them. That works, but it's slower, and it loses the in-app preview, filters and persona import.
  • Use the website's HTML pages. Not acceptable: the documented API is stable, versioned (/api/v1) and meant for this.

Additional context

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Oct 12, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7480 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? The **Card Browser** (Download Cards) lets you search ChubAI, JannyAI, Pygmalion, Wyvern and DataCat, then import a card as a character or persona. [PlotLight](https://plotlightstudios.com) now has a public, read-only content API, but its cards and personas can only be added by downloading the file on the website and uploading it into Marinara. ## Proposed solution Add **PlotLight** as a Card Browser source, for both characters and personas, using its public content API: https://plotlightstudios.com/docs/api/public-content What the API offers: - **No key or account needed.** It is guest read-only, CORS is allowed (`credentials: 'omit'`), and it uses no inference tokens. - **Search:** `GET /api/v1/content/{type}`, with `type` `cards` (or `characters`) or `personas`. - Parameters: - `q` (up to 200 characters); - `mode`: for cards `names`, `creators`, `tags`, `fandoms` or `genres`; for personas `names` or `creators`; - `tags` (all must match) and `exclude_tags` (any removes), at most 10 slugs each; - `sort`: `recent`, `popular` or `rating`; - `limit`, 1–100; - `offset`, 0–10000. - Card-only filters: `min_rating` (0–5) and `has_vn`. Personas accept `min_favorites`. - Response: a `data` array of `{ id, type, name, description, image_url, updated_at, creator { name, username }, tags[], detail_url, downloads { format: relative URL } }`, plus `pagination { limit, offset, has_more, next_offset }`. - There is no total count. Page until `next_offset` is `null`; a short or empty page doesn't mean the end. - **Tag catalog:** `GET /api/v1/content/tags?type=…&category=…` returns slugs. Use the slugs exactly, never derive them from display names. - **Download:** `GET /api/v1/content/{type}/{id}?format=…`. - Cards: `png3` (V3 with V2 compatibility, portrait embedded), `png` (V2), `json3` (V3), `json` (V2) or `backyard`. - Personas: `json`. - Lorebooks the author allows are merged into `character_book`. V3 cards may reference sprites that have to be fetched separately. - **Errors and limits:** - `400`: invalid query; unknown or repeated parameters are rejected. - `401`/`403`: not exportable to guests. - `404`: unavailable. - `429`: rate limited. - Honor `Retry-After` and `X-RateLimit-*`, debounce searches, and avoid parallel bulk downloads. - **Adult content:** the API follows the native guest rules ("After Dark" restrictions). `include_after_dark` on the tag catalog doesn't unlock adult content, so the source's adult-content toggle should reflect what guests can actually get. - **Attribution:** public availability doesn't grant permission to republish. Keep the creator's name and a **View on PlotLight** link (`detail_url`) on the detail page, as the other sources do. Implementation notes: - Follow the existing providers: a provider config in `packages/client/src/components/bot-browser/BotBrowserView.tsx`. If proxying is needed for image or download URLs, add a server route like `packages/server/src/routes/bot-browser-*.routes.ts`. - Prefer `png3`, falling back to `json3` or `json`, so the import keeps the portrait and any embedded book. - Treat every downloaded field as untrusted data. - Update `docs/characters/bot-browser.md`, which lists the sources, and the `docs-i18n` packs (or open a `[docs-i18n]` follow-up). - Localize the new UI copy. ## Alternatives considered - Keep downloading files from the website by hand and uploading them. That works, but it's slower, and it loses the in-app preview, filters and persona import. - Use the website's HTML pages. Not acceptable: the documented API is stable, versioned (`/api/v1`) and meant for this. ## Additional context - API docs: https://plotlightstudios.com/docs/api/public-content - Existing Card Browser guide: `docs/characters/bot-browser.md` ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:12:02 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Oct 12, 2026):

@SpicyMarinara owns this; the implementation is in #7495 (ready for review). Note: PlotLight currently returns 404 for every persona download I tried, so persona import shows "PlotLight doesn't offer this for download." until PlotLight serves those files.

<!-- gh-comment-id:6129995888 --> @SpicyMarinara commented on GitHub (Oct 12, 2026): @SpicyMarinara owns this; the implementation is in #7495 (ready for review). Note: PlotLight currently returns 404 for every persona download I tried, so persona import shows "PlotLight doesn't offer this for download." until PlotLight serves those files.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 12, 2026):

Fixed on staging by #7495.

<!-- gh-comment-id:6131793889 --> @SpicyMarinara commented on GitHub (Oct 12, 2026): Fixed on staging by #7495.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4167
No description provided.