public void ResetState() { ExecutionInfo = "Retrying"; STATUS = "NONE"; SOURCE = string.Empty; RAWSOURCE = Array.Empty <byte>(); ADDRESS = string.Empty; RESPONSECODE = 0; COOKIES.Clear(); HEADERS.Clear(); MarkedForCapture.Clear(); // We need to dispose of objects created in each retry, because jobs should // only dispose of them after the bot has completed its work DisposeObjectsExcept(new[] { "puppeteer", "puppeteerPage", "puppeteerFrame", "httpClient", "ironPyEngine" }); }
static API() { foreach (var cookie in Utils.LoadDictionary(PATH_MAIN + "Cookies.txt")) { COOKIES.Add( new Cookie( cookie.Key, cookie.Value, "/", "okcupid.com" ) ); } CLIENT_MAIN.AddDefaultHeader("Accept", "application/json, text/javascript, */*; q=0.01"); CLIENT_MAIN.AddDefaultHeader("Accept-Encoding", "gzip, deflate, br"); CLIENT_MAIN.AddDefaultHeader("Accept-Language", "en-US,en;q=0.9"); CLIENT_MAIN.AddDefaultHeader("X-Requested-With", "XMLHttpRequest"); }