Check out napkatti fork on setting variables and running locally napkatti fork
Click button at bottom for next step
You will need to install Git and Heroku if you wish to use Heroku for the login helper.
Follow the instructions and sign into Heroku after installing the CLI from either command prompt or terminal whichever you use.
A GitHub account is not required/needed to clone this repo, you only need a Heroku account.
You need a credit card for the heroku-scheduler portion, don't worry they will not charge you (this is just to prevent abuse). You can use a prepaid credit card or similar for this if you don't want to use your actual card.
This will create a new folder genshin-impact-helper
in the working directory path you executed the command, when you first open command prompt it'll usually take you to C:\Users\YOUR-NAME
, you can type start .
in command prompt to see where it will be cloned.
git clone https://github.com/am-steph/genshin-impact-helper.git
Do not close the command prompt, keep it open
You can either create a app from your Heroku dashboard or just run heroku create
If you use heroku create
, it will make a random app name (e.g. alphine-15735)
This is a repeat of the instructions in the image above for copy and pasting/clarification
Login to Heroku if you haven't already. It should bring up a webpage to login.
heroku login
Navigate to your project folder, because we cloned this repo we enter cd genshin-impact-helper
cd genshin-impact-helper
git init
heroku git:remote -a YOUR-APP-NAME-HERE #replace YOUR-APP-NAME-HERE with the app name of your heroku application
git add .
git commit -am "initial commit"
git push heroku master
This is roughly what it should look like and the expected output when you enter in the commands.
If for some magical reason it fails to push, try git push heroku HEAD:master
(Thanks to doraemon#9784 for finding this)
To get your cookie go to the Daily Check-In event website https://webstatic-sea.mihoyo.com/ys/event/signin-sea/index.html?act_id=e202102251931481&lang=en-us
Log in with your MiHoYo/Genshin Impact account.
If you have never checked in before, manually check in once to ensure that your cookies are set properly.
Open the developer tools on your web browser (F12 on firefox/chrome)
Click on the "Console" tab
Type in document.cookie
in the console
If you are getting list index out of range
Don't copy the quotation marks
Value should look like: login_ticket=xxx; account_id=696969; cookie_token=xxxxx; ltoken=xxxx; ltuid=696969; mi18nLang=en-us; _MHYUUID=xxx
The semi-colons seperate the values (e.g. login_ticket=
and account_id=
are different values), the order these values are in doesn't matter, it can start with login_ticket
or it could start with ltoken
, but make sure you have every value listed above.
Go to Google and type 'what is my user agent' and copy your user agent
Enter USER_AGENT
in KEY and your user agent you copied in VALUE and click Add.
Your token should look like this
**IF YOU WANT TO CHECK-IN MULTIPLE GENSHIN ACCOUNTS:**
1. Paste your first cookie into the Value box on Heroku, but do not click "Add" yet.
2. Open a new private browsing / Incognito window
3. Go to the MiHoYo event website on your new browser instance, and log in with your second account
4. Copy the `document.cookie` as before
5. Go back to the Heroku page, and type a hash `#` at the end of your first cookie
6. Paste your second cookie immediately after the `#` and remove the quotation marks "" if needed
7. Click "Add"
You can always click the pencil icon later on to edit your OS_COOKIE value if you want to add another account
If you wish to add a Discord webhook to receive notifications when the login helper runs, you can add another key value DISCORD_WEBHOOK
. Look at the end of the page to see where you can get your webhook.
- Go to Resources tab and add the Heroku Scheduler add-on, don't worry this is free
- Create a new job, set it to run everyday at the time you wish (time is in UTC)
For the command, put python run.py
If you want to test to see if your script will run go back to your command window and type heroku run bash
. After you are loaded in, type python run.py
and check.
There is a random sleep time inserted in the script, if it says sleeping for x amount of time just wait it out.
If you no longer want to check in automatically, you can disable/delete the scheduler
This is an OPTIONAL step to let the script send you a notification on Discord whenever it runs a check-in.
- Edit channel settings. (Create your own discord server or private channel for this)
- Go into Integrations and view webhooks.
- Create a new webhook and copy the URL.
- Go back to the "Settings" tab on the app and add a new KEY called DISCORD_WEBHOOK and paste in the URL.
To stop receiving Discord notifications, delete your DISCORD_WEBHOOK secret.