This commit is contained in:
2022-05-20 09:57:35 +03:00
parent c719eaf4fd
commit 9f656d5f3f
24 changed files with 70 additions and 1502 deletions

View File

@@ -0,0 +1,22 @@
using PluginManager.Online;
namespace Games.Objects;
public class GameData
{
internal async static Task<string> GetSteamLinkFromGame(string GameName)
{
string URL = $"https://store.steampowered.com/search?term={GameName.Replace(" ", "+")}";
List<string> lines = await ServerCom.ReadTextFromFile(URL);
string? gameData = (
from s in lines
where s.Contains(GameName.Replace(" ", "_"), StringComparison.OrdinalIgnoreCase)
select s).FirstOrDefault();
if (gameData is null || gameData.Length < 3)
throw new Exception("Unknown GAME");
string GameURL = gameData.Split('\"')[1].Split('?')[0];
return GameURL;
}
}