Skip to content

Commit

Permalink
Fix error with daily reward routes
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati authored and KT-Yeh committed Oct 10, 2024
1 parent 7a7cb43 commit ea4d9b5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions genshin/client/components/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ async def request_daily_reward(
base_url = routes.REWARD_URL.get_url(self.region, game)
url = (base_url / endpoint).update_query(**base_url.query)

if game is types.Game.GENSHIN:
headers["x-rpc-signgame"] = "hk4e"
elif game is types.Game.ZZZ:
headers["x-rpc-signgame"] = "zzz"

if self.region == types.Region.OVERSEAS:
params["lang"] = lang or self.lang
headers["referer"] = "https://act.hoyolab.com/"
Expand All @@ -66,14 +71,8 @@ async def request_daily_reward(
headers["x-rpc-channel"] = "miyousheluodi"
headers["x-rpc-device_model"] = str(self.hoyolab_id) or ""

if game == types.Game.GENSHIN:
headers["x-rpc-signgame"] = "hk4e"

headers["ds"] = ds_utility.generate_dynamic_secret(constants.DS_SALT["cn_signin"])

else:
raise TypeError(f"{self.region!r} is not a valid region.")

if challenge:
headers["x-rpc-challenge"] = challenge["challenge"]
headers["x-rpc-seccode"] = challenge["seccode"]
Expand Down

0 comments on commit ea4d9b5

Please sign in to comment.