torikushiii / hoyolab-auto

Auto check-in and others for any Hoyoverse games
https://ko-fi.com/torikushiii
GNU Affero General Public License v3.0
107 stars 24 forks source link

[Suggestion] Method of notifying or updating expired cookie #42

Closed FlamingFox911 closed 4 months ago

FlamingFox911 commented 4 months ago

Hoyolab cookies do not last forever, so ideally there should either be a notification that let's the person know if the cookie has expired, or even better, a method to allow the user directly or indirectly update their cookie. Note that for the latter, it may require user interaction due to captcha.

And I am totally not making this suggestion because I got three notifications of code redemption failures caused by not being logged in, even though I had the cookie setup in the config... 👀

torikushiii commented 4 months ago

5 days ago I pushed a commit that should refresh your cookie automatically https://github.com/torikushiii/hoyolab-auto/commit/b8f7a3b03a6bc39bcd5165890c821445dcc3505b unless it doesn't work properly.

As for sending notifications when cookie is expired, I totally can do that. But let me know first if you are using commit that is older than i mentioned above.

FlamingFox911 commented 4 months ago

I had a version that was from 8 days ago. I pulled the latest changes at around 8:36 AM. Then I got another notification afterwards saying "Code Redeem Failed" again, but with fixed text. image Probably what happened is my cookie expired before I updated my code, and it never had the opportunity to update again. I'll update again if I get another successful code redemption. If not, I'll copy my logs before I rebuild.

FlamingFox911 commented 4 months ago

Redeem Successful, so I guess I just needed to refresh the token myself first after I pulled the latest commits.