From 03de06d9bdb6bfb0596c9b1cf579e98431c1effb Mon Sep 17 00:00:00 2001 From: "DESKTOP-NPVP038\\gosha" Date: Fri, 26 Aug 2022 21:02:03 +0300 Subject: [PATCH 1/3] Update browser-cookie3 (fix browsers cookie paths) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d0abe16..4fbb1e0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ altgraph==0.17 -browser-cookie3==0.12.1 +browser-cookie3==0.16.0 certifi==2020.12.5 cffi==1.14.5 chardet==4.0.0 From 3a1f376d2d045a26d364edd9d8ef6f99b54db146 Mon Sep 17 00:00:00 2001 From: "DESKTOP-NPVP038\\gosha" Date: Fri, 26 Aug 2022 21:08:31 +0300 Subject: [PATCH 2/3] Update mihoyo links --- config.json | 2 +- main_windows.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config.json b/config.json index a341902..908f5e7 100644 --- a/config.json +++ b/config.json @@ -5,6 +5,6 @@ "RANDOMIZE": true, "RANDOM_RANGE": 3600, "ACT_ID": "e202102251931481", - "DOMAIN_NAME": ".mihoyo.com", + "DOMAIN_NAME": ".hoyolab.com", "SCHEDULER_NAME": "HoyolabCheckInBot" } diff --git a/main_windows.py b/main_windows.py index e52490a..8246ecb 100644 --- a/main_windows.py +++ b/main_windows.py @@ -44,7 +44,7 @@ 'RANDOMIZE': False, 'RANDOM_RANGE': 3600, 'ACT_ID': 'e202102251931481', - 'DOMAIN_NAME': '.mihoyo.com', + 'DOMAIN_NAME': '.hoyolab.com', 'SCHEDULER_NAME': 'HoyolabCheckInBot' } config_file = open(os.path.join(app_path, 'config.json'), 'w') @@ -113,9 +113,9 @@ def getDailyStatus(): headers = { 'Accept': 'application/json, text/plain, */*', 'Accept-Language': 'en-US,en;q=0.5', - 'Origin': 'https://webstatic-sea.mihoyo.com', + 'Origin': 'https://act.hoyolab.com', 'Connection': 'keep-alive', - 'Referer': f'https://webstatic-sea.mihoyo.com/ys/event/signin-sea/index.html?act_id={config["ACT_ID"]}&lang=en-us', + 'Referer': f'https://act.hoyolab.com/ys/event/signin-sea-v3/index.html?act_id={config["ACT_ID"]}&lang=en-us', 'Cache-Control': 'max-age=0', } @@ -125,7 +125,7 @@ def getDailyStatus(): ) try: - response = requests.get('https://hk4e-api-os.mihoyo.com/event/sol/info', + response = requests.get('https://sg-hk4e-api.hoyolab.com/event/sol/info', headers=headers, params=params, cookies=cookies) return response.json() except requests.exceptions.ConnectionError as e: @@ -155,9 +155,9 @@ def claimReward(): 'Accept': 'application/json, text/plain, */*', 'Accept-Language': 'en-US,en;q=0.5', 'Content-Type': 'application/json;charset=utf-8', - 'Origin': 'https://webstatic-sea.mihoyo.com', + 'Origin': 'https://act.hoyolab.com', 'Connection': 'keep-alive', - 'Referer': f'https://webstatic-sea.mihoyo.com/ys/event/signin- sea/index.html?act_id={config["ACT_ID"]}&lang=en-us', + 'Referer': f'https://act.hoyolab.com/ys/event/signin-sea-v3/index.html?act_id={config["ACT_ID"]}&lang=en-us', } params = ( @@ -167,7 +167,7 @@ def claimReward(): data = {'act_id': config['ACT_ID']} try: - response = requests.post('https://hk4e-api-os.mihoyo.com/event/sol/sign', + response = requests.post('https://sg-hk4e-api.hoyolab.com/event/sol/sign', headers=headers, params=params, cookies=cookies, json=data) return response.json() except requests.exceptions.ConnectionError as e: From 4ac82145d4dfe1ab2cc9d5f094f5f2f9020f2382 Mon Sep 17 00:00:00 2001 From: "DESKTOP-NPVP038\\gosha" Date: Sun, 28 Aug 2022 23:05:31 +0300 Subject: [PATCH 3/3] Update cookie name to long-expired cookie --- main_windows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main_windows.py b/main_windows.py index 8246ecb..d182db7 100644 --- a/main_windows.py +++ b/main_windows.py @@ -79,7 +79,7 @@ found = False for cookie in cookies: - if cookie.name == "cookie_token": + if cookie.name == "ltoken": found = True break if not found: