diff --git a/NOWT/Helpers/LiveMatch.cs b/NOWT/Helpers/LiveMatch.cs index 0f7de11..e68c1b2 100644 --- a/NOWT/Helpers/LiveMatch.cs +++ b/NOWT/Helpers/LiveMatch.cs @@ -1134,19 +1134,22 @@ private static async Task TrackerAsync(string username) try { var encodedUsername = Uri.EscapeDataString(username); - var url = new Uri("https://tracker.gg/valorant/profile/riot/" + encodedUsername); + var url = new Uri( + "https://api.tracker.network/api/v2/valorant/standard/profile/riot/" + + encodedUsername + ); var response = await DoCachedRequestAsync( Method.Get, url.ToString(), false, false, false, - true + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 OverwolfClient/0.190.0.13" ) .ConfigureAwait(false); var numericStatusCode = (short)response.StatusCode; if (numericStatusCode == 200) - return url; + return new Uri("https://tracker.gg/valorant/profile/riot/" + encodedUsername); } catch (Exception e) { diff --git a/NOWT/Helpers/Login.cs b/NOWT/Helpers/Login.cs index 88f704a..5823018 100644 --- a/NOWT/Helpers/Login.cs +++ b/NOWT/Helpers/Login.cs @@ -173,7 +173,7 @@ public static async Task DoCachedRequestAsync( bool addRiotAuth, bool bypassCache = false, bool displayError = true, - bool userAgentTrickery = false + string? userAgent = null ) { var attemptCache = method == Method.Get && !bypassCache; @@ -182,9 +182,9 @@ public static async Task DoCachedRequestAsync( return res; var client = new RestClient(url); - if (userAgentTrickery) + if (userAgent is not null) { - client.AddDefaultHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"); + client.AddDefaultHeader("User-Agent", userAgent); } var request = new RestRequest();