public StreamcloudStreamingSite(string link) : base(link)
 {
     requestBrowser = new OffscreenChromiumBrowser();
     requestBrowser.WaitForInit();
     requestBrowser.LoadingStateChanged += RequestBrowser_LoadingStateChanged;
     trueLink = link;
     requestBrowser.Load(link);
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 public VivoStreamingSite(string link) : base(link)
 {
     requestBrowser = new OffscreenChromiumBrowser();
     requestBrowser.WaitForInit();
 }
Ejemplo n.º 5
0
 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;
     }
     
 }
Ejemplo n.º 6
0
 public BsToOpenLoadSite(string link) : base(link)
 {
     requestBrowser = new OffscreenChromiumBrowser();
 }