Giter Club home page Giter Club logo

Comments (8)

K3YOMI avatar K3YOMI commented on July 29, 2024 2

Having the same issue as well.
[EDIT 1]
Seems to return a 403 Forbidden
image

[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
image
authenticateAsGuest
image

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.
image

from node_characterai.

realcoloride avatar realcoloride commented on July 29, 2024

from node_characterai.

lss233 avatar lss233 commented on July 29, 2024

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.

lss233 avatar lss233 commented on July 29, 2024

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.

realcoloride avatar realcoloride commented on July 29, 2024

Is your IP banned? Does your DNS not allow the website? Thats weird. I've tried it myself and it worked.

from node_characterai.

realcoloride avatar realcoloride commented on July 29, 2024

Also, is your code running in an asynchronous context?

from node_characterai.

realcoloride avatar realcoloride commented on July 29, 2024

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.

realcoloride avatar realcoloride commented on July 29, 2024

Hello OP!

Do you still need help?

from node_characterai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.