diff --git a/RC2BotArchiver/DownloadImages.cs b/RC2BotArchiver/DownloadImages.cs index 1916c6f..db790ea 100644 --- a/RC2BotArchiver/DownloadImages.cs +++ b/RC2BotArchiver/DownloadImages.cs @@ -15,7 +15,7 @@ public static class DownloadImages if (url is null) continue; var response = await client.GetAsync(url); await using var stream = await response.Content.ReadAsStreamAsync(); - await using var fs = File.OpenWrite(Path.Combine(dir, "thumbnail.jpg")); + await using var fs = File.OpenWrite(Path.Combine(dir, "thumbnail.jpeg")); await stream.CopyToAsync(fs); Console.WriteLine($"Saved image for {doc.RootElement.GetProperty("name")}"); } diff --git a/RC2BotArchiver/Program.cs b/RC2BotArchiver/Program.cs index 947d7f0..7fa4f1f 100644 --- a/RC2BotArchiver/Program.cs +++ b/RC2BotArchiver/Program.cs @@ -84,6 +84,8 @@ foreach (var result in results.EnumerateArray()) responseJson = await Get(factoryUrl + "/v1/foundry/vehicles/" + robot.GetProperty("id")); if (!responseJson.HasValue) throw new Exception($"Could not get bot {robot.GetProperty("name")}"); File.WriteAllText(Path.Combine(dirPath, "robotData.json"), responseJson.Value.GetRawText()); + var data = responseJson.Value.GetProperty("data").GetString()!; + File.WriteAllBytes(Path.Combine(dirPath, "robot.rc2"), Convert.FromBase64String(data)); Console.WriteLine($"Saved {robot.GetProperty("name")} by {robot.GetProperty("creatorName")}"); Thread.Sleep(100); }