Get hoyo daily login rewards automatically!
Project description
hoyo-daily-login-helper
Get hoyo daily login rewards automatically!
Usage
- Get your cookie string, open the daily check in page
- Open a development console (F12) and insert the following code:
document.cookie
- Copy the returned string should be something like "ltoken=....; account_id=....;" this is your cookie string
- Open a terminal with the command prepared and enter:
$ hoyo-daily-logins-helper --cookie="your cookie string" --genshin
(or--starrail
for Honkai Star Rail) - Done!
Installation
Docker
The command line options are also available via environment variables which allows you to easily run this script in Docker/Podman!
$ docker run --rm --env HOYO_GAME=starrail --env HOYO_COOKIE="your cookie string" ghcr.io/atomicptr/hoyo-daily-logins-helper
pip
$ pipx install hoyo-daily-logins-helper
Note: While regular pip should work, it's highly recommended installing this tool via pipx instead!
PyPi: https://pypi.org/project/hoyo-daily-logins-helper/
Configuration
Cookie
You can provide the cookie information either via the HOYO_COOKIE environment variable or using the --cookie CLI flag.
Game
You can provide the cookie information either via the HOYO_GAME environment variable or using the --game NAME/--genshin/--starrail CLI flags.
Supported Games:
- Genshin Impact (genshin)
- Honkai: Star Rail (starrail)
- Honkai Impact 3rd (honkai)
- Tears of Themis (themis)
Debug mode
If something doesn't work properly and/or you want to report an issue try running the tool with the DEBUG_MODE environment variable set to 1! Or provide the --debug flag!
$ HOYO_DEBUG=1 hoyo-daily-logins-helper --starrail --cookie="..."
Language
If you want to see the results in other languages than English you can change it via the HOYO_LANGUAGE environment variable or the --language CLI flag
$ HOYO_LANGUAGE=ja-jp hoyo-daily-logins-helper --genshin --cookie="..."
Multiple accounts
You can run this tool for multiple accounts at once:
$ hoyo-daily-logins-helper --game genshin --cookie "cookie for acc 1" --game starrail --cookie "cookie for acc 2"
If you want to do this with environment variables it works basically the same, you just have to seperate the values by a ","
$ HOYO_GAME=genshin,starrail HOYO_COOKIE="cookie 1 data...,cookie 2 data..." hoyo-daily-logins-helper
Although I'd recommend you to use a configuration file for this (see the next point)
Configuration file
If there is a file called "hoyo-daily-logins-helper.toml" in the current working directory (or you provided one via --config-file) the tool will read data from there.
$ hoyo-daily-logins-helper --config-file ~/.my-hoyo-logins-helper-config.toml
Content:
# you can configurate some things here like the language or the user agent
# keep in mind that config and every key in there is optional and you can omit it
[config]
user-agent = "My fancy user agent"
language = "en-us"
# every account starts with this index/key
[[accounts]]
# accounts can have identifiers for you to differentiate them in the logs
# you could for instance add your account name or UID here
identifier = "My Genshin Account Name"
# the game identifier which has to be genshin or starrail
game = "genshin"
# and the cookie value
cookie = "My Genshin Cookie..."
# repeat this for every other account you might have
[[accounts]]
identifier = "My Starrail Account #1"
game = "starrail"
cookie = "My Starrail Cookie..."
[[accounts]]
identifier = "My Starrail Account #2"
game = "starrail"
cookie = "My Starrail Cookie..."
Scheduler mode
Scheduler mode can only be used if you are working with a configuration file. To
enable the scheduler mode, set enable_scheduler = true
in the config
section.
[config]
# ...
enable_scheduler = true
[[accounts]]
# ....
This feature also requires you to set account regions which you can do like this:
[config]
# ...
enable_scheduler = true
region = "EU"
[[accounts]]
identifier = "My Starrail Account #1"
game = "starrail"
cookie = "My Starrail Cookie..."
# this account is in the EU region and we set this as the default so you dont have to do anything
[[accounts]]
identifier = "My Starrail Account #2"
game = "starrail"
cookie = "My Starrail Cookie..."
# this account is in a different region so you have to explicitly overwrite this
region = "Asia"
If you are not setting the regions properly the scheduler will run at the wrong time.
Discord notifications
If you want to ping a Discord channel create a webhook and add it to the configuration:
[config]
# ...
notifications = [
{type = "discord", webhook_url = "https://...."}
]
License
GNU General Public License v3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hoyo-daily-logins-helper-2.4.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25d5758a01ef84dbe311dfc3bf8a7395e732de693b6bc91d7c9a36587350a371 |
|
MD5 | af434cf0bcabaa5b5df4348ed3e9fe05 |
|
BLAKE2b-256 | c36fdd03c1c61a825c119a89d39aa9175b2a6b62d14a0bbee90b42ad7a20e8d6 |
Hashes for hoyo_daily_logins_helper-2.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de98ad14c03a2edd7a650ca2632f6aa16ee8a0e04a336b5b8098a2964c3af6f9 |
|
MD5 | b4909dce71e887b4a0429869cc60fbfb |
|
BLAKE2b-256 | 0b308971fb9fec49c5dac8e7f5fe5e3574fd4835cc0df5517a52d008bcedd5e9 |