No longer use cef for mediafire (to avoid popups)

This commit is contained in:
Timothy Baldridge 2020-05-04 15:02:26 -06:00
parent 589ef33160
commit 391354e241
2 changed files with 6 additions and 12 deletions

View File

@ -50,18 +50,11 @@ namespace Wabbajack.Lib.Downloaders
private async Task<HTTPDownloader.State?> Resolve()
{
using (var d = await Driver.Create())
{
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");
if (newURL == null || !newURL.StartsWith("http")) return null;
return new HTTPDownloader.State(newURL)
{
Client = new Common.Http.Client(),
};
}
var client = new Common.Http.Client();
var body = await client.GetHtmlAsync(Url);
var node = body.DocumentNode.DescendantsAndSelf().First(d => d.HasClass("input") && d.HasClass("popsok") &&
d.GetAttributeValue("aria-label", "") == "Download file");
return new HTTPDownloader.State(node.GetAttributeValue("href", "not-found"));
}
public override IDownloader GetDownloader()

View File

@ -14,6 +14,7 @@ namespace Wabbajack.Lib.WebAutomation
public Driver()
{
_browser = new ChromiumWebBrowser();
_driver = new CefSharpWrapper(_browser);
}