mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
2.5.3.6
This commit is contained in:
parent
a84394ad6b
commit
591673c46b
@ -1,5 +1,9 @@
|
|||||||
### Changelog
|
### Changelog
|
||||||
|
|
||||||
|
#### Version - 2.5.3.6 - 2/1/2022
|
||||||
|
* Implemented new (more reliable) code for back porting to Skyrim SE
|
||||||
|
* Mega links that use `manualURL=` now work properly with the manual downloader
|
||||||
|
|
||||||
#### Version - 2.5.3.5 - 1/19/2022
|
#### Version - 2.5.3.5 - 1/19/2022
|
||||||
* Fixed support for Cyberpunk 2077 on GoG
|
* Fixed support for Cyberpunk 2077 on GoG
|
||||||
* Added support for Sims 4
|
* Added support for Sims 4
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<AssemblyName>wabbajack-cli</AssemblyName>
|
<AssemblyName>wabbajack-cli</AssemblyName>
|
||||||
<Company>Wabbajack</Company>
|
<Company>Wabbajack</Company>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<AssemblyVersion>2.5.3.5</AssemblyVersion>
|
<AssemblyVersion>2.5.3.6</AssemblyVersion>
|
||||||
<FileVersion>2.5.3.5</FileVersion>
|
<FileVersion>2.5.3.6</FileVersion>
|
||||||
<Copyright>Copyright © 2019-2021</Copyright>
|
<Copyright>Copyright © 2019-2021</Copyright>
|
||||||
<Description>An automated ModList installer</Description>
|
<Description>An automated ModList installer</Description>
|
||||||
<PublishReadyToRun>true</PublishReadyToRun>
|
<PublishReadyToRun>true</PublishReadyToRun>
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net5.0-windows</TargetFramework>
|
<TargetFramework>net5.0-windows</TargetFramework>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<AssemblyVersion>2.5.3.5</AssemblyVersion>
|
<AssemblyVersion>2.5.3.6</AssemblyVersion>
|
||||||
<FileVersion>2.5.3.5</FileVersion>
|
<FileVersion>2.5.3.6</FileVersion>
|
||||||
<Copyright>Copyright © 2019-2020</Copyright>
|
<Copyright>Copyright © 2019-2020</Copyright>
|
||||||
<Description>Wabbajack Application Launcher</Description>
|
<Description>Wabbajack Application Launcher</Description>
|
||||||
<PublishReadyToRun>true</PublishReadyToRun>
|
<PublishReadyToRun>true</PublishReadyToRun>
|
||||||
|
@ -453,6 +453,9 @@ namespace Wabbajack.Lib.Downloaders
|
|||||||
if (!Downloader.IsCloudFlareProtected)
|
if (!Downloader.IsCloudFlareProtected)
|
||||||
return await Downloader.AuthedClient.GetAsync(uri);
|
return await Downloader.AuthedClient.GetAsync(uri);
|
||||||
|
|
||||||
|
throw new NotImplementedException();
|
||||||
|
|
||||||
|
/*
|
||||||
using var driver = await Downloader.GetAuthedDriver();
|
using var driver = await Downloader.GetAuthedDriver();
|
||||||
TaskCompletionSource<Uri?> promise = new();
|
TaskCompletionSource<Uri?> promise = new();
|
||||||
driver.DownloadHandler = uri1 =>
|
driver.DownloadHandler = uri1 =>
|
||||||
@ -465,6 +468,7 @@ namespace Wabbajack.Lib.Downloaders
|
|||||||
if (url == null) throw new Exception("No Url to download");
|
if (url == null) throw new Exception("No Url to download");
|
||||||
var location = await driver.GetLocation();
|
var location = await driver.GetLocation();
|
||||||
return await Helpers.GetClient(await Helpers.GetCookies(), location!.ToString()).GetAsync(uri);
|
return await Helpers.GetClient(await Helpers.GetCookies(), location!.ToString()).GetAsync(uri);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string[] GetMetaIni()
|
public override string[] GetMetaIni()
|
||||||
|
@ -48,6 +48,8 @@ namespace Wabbajack.Lib.Downloaders
|
|||||||
|
|
||||||
public override async Task<bool> Download(Archive a, AbsolutePath destination)
|
public override async Task<bool> Download(Archive a, AbsolutePath destination)
|
||||||
{
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
/*
|
||||||
using var driver = await WebAutomation.Driver.Create();
|
using var driver = await WebAutomation.Driver.Create();
|
||||||
var tcs = new TaskCompletionSource<Uri?>();
|
var tcs = new TaskCompletionSource<Uri?>();
|
||||||
driver.DownloadHandler = uri => tcs.SetResult(uri);
|
driver.DownloadHandler = uri => tcs.SetResult(uri);
|
||||||
@ -55,6 +57,7 @@ namespace Wabbajack.Lib.Downloaders
|
|||||||
await driver.EvalJavascript("document.getElementsByClassName(\"download-button\")[0].click();");
|
await driver.EvalJavascript("document.getElementsByClassName(\"download-button\")[0].click();");
|
||||||
var uri = await tcs.Task;
|
var uri = await tcs.Task;
|
||||||
return await new HTTPDownloader.State(uri!.ToString()).Download(destination);
|
return await new HTTPDownloader.State(uri!.ToString()).Download(destination);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<bool> Verify(Archive archive, CancellationToken? token)
|
public override async Task<bool> Verify(Archive archive, CancellationToken? token)
|
||||||
|
@ -22,7 +22,7 @@ namespace Wabbajack.Lib.NexusApi
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Forces the client to do manual downloading via CEF (for testing)
|
/// Forces the client to do manual downloading via CEF (for testing)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static bool ManualTestingMode = false;
|
private static bool ManualTestingMode = true;
|
||||||
|
|
||||||
public Http.Client HttpClient { get; } = new();
|
public Http.Client HttpClient { get; } = new();
|
||||||
|
|
||||||
|
@ -18,12 +18,10 @@ namespace Wabbajack.Lib.WebAutomation
|
|||||||
public class CefSharpWrapper : IWebDriver
|
public class CefSharpWrapper : IWebDriver
|
||||||
{
|
{
|
||||||
private readonly IWebBrowser _browser;
|
private readonly IWebBrowser _browser;
|
||||||
public Action<Uri>? DownloadHandler { get; set; }
|
|
||||||
public CefSharpWrapper(IWebBrowser browser)
|
public CefSharpWrapper(IWebBrowser browser)
|
||||||
{
|
{
|
||||||
_browser = browser;
|
_browser = browser;
|
||||||
|
|
||||||
_browser.DownloadHandler = new DownloadHandler(this);
|
|
||||||
_browser.LifeSpanHandler = new PopupBlocker(this);
|
_browser.LifeSpanHandler = new PopupBlocker(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,26 +215,4 @@ namespace Wabbajack.Lib.WebAutomation
|
|||||||
callback.Resume();
|
callback.Resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DownloadHandler : IDownloadHandler
|
|
||||||
{
|
|
||||||
private CefSharpWrapper _wrapper;
|
|
||||||
|
|
||||||
public DownloadHandler(CefSharpWrapper wrapper)
|
|
||||||
{
|
|
||||||
_wrapper = wrapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeDownload(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem,
|
|
||||||
IBeforeDownloadCallback callback)
|
|
||||||
{
|
|
||||||
_wrapper.DownloadHandler?.Invoke(new Uri(downloadItem.Url));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem,
|
|
||||||
IDownloadItemCallback callback)
|
|
||||||
{
|
|
||||||
callback.Cancel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,5 @@ namespace Wabbajack.Lib.WebAutomation
|
|||||||
Task NavigateTo(Uri uri, CancellationToken? token = null);
|
Task NavigateTo(Uri uri, CancellationToken? token = null);
|
||||||
Task<string> EvaluateJavaScript(string text);
|
Task<string> EvaluateJavaScript(string text);
|
||||||
Task<Helpers.Cookie[]> GetCookies(string domainPrefix);
|
Task<Helpers.Cookie[]> GetCookies(string domainPrefix);
|
||||||
public Action<Uri>? DownloadHandler { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,10 +93,6 @@ namespace Wabbajack.Lib.WebAutomation
|
|||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Action<Uri?> DownloadHandler {
|
|
||||||
set => _driver.DownloadHandler = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<string> GetAttr(string selector, string attr)
|
public Task<string> GetAttr(string selector, string attr)
|
||||||
{
|
{
|
||||||
return _driver.EvaluateJavaScript($"document.querySelector(\"{selector}\").{attr}");
|
return _driver.EvaluateJavaScript($"document.querySelector(\"{selector}\").{attr}");
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net5.0-windows</TargetFramework>
|
<TargetFramework>net5.0-windows</TargetFramework>
|
||||||
<AssemblyVersion>2.5.3.5</AssemblyVersion>
|
<AssemblyVersion>2.5.3.6</AssemblyVersion>
|
||||||
<FileVersion>2.5.3.5</FileVersion>
|
<FileVersion>2.5.3.6</FileVersion>
|
||||||
<Copyright>Copyright © 2019-2021</Copyright>
|
<Copyright>Copyright © 2019-2021</Copyright>
|
||||||
<Description>Wabbajack Server</Description>
|
<Description>Wabbajack Server</Description>
|
||||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||||
|
@ -33,7 +33,7 @@ namespace Wabbajack
|
|||||||
|
|
||||||
private async Task WrapBrowserJob(IUserIntervention intervention, Func<WebBrowserVM, CancellationTokenSource, Task> toDo)
|
private async Task WrapBrowserJob(IUserIntervention intervention, Func<WebBrowserVM, CancellationTokenSource, Task> toDo)
|
||||||
{
|
{
|
||||||
var wait = await _browserLock.WaitAsync();
|
using var wait = await _browserLock.WaitAsync();
|
||||||
var cancel = new CancellationTokenSource();
|
var cancel = new CancellationTokenSource();
|
||||||
var oldPane = MainWindow.ActivePane;
|
var oldPane = MainWindow.ActivePane;
|
||||||
using var vm = await WebBrowserVM.GetNew();
|
using var vm = await WebBrowserVM.GetNew();
|
||||||
@ -58,10 +58,6 @@ namespace Wabbajack
|
|||||||
Utils.Error(ex);
|
Utils.Error(ex);
|
||||||
intervention.Cancel();
|
intervention.Cancel();
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
wait.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
MainWindow.NavigateTo(oldPane);
|
MainWindow.NavigateTo(oldPane);
|
||||||
}
|
}
|
||||||
@ -166,13 +162,9 @@ namespace Wabbajack
|
|||||||
|
|
||||||
var result = new TaskCompletionSource<Uri>();
|
var result = new TaskCompletionSource<Uri>();
|
||||||
|
|
||||||
browser.DownloadHandler = uri =>
|
|
||||||
{
|
|
||||||
//var client = Helpers.GetClient(browser.GetCookies("").Result, browser.Location);
|
|
||||||
result.SetResult(uri);
|
|
||||||
};
|
|
||||||
|
|
||||||
await vm.Driver.WaitForInitialized();
|
await vm.Driver.WaitForInitialized();
|
||||||
|
using var _ = browser.SetDownloadHandler(new ManualDownloadHandler(result));
|
||||||
|
|
||||||
await browser.NavigateTo(new Uri(manuallyDownloadFile.State.Url));
|
await browser.NavigateTo(new Uri(manuallyDownloadFile.State.Url));
|
||||||
|
|
||||||
@ -190,7 +182,30 @@ namespace Wabbajack
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ManualDownloadHandler : IDownloadHandler
|
||||||
|
{
|
||||||
|
private readonly TaskCompletionSource<Uri> _tcs;
|
||||||
|
|
||||||
|
public ManualDownloadHandler(TaskCompletionSource<Uri> tcs)
|
||||||
|
{
|
||||||
|
_tcs = tcs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnBeforeDownload(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem,
|
||||||
|
IBeforeDownloadCallback callback)
|
||||||
|
{
|
||||||
|
_tcs.TrySetResult(new Uri(downloadItem.Url));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem,
|
||||||
|
IDownloadItemCallback callback)
|
||||||
|
{
|
||||||
|
callback.Cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private async Task HandleManualMegaDownload(WebBrowserVM vm, CancellationTokenSource cancel, ManuallyDownloadMegaFile manuallyDownloadFile)
|
private async Task HandleManualMegaDownload(WebBrowserVM vm, CancellationTokenSource cancel, ManuallyDownloadMegaFile manuallyDownloadFile)
|
||||||
{
|
{
|
||||||
var browser = new CefSharpWrapper(vm.Browser);
|
var browser = new CefSharpWrapper(vm.Browser);
|
||||||
@ -224,7 +239,7 @@ namespace Wabbajack
|
|||||||
public void OnBeforeDownload(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem,
|
public void OnBeforeDownload(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem,
|
||||||
IBeforeDownloadCallback callback)
|
IBeforeDownloadCallback callback)
|
||||||
{
|
{
|
||||||
callback.Continue(_manualFile.ToString(), false);
|
callback.Continue(_manualFile.Destination.ToString(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem,
|
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem,
|
||||||
@ -235,7 +250,7 @@ namespace Wabbajack
|
|||||||
_tcs.TrySetResult();
|
_tcs.TrySetResult();
|
||||||
}
|
}
|
||||||
callback.Resume();
|
callback.Resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task HandleManualNexusDownload(WebBrowserVM vm, CancellationTokenSource cancel, ManuallyDownloadNexusFile manuallyDownloadNexusFile)
|
private async Task HandleManualNexusDownload(WebBrowserVM vm, CancellationTokenSource cancel, ManuallyDownloadNexusFile manuallyDownloadNexusFile)
|
||||||
@ -243,19 +258,27 @@ namespace Wabbajack
|
|||||||
var state = manuallyDownloadNexusFile.State;
|
var state = manuallyDownloadNexusFile.State;
|
||||||
var game = state.Game.MetaData();
|
var game = state.Game.MetaData();
|
||||||
await vm.Driver.WaitForInitialized();
|
await vm.Driver.WaitForInitialized();
|
||||||
IWebDriver browser = new CefSharpWrapper(vm.Browser);
|
|
||||||
vm.Instructions = $"Click the download button to continue (get a NexusMods.com Premium account to automate this)";
|
vm.Instructions = $"Click the download button to continue (get a NexusMods.com Premium account to automate this)";
|
||||||
browser.DownloadHandler = uri =>
|
var browser = new CefSharpWrapper(vm.Browser);
|
||||||
{
|
var tcs = new TaskCompletionSource<Uri>();
|
||||||
manuallyDownloadNexusFile.Resume(uri);
|
using var _ = browser.SetDownloadHandler(new ManualDownloadHandler(tcs));
|
||||||
browser.DownloadHandler = null;
|
|
||||||
};
|
|
||||||
var url = new Uri(@$"https://www.nexusmods.com/{game.NexusName}/mods/{state.ModID}?tab=files&file_id={state.FileID}");
|
var url = new Uri(@$"https://www.nexusmods.com/{game.NexusName}/mods/{state.ModID}?tab=files&file_id={state.FileID}");
|
||||||
await browser.NavigateTo(url);
|
await browser.NavigateTo(url);
|
||||||
|
|
||||||
while (!cancel.IsCancellationRequested && !manuallyDownloadNexusFile.Task.IsCompleted) {
|
while (!cancel.IsCancellationRequested && !tcs.Task.IsCompleted) {
|
||||||
await Task.Delay(250);
|
await Task.Delay(250);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tcs.Task.IsFaulted)
|
||||||
|
{
|
||||||
|
manuallyDownloadNexusFile.Cancel();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var uri = await tcs.Task;
|
||||||
|
manuallyDownloadNexusFile.Resume(uri);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
|
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
|
||||||
<AssemblyVersion>2.5.3.5</AssemblyVersion>
|
<AssemblyVersion>2.5.3.6</AssemblyVersion>
|
||||||
<FileVersion>2.5.3.5</FileVersion>
|
<FileVersion>2.5.3.6</FileVersion>
|
||||||
<Copyright>Copyright © 2019-2021</Copyright>
|
<Copyright>Copyright © 2019-2021</Copyright>
|
||||||
<Description>An automated ModList installer</Description>
|
<Description>An automated ModList installer</Description>
|
||||||
<PublishReadyToRun>true</PublishReadyToRun>
|
<PublishReadyToRun>true</PublishReadyToRun>
|
||||||
|
Loading…
Reference in New Issue
Block a user