Download BadUpdate and Tools from CDN instead of GitHub.
This commit is contained in:
@@ -14,7 +14,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Octokit" Version="14.0.0" />
|
|
||||||
<PackageReference Include="SharpCompress" Version="0.39.0" />
|
<PackageReference Include="SharpCompress" Version="0.39.0" />
|
||||||
<PackageReference Include="Spectre.Console" Version="0.49.1" />
|
<PackageReference Include="Spectre.Console" Version="0.49.1" />
|
||||||
<PackageReference Include="System.Management" Version="9.0.3" />
|
<PackageReference Include="System.Management" Version="9.0.3" />
|
||||||
|
|||||||
@@ -34,8 +34,9 @@ namespace BadBuilder
|
|||||||
("Rock Band Blitz", "https://cdn.niklascfw.de/xbox360/GameData.zip"),
|
("Rock Band Blitz", "https://cdn.niklascfw.de/xbox360/GameData.zip"),
|
||||||
("Simple 360 NAND Flasher", "https://cdn.niklascfw.de/xbox360/Flasher.7z"),
|
("Simple 360 NAND Flasher", "https://cdn.niklascfw.de/xbox360/Flasher.7z"),
|
||||||
("XeUnshackle", "https://cdn.niklascfw.de/xbox360/XeUnshackle-BETA-v1_03.zip"),
|
("XeUnshackle", "https://cdn.niklascfw.de/xbox360/XeUnshackle-BETA-v1_03.zip"),
|
||||||
|
("BadUpdate", "https://cdn.niklascfw.de/xbox360/Xbox360BadUpdate-Retail-USB-v1.2.zip"),
|
||||||
|
("BadUpdate Tools", "https://cdn.niklascfw.de/xbox360/Tools.zip"),
|
||||||
};
|
};
|
||||||
await DownloadHelper.GetGitHubAssets(items);
|
|
||||||
|
|
||||||
List<DownloadItem> existingFiles = items.Where(item =>
|
List<DownloadItem> existingFiles = items.Where(item =>
|
||||||
File.Exists(Path.Combine(DOWNLOAD_DIR, item.url.Split('/').Last()))).ToList();
|
File.Exists(Path.Combine(DOWNLOAD_DIR, item.url.Split('/').Last()))).ToList();
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Octokit;
|
using Spectre.Console;
|
||||||
using Spectre.Console;
|
|
||||||
|
|
||||||
using static BadBuilder.Utilities.Constants;
|
using static BadBuilder.Utilities.Constants;
|
||||||
|
|
||||||
@@ -7,34 +6,6 @@ namespace BadBuilder.Helpers
|
|||||||
{
|
{
|
||||||
internal static class DownloadHelper
|
internal static class DownloadHelper
|
||||||
{
|
{
|
||||||
internal static async Task GetGitHubAssets(List<DownloadItem> items)
|
|
||||||
{
|
|
||||||
GitHubClient gitClient = new(new ProductHeaderValue("BadBuilder-Downloader"));
|
|
||||||
List<string> repos =
|
|
||||||
[
|
|
||||||
"grimdoomer/Xbox360BadUpdate"
|
|
||||||
];
|
|
||||||
|
|
||||||
foreach (var repo in repos)
|
|
||||||
{
|
|
||||||
string[] splitRepo = repo.Split('/');
|
|
||||||
var latestRelease = await gitClient.Repository.Release.GetLatest(splitRepo[0], splitRepo[1]);
|
|
||||||
|
|
||||||
foreach (var asset in latestRelease.Assets)
|
|
||||||
{
|
|
||||||
string friendlyName = asset.Name switch
|
|
||||||
{
|
|
||||||
var name when name.Contains("Free", StringComparison.OrdinalIgnoreCase) => "FreeMyXe",
|
|
||||||
var name when name.Contains("Tools", StringComparison.OrdinalIgnoreCase) => "BadUpdate Tools",
|
|
||||||
var name when name.Contains("BadUpdate", StringComparison.OrdinalIgnoreCase) => "BadUpdate",
|
|
||||||
_ => asset.Name.Substring(0, asset.Name.Length - 4)
|
|
||||||
};
|
|
||||||
|
|
||||||
items.Add(new(friendlyName, asset.BrowserDownloadUrl));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static async Task DownloadFileAsync(HttpClient client, ProgressTask task, string url)
|
internal static async Task DownloadFileAsync(HttpClient client, ProgressTask task, string url)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user