Skip to content

Commit

Permalink
Fix U.GG provider again
Browse files Browse the repository at this point in the history
  • Loading branch information
pipe01 committed Jun 4, 2019
1 parent 533bd0b commit 7537391
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Legendary Rune Maker/Data/Providers/UGGProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ private async Task<string> GetLolUGGVersion()
{
if (_LolUGGVersion == null)
{
var page = await WebCache.String("https://u.gg");
var page = await WebCache.String("https://u.gg", soft: true);
var scriptUrl = Regex.Match(page, @"(?<=<script src="").*main.*\.js").Value;

var scriptText = await WebCache.String(scriptUrl);
var versionsJson = Regex.Match(scriptText, @"(?<=Ln=)\[.*?\]").Value;
var scriptText = await WebCache.String(scriptUrl, soft: true);
var versionsJson = Regex.Match(scriptText, @"(?<=\=)\[\{value:""\d+_\d+.*?]").Value;
var versions = JArray.Parse(versionsJson);

_LolUGGVersion = versions[0]["value"].ToObject<string>();
Expand All @@ -58,7 +58,7 @@ protected async Task<JObject> GetChampionData(int championId)
{
string url = $"https://stats2.u.gg/lol/{UGGApiVersion}/overview/{await GetLolUGGVersion()}/ranked_solo_5x5/{championId}/{UGGOverviewVersion}.json";

var json = JObject.Parse(await WebCache.String(url));
var json = JObject.Parse(await WebCache.String(url, soft: true));
ChampionData[championId] = data = (JObject)json[OverviewWorld.ToString()][OverviewPlatPlus.ToString()];
}

Expand Down

0 comments on commit 7537391

Please sign in to comment.