Watch
1
0
Fork
You've already forked hoyolab-auto-daily
1
mirror of https://github.com/sglkc/hoyolab-auto-daily.git synced 2026-11-16 19:41:39 +00:00
hoyolab-auto-daily/README.md
SlashNephy 3bd08f4fd5 feat: make check-in language configurable via HOYOLAB_LANG variable
The check-in request hardcoded `lang=en-us`, so the reward messages HoYoLAB
shows in game and in the check-in history were always English. Read the locale
from an optional `HOYOLAB_LANG` repository variable instead, defaulting to
`en-us`.

The name is prefixed rather than a plain `LANGUAGE` to avoid colliding with the
GNU gettext variable of that name when running index.js locally.

`||` is used rather than `??` because an unset repository variable is injected
as an empty string by Actions, which `??` would pass through as an empty `lang`.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-12 09:40:19 +09:00

210 lines
8.7 KiB
Markdown

# Hoyolab Auto Daily Check In
Today's check in status:
[![If you see this text, chances are the automation hasn't run. Do your setup below!](../../actions/workflows/login.yml/badge.svg)](../../actions/workflows/login.yml)
Repository version:
[![Do your setup!](../../actions/workflows/version.yml/badge.svg)](../../actions/workflows/version.yml)
## Table of Contents
- [Getting your cookie](#getting-your-cookie)
- [Usage](#usage)
- [Multiple Accounts](#multiple-accounts)
- [Language](#language)
- [Discord Webhook](#discord-webhook)
- [Telegram](#telegram)
- [FAQ](#faq)
- [Is this safe?](#is-this-safe)
- [How to update my (fork) repository version?](#how-to-update-my-fork-repository-version)
- [Error not logged in](#error-not-logged-in)
- [I have other issues](#i-have-other-issues)
## Getting your cookie
You have to check in manually first to get your cookie, follow these steps (click to open screenshot):
1. Open [HoYoLAB](https://www.hoyolab.com/home) and login if you haven't
2. <details>
<summary>Open dev tool (<kbd>Ctrl+Shift+I</kbd> or right click > Inspect)</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/81a57cfa-9f2e-48d7-bec6-5ef4edc3b857" />
</details>
4. <details>
<summary>For Chromium users, click on the Application tab. If not found, click on the arrow.</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/ea4bb233-367c-4c41-8c66-30c2bc2f3150" />
</details>
<details>
<summary>For Firefox/Gecko-based browsers, click on the Storage tab.</summary>
<img src="https://github.com/user-attachments/assets/4e12c315-9a01-4ad8-9e5f-6197328e900f" />
</details>
5. <details>
<summary>On the filter box, type <code>v2</code>. You might want to expand the dev tools to see clearly.</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/bf1eec5f-bb1e-4af2-b37b-3c3c252328db" />
</details>
6. <details>
<summary>Find <code>ltoken_v2</code> and <code>ltuid_v2</code>, click on them, and copy the value below.</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/3ce70d90-6d5d-4353-ab35-8476c44124a1" />
</details>
7. <details open>
<summary>Write <code>ltuid_v2=PASTE_ltuid_v2; ltoken_v2=PASTE_ltoken_v2</code> like the screenshot.</summary>
Writing the line in the browser URL bar makes it easier. Pay attention: use a semicolon (;), not a colon (:)
It should look like this: `ltuid_v2=249806310; ltoken_v2=v2_CAISDG...`
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/4309fcd9-3d6b-43f3-96f2-d8276bea6280" />
</details>
9. Copy that. That's your cookie, keep it save and do NOT share it with anyone!
## Usage
1. [Fork this repo](../../fork)
2. Open your fork repository
3. <details>
<summary>Go to Settings > Secrets and variables > Actions</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/134a2c25-0345-4a46-b84f-5fa928031e5a" />
</details>
4. <details>
<summary>Click on New repository secrets</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/9d77c1d2-60e5-4dd0-a5d4-3b81c1bf0321" />
</details>
5. <details>
<summary>
Insert name with <code>COOKIE</code> and secret with
<a href="#getting-your-cookie">your cookie</a>, then click Add secret
</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/9a450ba4-a155-4a0e-8a48-d730a3be5c73" />
</details>
6. <details>
<summary>Now for the games, go to Variables and click New repository variable</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/5c6c226a-141c-41c2-82f5-8254b1741196" />
</details>
7. <details>
<summary>
Insert name with <code>GAMES</code> and value with the game codes you want to check in, separated by space like the example screenshot.<br/>
Supported values are: <code>zzz</code>, <code>gi</code>, <code>hsr</code>, <code>hi3</code>, <code>tot</code>
</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/01cd1a4b-16ae-4f3c-ba3e-cd3f913e44fa" />
</details>
8. <details>
<summary>
For the first day, you have to trigger this manually.
Simply go <a href="../../actions/workflows/login.yml">HERE</a> and click on Run workflow
</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/ea1e48d2-a069-4db6-bdcd-86eecae8d81d" />
</details>
9. <details>
<summary>Refresh the page, wait for 15-25 secs, and see if it ran successfully. You should now see the check in status on top of README.</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/5c8520ee-a8b7-4c66-bb1b-ef945c499112" />
</details>
10. You're set! Hop on your game the next day and see if you got the rewards
## Multiple Accounts
<details>
<summary>To add other accounts, you can add another cookie and games in a new line like below.</summary>
<img src="https://github.com/user-attachments/assets/99fd25cd-71f6-4aae-9949-11d055fadf73" />
<img src="https://github.com/user-attachments/assets/4a56f4e1-8fb4-4137-acc6-ac30cade78f1" />
</details>
## Language
Check in requests are made in English (`en-us`) by default. The language decides how
HoYoLAB localizes the check in, so the reward messages you see in game and in the
check in history follow it.
To change it, create a new repository *variable* (Settings > Secrets and variables >
Actions > Variables) named `HOYOLAB_LANG` with one of the values HoYoLAB supports:
`zh-cn`, `zh-tw`, `de-de`, `en-us`, `es-es`, `fr-fr`, `id-id`, `it-it`, `ja-jp`,
`ko-kr`, `pt-pt`, `ru-ru`, `th-th`, `tr-tr`, `vi-vn`
Leaving the variable unset keeps the current `en-us` behaviour.
## Discord Webhook
You may use Discord webhook to send notifications to your channel!
1. <details>
<summary>Go to channel settings</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/80f3b2f1-cc55-4316-9153-3fc5026b7da8" />
</details>
2. <details>
<summary>Go to Integrations and click Create Webhook</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/b4d0c07d-35a5-4382-99de-584c70c4d730" />
</details>
3. <details>
<summary>You can edit the name and picture freely, then Copy Webhook URL</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/3df5b59c-edc9-4884-897c-9159e243598e" />
</details>
4. <details>
<summary>Create a new repository <em>variable</em> named <code>DISCORD_WEBHOOK</code> with value of the webhook URL</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/15b029ff-906d-472c-b356-ae9efed4477b" />
</details>
5. <details>
<summary>(Optional) If you want to be tagged on check in, add `DISCORD_USER` variable with your Discord ID.</summary>
<img src="https://github.com/user-attachments/assets/995a4b18-4c22-4dcd-9a2e-90fac74079c1" />
<img src="https://github.com/user-attachments/assets/52dff051-abb4-4cc0-b834-685d49a06731" />
</details>
6. You may trigger the check in manually and see if the messages got sent
## Telegram
You may use a Telegram bot to send notifications to yourself or a group.
1. Open [@BotFather](https://t.me/BotFather) in Telegram, send `/newbot`, and follow the
prompts. It gives you a **bot token** like `123456789:AAE...`
2. Start a chat with your new bot and send it any message (the bot can't message you first).
3. Get your **chat ID**: open
`https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates` in your browser (replace
`<YOUR_TOKEN>`) and copy the number in `"chat":{"id":...}`. For a group, add the bot
to the group first, then read the group's negative chat ID from the same URL.
4. Add two repository *secrets* (Settings > Secrets and variables > Actions):
- `TELEGRAM_TOKEN` with the bot token
- `TELEGRAM_CHAT_ID` with the chat ID
5. Trigger the check in manually and see if the message arrives.
Discord and Telegram are independent — set up either, both, or neither.
## FAQ
### Is this safe?
There should be no issues, automated check-in exists for years and there hasn't been any reports about hoyo doing anything against it
### How to update my (fork) repository version?
<details>
<summary>Go to your repository and click Sync fork</summary>
<img src="https://github.com/sglkc/hoyolab-auto-daily/assets/31957516/08c10262-8a97-433b-b499-143cc116184d" />
</details>
### Error not logged in
This is a common issue even if you seem to get the cookies right. Here's another method to get your cookies:
https://gist.github.com/torikushiii/59eff33fc8ea89dbc0b2e7652db9d3fd
Just copy everything and paste to the COOKIE secret
### I have other issues
To the [Issues page](https://github.com/sglkc/hoyolab-auto-daily/issues)