vermaysha / hoyoapi

HoYoAPI is an unofficial API Wrapper library developed to facilitate communication with the official HoYoLab API.
https://vermaysha.github.io/hoyoapi/
MIT License
68 stars 13 forks source link

Issue: Problems with Cookies in HoYoAPI #151

Open rinaldy143 opened 2 months ago

rinaldy143 commented 2 months ago

Issue: Problems with Cookies in HoYoAPI

Description:

I am encountering two issues related to obtaining and using cookies with HoYoAPI:

  1. HttpOnly Issue with Cookies:

    • The cookies ltoken_v2 and cookie_token_v2 need to have HttpOnly disabled manually in order to be accessible by the script. This is necessary for the script to properly obtain the cookies.
  2. Incompatible Cookie Format:

    • HoYoAPI cannot process cookies named ltoken_v2 and ltuid_v2. These cookies need to be changed to ltoken and ltuid to be recognized and processed correctly by HoYoAPI.

Steps to Reproduce:

  1. Log in to your HoYoLab or Genshin Battlepass account.
  2. Access the cookie retrieval page using the provided script.
  3. Check the names of the retrieved cookies.
  4. Note that the required cookies are ltoken and ltuid, not ltoken_v2 and ltuid_v2.

Expected Solution:

  1. Disable HttpOnly:

    • Additional features or further documentation may be needed to disable HttpOnly for the cookies ltoken_v2 and cookie_token_v2.
  2. Change Cookie Names:

    • There is a need for modification or configuration in HoYoAPI to automatically accept and process cookies named ltoken_v2 and ltuid_v2, or to provide guidance on changing these cookie names to ltoken and ltuid.

Documentation Reference:

Additional Information:

Please let me know if additional information is needed or if there are any interim solutions available.