thesadru / genshinstats

PLEASE USE GENSHIN.PY A python library that can get the stats of Genshin Impact players using Mihoyo's API. PLEASE USE GENSHIN.PY
https://thesadru.github.io/pdoc/genshinstats/
MIT License
265 stars 38 forks source link

I have some problems with getting ltuid and ltoken #70

Closed DouleLove closed 1 year ago

DouleLove commented 1 year ago

When i open cookies in developers tools everything there is v2 (e.g. ltoken_v2, ltuid_v2, account_id_v2 etc). How can i solve it? Therefore, i guess, i always get NotLoggedIn exception.

thesadru commented 1 year ago

Just use those. They work too.

DouleLove commented 1 year ago

idk, maybe i do smt wrong, but after getting request code 200 (i used python's debugger to see it), it just calls the function with errors, tf is this?

thesadru commented 1 year ago

May I see the errors?

DouleLove commented 1 year ago

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: NotLoggedIn: Login cookies have not been provided or are incorrect.

thesadru commented 1 year ago

How exactly are you using the library?

Also you should really switch to genshin.py, especially if you're using discord.py

DouleLove commented 1 year ago

I use it like this: max_user_floor = await asyncio.to_thread(get_spiral_abyss, uid=uid, previous=False, cookie={'ltuid': LTUID, 'ltoken': LTOKEN}). i've tried to use genshin.py, but when i import this library, it say "no module named 'ramael'"

DouleLove commented 1 year ago

Actually it isn't required to switch to genshin.py, i guess. Because getting spiral abyss is only function i need

GauravM512 commented 1 year ago

Switching to genshin.py is necessary because discord.py is an asynchronous library, while genshinstats is synchronous. This difference in their nature can lead to blocking issues. Moreover, genshin.py is actively maintained, unlike genshinstats, as mentioned in the readme sections. Therefore, to ensure smooth functionality and avoid potential problems, it's recommended to make the switch.

DouleLove commented 1 year ago

I see. Well, i'll try to figure out problems with that library. Thank you

DouleLove commented 1 year ago

Should i close the issue then?

DouleLove commented 1 year ago

Hey, guys, i know, that it's not connected with your library, but... could you help me, please? I've fixed problem with import genshin.py, but another one occured: pydantic.errors.PydanticUserError: If you use @root_validator with pre=False (the default) you MUST specify skip_on_failure=True. Note that @root_validator is deprecated and should be replaced with @model_validator.

I've tried to set skip_on_failure=True in @root_validator decorator from pydantic.v1 package, but it didn't help. Does someone know how to fix it?