diff --git a/Wabbajack.Common/Consts.cs b/Wabbajack.Common/Consts.cs index e67c93de..dc3825c1 100644 --- a/Wabbajack.Common/Consts.cs +++ b/Wabbajack.Common/Consts.cs @@ -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 SupportedArchives = new[]{".zip", ".rar", ".7z", ".7zip", ".fomod", ".omod", ".exe", ".dat", ".gz", ".tar"} .Select(s => new Extension(s)).ToHashSet(); diff --git a/Wabbajack.Lib/Downloaders/MEGADownloader.cs b/Wabbajack.Lib/Downloaders/MEGADownloader.cs index f3a0d131..ecf60c8e 100644 --- a/Wabbajack.Lib/Downloaders/MEGADownloader.cs +++ b/Wabbajack.Lib/Downloaders/MEGADownloader.cs @@ -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) {