Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API error #44

Open
Bestfast opened this issue May 30, 2024 · 35 comments
Open

API error #44

Bestfast opened this issue May 30, 2024 · 35 comments

Comments

@Bestfast
Copy link

Bestfast commented May 30, 2024

out of 4 accounts, only one works as of right now. I tried regenerating tokens by logging out and logging in an incognito tab, but I receive the same error:
2024-05-30 12:28:14 [INFO]: { message: 'API error when getting stamina info', args: { statusCode: 200, body: { data: null, message: '', retcode: 10035 } } }
any clue will be of great help

@Capoouo
Copy link

Capoouo commented May 30, 2024

I have the same issue, but it only happens frequently with one of my four accounts
Only that account frequently has this issue, while the other accounts rarely do. I don't know the reason why

@torikushiii
Copy link
Owner

retcode: 10035 indicates that the account needs to complete a CAPTCHA. Have you encountered any CAPTCHAs while regenerating the account tokens? This issue usually resolves itself after you solve one.

If you haven't encountered any CAPTCHAs while regenerating token, please try to claim check-in manually and see if you get any CAPTCHA

@Capoouo
Copy link

Capoouo commented May 30, 2024

I just tried the auto check-in, and the account did check-in, but the stamina check still showed the same error
emmm...and when I log into that account, I don't encounter any CAPTCHA

@torikushiii
Copy link
Owner

I see, thank you for reporting back. I'll try to investigate if this is happening anywhere else.

@Bestfast
Copy link
Author

I just tried the auto check-in, and the account did check-in, but the stamina check still showed the same error emmm...and when I log into that account, I don't encounter any CAPTCHA

can confirm this behavior on my side too

@Capoouo
Copy link

Capoouo commented Jun 2, 2024

Let me add some details. I tested the Code Redeem and auto-sign, and they are working. However, every half an hour, the following message appears:
message: 'API error when getting stamina info',
args: { statusCode: 200, body: { data: null, message: '', retcode: 10035 } }
It is indeed a bit annoying LOL

@torikushiii
Copy link
Owner

torikushiii commented Jun 2, 2024

Hello, I've updated the code and it should working fine now, please pull/download the new version and follow the new instruction

If you still encounters any problem, feel free to ask.

@Bestfast
Copy link
Author

Bestfast commented Jun 2, 2024

Hello, I've updated the code and it should working fine now, please pull/download the new version and follow the new instruction

If you still encounters any problem, feel free to ask.

Problem persists after pulling the repo and updating the cookies, with only account_mid_v2, cookie_token_v2 and ltuid_v2.
If you prefer, we could try to debug it more on discord, with my id being bestfast

@Bestfast
Copy link
Author

Bestfast commented Jun 2, 2024

for more context: login works, stamina retrieval doesn't

@torikushiii
Copy link
Owner

I'm gonna assume it have the same retcode error which is retcode: 10035?

@Bestfast
Copy link
Author

Bestfast commented Jun 2, 2024

yep

@Capoouo
Copy link

Capoouo commented Jun 3, 2024

It's still the same situation after the replacement
24

@torikushiii
Copy link
Owner

torikushiii commented Jun 3, 2024

After looking around, retcode: 10035 is indeed related to captcha, can any of you guys that received this error go to your HoyoLab Battle Chronicle / Battle Records to see if any of you got captchas to solve?

I've tried spamming the end-point and managed to trigger the captcha system
image

After solving it, everything runs fine

@Capoouo
Copy link

Capoouo commented Jun 4, 2024

I did not use incognito mode and after repeatedly logging out and logging in with four accounts, everything is currently working fine.
Thank you for your help

@Bestfast
Copy link
Author

Bestfast commented Jun 4, 2024

I confirm that spamming works
Maybe could be added as a command for telegram/discord, to remind that a captcha must be completed, along a message in the readme?

@Bestfast
Copy link
Author

Bestfast commented Jun 4, 2024

Ok no, nevermind, the issue only fixed for a very small amount of time

@torikushiii
Copy link
Owner

torikushiii commented Jun 5, 2024

I forgot to mention that the captcha will come back because your accounts still flagged as high_risk at their endpoint, so you'll need to do few captchas before it will go away completely.

@Bestfast
Copy link
Author

Bestfast commented Jun 5, 2024

I spammed the endpoint for 25 minutes, managed to do 5 captchas in the first 15 minutes and nothing else happened. After 1 hours the issue happened again, but i don't see any captcha anymore. Worth of note, it's running on my machine with the same ip address and everything. I don't know what the issue could be here, maybe it's flagging the client somehow?

@torikushiii
Copy link
Owner

torikushiii commented Jun 5, 2024

Are you running multiple accounts? It’s possible that this is triggering the captcha. I can add a few delays to each request to the notes endpoint, but I don’t think it will help because their captcha system is pretty aggressive.

@Bestfast
Copy link
Author

Bestfast commented Jun 7, 2024

Yes I'm currently running 3 accounts, the issue persists after solving the captcha (5 times each account) on every account
0 clue how to proceed, seems strange as it's been working for the past 5? months

@torikushiii
Copy link
Owner

I noticed that they have started aggressively detecting bots in the past few days too, maybe I can just add a delay on every request to the notes endpoint and see if its help

@Capoouo
Copy link

Capoouo commented Jun 8, 2024

I noticed that they have started aggressively detecting bots in the past few days too, maybe I can just add a delay on every request to the notes endpoint and see if its help

you can give it a try Currently, I am in the same situation as him

@torikushiii
Copy link
Owner

@Bestfast, can you try this branch and tell me the result? I've tested it with at least three accounts and haven't been flagged.

Do the captcha for at least one or more accounts, then follow this guide again, but only from step 1 through 6.

To get your device_id, go to the getGameRecordCard headers and find this header:
image

To get your device fp, go to Application > Cookies > https://www.hoyolab.com > Filter bar > Search for DEVICEFP > and copy whichever value you see:
image

@Bestfast
Copy link
Author

It's running for now, i'll report back if it's fixed or not soon ™️

@Bestfast
Copy link
Author

also I don't know if it's supposed to be like that, but both devicefp and deviceid are the same for every account, i think it's bound to your browser session or something

@torikushiii
Copy link
Owner

iirc its browser bounded and it should be fine

@Bestfast
Copy link
Author

rip it didn't even last 2 hours, doesnt seem like it's working, my account get instantly flagged again

@torikushiii
Copy link
Owner

Interesting... I'm assuming you're running the cron timers using the default value?

If so, I'll take a look again later this day and figure out what's going on.

@Bestfast
Copy link
Author

Yes, I'm using the default value

@torikushiii
Copy link
Owner

torikushiii commented Jun 12, 2024

@Bestfast , are you willing to try this hoyolab-auto repo?

This repo is currently in development and has the same functionality, but instead of supporting only Star Rail, it supports all Hoyo games.

Currently, I'm trying to cache the requests and clear the cache every hour. That's the simplest solution I can think of for now. I haven't implemented the function here since it's kind of difficult to integrate it with the current codebase.

However, if you don't encounter any captcha errors while using that repo, I can try to port the code to this repo for those who still use it.

For the accounts that receive captchas, can you solve them and refresh the Battle Records at least two times to ensure you don't get any captcha before running the script? If you do, repeat the step until you don't receive any captcha (don't forget to refresh the page one or two times).

If you have any question feel free to ask on either of the repo.

@Capoouo
Copy link

Capoouo commented Jun 13, 2024

@Bestfast , are you willing to try this hoyolab-auto repo?

This repo is currently in development and has the same functionality, but instead of supporting only Star Rail, it supports all Hoyo games.

Currently, I'm trying to cache the requests and clear the cache every hour. That's the simplest solution I can think of for now. I haven't implemented the function here since it's kind of difficult to integrate it with the current codebase.

However, if you don't encounter any captcha errors while using that repo, I can try to port the code to this repo for those who still use it.

For the accounts that receive captchas, can you solve them and refresh the Battle Records at least two times to ensure you don't get any captcha before running the script? If you do, repeat the step until you don't receive any captcha (don't forget to refresh the page one or two times).

If you have any question feel free to ask on either of the repo.

I might try hoyolab-auto tonight because this issue is really annoying LOL
However, I want to ask how the redeem code functionality in hoyolab-auto works
From the code I haven't seen anything related to finding new redemption codes, and if it has something similar to code.js in starrail-auto. If it's the first time running, will there be a code.js or a message about redemption?

@torikushiii
Copy link
Owner

I might try hoyolab-auto tonight because this issue is really annoying LOL However, I want to ask how the redeem code functionality in hoyolab-auto works From the code I haven't seen anything related to finding new redemption codes, and if it has something similar to code.js in starrail-auto. If it's the first time running, will there be a code.js or a message about redemption?

redeem code is currently is under development, and not yet implemented as of now, but the idea is mostly the same of the current one on starrail-auto.

before you tried the hoyolab-auto, remember to do this step before running it

For the accounts that receive captchas, can you solve them and refresh the Battle Records at least two times to ensure you don't get any captcha before running the script? If you do, repeat the step until you don't receive any captcha (don't forget to refresh the page one or two times).

@Capoouo
Copy link

Capoouo commented Jun 13, 2024

Sure, I understand. Looking forward to your implementation of the redeem code (the reason I'm more involved in this project is because of LOL)
Thank you for continuously updating your project <3

@Bestfast
Copy link
Author

Sure, I understand. Looking forward to your implementation of the redeem code (the reason I'm more involved in this project is because of LOL) Thank you for continuously updating your project <3

Did you try that solution? I have been busy the whole week and didn't have time to

@Capoouo
Copy link

Capoouo commented Jun 22, 2024

Sure, I understand. Looking forward to your implementation of the redeem code (the reason I'm more involved in this project is because of LOL) Thank you for continuously updating your project <3

Did you try that solution? I have been busy the whole week and didn't have time to

I'm currently still using this project. As for the other project, hoyolab-auto, I see that the author is still continuously updating it. I plan to use it once it becomes more stable. For now, I've turned off the stamina reminder to avoid those annoying messages, LOL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants