canaria3406 / hoyolab-auto-sign

A lightweight, secure, and free script that automatically collect Hoyolab daily check in rewards. Supports Genshin Impact, Honkai Impact 3rd, and Honkai: Star Rail.
MIT License
332 stars 40 forks source link

Can I run this with node on my home server? #21

Closed Deses closed 8 months ago

Deses commented 11 months ago

Title.

I'd rather not use someone elses computer when I have mine. :P

canaria3406 commented 11 months ago

Of course, yes. But you should change the code that relies on Google Apps Script's UrlFetchApp feature to http request service, such as axios.

Deses commented 11 months ago

I was doing the port and I was always getting Not logged in as a response.

To do a sanity check I ran your unmodified script in Google's App Script and I'm getting the same response with my cookie, and I have all the necessary info in:

token:
  account_mid_v2=XXXXXXuq6d_hy;
  account_id_v2=95XXXXXX;
  ltoken_v2=v2_XXXXXXXXXXFhcTNzM2d1OBokN2FXXXXXXTQtNTE1Ni00MDIxLTlhMzUtYjXXXXXXXXXXMTg0IK_FtqYGKNSBXXXXXXviLQ;
  ltmid_v2=XXXXXXuq6d_hy;
  ltuid_v2=95XXXXXX;"
Deses commented 11 months ago

https://github.com/canaria3406/hoyolab-auto-sign/issues/20#issuecomment-1670062380 also fixed my issue I was having with the Node version. Right now is working and getting a successful response

  data: {
    data: null,
    message: "Traveler, you've already checked in today~",
    retcode: -5003
  }

Excellent!