A Python script to automate daily check-ins for HoYoLAB games, including Zenless Zone Zero (ZZZ), Genshin Impact (GI), Honkai: Star Rail (HSR), Honkai Impact 3rd (HI3), and Tears of Themis (ToT). The script uses a config.json file for configuration and supports Discord webhook notifications.
- Automates daily check-ins for multiple HoYoLAB accounts and games.
- Configurable via a JSON file (
config.json). - Displays check-in status, including whether the check-in was performed today and total sign-in days.
- Supports Discord webhook for status notifications.
- Clean console output with game names in parentheses, e.g.,
(HSR). - Error handling for invalid cookies, network issues, and configuration errors.
- Automatically creates a default
config.jsonif none exists. - Logs debug information for API issues.
- Clone or download this repository.
- Install the required packages:
pip install requests
- Run the script to generate a default
config.json:python main.py
- Edit
config.jsonwith your account details (see Configuration).
The script uses a config.json file in the same directory. A default file is created if none exists. The structure is as follows:
{
"accounts": [
{
"cookie": "ltuid_v2=your_ltuid; ltoken_v2=your_ltoken",
"games": ["zzz", "gi", "hsr", "hi3", "tot"]
},
{
"cookie": "ltuid_v2=another_ltuid; ltoken_v2=another_ltoken",
"games": ["gi", "tot"]
}
],
"discord": {
"webhook_url": "https://discord.com/api/webhooks/...",
"user_id": "your_discord_user_id"
}
}accounts: List of accounts, each with acookieand a list ofgamesto check in.discord: Optional Discord webhook URL and user ID for notifications.- Valid games:
zzz,gi,hsr,hi3,tot.
To get your HoYoLAB cookie, you must first check in manually. Follow these steps:
- Visit HoYoLAB and log in.
- Open developer tools (press
Ctrl+Shift+Ior right-click and select "Inspect"). - Navigate to the appropriate tab:
- For Chromium-based browsers (e.g., Chrome, Edge), go to the Application tab. If not visible, click the double-arrow to expand.
- For Firefox, go to the Storage tab.
- In the filter box, type
v2to locate relevant cookies. - Find
ltoken_v2andltuid_v2, click each, and copy their values. - Format the cookie as:
ltuid_v2=your_ltuid_v2; ltoken_v2=your_ltoken_v2- Example:
ltuid_v2=249806310; ltoken_v2=v2_CAISDG... - Use a semicolon (
;) between values, not a colon.
- Example:
- Copy the formatted string. This is your cookie. Keep it secure and never share it!
Run the script using:
python main.py--accounts: Specify account indices (0-based) to process:python main.py --accounts 0 1
--games: Specify games to check in:python main.py --games hsr gi
The script will:
- Load or create
config.json. - Process check-ins for each account and game.
- Display check-in status and available rewards (if provided by the API).
- Send Discord notifications if configured.
- Exit with an error if any issues occur.
Feel free to open issues or submit pull requests for improvements or bug fixes.
Licensed under the MIT License. See the LICENSE file for details.