mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Updates tweaks
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
using GHelper.UI;
|
using GHelper.UI;
|
||||||
using Ryzen;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
@@ -63,12 +62,12 @@ namespace GHelper
|
|||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
DriversAsync($"https://rog.asus.com/support/webapi/product/GetPDBIOS?website=global&model={model}&cpu=CPUNAME", model, 1, tableBios);
|
DriversAsync($"https://rog.asus.com/support/webapi/product/GetPDBIOS?website=global&model={model}&cpu={model}", 1, tableBios);
|
||||||
});
|
});
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
DriversAsync($"https://rog.asus.com/support/webapi/product/GetPDDrivers?website=global&model={model}&cpu=CPUNAME&osid=52", model, 0, tableDrivers);
|
DriversAsync($"https://rog.asus.com/support/webapi/product/GetPDDrivers?website=global&model={model}&cpu={model}&osid=52", 0, tableDrivers);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +223,7 @@ namespace GHelper
|
|||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void DriversAsync(string url, string model, int type, TableLayoutPanel table)
|
public async void DriversAsync(string url, int type, TableLayoutPanel table)
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -234,12 +233,10 @@ namespace GHelper
|
|||||||
AutomaticDecompression = DecompressionMethods.All
|
AutomaticDecompression = DecompressionMethods.All
|
||||||
}))
|
}))
|
||||||
{
|
{
|
||||||
var urlNormal = url.Replace("CPUNAME", model);
|
Logger.WriteLine(url);
|
||||||
Logger.WriteLine(urlNormal);
|
|
||||||
|
|
||||||
httpClient.DefaultRequestHeaders.AcceptEncoding.ParseAdd("gzip, deflate, br");
|
httpClient.DefaultRequestHeaders.AcceptEncoding.ParseAdd("gzip, deflate, br");
|
||||||
httpClient.DefaultRequestHeaders.Add("User-Agent", "C# App");
|
httpClient.DefaultRequestHeaders.Add("User-Agent", "C# App");
|
||||||
var json = await httpClient.GetStringAsync(urlNormal);
|
var json = await httpClient.GetStringAsync(url);
|
||||||
|
|
||||||
var data = JsonSerializer.Deserialize<JsonElement>(json);
|
var data = JsonSerializer.Deserialize<JsonElement>(json);
|
||||||
var result = data.GetProperty("Result");
|
var result = data.GetProperty("Result");
|
||||||
@@ -247,8 +244,7 @@ namespace GHelper
|
|||||||
// fallback for bugged API
|
// fallback for bugged API
|
||||||
if (result.ToString() == "" || result.GetProperty("Obj").GetArrayLength() == 0)
|
if (result.ToString() == "" || result.GetProperty("Obj").GetArrayLength() == 0)
|
||||||
{
|
{
|
||||||
Random rnd = new Random();
|
var urlFallback = url + "&tag=" + new Random().Next(10, 99);
|
||||||
var urlFallback = url.Replace("CPUNAME", model + rnd.Next(10, 99));
|
|
||||||
Logger.WriteLine(urlFallback);
|
Logger.WriteLine(urlFallback);
|
||||||
json = await httpClient.GetStringAsync(urlFallback);
|
json = await httpClient.GetStringAsync(urlFallback);
|
||||||
data = JsonSerializer.Deserialize<JsonElement>(json);
|
data = JsonSerializer.Deserialize<JsonElement>(json);
|
||||||
|
|||||||
Reference in New Issue
Block a user