public StreamcloudStreamingSite(string link) : base(link) { requestBrowser = new OffscreenChromiumBrowser(); requestBrowser.WaitForInit(); requestBrowser.LoadingStateChanged += RequestBrowser_LoadingStateChanged; trueLink = link; requestBrowser.Load(link); }
private async static Task<string> WaitForLoadingBrowser(OffscreenChromiumBrowser browser) { ShowUserInformation("Waiting for Cloudflare protection ..."); long timeout = 10 * TimeSpan.TicksPerSecond; long startTime = DateTime.Now.Ticks; while (true) { await Task.Delay(100); if ((DateTime.Now.Ticks - startTime) > timeout) { string s = await browser.GetHtmlSourceAsync(); return s; } else if (browser.IsPageLoaded && !(await browser.GetHtmlSourceAsync()).Contains("Checking your browser before accessing")) { break; } } return await browser.GetHtmlSourceAsync(); }
private async static Task<string> GetBrowserResponseAsync(string url) { if (requestBrowser == null) requestBrowser = new OffscreenChromiumBrowser(); requestBrowser.WaitForInit(); requestBrowser.Load(url); string result = await WaitForLoadingBrowser(requestBrowser); requestBrowser.Load("about:blank"); return result; }
public VivoStreamingSite(string link) : base(link) { requestBrowser = new OffscreenChromiumBrowser(); requestBrowser.WaitForInit(); }
public async override Task<string> RequestFileAsync(IProgress<int> progress, CancellationToken ct) { requestBrowser.Load(base.link); try { ct.ThrowIfCancellationRequested(); return await FindLink(ct); } catch (OperationCanceledException ex) { requestBrowser.Load("about:blank"); requestBrowser = null; throw ex; } }
public BsToOpenLoadSite(string link) : base(link) { requestBrowser = new OffscreenChromiumBrowser(); }