public async static Task <WorkshopAddon> GetAddonByIDAsync(Int32 ID, String APIKey) { var resp = await WebClientGETAsync( "https://api.steampowered.com/IPublishedFileService/GetDetails/v1/", new NameValueCollection { { "key", APIKey }, { "publishedfileids[0]", ID.ToString( ) }, { "includetags", "0" }, { "includeadditionalpreviews", "0" }, { "includechildren", "0" }, { "includekvtags", "0" }, { "includevotes", "0" }, { "short_description", "0" }, { "includeforsaledata", "0" }, { "includemetadata", "0" }, { "return_playtime_stats", "30" }, { "appid", "4000" }, { "strip_description_bbcode", "1" } } ).ConfigureAwait(false); WorkshopAddon addon = JToken.Parse(resp) ["response"] ["publishedfiledetails"] [0] .ToObject <WorkshopAddon> ( ); addon.ID = ID; return(addon); }
public static Task DownloadAddonFileAsync(WorkshopAddon Addon, String path) { using (var wc = new WebClient( )) return(wc.DownloadFileTaskAsync(Addon.URL, path)); }
public static Task <Byte[]> DownloadAddonDataAsync(WorkshopAddon Addon) { using (var wc = new WebClient()) return(wc.DownloadDataTaskAsync(Addon.URL)); }