From 616277e3d554fcbb26532f19ba9d63358807c6e2 Mon Sep 17 00:00:00 2001 From: kawaiizenbo <48113593+kawaiizenbo@users.noreply.github.com> Date: Thu, 9 Dec 2021 19:42:46 -0700 Subject: [PATCH] good --- RepoFullDownloader-Core/Program.cs | 17 +++++------------ .../Properties/launchSettings.json | 7 +++++++ 2 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 RepoFullDownloader-Core/Properties/launchSettings.json diff --git a/RepoFullDownloader-Core/Program.cs b/RepoFullDownloader-Core/Program.cs index 515d1f4..6dc9737 100644 --- a/RepoFullDownloader-Core/Program.cs +++ b/RepoFullDownloader-Core/Program.cs @@ -14,6 +14,8 @@ namespace RepoFullDownloader_Core { class Program { + private static Options options = new Options(); + static void Main(string[] args) { Console.WriteLine("RepoFullDownloader by KawaiiZenbo"); @@ -51,23 +53,13 @@ namespace RepoFullDownloader_Core Console.WriteLine("Could not find options.json"); Console.WriteLine("Generating example..."); // generate example options - Options exampleOptions = new Options(); - exampleOptions.originalFilenames = false; - Repo repo1 = new Repo(); - repo1.url = "http://cydia.invoxiplaygames.uk/"; - repo1.isInstaller = false; - Repo repo2 = new Repo(); - repo2.url = "http://apptapp.saurik.com/"; - repo2.isInstaller = true; - exampleOptions.repos = new[] { repo1, repo2 }; - string exampleOut = JsonSerializer.Serialize(exampleOptions); - File.WriteAllText("./options.json", exampleOut); + File.WriteAllText("./options.json", JsonSerializer.Serialize(new Options())); return; } // Load Options from 'options.json' string optionsJson = File.ReadAllText("./options.json"); - Options options = JsonSerializer.Deserialize(optionsJson); + options = JsonSerializer.Deserialize(optionsJson); foreach (Repo r in options.repos) { @@ -190,6 +182,7 @@ namespace RepoFullDownloader_Core Console.WriteLine(e.Message); failed.Add(link + p.link); } + Thread.Sleep(options.delay); } Console.WriteLine("Finished downloading " + link); if(failed.Count != 0) File.WriteAllLines($"./output/{cleanLink}/failed.txt", failed); diff --git a/RepoFullDownloader-Core/Properties/launchSettings.json b/RepoFullDownloader-Core/Properties/launchSettings.json new file mode 100644 index 0000000..7e35e9d --- /dev/null +++ b/RepoFullDownloader-Core/Properties/launchSettings.json @@ -0,0 +1,7 @@ +{ + "profiles": { + "RepoFullDownloader-Core": { + "commandName": "Project" + } + } +} \ No newline at end of file