JanitorAI Personality Snatcher

Steals JanitorAI bot descriptions.

< 脚本JanitorAI Personality Snatcher的反馈

评价:差评 - 脚本失效或无法使用

§
发表于:2025-03-06

"Less than two occurrences of "'s Persona: " and "Error parsing JSON: SyntaxError: Unexpected token 'e', "en=GA%3Aap" are popping up for me, i dont know what these things mean i assume a janitor ai update broke this some time ago

§
发表于:2025-03-16

Deepseek fixed code for me. Now it gives out a description of the character, I checked. Replace part of the code with this. When the script asked "Send a message or reload previous bot message to obtain description."write something in the chat with the bot and send it. The txt file is downloaded automatically. It not json but still have character definition.Caution: replace only the lower part of the original script, which begins with (function() {.


(function() {
'use strict';

// Function to download a file
function downloadFile(filename, text) {
const blob = new Blob([text], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}

// Create the button
const button = document.createElement('button');
button.innerText = 'Steal Personality';
button.style.position = 'fixed';
button.style.top = '8px';
button.style.left = '50%';
button.style.transform = 'translate(-50%, 0)';
button.style.padding = '5px 8px';
button.style.borderRadius = '6px';
button.style.backgroundColor = 'rgba(128, 90, 213, 0.6)';
button.style.color = 'var(--chakra-colors-whiteAlpha-800)';
button.style.border = 'none';
button.style.cursor = 'pointer';
button.style.zIndex = '9999';
button.style.fontFamily = 'var(--chakra-fonts-body)';
button.style.lineHeight = '1';
button.style.fontSize = '14px';

let requestCount = 0;

// Function to log fetch requests
function logFetchRequests() {
const originalFetch = window.fetch;
button.style.backgroundColor = 'rgba(169, 20, 20, 0.6)';
window.fetch = async (...args) => {
requestCount++;

if (requestCount === 2) {
const requestBody = args[1]?.body;

if (requestBody) {
let bodyText;

if (typeof requestBody === 'string') {
bodyText = requestBody;
} else if (requestBody instanceof Blob) {
bodyText = await requestBody.text();
} else if (requestBody instanceof FormData) {
bodyText = JSON.stringify(Object.fromEntries(requestBody.entries()));
} else {
console.error('Unsupported request body type:', requestBody);
alert('Unsupported request body type.');
return originalFetch(...args);
}

try {
const jsonBody = JSON.parse(bodyText); // Parse JSON
const messages = jsonBody.messages;

if (Array.isArray(messages) && messages.length > 0) {
const content = messages[0].content;
const occurrences = content.split("'s Persona: ");

let result;
if (occurrences.length > 2) {
result = occurrences.slice(2).join("'s Persona: ");
const systemNoteIndex = result.indexOf("[System note");

if (systemNoteIndex !== -1) {
result = result.substring(0, systemNoteIndex).trim();
}
result = 'Personality: ' + result;
} else {
// If there are less than two occurrences, use the entire text
result = content;
}

// Download the file with the result
downloadFile('personality.txt', result);
alert('File downloaded with personality data.');
button.style.backgroundColor = 'rgba(128, 90, 213, 0.6)';
} else {
alert('No messages found or messages is not an array.');
button.style.backgroundColor = 'rgba(128, 90, 213, 0.6)';
}
} catch (error) {
console.error('Error parsing JSON:', error);
alert('Error parsing JSON: ' + error.message);
button.style.backgroundColor = 'rgba(128, 90, 213, 0.6)';
}
} else {
alert('Request body is empty.');
button.style.backgroundColor = 'rgba(128, 90, 213, 0.6)';
}

requestCount = 0; // Reset the counter
}

return originalFetch(...args);
};
}

// Add a click event listener to the button
button.addEventListener('click', () => {
requestCount = 0;
logFetchRequests();
alert('Send a message or reload previous bot message to obtain description.');
});

// Append the button to the body
document.body.appendChild(button);
})();

§
发表于:2025-03-16

the code got corrupted in my comment.Couldn't edit the comment. Here is the correct code:

https://drive.google.com/file/d/1XpspEou8qL40ZvOhB4UMP_tyO5VjNWC8/view?usp=sharing

发表回复

登录(不可用)以发表回复。

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址