public override async Task <bool> PrepareAsync(WebClient client, CancellationToken cancellation)
{
var downloadPage = await client.DownloadStringTaskAsync(Url);
if (cancellation.IsCancellationRequested)
{
return(false);
}
var match = Regex.Match(downloadPage, @"<p class=""download""><a href=""([^""]+)");
if (!match.Success)
{
NonfatalError.Notify(ToolsStrings.Common_CannotDownloadFile, ToolsStrings.DirectLoader_AcClubChanged);
return(false);
}
Url = HttpUtility.HtmlDecode(match.Groups[1].Value);
Logging.Write("AssettoCorsa.club download link: " + Url);
_innerLoader = FlexibleLoader.CreateLoader(Url);
if (_innerLoader is AcClubLoader)
{
throw new Exception(ToolsStrings.DirectLoader_RecursionDetected);
}
return(await _innerLoader.PrepareAsync(client, cancellation));
}