Ejemplo n.º 1
0
 public void Inject(IDownloader downloader, bool pauseBeforeInject)
 {
     if (!CheckFrequency())
     {
         return;
     }
     if (pauseBeforeInject)
     {
         Controllable.Pause(() =>
         {
             foreach (Cookie cookie in GetCookies(Controllable))
             {
                 downloader.AddCookie(cookie);
             }
             downloader.Logger?.Information("Inject cookies success.");
             Controllable.Contiune();
         });
     }
     else
     {
         foreach (Cookie cookie in GetCookies(Controllable))
         {
             downloader.AddCookie(cookie);
         }
         downloader.Logger?.Information("Inject cookies success.");
     }
 }