This guide provides one method to extract cookies from your HoyoLab profile. These cookies can be used for various purposes, such as automating tasks with scripts. Follow the steps carefully to ensure you obtain the required cookies correctly.
Warning
Please login through incognito mode and proceed with the steps below to ensure that you're getting the correct cookies.
-
Go to your HoyoLab profile and log in with your Hoyoverse account.
-
Open the browser console by pressing
F12
. -
Navigate to the Network tab.
-
Search for
getGameRecordCard
in the network requests and click on the result. (If you didn't see anything, refresh the page while keeping the browser console open) -
Go to the Headers tab and scroll down to find Request Headers. Copy all the cookie values.
-
Rename
default.config.js
toconfig.js
-
Paste the copied cookie into your
config.js
file, and your cookie value should look like this
{
id: 2,
active: true,
type: "genshin",
data: [
{
cookie: "mi18nLang=xxxx; _MHYUUID=xxxx; HYV_LOGIN_PLATFORM_OPTIONAL_AGREEMENT=xxxx; e_nap_token=xxxx; cookie_token_v2=xxxx; account_mid_v2=xxxx; account_id_v2=xxxx; ltoken_v2=xxxx; ltmid_v2=xxxx; ltuid_v2=xxxx; HYV_LOGIN_PLATFORM_LOAD_TIMEOUT=xxxx; DEVICEFP_SEED_ID=xxxx; DEVICEFP_SEED_TIME=xxxx; DEVICEFP=xxxx; HYV_LOGIN_PLATFORM_TRACKING_MAP=xxxx; HYV_LOGIN_PLATFORM_LIFECYCLE_ID=xxxx",
redeemCode: false,
dailiesCheck: true,
weekliesCheck: true,
stamina: {
check: false,
threshold: 150,
persistent: false
},
expedition: {
check: false,
persistent: false
}
}
]
}
- Run the script using
npm start
ornode index.js
.