public Cash365() { httpRequest.UserAgentRandomize(); //обманем CloudFlare //CloudFlareXNet cloudFlare = new CloudFlareXNet(); //cloudFlare.Get(BASE_URL, ref httpRequest); }
public bool CheckIsBanForever(ProxySettingsItem proxy, bool removeFromProxyJSON = true) { Leaf.xNet.HttpRequest http = new Leaf.xNet.HttpRequest(); http.UserAgentRandomize(); http.Proxy = proxy.CreateProxyClient(); bool isBan = false; try { http.ConnectTimeout = 3000; isBan = Helper.IsBanForever(http.Get(BASE_URL)); } catch (Exception ex) { isBan = true; } try { if (isBan && removeFromProxyJSON) { App.settings.proxy.Remove(proxy.ip, proxy.port); } } catch (Exception ex) { } return(isBan); }
private static void Worker() { var random = new Random(); while (true) { try { using (var req = new HttpRequest { Proxy = _scraper.Next() }) { req.UserAgentRandomize(); HttpResponse res = req.Get($"https://www.youtube.com/watch?v={_id}"); var sres = res.ToString(); var viewersTemp = string.Join("", RegularExpressions.Viewers.Match(sres).Groups[1].Value.Where(char.IsDigit)); if (!string.IsNullOrEmpty(viewersTemp)) { _viewers = viewersTemp; } _title = RegularExpressions.Title.Match(sres).Groups[1].Value; var url = RegularExpressions.ViewUrl.Match(sres).Groups[1].Value; url = url.Replace(@"\u0026", "&").Replace("%2C", ",").Replace(@"\/", "/"); var query = HttpUtility.ParseQueryString(url); var cl = query.Get(query.AllKeys[0]); var ei = query.Get("ei"); var of = query.Get("of"); var vm = query.Get("vm"); var buffer = new byte[100]; random.NextBytes(buffer); var cpn = RegularExpressions.Trash.Replace(Convert.ToBase64String(buffer), "").Substring(0, 16); var st = random.Next(1000, 10000); var et = st + random.Next(200, 700); var rt = random.Next(10, 200); var lact = random.Next(1000, 8000); var rtn = rt + 300; var args = new Dictionary <string, string> { ["ns"] = "yt", ["el"] = "detailpage", ["cpn"] = cpn, ["docid"] = _id, ["ver"] = "2", ["cmt"] = et.ToString(), ["ei"] = ei, ["fmt"] = "243", ["fs"] = "0", ["rt"] = rt.ToString(), ["of"] = of, ["euri"] = "", ["lact"] = lact.ToString(), ["live"] = "dvr", ["cl"] = cl, ["state"] = "playing", ["vm"] = vm, ["volume"] = "100", ["cbr"] = "Firefox", ["cbrver"] = "83.0", ["c"] = "WEB", ["cplayer"] = "UNIPLAYER", ["cver"] = "2.20201210.01.00", ["cos"] = "Windows", ["cosver"] = "10.0", ["cplatform"] = "DESKTOP", ["delay"] = "5", ["hl"] = "en_US", ["rtn"] = rtn.ToString(), ["aftm"] = "140", ["rti"] = rt.ToString(), ["muted"] = "0", ["st"] = st.ToString(), ["et"] = et.ToString() }; var urlToGet = BuildUrl(args); req.AcceptEncoding = "gzip, deflate"; req.AddHeader("Host", "www.youtube.com"); req.Get(urlToGet); Interlocked.Increment(ref _botted); } } catch { Interlocked.Increment(ref _errors); } Thread.Sleep(1); } }
public MineExchangeDriver() { httpRequest.UserAgentRandomize(); httpRequest.ConnectTimeout = 10000; }