mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Chub cope
This commit is contained in:
10
server.js
10
server.js
@@ -4091,6 +4091,7 @@ async function downloadChubLorebook(id) {
|
||||
});
|
||||
|
||||
if (!result.ok) {
|
||||
console.log(await result.text());
|
||||
throw new Error('Failed to download lorebook');
|
||||
}
|
||||
|
||||
@@ -4133,7 +4134,14 @@ function parseChubUrl(str) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const domainIndex = splitStr.indexOf('chub.ai');
|
||||
let domainIndex = -1;
|
||||
|
||||
splitStr.forEach((part, index) => {
|
||||
if (part === 'www.chub.ai' || part === 'chub.ai') {
|
||||
domainIndex = index;
|
||||
}
|
||||
})
|
||||
|
||||
const lastTwo = domainIndex !== -1 ? splitStr.slice(domainIndex + 1) : splitStr;
|
||||
|
||||
const firstPart = lastTwo[0].toLowerCase();
|
||||
|
Reference in New Issue
Block a user