Merge pull request #768 from erri120/downloader-fixes

Downloader fixes
This commit is contained in:
Timothy Baldridge 2020-04-27 15:39:29 -06:00 committed by GitHub
commit 452e8f5397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,9 @@
### Changelog
#### Version - 2.0.1.1 - 4/27/2020
* Fixed mediafire links not getting resolved
* Fixed new mega links not being accepted
#### Version - 2.0.1.0 - 4/27/2020
* Fixed "FileNotFound" and "File is open by another process" bugs during installation
* Raised the BSA limit from 2,000,000,000 bytes to 2 ^ 31 bytes

View File

@ -21,6 +21,7 @@ namespace Wabbajack.Common
public static AbsolutePath ModListDownloadFolder => "downloaded_mod_lists".RelativeTo(AbsolutePath.EntryPoint);
public static string MegaPrefix = "https://mega.nz/#!";
public static string MegaFilePrefix = "https://mega.nz/file/";
public static readonly HashSet<Extension> SupportedArchives = new[]{".zip", ".rar", ".7z", ".7zip", ".fomod", ".omod", ".exe", ".dat", ".gz", ".tar"}
.Select(s => new Extension(s)).ToHashSet();

View File

@ -77,7 +77,7 @@ namespace Wabbajack.Lib.Downloaders
public AbstractDownloadState? GetDownloaderState(string url)
{
if (url != null && url.StartsWith(Consts.MegaPrefix))
if (url != null && (url.StartsWith(Consts.MegaPrefix) || url.StartsWith(Consts.MegaFilePrefix)))
return new State(url);
return null;
}
@ -132,7 +132,7 @@ namespace Wabbajack.Lib.Downloaders
try
{
var node = await MegaApiClient.GetNodeFromLinkAsync(fileLink);
return true;
return node != null;
}
catch (Exception)
{

View File

@ -52,7 +52,7 @@ namespace Wabbajack.Lib.Downloaders
{
using (var d = await Driver.Create())
{
await d.NavigateTo(new Uri("http://www.mediafire.com/file/agiqzm1xwebczpx/WABBAJACK_TEST_FILE.tx"));
await d.NavigateTo(new Uri(Url));
// MediaFire creates the link after all the JS loads
await Task.Delay(1000);
var newURL = await d.GetAttr("a.input", "href");