Comments (8)
Having the same issue as well.
[EDIT 1]
Seems to return a 403 Forbidden
[EDIT 2]
I seemed to have found a partial fix for this issue by applying a user-agent with the request, specifically
CharacterAI/1.0.0 (iPhone; iOS 14.4.2; Scale/3.00)
authenticateWithToken
authenticateAsGuest
Both now return 200 instead of the 403 forbidden. Going to just double check and I'll keep you all updated if everything works out
[EDIT 3]
I have it functioning and works, It just seems to be a few user-agent issues and a misplace in a token variable.
from node_characterai.
from node_characterai.
Node version: v16.19.0
node_characterai: 1.0.17
import fetch from 'node-fetch';
const HttpsProxyAgent = require('https-proxy-agent');
const CharacterAI = require('node_characterai');
const characterAI = new CharacterAI();
globalThis.fetch = (url: RequestInfo | URL, options: RequestInit) => {
return fetch(url, {
agent: HttpsProxyAgent('http://172.22.208.1:10810'),
...options
})
}
await characterAI.authenticateAsGuest();
const characterId = "8_1NyR8w1dOXmI1uWaieQcd147hecbdIK7CeEAIrdJw" // Discord moderator
const chat = await characterAI.createOrContinueChat(characterId);
const response = await chat.sendAndAwaitResponse(argv.args.join(' '), true)
I have to replace fetch
with node-fetch
because I cannot connect to the server directly without proxy.
from node_characterai.
I also tried curl, it has error too.
curl --location --request POST 'https://beta.character.ai/chat/auth/lazy/' \
--header 'Content-Type: application/json' \
--header 'Cookie: __cf_bm=RbaY5rYyFvMZVcVFE6YJ0Rgk804aWePlqQUB8ACOzlM-1675785383-0-AZCWYNkYNFJprIPmJ+Z+U+v1QdUYYUXxfZRsBj2CVSyxi4bMufRoG6gFssADcEbfwV/Qi11GlnhWYa+hiH+YZAg=; __cfwaitingroom=ChhFcUlveGRFQk5pdVB3dDk1S2QyZnlnPT0SlAIvS1FxV3N3bUF1ZXpoNUhIanB5SFc2djc3VFNiL1ZydDRXZmdxZHN3azRaQTh0Tmx0amZITlJEalVmdGczcHA2c0ZyQTU0cjRIN3JEYjdURmQ1SitVbk9rTWk4d1pPY2ZyREVCbWdzMTU0Qm95WlU5SGc2ZnRpcHc5SXNvNURkSFZqenhoZEFBWGsxK2xCT3F3a2NmQkN2NjlIb01aV1gyeG1qQVEvSmZYQXR2bEp3c1RiVkkyUXg4TkhnczRNeDY1NUtZZ0pGdXZaSWJzZjJUQTF5eGh4R2IzR2NGbEFjenNKR0M5Vm9qdUJ4SHRaT0k5N0Njb1R1NUJweTE0N1h3MmxzdGtJRUxLTDYxSEZQck1rMD0%3D; csrftoken=RATHLAweU2vrADFyg8riQt2ClxWVdCnw; sessionid=a52vzeia0a8fq5j6vdlbcwbmldj2yrv4' \
--data-raw '{
"lazy_uuid": "eb711c64-934a-4775-9b11-e082d6618dc1"
}'
error code: 1020
from node_characterai.
Is your IP banned? Does your DNS not allow the website? Thats weird. I've tried it myself and it worked.
from node_characterai.
Also, is your code running in an asynchronous context?
from node_characterai.
Hello! Could you tell me where the issue was exactly and how you fixed it?
What did you specify in the user agent/token variable?
If any further issues happen:
They might have changed the way (guest users) work (using lazy tokens). For my case, when I last used, it worked properly. If the same issue seems to continue, i will look indepth. Please note that guest accounts have 5-10 messages for free before prompted to login ("maximum messages reached").
If you have any questions in the meantime, please let me know and I will look further in later on.
Good luck and have fun!
from node_characterai.
Hello OP!
Do you still need help?
from node_characterai.
Related Issues (20)
- How To Fix On Node.Js Hosting Server? HOT 2
- AI does not respond to the message HOT 3
- .puppeteerPath not working correctly. HOT 7
- Recreate new Chat HOT 1
- `characterAI.requester.usePlus = true;` not working HOT 20
- Getting access token on mobile (Not issue, but a help) HOT 1
- how to fix? HOT 4
- Server initialization delay. HOT 7
- An `executablePath` or `channel` must be specified for `puppeteer-core` HOT 2
- puppeteer error here HOT 3
- IF YOU USER REPLIT READ THIS, ITS NOT ISSUES! TIPS FOR REPLIT USER HOT 1
- puppeteer failed to launch browser HOT 1
- character ai bot writes code straight HOT 2
- (discord) bot forgets conversation HOT 1
- AuthenticateWithToken(); doesn't work properly HOT 2
- Image uploading is completely broken. HOT 2
- SyntaxError HOT 18
- Guest eval fetching no longer working after update HOT 8
- Authentication token is invalid HOT 10
- Terms of Service update
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node_characterai.