Beispiel #1
0
 private void ProcessWork()
 {
     while (true)
     {
         if (listConQueue.Count > 0)
         {
             try
             {
                 IPMetaDataItem mdi = null;
                 IPItem         di  = null;
                 lock (objec)
                 {
                     if (listConQueue.TryDequeue(out di))
                     {
                         RefreshIESettings(di.ipwithport);
                         //webBrowser1.Navigate("https://https://www.baidu.com/", null, null, null);
                         webBrowser1.Navigate("https://heycar.m.autohome.com.cn/NewYearH5/Index?ssor=1851197957", null, null, null);
                         //webBrowser2.Navigate("https://heycar.m.autohome.com.cn/AnnualMeetingAnswer/AnswerIndex");
                         //webBrowser3.Navigate("https://heycar.m.autohome.com.cn/young/SchoolZmActivity");
                         //webBrowser4.Navigate("https://club.m.autohome.com.cn/bbs/thread/922a3efdd3f63a4c/91344584-1.html#pvareaid=3460109");
                         //webBrowser5.Navigate("https://club.m.autohome.com.cn/partner/uc/thread/91341569");
                         //webBrowser6.Navigate("https://club.m.autohome.com.cn/partner/yidian/thread/91341569");
                         //webBrowser7.Navigate("https://club.m.autohome.com.cn/partner/qutoutiao/thread/91341569");
                         //webBrowser8.Navigate("https://club.m.autohome.com.cn/partner/oppo/thread/91341569");
                         //webBrowser9.Navigate("https://club.autohome.com.cn/hongrenzhuanti#pvareaid=3454633");
                         //webBrowser10.Navigate("https://heycar.m.autohome.com.cn/Act/haowu/index.htm");
                         //webBrowser11.Navigate("https://heycar.m.autohome.com.cn/Act/haowu/liebian.htm");
                         //webBrowser12.Navigate("https://heycar.m.autohome.com.cn/Act/oneyear/index.htm");
                         Thread.Sleep(8000);
                         RefreshIESettings(string.Empty);
                     }
                 }
             }
             catch (Exception ex)
             {
                 //_logger.Error("优信拍 抓取主过程 异常:{0}", ex);
             }
         }
         else
         {
             yxpProducer.Process(null);
         }
     }
 }
Beispiel #2
0
        public static IPMetaDataItem Convert2IPMetaDataItem(this IPItem di, string requesturl = @"https://club.m.autohome.com.cn/young")
        {
            string ahpplid    = "";
            string requestUrl = ConfigUtls.mda_pv_init;

            if (string.IsNullOrWhiteSpace(requesturl))
            {
                requestUrl = alRequestUrls.FirstOrDefault();
            }
            List <string> tempAiRequestUrls = new List <string>();

            if (ConfigUtls.proxy_rate_open > 0)
            {
                for (int i = 0; i < ConfigUtls.proxy_rate; i++)
                {
                    ahpplid = GetAhpplid(10);
                    //requesturl = requesturl.Replace("&ahpplid=1596326603158vXrEyx9cl_&", string.Format("&ahpplid={0}&", ahpplid));
                    requestUrl = requestUrl.Replace(ConfigUtls.mda_pv_init_ahpplid, string.Format("%26ahpplid%3d{0}%26", ahpplid));
                    string outStr = (long.Parse(ahpplid.Substring(2, 10)) >> 3).ToString() + new Random().Next().ToString().Substring(2, 5);
                    outStr = outStr.Substring(0, 11);
                    //requesturl = requesturl.Replace("&ahpsign=1204082574&", string.Format("&ahpsign={0}&", outStr));
                    requestUrl = requestUrl.Replace(ConfigUtls.mda_pv_init_ahpsign, string.Format("%26ahpsign%3d{0}%26", outStr));
                    //}
                    tempAiRequestUrls.Add(requestUrl);
                }
            }
            else
            {
                ahpplid = GetAhpplid(10);
                //requesturl = requesturl.Replace("&ahpplid=1596326603158vXrEyx9cl_&", string.Format("&ahpplid={0}&", ahpplid));
                requestUrl = requestUrl.Replace(ConfigUtls.mda_pv_init_ahpplid, string.Format("%26ahpplid%3D{0}%26", ahpplid));
                string outStr = (long.Parse(ahpplid.Substring(2, 10)) >> 3).ToString() + new Random().Next().ToString().Substring(2, 5);
                outStr = outStr.Substring(0, 11);
                //requesturl = requesturl.Replace("&ahpsign=1204082574&", string.Format("&ahpsign={0}&", outStr));
                requestUrl = requestUrl.Replace(ConfigUtls.mda_pv_init_ahpsign, string.Format("%26ahpsign%3d{0}%26", outStr));
                //}
                tempAiRequestUrls.Add(requestUrl);
            }
            return(new IPMetaDataItem()
            {
                ipwithport = di.ipwithport, requesturl = requestUrl, requesturls = tempAiRequestUrls.ToArray(), fvlid = ahpplid, outip = di.outip
            });
        }