Closed djdoolky76 closed 4 months ago
that's cookie related issue, try refreshing your cookies first
that's cookie related issue, try refreshing your cookies first
It's been five days since the last time I got the cookie, and issues related to this have also arisen. Is there a better way to handle this situation now?
It's been five days since the last time I got the cookie, and issues related to this have also arisen. Is there a better way to handle this situation now?
I'll try looking into it, but so far non of my accounts is needed refreshing since weeks
I refreshed my cookie just yesterday, and this happened for me as well.
@djdoolky76 @Capoouo @abigailwillow as of this commit, i've added a method that should refresh your cookie every 2 hour, if some of you still using
config.js
file, please migrate toconfig.jsonc
using this guide for easier migration
Thank you for the quick update <3 BTW, I encountered this message. Will it cause any other issues?
2024-07-17 21:12:58 hoyolab-auto | 2024-07-17 21:12:58
Or can I just ignore it?
You can safely ignore it. It's just the website is not reachable at the moment.
You can safely ignore it. It's just the website is not reachable at the moment.
I noticed that it has been changed to JSON5, but currently, mine is JSONC. So, I need to run convert.js to JSON5, right? In that case, do I need to modify the code in convert.js to convert JSONC to JSON5?
edit : I used an online formatter to convert JSONC to JSON5 and changed the format to JSON5. Currently, there are no issues
I noticed that it has been changed to JSON5, but currently, mine is JSONC. So, I need to run convert.js to JSON5, right? In that case, do I need to modify the code in convert.js to convert JSONC to JSON5?
edit : I used an online formatter to convert JSONC to JSON5 and changed the format to JSON5. Currently, there are no issues
Sorry for this, there was a small transition period between the two. For anyone else still running into this issue, the following code can be used to convert JSONC to JSON5.
const file = require("node:fs");
const JSON5 = require("json5");
const { jsonc } = require('jsonc');
const config = jsonc.readSync("./config.jsonc");
function kebabToCamelCase (object) {
for (const key of Object.keys(object)) {
if (object[key] && typeof object[key] === "object" && !Array.isArray(object[key])) {
kebabToCamelCase(object[key]);
}
const convertedKey = key.replace(/-./g, match => match[1].toUpperCase());
if (key !== convertedKey) {
object[convertedKey] = object[key];
delete object[key];
}
}
}
kebabToCamelCase(config);
file.writeFileSync("./config.json5", JSON5.stringify(config, null, 4));
console.log("config.jsonc converted to config.json5");
[!NOTE] This requires the JSONC package to be installed, which can be installed by running the
npm i jsonc
command in your terminal.
I'm going to close this issue. Three days have passed since the testing, and the cookie issue seems fixed. Thanks for the hard work @torikushiii
I'm still experiencing the issue. Could multiple accounts from various locations cause cookie invalidation? The code redemption fails on all accounts except for the first.
@JustArion multiple accounts should not be causing this, I have 3 accounts currently running with redemption code enabled and never had any issue with this, try refreshing your cookie first and see how it goes, if the problem still persist I'll try investigate it further.
mine is still fine, I'm using multiple accounts and all codes redeemed successfully
@JustArion multiple accounts should not be causing this, I have 3 accounts currently running with redemption code enabled and never had any issue with this, try refreshing your cookie first and see how it goes, if the problem still persist I'll try investigate it further.
The issue still persists. I refreshed the cookie. It works when testing redeem code. I wait a few days. It prompts to log in again.
The project is running on a VPS in a docker container running 24/7
@JustArion alright, thank you for letting me know, I'll try to replicate this issue if possible and figure it out how to deal with this.
@torikushiii Here's some additional info I hope might be useful. I've noticed my ./data/
folder is empty (apart from the README.md
)
I've also taken the liberty to attach the logs from make logs
for you under the debug
log level (accounts redacted for anonymity, hope you can understand)
logs.log
I've also attached my current config file (File extension renamed to be able to upload to GitHub .json5 -> .json
).
config.json
The above was done after doing a git pull
and a make update
then waiting for a code check. and then doing a manual redeem via Discord for a fake key.
My assumption would be that the tokens aren't refreshed or they're not stored on my end. Is there a way I can confirm / remedy this?
@JustArion is this still regarding the same issue with this topic?
token should be refreshed every 2 hour as you can see here
https://github.com/torikushiii/hoyolab-auto/blob/main/crons/update-cookie/index.js
and here
you should see a log if any of the cookie update is failed.
As far as I know, Hoyo can invalidate your cookie for various reasons, and I'm not sure which ones yet. One of the reasons could be logging out from Hoyolab, changing the password, or they could just invalidate it because they detect that the device fingerprint does not match. I'm still exploring options, but so far, no luck.
@JustArion is this still regarding the same issue with this topic?
Yea
As far as I know, Hoyo can invalidate your cookie for various reasons, and I'm not sure which ones yet. One of the reasons could be logging out from Hoyolab, changing the password, or they could just invalidate it because they detect that the device fingerprint does not match. I'm still exploring options, but so far, no luck.
Alrighty, good luck!
For note regarding my current VPS, the associated IP has the following info from ipapi that may be of interest.
is_bogon : False
is_mobile : False
is_crawler : False
is_datacenter : True
is_tor : False
is_proxy : False
is_vpn : False
is_abuser : False
With an abuser score of 0.0024 (Low)
Seems auto redeem is not working. Same on other Hoyoverse games, but auto check-in works fine