realcoloride/node_characterai

`characterAI.requester.usePlus = true;` not working

Closed this issue · 20 comments

So I bought plus and re-logged in, and I re-copied the access-token, But now when I request, It does nothing, It just keeps hanging, No reply at all, Any fix for this?

I also made sure to debug if it's actually on the plus.character.ai site, And yet still doesn't work.

Are you sure this is only for plus users? This seems like a common issue with the package even with regular users.

Are you sure this is only for plus users? This seems like a common issue with the package even with regular users.

Yes I am sure, When I'm on an account that never subbed, It instantly works and pretty quick as well, But when I login through my subbed account, It just doesn't respond, It logs out the " Done setup " But it just doesn't do anything after that, So yes I am pretty sure, Right now I'm using it on my alt non-subbed account and it works fine.

I have debugged if it works as in it loads plus.character.ai instead of beta.xxx..... , And it works it does log the plus site, But yet it still does not work.

Ok, thanks for the info. Definitely strange. @realcoloride could you check this out?

Set the headless mode to false and see what pops on the browser screen. See the page you get when its frozen and see what appears in the console aswell.
I cannot reproduce the issue since I don't own CAI+.

Keep me updated.

Set the headless mode to false and see what pops on the browser screen. See the page you get when its frozen and see what appears in the console aswell. I cannot reproduce the issue since I don't own CAI+.

Keep me updated.

Okay I will be doing that and testing it out and letting you know what could be the issue.

After some investigation without headless mode as you said, Apperantly, this comes up:

image

Can't show the body cuz it contains the key, But basically it opens plus.character.ai , But then it returns me to beta.character.ai/dj-rest-auth/auth0/

And I think this is why it doesn't load anything in any case, Cuz as soon as you sub, It saves a cookie on your PC that keeps directing you to plus.character.ai if you subbed once, So this could be the issue as well

The main issue here is that, When you have plus once, You'll always have it, Meaning even if your sub exprired, You'll be directed to plus.charater.ai which then presents the "purchase " popout:

Here's an example when I logout frmo a subbed account:

image

The cookie now is fully saved as you're a plus user and need to pay again, You can easily fix this with clearing the data of the site on Chrome, But this could be the issue.

Okay I found the fix easily, So the problem is that in ./node_charatcerai/client.js All the URL's/endpoints are beta.charatcer.ai/.....
Which is wrong, It should be plus.charatcer.ai/..... So changing them manually all to plus worked, Or just applying that check for Plus, So that's an easy fix. For you guys at least, Just apply the
await page.goto("https://" + (this.usePlus ? "plus" : "beta") + ".character.ai");
To client.js and chat.js .

@ftk789 nice job fixing it!

@ftk789 nice job fixing it!

Thank you man, Now You guys need to update this no?

@ftk789 sure! Could you paste the file you changed on here and I'll open a PR?

@Parking-Master Scuffed how I did it, But those 3 files.

Is there a better way I can upload them? 3 files and all are long

Also i'm faceing an issue on how to get the " useplus " to be used on each file to determine the site.

Is there a better way I can upload them? 3 files and all are long

@ftk789 you could try opening a pull request yourself then. It's pretty easy.

  • Fork this repository at the top of the website
  • Change the specific files on the forked repo that you changed locally
  • When done, go to "Pull requests" on the forked repo and click "Open pull request"
  • Add a title and description, then wait for @realcoloride to merge it

Should be pretty straightforward. Let me know if you need any help.

Also i'm faceing an issue on how to get the " useplus " to be used on each file to determine the site.

Oh, yeah. I forgot about that. While I was updating the repo a few months ago I also ran into that issue. The usePlus variable is only used in requester.js. Some how, when requiring/importing the other files into the requester, you're gonna need to pass the default options (along with usePlus) into that require statement. Unfortunately that's the only way. Otherwise you'd need to combine all the files into one which realcoloride does not want.

You need to specify usePlus before initializing your client in the client.requester class.

This seems like the same problem related to #108 and #91 ? Character AI should really fix their API structure/domain, it's just bad.