Skip to content

Commit 0f6c806

Browse files
committed
fix manifest 403's
1 parent 8bc9a55 commit 0f6c806

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

FModel/ViewModels/CUE4ParseViewModel.cs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Diagnostics;
44
using System.IO;
55
using System.Linq;
6+
using System.Net.Http;
67
using System.Net.Http.Headers;
78
using System.Text.RegularExpressions;
89
using System.Threading;
@@ -27,8 +28,8 @@
2728
using CUE4Parse.GameTypes.PAXDEI.Encryption.Aes;
2829
using CUE4Parse.GameTypes.Rennsport.Encryption.Aes;
2930
using CUE4Parse.GameTypes.Snowbreak.Encryption.Aes;
30-
using CUE4Parse.GameTypes.UDWN.Encryption.Aes;
3131
using CUE4Parse.GameTypes.THPS.Encryption.Aes;
32+
using CUE4Parse.GameTypes.UDWN.Encryption.Aes;
3233
using CUE4Parse.MappingsProvider;
3334
using CUE4Parse.UE4.AssetRegistry;
3435
using CUE4Parse.UE4.Assets.Exports;
@@ -42,7 +43,6 @@
4243
using CUE4Parse.UE4.Assets.Exports.Wwise;
4344
using CUE4Parse.UE4.IO;
4445
using CUE4Parse.UE4.Localization;
45-
using CUE4Parse.UE4.Objects.Core.Misc;
4646
using CUE4Parse.UE4.Objects.Core.Serialization;
4747
using CUE4Parse.UE4.Objects.Engine;
4848
using CUE4Parse.UE4.Oodle.Objects;
@@ -53,9 +53,11 @@
5353

5454
using CUE4Parse_Conversion;
5555
using CUE4Parse_Conversion.Sounds;
56-
using CUE4Parse.UE4.Assets;
56+
5757
using EpicManifestParser;
58+
using EpicManifestParser.UE;
5859
using EpicManifestParser.ZlibngDotNetDecompressor;
60+
5961
using FModel.Creator;
6062
using FModel.Extensions;
6163
using FModel.Framework;
@@ -66,7 +68,7 @@
6668
using FModel.Views.Snooper;
6769

6870
using Newtonsoft.Json;
69-
using OffiUtils;
71+
7072
using OpenTK.Windowing.Common;
7173
using OpenTK.Windowing.Desktop;
7274

@@ -77,6 +79,7 @@
7779
using UE4Config.Parsing;
7880

7981
using Application = System.Windows.Application;
82+
using FGuid = CUE4Parse.UE4.Objects.Core.Misc.FGuid;
8083

8184
namespace FModel.ViewModels;
8285

@@ -247,10 +250,20 @@ await _threadWorkerView.Begin(cancellationToken =>
247250
};
248251

249252
var startTs = Stopwatch.GetTimestamp();
250-
var (manifest, _) = manifestInfo.DownloadAndParseAsync(manifestOptions,
251-
cancellationToken: cancellationToken,
252-
elementManifestPredicate: x => x.Uri.Host is ("epicgames-download1.akamaized.net" or "download.epicgames.com")
253+
FBuildPatchAppManifest manifest;
254+
255+
try
256+
{
257+
(manifest, _) = manifestInfo.DownloadAndParseAsync(manifestOptions,
258+
cancellationToken: cancellationToken,
259+
elementManifestPredicate: static x => x.Uri.Host != "cloudflare.epicgamescdn.com"
253260
).GetAwaiter().GetResult();
261+
}
262+
catch (HttpRequestException ex)
263+
{
264+
Log.Error("Failed to download manifest ({ManifestUri})", ex.Data["ManifestUri"]?.ToString() ?? "");
265+
throw;
266+
}
254267

255268
if (manifest.TryFindFile("Cloud/IoStoreOnDemand.ini", out var ioStoreOnDemandFile))
256269
{

0 commit comments

Comments
 (0)