private async Task <CDNFileDefinition> GetDefinition()
            {
                var client = new Wabbajack.Lib.Http.Client();

                if (DomainRemaps.TryGetValue(Url.Host, out var remap))
                {
                    var builder = new UriBuilder(Url)
                    {
                        Host = remap
                    };
                    using var data = await client.GetAsync(builder + "/definition.json.gz");

                    await using var gz = new GZipStream(await data.Content.ReadAsStreamAsync(),
                                                        CompressionMode.Decompress);
                    return(gz.FromJson <CDNFileDefinition>());
                }
                else
                {
                    client.Headers.Add(("Host", Url.Host));
                    using var data = await GetWithMirroredRetry(client, Url + "/definition.json.gz");

                    await using var gz = new GZipStream(await data.Content.ReadAsStreamAsync(),
                                                        CompressionMode.Decompress);
                    return(gz.FromJson <CDNFileDefinition>());
                }
            }
            public override async Task <bool> Download(Archive a, AbsolutePath destination)
            {
                destination.Parent.CreateDirectory();
                var definition = await GetDefinition();

                await using var fs = await destination.Create();

                using var mmfile = MemoryMappedFile.CreateFromFile(fs, null, definition.Size, MemoryMappedFileAccess.ReadWrite, HandleInheritability.None, false);
                var client = new Wabbajack.Lib.Http.Client();

                if (!DomainRemaps.ContainsKey(Url.Host))
                {
                    client.Headers.Add(("Host", Url.Host));
                }

                using var queue = new WorkQueue();
                await definition.Parts.PMap(queue, async part =>
                {
                    Utils.Status($"Downloading {a.Name}", Percent.FactoryPutInRange(definition.Parts.Length - part.Index, definition.Parts.Length));
                    await using var ostream = mmfile.CreateViewStream(part.Offset, part.Size);

                    if (DomainRemaps.TryGetValue(Url.Host, out var remap))
                    {
                        var builder = new UriBuilder(Url)
                        {
                            Host = remap
                        };
                        using var response = await client.GetAsync($"{builder}/parts/{part.Index}");
                        if (!response.IsSuccessStatusCode)
                        {
                            throw new HttpException((int)response.StatusCode, response.ReasonPhrase);
                        }
                        await response.Content.CopyToAsync(ostream);
                    }
                    else
                    {
                        using var response = await GetWithMirroredRetry(client, $"{Url}/parts/{part.Index}");
                        if (!response.IsSuccessStatusCode)
                        {
                            throw new HttpException((int)response.StatusCode, response.ReasonPhrase);
                        }
                        await response.Content.CopyToAsync(ostream);
                    }
                });

                return(true);
            }