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

Cookie token code seems to have stopped working #18

Closed cd36th closed 11 months ago

cd36th commented 11 months ago

Only returns "ltoken=undefined; ltuid=undefined;"

jason21415 commented 11 months ago

i test is works. maybe you should try to log in again.

hoyolab

token f12>console>Paste>get token

function getCookie(name) {
  const value = `; ${document.cookie}`;
  const parts = value.split(`; ${name}=`);
  if (parts.length === 2) return parts.pop().split(';').shift();
}
let token = 'ltoken=' + getCookie('ltoken') + '; ltuid=' + getCookie('ltuid') + ';';
let ask = confirm(token + '\n\nPress enter, then paste the token into your Google Apps Script Project');
if (ask == true) {
  copy(token);
  msg = token;
} else {
  msg = 'Cancel';
}
jason21415 commented 11 months ago

image image

cd36th commented 11 months ago

ok yeah relogging worked thank you, didnt try that because genshin wizard which also uses tokens has disabled token stuff temporarily to fix things