wabbajack/Wabbajack.CLI/Verbs/AllKnownDownloadStates.cs
Timothy Baldridge db3b441d19 #### Version - 2.3.6.1 - 12/31/2020
* When IPS4 (e.g. LL) sites based on CEF fail to validate, they no longer hang the app
* If a IPS4 CEF site throws a 503, or 400 error, retry
* Clean out the cookies during IPS4 CEF downloads so that they don't cause 400 errors
* Limit the number of connections to IPS4 sites to 20 per minute (one per 6 seconds)
* If a site *does* timeout, throw a log of the CEF state into `CEFStates` for easier debugging by the WJ team
* Wrote a new CLI utility to stress test the Verification routines.
* Ignore files that have `\Edit Scripts\Export\` in their path
2020-12-30 23:44:58 -07:00

37 lines
1.2 KiB
C#

using System;
using System.Threading.Tasks;
using CommandLine;
using Wabbajack.Common;
using Wabbajack.Lib;
using Wabbajack.Lib.Downloaders;
using Wabbajack.Lib.FileUploader;
namespace Wabbajack.CLI.Verbs
{
[Verb("all-known-download-states", HelpText = "Print known Ini info for a given hash")]
public class AllKnownDownloadStates : AVerb
{
[Option('i', "input", Required = true, HelpText = "Input Hash")]
public string _input { get; set; } = "";
public Hash Input => Hash.Interpret(_input);
protected override async Task<ExitCode> Run()
{
var states = await ClientAPI.InferAllDownloadStates(Input);
Console.WriteLine($"Found {states.Length} states");
foreach (var archive in states)
{
Console.WriteLine("----");
Console.WriteLine($"Name : {archive.State.PrimaryKeyString}");
Console.WriteLine($"Is Valid: {await archive.State.Verify(archive)}");
Console.WriteLine("------ Begin INI--------");
Console.WriteLine(archive.State.GetMetaIniString());
Console.WriteLine("------ End INI --------");
}
return ExitCode.Ok;
}
}
}