Reviews for Janitor AI Scraper
Janitor AI Scraper by Weary Galaxy
2 reviews
- Rated 4 out of 5by randombum, 2 days agoHas been of much use. Thanks :) Had an AI fix a bug. Feed it into yours if you feel like it:
### Bug Report
**Title:** Fix for extraction crash (undefined `first_message`) & missing messages on long characters
**The Issues & Causes:**
1. **Extraction Crash:** When a character's definition/first message is extremely long, Janitor AI omits the first message from the network payload to save context. This causes `characterData.first_message` to be `undefined`. When `buildCharacterData` attempts to run `.replace()` on it to scrub the user persona, the extension throws a `TypeError` and crashes.
2. **Leftover Tags:** The persona scrubber currently only removes ``, but Janitor AI sometimes uses ``, leaving the tag in the extracted card.
**The Fixes (in `content_script.js`):**
**1. Add a DOM fallback for the missing first message:**
```javascript
// Add above buildCharacterData:
function getFallbackFirstMessage() {
const sliderContainer = document.querySelector(CONFIG.BOT_CHOICES_SLIDER_SELECTOR);
if (sliderContainer) {
const firstLi = sliderContainer.querySelector('li[class*="_messageDisplayWrapper_"]');
if (firstLi) return extractChatMessageContent(firstLi);
}
const wrappers = getPrimaryChatMessageWrappers();
const firstBotWrapper = wrappers.find(msgWrapper => !!msgWrapper.querySelector(CONFIG.CHARACTER_ICON_SELECTOR));
return firstBotWrapper ? extractChatMessageContent(firstBotWrapper) : null;
}
```
**2. Update `buildCharacterData` to use the fallback, safe `.replace()` calls, and handle both tag types:**
```javascript
// Inside buildCharacterData(rawContent):
let effectiveFirstMessage = STATE.firstMessage || getFallbackFirstMessage();
// ... [existing data parsing] ...
if (STATE.userPersonaName && STATE.userPersonaName.trim() !== '') {
// 1. Target both tag types
characterData.description = (characterData.description || '').replace(/<(?:PersonaName|UserPersona)>.*?<\/(?:PersonaName|UserPersona)>/gi, '');
// ... [existing tag stripping] ...
// 2. Add safe fallbacks (|| '') to prevent TypeErrors
characterData.description = (characterData.description || '').replace(personaNameRegex, '{{user}}');
characterData.scenario = (characterData.scenario || '').replace(personaNameRegex, '{{user}}');
characterData.first_message = (characterData.first_message || '').replace(personaNameRegex, '{{user}}');
characterData.mes_example = (characterData.mes_example || '').replace(personaNameRegex, '{{user}}');
if (Array.isArray(characterData.alternate_greetings)) {
characterData.alternate_greetings = characterData.alternate_greetings.map(g => (g || '').replace(personaNameRegex, '{{user}}'));
}
}
```
*** - Rated 4 out of 5by SakuraCake, 4 months agoA very good extension with a simple, easy-to-use UI! Significantly faster and more convenient than other bot extraction methods ( ˶ˆᗜˆ˵ ).
I mainly utilize this for JanitorAI. The only (minor) complications are:
1̶.̶ ̶E̶x̶p̶a̶n̶d̶i̶n̶g̶ ̶'̶↗️'̶ ̶t̶h̶e̶ ̶U̶I̶ ̶w̶i̶n̶d̶o̶w̶ ̶i̶n̶t̶o̶ ̶a̶ ̶n̶e̶w̶ ̶b̶r̶o̶w̶s̶e̶r̶ ̶t̶a̶b̶ ̶(̶C̶h̶a̶r̶a̶c̶t̶e̶r̶ ̶S̶t̶u̶d̶i̶o̶)̶ ̶i̶s̶ ̶n̶e̶c̶e̶s̶s̶a̶r̶y̶ ̶t̶o̶ ̶u̶s̶e̶ ̶t̶h̶e̶ ̶'̶D̶o̶w̶n̶l̶o̶a̶d̶ ̶P̶N̶G̶'̶ ̶f̶e̶a̶t̶u̶r̶e̶.̶ ̶T̶r̶y̶i̶n̶g̶ ̶t̶o̶ ̶d̶o̶ ̶s̶o̶ ̶f̶r̶o̶m̶ ̶t̶h̶e̶ ̶U̶I̶ ̶w̶i̶n̶d̶o̶w̶ ̶w̶i̶l̶l̶ ̶n̶o̶t̶ ̶w̶o̶r̶k̶ ̶a̶n̶d̶ ̶g̶i̶v̶e̶s̶ ̶t̶h̶i̶s̶ ̶e̶r̶r̶o̶r̶:̶ ̶"̶P̶N̶G̶ ̶c̶r̶e̶a̶t̶i̶o̶n̶ ̶f̶a̶i̶l̶e̶d̶:̶ ̶B̶a̶c̶k̶g̶r̶o̶u̶n̶d̶ ̶P̶N̶G̶ ̶c̶o̶n̶v̶e̶r̶s̶i̶o̶n̶ ̶f̶a̶i̶l̶e̶d̶:̶ ̶C̶o̶u̶l̶d̶ ̶n̶o̶t̶ ̶e̶s̶t̶a̶b̶l̶i̶s̶h̶ ̶c̶o̶n̶n̶e̶c̶t̶i̶o̶n̶.̶ ̶R̶e̶c̶e̶i̶v̶i̶n̶g̶ ̶e̶n̶d̶ ̶d̶o̶e̶s̶ ̶n̶o̶t̶ ̶e̶x̶i̶s̶t̶.̶"̶
2̶.̶ ̶I̶m̶p̶o̶r̶t̶i̶n̶g̶ ̶t̶h̶e̶ ̶e̶x̶p̶o̶r̶t̶e̶d̶ ̶c̶h̶a̶t̶ ̶i̶n̶t̶o̶ ̶S̶i̶l̶l̶y̶T̶a̶v̶e̶r̶n̶ ̶w̶o̶n̶'̶t̶ ̶w̶o̶r̶k̶ ̶s̶i̶n̶c̶e̶ ̶o̶n̶l̶y̶ ̶J̶S̶O̶N̶ ̶a̶n̶d̶ ̶J̶S̶O̶N̶L̶ ̶i̶s̶ ̶s̶u̶p̶p̶o̶r̶t̶e̶d̶.̶ ̶H̶o̶w̶e̶v̶e̶r̶,̶ ̶t̶x̶t̶ ̶t̶o̶ ̶j̶s̶o̶n̶ ̶f̶i̶l̶e̶ ̶c̶o̶n̶v̶e̶r̶s̶i̶o̶n̶ ̶m̶i̶g̶h̶t̶ ̶b̶e̶ ̶v̶i̶a̶b̶l̶e̶ ̶f̶o̶r̶ ̶t̶h̶a̶t̶.̶ ̶E̶v̶e̶n̶ ̶s̶o̶,̶ ̶i̶t̶ ̶w̶o̶u̶l̶d̶ ̶b̶e̶ ̶n̶i̶c̶e̶ ̶i̶f̶ ̶t̶h̶e̶r̶e̶ ̶w̶a̶s̶ ̶a̶n̶ ̶o̶p̶t̶i̶o̶n̶ ̶t̶o̶ ̶e̶x̶p̶o̶r̶t̶ ̶t̶h̶e̶ ̶c̶o̶n̶v̶e̶r̶s̶a̶t̶i̶o̶n̶ ̶a̶s̶ ̶o̶n̶e̶ ̶J̶S̶O̶N̶ ̶o̶r̶ ̶J̶S̶O̶N̶L̶.̶
3̶.̶ ̶T̶h̶e̶ ̶U̶I̶ ̶w̶i̶n̶d̶o̶w̶ ̶g̶l̶i̶t̶c̶h̶e̶s̶ ̶w̶h̶e̶n̶ ̶t̶h̶e̶ ̶f̶i̶r̶s̶t̶ ̶m̶e̶s̶s̶a̶g̶e̶ ̶a̶n̶d̶ ̶a̶l̶t̶e̶r̶n̶a̶t̶e̶ ̶g̶r̶e̶e̶t̶i̶n̶g̶s̶ ̶e̶x̶c̶e̶e̶d̶ ̶s̶i̶x̶ ̶i̶n̶ ̶t̶o̶t̶a̶l̶.̶ ̶A̶n̶y̶t̶h̶i̶n̶g̶ ̶o̶v̶e̶r̶ ̶s̶i̶x̶ ̶'̶i̶n̶t̶r̶o̶s̶'̶ ̶c̶a̶u̶s̶e̶s̶ ̶m̶a̶l̶f̶u̶n̶c̶t̶i̶o̶n̶.̶
4̶.̶ ̶A̶s̶ ̶o̶f̶ ̶l̶a̶t̶e̶,̶ ̶t̶h̶e̶ ̶'̶C̶o̶p̶y̶ ̶T̶e̶x̶t̶'̶ ̶f̶e̶a̶t̶u̶r̶e̶ ̶h̶a̶s̶ ̶b̶e̶e̶n̶ ̶i̶n̶c̶o̶n̶s̶i̶s̶t̶e̶n̶t̶l̶y̶ ̶w̶o̶r̶k̶i̶n̶g̶.̶ ̶N̶o̶t̶ ̶s̶u̶r̶e̶ ̶w̶h̶a̶t̶'̶s̶ ̶c̶a̶u̶s̶i̶n̶g̶ ̶t̶h̶a̶t̶.̶
But otherwise, the extension performs as intended and I am so glad I found it! 🌸🍰
03-06-26
Update (03-08-26): I tried removing the extension and adding it again which seems to have fixed Complication #1! I cannot say the same for Complication #4, however. To clarify, I use this extension on my laptop through Firefox for Linux (ESR) on Linux Crostini.
Update (03-15-26): All complications were resolved in the newest update with JSONL file format now available for exporting chats! 💗 However, I've encountered a bug where the 'Export Chat' feature yields a JSONL file with an incomplete conversation. So an export of a conversation with over 10 messages does not show all 10 messages. No matter what message you extract from. It also seems like previous bots may bleed into the UI with the currently extracted one. For example, the creator notes and tags of a bot it was previously used with showed up. Refreshing did not help much.Developer response
posted 4 months agoHey, glad you enjoyed it! I'm aware of issues 2 and 3. I just haven't had time to work on that.
As for issues, 1 and 4, I wasn't able to reproduce those bugs. Are you using this on Firefox or a fork of Firefox?