realcoloride / node_characterai

Unofficial Character AI wrapper for node.
https://beta.character.ai/
341 stars 72 forks source link

Fix beta domain used when plus subscriber #108

Closed sivertheisholt closed 6 months ago

sivertheisholt commented 11 months ago

This fixes #91

A few ways todo this, this is one of them.

realcoloride commented 11 months ago

This is probably bad. Why?

Well lets say someone made a request containing "beta" in the link (encoded URI), then that would be automatically replaced by "plus".

sivertheisholt commented 11 months ago

This is probably bad. Why?

Well lets say someone made a request containing "beta" in the link (encoded URI), then that would be automatically replaced by "plus".

Yepp, that is very true. I just thought u wanted to keep it like that from what u mentioned in the issue.

Replacing it using the index should be a better solution as the start will most likely never change unless they switch out their domain to something else. The ideal solution would most likely be to keep the base URL separate from the request URL's, but that is a bigger change I don't have time for right now.

sivertheisholt commented 11 months ago

@realcoloride this is javascript in its finest. Look at this lol, apparently replace function only replaces the first occurrence .

image

So replace should work fine?

realcoloride commented 11 months ago

I'll check. Regex might be an option aswell just in case.

sivertheisholt commented 11 months ago

I'll check. Regex might be an option aswell just in case.

Yes regex would also work, although less readability and it does involve the overhead of regex pattern parsing.

sivertheisholt commented 6 months ago

Hi, any update on this @realcoloride ?

Been using it for a couple of months now from my fork, but would like to switch to using the original instead if the issue is resolved.

Also they seem to be moving away from their beta/plus domain design, their redesigned page is: https://character.ai/?redesign=true

Network calls are still goin to beta/plus/neo sub domains tho.

realcoloride commented 6 months ago

Hello, The issue should be solved.

For the moving away to their beta/plus domain, I have noticed that aswell but currently as long as the old interface & endpoints work, i'll continue using them (for compatibility reasons). I've seen they use a websocket aswell, which could perhaps make it more efficient to use.

However, looking at the new (neo) interface it does look like they're using the neo endpoints and plus endpoints. As of authentication, things seem to be the same.

EDIT: the new models in the new interface seem to be terribly dumbed down...

sivertheisholt commented 6 months ago

Awesome! Thanks for the update.

The new interface feels pretty responsive and improved. Hopefully they wont do any sudden changes to the endpoints. Hoping for an official API before that happens :)

I will do some testing with Electron and close the PR + issue if everything works fine.