Code Monkey home page Code Monkey logo

Comments (9)

c436zhan avatar c436zhan commented on September 20, 2024

Turns out that my ad blocker blocked ltmid_v2 and ltuid_v2. Still getting ltoken_v2 undefined after turning my ad block off. Same issue for my friend as well.

from hoyolab-auto-sign.

AndreiAdii avatar AndreiAdii commented on September 20, 2024

To get the token go to Honkai: Star Rail for example, in console type "document.cookie" and you get your cookie. If not, go to Network, and check "Preserve Log", reload the page, go pack to Console type that again and you should get it. That's what i did

from hoyolab-auto-sign.

Deses avatar Deses commented on September 20, 2024

Even worse, I'm getting account_mid_v2=undefined; account_id_v2=undefined; ltoken_v2=undefined; ltmid_v2=undefined; ltuid_v2=undefined;

🤷

Maybe it's because I'm using Brave or my HoyoLab is set to spanish.

Using Edge and with hoyolab in english worked. (it was like that using edge for some reason, I didn't change it)

from hoyolab-auto-sign.

Deses avatar Deses commented on September 20, 2024

I had to use https://chrome.google.com/webstore/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc/ to properly get ltoken_v2.

IDK why getCookie is not retrieving data correctly on any of my browsers. But it's good to know this workaround.

from hoyolab-auto-sign.

Deses avatar Deses commented on September 20, 2024

I logged out and back into HoyoLab and now my cookie has none of these values set:

account_mid_v2 account_id_v2 ltoken_v2 ltmid_v2 ltuid_v2

And now I have ltoken ltuid cookie_token account_id

from hoyolab-auto-sign.

canaria3406 avatar canaria3406 commented on September 20, 2024

Try :

function getCookie(name) {
  const value = `; ${document.cookie}`;
  const parts = value.split(`; ${name}=`);
  if (parts.length === 2) return parts.pop().split(';').shift();
}
let token = 'Error';
if (document.cookie.includes('ltoken=')) {
  token = 'ltoken=' + getCookie('ltoken') + '; ltuid=' + getCookie('ltuid') + ';';
} else if (document.cookie.includes('ltoken_v2=')) {
  token = 'account_mid_v2=' + getCookie('account_mid_v2') + '; account_id_v2=' + getCookie('account_id_v2') + '; ltoken_v2=' + getCookie('ltoken_v2') + '; ltmid_v2=' + getCookie('ltmid_v2') + '; ltuid_v2=' + getCookie('ltuid_v2') + ';';
}
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';
}

If you get ltoken, then use ltoken. If you get ltoken_v2, then use ltoken_v2.

from hoyolab-auto-sign.

Deses avatar Deses commented on September 20, 2024

I finally got an "OK" as a response using Google's AS with this updated script!

Today it got token = 'ltoken=' + getCookie('ltoken') + '; ltuid=' + getCookie('ltuid') + ';';

Maybe they reverted back to the "old" tokens.

from hoyolab-auto-sign.

c436zhan avatar c436zhan commented on September 20, 2024

Able to get the token now

from hoyolab-auto-sign.

AureliusGemini avatar AureliusGemini commented on September 20, 2024

its broken again.
i got to do it manually using filter and search lt

from hoyolab-auto-sign.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.