Skip to content

Commit

Permalink
adapt to new star rail gacha url Scighost#1002
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Aug 1, 2024
1 parent f43096e commit 96d9493
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Starward.Core/Gacha/GachaLogClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public abstract class GachaLogClient

protected const string WEB_CACHE_SR_PATH = @"StarRail_Data\webCaches\Cache\Cache_Data\data_2";

protected const string API_PREFIX_SR_CN = "https://api-takumi.mihoyo.com/common/gacha_record/api/getGachaLog";
protected const string API_PREFIX_SR_OS = "https://api-os-takumi.mihoyo.com/common/gacha_record/api/getGachaLog";
protected const string API_PREFIX_SR_CN = "https://public-operation-hkrpg.mihoyo.com/common/gacha_record/api/getGachaLog";
protected const string API_PREFIX_SR_OS = "https://public-operation-hkrpg-sg.hoyoverse.com/common/gacha_record/api/getGachaLog";

protected static ReadOnlySpan<byte> SPAN_WEB_PREFIX_SR_CN => "https://webstatic.mihoyo.com/hkrpg/event/e20211215gacha-v2/index.html"u8;
protected static ReadOnlySpan<byte> SPAN_WEB_PREFIX_SR_OS => "https://gs.hoyoverse.com/hkrpg/event/e20211215gacha-v2/index.html"u8;
Expand Down
2 changes: 1 addition & 1 deletion src/Starward.Core/Gacha/Genshin/GenshinGachaClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected override string GetGachaUrlPrefix(string gachaUrl, string? lang = null
}
return gachaUrl;
}
match = Regex.Match(gachaUrl, @"(https://hk4e-api[!-z]+)");
match = Regex.Match(gachaUrl, @"(https://public-operation-hk4e[!-z]+)");
if (match.Success)
{
gachaUrl = match.Groups[1].Value;
Expand Down
2 changes: 1 addition & 1 deletion src/Starward.Core/Gacha/StarRail/StarRailGachaClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected override string GetGachaUrlPrefix(string gachaUrl, string? lang = null
}
return gachaUrl;
}
match = Regex.Match(gachaUrl, @"(https://api[!-z]+)");
match = Regex.Match(gachaUrl, @"(https://public-operation-hkrpg[!-z]+)");
if (match.Success)
{
gachaUrl = match.Groups[1].Value;
Expand Down

0 comments on commit 96d9493

Please sign in to comment.