Add Support to Resolve MiyousheGeetestError #183
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Miyoushe API requests will fail when any request is being sent from an unrecognized device, in a previous commit I implemented a check to raise
MiyousheGeetestError
if that is the case, but there are currently no ways of resolving those errors with the library.Here are 3 ways (that I know) to resolve the error.
1. Pass in Device Information (Easiest to Implement)
This requires the user to have a device that is already "trusted", typically a phone that has the Miyoushe app installed and has been logged in with the Miyoushe account for a long period of time. When requesting, pass in the information of that device through the
device_fp
anddevice_id
headers, and theoretically Miyoushe will think this request is secure and will not raise the error. A possible implementation is to allow users to pass in custom headers duringgenshin.Client
initialization, and the client will use them in all requests.2. Solve the Geetest and Re-Request (WIP)
This is what I am currently working on, though not quite successful.
The code snippet below is what I plan to implement this solution:
However, I encountered an unknown error with retcode
10306
and no error message inverify_mmt
. So, I'm stuck.3. Make the Device Become a Trusted Device
There is little information on this yet, but while looking at gsuid_core's code when I'm trying to resolve the error above, I noticed that it seems to be possible to generate random device information and make them become trusted through API requests, I will look more into this. Also, I'm thinking about adding methods to the auth client that generate random device information, but I need to figure out what
device_fp
,device_id
, andx-rpc-device_id
are.Side Notes
We don't necessarily need to implement all 3 solutions, in fact any one of them being implemented should be enough for the user.
Task List