good
This commit is contained in:
parent
123477ed3f
commit
616277e3d5
2 changed files with 12 additions and 12 deletions
|
@ -14,6 +14,8 @@ namespace RepoFullDownloader_Core
|
||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
|
private static Options options = new Options();
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Console.WriteLine("RepoFullDownloader by KawaiiZenbo");
|
Console.WriteLine("RepoFullDownloader by KawaiiZenbo");
|
||||||
|
@ -51,23 +53,13 @@ namespace RepoFullDownloader_Core
|
||||||
Console.WriteLine("Could not find options.json");
|
Console.WriteLine("Could not find options.json");
|
||||||
Console.WriteLine("Generating example...");
|
Console.WriteLine("Generating example...");
|
||||||
// generate example options
|
// generate example options
|
||||||
Options exampleOptions = new Options();
|
File.WriteAllText("./options.json", JsonSerializer.Serialize(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);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load Options from 'options.json'
|
// Load Options from 'options.json'
|
||||||
string optionsJson = File.ReadAllText("./options.json");
|
string optionsJson = File.ReadAllText("./options.json");
|
||||||
Options options = JsonSerializer.Deserialize<Options>(optionsJson);
|
options = JsonSerializer.Deserialize<Options>(optionsJson);
|
||||||
|
|
||||||
foreach (Repo r in options.repos)
|
foreach (Repo r in options.repos)
|
||||||
{
|
{
|
||||||
|
@ -190,6 +182,7 @@ namespace RepoFullDownloader_Core
|
||||||
Console.WriteLine(e.Message);
|
Console.WriteLine(e.Message);
|
||||||
failed.Add(link + p.link);
|
failed.Add(link + p.link);
|
||||||
}
|
}
|
||||||
|
Thread.Sleep(options.delay);
|
||||||
}
|
}
|
||||||
Console.WriteLine("Finished downloading " + link);
|
Console.WriteLine("Finished downloading " + link);
|
||||||
if(failed.Count != 0) File.WriteAllLines($"./output/{cleanLink}/failed.txt", failed);
|
if(failed.Count != 0) File.WriteAllLines($"./output/{cleanLink}/failed.txt", failed);
|
||||||
|
|
7
RepoFullDownloader-Core/Properties/launchSettings.json
Normal file
7
RepoFullDownloader-Core/Properties/launchSettings.json
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"profiles": {
|
||||||
|
"RepoFullDownloader-Core": {
|
||||||
|
"commandName": "Project"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue