Extract character card with "T" key (WHILE IN CHAT PAGE) and save as .txt, .png, or .json (proxy required)
< Feedback on JanitorAI Character Card Scraper
I went ahead and modified the modifyResponse
function and made the following change:
let charBlock = "";
let scen = "";
let persona = "";
let exampleDialogs = "";
// 1) Strip a leading [System note: ...] ONLY if it is at the very start.
// Do not remove any [System note: ...] appearing later in the content.
let content = typeof sys === "string" ? sys : "";
content = content.replace(/^\s*\[System note:[\s\S]*?\]\s*/, "");
// 2) Parse fields from tags (and remove it)
// User persona (inner text)
const userPersonaMatch = content.match(/<UserPersona>([\s\S]*?)<\/UserPersona>/i);
if (userPersonaMatch) {
persona = userPersonaMatch[1].trim();
content = content.replace(userPersonaMatch[0], ""); // yeet
}
// Example dialogs (inner text)
// <example_dialogs> is always present per the new format
const exampleDialogsMatch = content.match(/<example_dialogs>([\s\S]*?)<\/example_dialogs>/i);
if (exampleDialogsMatch) {
exampleDialogs = exampleDialogsMatch[1].trim();
content = content.replace(exampleDialogsMatch[0], ""); // yeet (2)
}
// 3) Whatever is left, save it to charBlock
charBlock = content.trim();
Unfortunately, the Scenario will be included with the Character's personality.
One thing to note: your custom prompt must be [System note: blah]
in the proxy configuration, as if not, your prompt will be in the saved file too, lol. See attached image.
Here's the output of the modified script:
==== Name ====
Character Name
==== Chat Name ====
Character Chat Name
==== Description ====
Personality
Scenario
==== Initial Message ====
First message
==== Example Dialogs ====
Example dialog
==== Character Card ====
https://janitorai.com/characters/...
==== Creator ====
https://janitorai.com/profiles/...
==== Creator Notes ====
Character Bio
Thank you for the detailed explanation, updated.
The character layout changed again
Extracting the character prompts manually results in this format:
It seems like
<{char}'s Persona>
and<scenario>
tags no longer exist, again.Test is done with the following test character, see attached image.