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

Not working for Genshin #16

Open
alohadude3 opened this issue Jun 16, 2023 · 18 comments
Open

Not working for Genshin #16

alohadude3 opened this issue Jun 16, 2023 · 18 comments

Comments

@alohadude3
Copy link

The script seems to be no longer working for Genshin (Still works for Honkai and Star Rail).

@TheTychoStar
Copy link

Same here. Started about 3 days ago. Discord push message says "sign OK" but actually it did not sign. If I try to sign in manually with hoyolab, an image verification pops up.

@thanminh24
Copy link

I think that it might be some kind of anti-bot thing because when I use an alt to sign in manually there is no verification.
So the solution might be to try manual for a couple of days I guess

@TheTychoStar
Copy link

I guess so. In this case the bot should return an error message to indicate the failure of signing in. However, it send an "OK" message to the discord server. This should be fixed I believe.
Mihoyo added intensive anti-bot verification on the CN server which made auto sign-in nearly impossible. Hopefully, this won't happen to the international server.

@cd36th
Copy link
Contributor

cd36th commented Jun 18, 2023

Might be a bit hard to fix the "OK" message, as this is what HoYoLAB is returning from the API request. HoYoLAB is telling us that the check-in worked when it didn't.

@Chillrend
Copy link
Contributor

Chillrend commented Jun 18, 2023

Can we maybe add user-agent, and x-http-referrer reader to the scripts and. The end-server are probably checking for user agents and referrer like mentioned here: #11 (comment)

My account started to require captchas this day after succesfully checking in with the script for 12 days

I will try to add the code to the header below to my scripts, and will report the result here tomorrow:

const header = {
    Cookie: token,
    'x-rpc-app_version': '2.34.1',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
    'x-rpc-client_type': '4',
    'Referer': 'https://webstatic.mihoyo.com/',
    'Origin': 'https://webstatic.mihoyo.com'
  };

@cd36th
Copy link
Contributor

cd36th commented Jun 19, 2023

this change to header worked for me

@Chillrend
Copy link
Contributor

this change to header worked for me

My account still requires captcha even after putting those header in the script.

The verification process probably done randomly or after certain days passed after checking-in without a user-agent/referrer, just a speculation though, cannot confirm anything...

Probably we want to push in the header changes to main anyway, just to make the script more like a human action to hoyoverse server logs.

@cd36th
Copy link
Contributor

cd36th commented Jun 19, 2023

yeah i agree, do u wanna do the pull request? i dont wanna take credit for ur work lmao

@Chillrend
Copy link
Contributor

I've opened one at #17 please have a look

@Chillrend
Copy link
Contributor

Today, the script successfully checked in my genshin account without captcha verification.

Will report here again if the captcha came back.

@canaria3406
Copy link
Owner

canaria3406 commented Jun 20, 2023

{
    "retcode": 0,
    "message": "OK",
    "data": {
        "code": "ok",
        "first_bind": false,
        "gt_result": {
            "risk_code": 5001,
            "gt": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "challenge": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "success": 1,
            "is_risk": true
        }
    }
}

This is an example of API response.
Based on current testing results:
If the script fails because of captcha, it returns risk_code=5001 or 5003, success = 1, is_risk=true.
If the script executes successfully, it returns risk_code=0, success=0, is_risk=false.

I am temporarily using is_risk=true or false to determine whether captcha is acting, but need more tests.
(Also, thanks for submitting #17)

@alohadude3
Copy link
Author

A commit in a similar python project seems to include some challenge parameters in the header:
thesadru/genshin.py@2d6f7d1
Though I'm not sure where you would get the actual solved challenge parameter from.

@djdoolky76
Copy link

seems to be working once again by doing nothing. although the captcha in the browser still showed up when you claim check in manually

@TheProJeckt
Copy link

It´s broken for me again :(
(Broke today)

(Telegramm)
Check-in completed for (me)
Genshin: Auto check-in failed due to CAPTCHA blocking. Please stop this script immediately and perform manual check-in for at least one week before attempting to use this script again.

After I manually collected it, it´s giving me the same message.

@Jimbo-Coder
Copy link

Jimbo-Coder commented Jun 27, 2023

Not working for me today, and using updated HTTP Headers from the Pull request #17 . I just started using this a few days ago so I have never ran the code without the HTTP headers.

HSR is functional, Genshin is encountering the CAPTCHA even after manually collecting.

Edit: Update on Functionality.
After 1 day of manually collecting the rewards by preforming the CAPTCHA/Check in on my phone for Genshin, the script worked for both Genshin and HSR the next day. I Will update this comment.

I don't fully understand tokens/http headers, but it seems like if the exact same HTTP check in request 2 days in a row (perhaps also same time of day) occurs, then the CAPTCHA is triggered for Checkin.

@Chillrend
Copy link
Contributor

Mine also started breaking today.

I can see some repo (like one mentioned above) might able to successfully bypass the geetest captcha, but i would not want to do it. Pretty sure it's borderline against their ToS.

Will report here again if i find another solution.

@ChristopherKlay
Copy link

Pretty sure it's borderline against their ToS.

The entire script already is.

@Deses
Copy link

Deses commented Aug 9, 2023

I needed to change const bannedCheck = hoyolabResponse.data?.gt_result?.is_risk; to const bannedCheck = hoyolabResponse.data.data?.gt_result?.is_risk; (add one more data) because the first one returns undefined, there are two data nodes and we need to get the deepest one.

...
    [Symbol(kUniqueHeaders)]: null
  },
  data: {
    retcode: 0,
    message: 'OK',
    data: { code: 'ok', first_bind: false, gt_result: [Object] }
  }
}

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