diff --git a/DLL/Robot.Framework.dll b/DLL/Robot.Framework.dll index ea0cdf9..994d789 100644 Binary files a/DLL/Robot.Framework.dll and b/DLL/Robot.Framework.dll differ diff --git a/FLSystem/Program.cs b/FLSystem/Program.cs index d035199..a6cded9 100644 --- a/FLSystem/Program.cs +++ b/FLSystem/Program.cs @@ -382,7 +382,7 @@ namespace FLSystem } static string GetExceptionMsg(Exception ex, string backStr, string r) { - + StringBuilder sb = new StringBuilder(); sb.AppendLine($"****************************异常文本_{r}****************************"); diff --git a/PCRobot/PCRobotForm.cs b/PCRobot/PCRobotForm.cs index 4a31522..9918f77 100644 --- a/PCRobot/PCRobotForm.cs +++ b/PCRobot/PCRobotForm.cs @@ -41,9 +41,10 @@ namespace PCRobot { try { - WeChatActivateHelper.Set_Hosts("dldir1v6.qq.com", "127.0.0.1"); - WeChatActivateHelper.Set_Hosts("dldir1.qq.com", "127.0.0.1"); - LogHelper.GetSingleObj().Info("屏蔽", "屏蔽微信自动更新成功"); + WeChatActivateHelper.Set_Hosts("", ""); + //WeChatActivateHelper.Set_Hosts("dldir1v6.qq.com", "127.0.0.1"); + //WeChatActivateHelper.Set_Hosts("dldir1.qq.com", "127.0.0.1"); + //LogHelper.GetSingleObj().Info("屏蔽", "屏蔽微信自动更新成功"); } catch (Exception exception) { diff --git a/PCRobot/Program.cs b/PCRobot/Program.cs index 3ffaf45..79f4683 100644 --- a/PCRobot/Program.cs +++ b/PCRobot/Program.cs @@ -1,15 +1,11 @@ using CsharpHttpHelper; -using PCRobot.Properties; using PCRobot.Utils; using System; -using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Security.Cryptography; using System.Text; using System.Threading; using System.Windows.Forms; -using System.Xml; namespace PCRobot { diff --git a/PCRobot/Utils/WeChatActivateHelper.cs b/PCRobot/Utils/WeChatActivateHelper.cs index cdb28e2..174cbd4 100644 --- a/PCRobot/Utils/WeChatActivateHelper.cs +++ b/PCRobot/Utils/WeChatActivateHelper.cs @@ -313,11 +313,11 @@ namespace WechatHelper string[] hosts = File.ReadAllLines(path); List list = hosts.ToList(); - string temp = hosts.ToList().FirstOrDefault(x => x.Contains(domain)); - if (string.IsNullOrEmpty(temp)) - { - list.Add($"{ip} {domain}"); - } + //string temp = hosts.ToList().FirstOrDefault(x => x.Contains(domain)); + //if (string.IsNullOrEmpty(temp)) + //{ + // list.Add($"{ip} {domain}"); + //} File.WriteAllLines(path, list.ToArray()); } diff --git a/类库/Api.Framework/Cps/DouyinApiV2.cs b/类库/Api.Framework/Cps/DouyinApiV2.cs index f204ac3..90f0f95 100644 --- a/类库/Api.Framework/Cps/DouyinApiV2.cs +++ b/类库/Api.Framework/Cps/DouyinApiV2.cs @@ -205,178 +205,6 @@ html = {html}"); return string.Empty; } - // /// - // /// 获取推广id - // /// - // /// - // /// - // /// - // /// - // public string GetPromotionId(string goodid, out string promotion_id, out string title) - // { - // promotion_id = string.Empty; - // title = string.Empty; - // //var param = $"urls=https:{HttpExtend.UrlEncode($"//haohuo.jinritemai.com/views/product/item2?id={goodid}")}"; - // var param = $"urls=https://haohuo.jinritemai.com/views/product/item2?id={goodid}"; - // var sign = GetSign(param, Member.other); - // if (!string.IsNullOrWhiteSpace(sign)) - // param = $"{param}&_signature={sign}"; - - // var xb = GetXbogus(param, Member.other); - - // HttpHelper http = new HttpHelper(); - // HttpItem item = new HttpItem() - // { - // URL = $"https://buyin.jinritemai.com/api/shop/batchLink?{param}&X-Bogus={xb}", - // Method = "GET", - // Timeout = 20000, - // ReadWriteTimeout = 30000, - // IsToLower = false, - // Cookie = Member.cookies, - // UserAgent = Member.other, - // Accept = "text/html, application/xhtml+xml, */*", - // ContentType = "text/html", - // Referer = "https://buyin.jinritemai.com/dashboard/shopwindow/goods-list", - // Allowautoredirect = false, - // AutoRedirectCookie = false, - // Postdata = "", - // ResultType = ResultType.String,//返回数据类型,是Byte还是String - // }; - // HttpResult result = http.GetHtml(item); - - // string html = result.Html; - - // if (!string.IsNullOrWhiteSpace(html)) - // { - // try - // { - // var jObj = JObject.Parse(html); - // if (jObj["msg"].ToString() == "success") - // { - // if (jObj["data"] != null) - // { - // var batch_shop_manage_promotions = (JArray)jObj["data"]["batch_shop_manage_promotions"]; - // if (batch_shop_manage_promotions != null && batch_shop_manage_promotions.Count != 0) - // { - // var good = batch_shop_manage_promotions[0]; - // var promotionIdTmp = good["promotion_id"].ToString(); - // if (!string.IsNullOrWhiteSpace(promotionIdTmp)) - // { - // promotion_id = good["promotion_id"].ToString(); - // goodid = good["product_id"].ToString(); - // title = good["title"].ToString(); - // return goodid; - // } - // } - // //这里可能商品id为推广id - // promotion_id = goodid; - // return string.Empty; - // } - // } - // } - // catch (Exception ex) - // { - // LogHelper.GetSingleObj().Error("抖音返利", $@"抖音解析推广id和商品id一致异常:{ex.Message} - {ex.StackTrace} - //商品id: {goodid},推广id: {promotion_id} - - //html = {html}"); - // } - // finally - // { - // LogHelper.GetSingleObj().Debug("抖音返利调试", $@"抖音解析推广id和商品id一致 - //商品id: {goodid},推广id: {promotion_id} - - //html = {html}"); - // } - // } - // return string.Empty; - // } - - - // public string GetPromotionId(string goodid, out string promotion_id) - // { - // promotion_id = string.Empty; - // var title = string.Empty; - // //var param = $"urls=https:{HttpExtend.UrlEncode($"//haohuo.jinritemai.com/views/product/item2?id={goodid}")}"; - // var param = $"urls=https://haohuo.jinritemai.com/views/product/item2?id={goodid}"; - // var sign = GetSign(param, Member.other); - // if (!string.IsNullOrWhiteSpace(sign)) - // param = $"{param}&_signature={sign}"; - - // var xb = GetXbogus(param, Member.other); - - // HttpHelper http = new HttpHelper(); - // HttpItem item = new HttpItem() - // { - // URL = $"https://buyin.jinritemai.com/api/shop/batchLink?{param}&X-Bogus={xb}", - // Method = "GET", - // Timeout = 20000, - // ReadWriteTimeout = 30000, - // IsToLower = false, - // Cookie = Member.cookies, - // UserAgent = Member.other, - // Accept = "text/html, application/xhtml+xml, */*", - // ContentType = "text/html", - // Referer = "https://buyin.jinritemai.com/dashboard/shopwindow/goods-list", - // Allowautoredirect = false, - // AutoRedirectCookie = false, - // Postdata = "", - // ResultType = ResultType.String - // }; - - // item.Header.Add("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"); - // item.Header.Add("Accept-Encoding", "deflate"); - - // HttpResult result = http.GetHtml(item); - - // string html = result.Html; - - // if (!string.IsNullOrWhiteSpace(html)) - // { - // try - // { - // var jObj = JObject.Parse(html); - // if (jObj["msg"].ToString() == "success") - // { - // if (jObj["data"] != null) - // { - // var batch_shop_manage_promotions = (JArray)jObj["data"]["batch_shop_manage_promotions"]; - // if (batch_shop_manage_promotions != null && batch_shop_manage_promotions.Count != 0) - // { - // var good = batch_shop_manage_promotions[0]; - // var promotionIdTmp = good["promotion_id"].ToString(); - // if (!string.IsNullOrWhiteSpace(promotionIdTmp)) - // { - // promotion_id = good["promotion_id"].ToString(); - // goodid = good["product_id"].ToString(); - // title = good["title"].ToString(); - // return goodid; - // } - // } - // //这里可能商品id为推广id - // promotion_id = goodid; - // return string.Empty; - // } - // } - // } - // catch (Exception ex) - // { - // LogHelper.GetSingleObj().Error("抖音返利", $@"抖音解析推广id和商品id一致异常:{ex.Message} - {ex.StackTrace} - //商品id: {goodid},推广id: {promotion_id} - - //html = {html}"); - // } - // finally - // { - // LogHelper.GetSingleObj().Debug("抖音返利调试", $@"抖音解析推广id和商品id一致 - //商品id: {goodid},推广id: {promotion_id} - - //html = {html}"); - // } - // } - // return string.Empty; - // } - #region 抖音原始信息解析 新 public string GetDyGoodsID(string mess, out string promotion_id) @@ -651,6 +479,7 @@ html = {html}"); }; HttpResult result = http.GetHtml(item); //{"code":0,"st":0,"msg":"","log_id":"20221227133233A4C3A96264EE24144183","data":{"batch_shop_manage_promotions":[{"url":"https://haohuo.jinritemai.com/views/product/item2?id=3589938322287552527","filter_status":0,"filter_status_msg":"审核通过","promotion_id":"3589938792703860658","product_id":"3589938322287552527","promotion_source":4,"item_type":4,"coupon_amount":"0","price":6990,"cos_fee":1048,"cos_ratio":15,"pending_cos_ratio":0,"title":"【现货速发】【N95】50只五层防护3D口罩一次性口罩A","detail_url":"https://haohuo.jinritemai.com/views/product/item2?id=3589938322287552527","new_cover":"https://lf26-cm.ecombdstatic.com/obj/ecom-shop-material/CxqUypcR_m_c8a5c3e74d81c7e7d4e026c3c02bdf0f_sx_143082_www800-800","sales":30470,"brand_icon":"https://lf6-cm.ecombdstatic.com/obj/temai/FqHBvTfXMoSfOaR6cjKqR40LOlHlwww84-42","original_promotion_source":4,"cos_type_name":"赚 ¥","shop_id":60308726,"pool_type":"0","is_leader":false,"privilege_info":{"privilege_id":1,"icon":{"url_list":["https://lf6-cm.ecombdstatic.com/obj/temai/buy_at_ease_v1.png"]},"platform_public_url":"https://mix.jinritemai.com/falcon/mix_page/index.html?__live_platform__=webcast\u0026activity_tag=%E5%85%B6%E4%BB%96\u0026allowMediaAutoPlay=1\u0026enter_from=mall_feed\u0026hide_nav_bar=1\u0026hide_system_video_poster=1\u0026id=7117178766052294949\u0026origin_type=mall_feed\u0026pass_enter_from=1\u0026pia_mixrender=1\u0026should_full_screen=1\u0026trans_status_bar=1\u0026ttwebview_extension_mixrender=1","privilege_info_detail":[{"tag_id":"authentic_guarantee","title":"正品保障","content":"100%正品,假一赔三,放心选购","icon":{"url_list":["https://lf6-cm.ecombdstatic.com/obj/temai/detail_certificate_guarantee.png"]},"small_icon":{"url_list":["https://lf6-cm.ecombdstatic.com/obj/temai/detail_certificate_support.png"]},"show_small_icon":true},{"tag_id":"pay_for_bad","title":"坏单包赔","content":"若签收时发现商品有明显损伤、变质、腐烂等情况,可在24小时内申请退款并提供图片凭证,商家将按比例赔付","icon":{"url_list":["https://lf3-cm.ecombdstatic.com/obj/eden-cn/nupfupebo/services/PayForBad.png"]}},{"tag_id":"insurance_freight","title":"运费险","content":"商家已为您投保,退货成功后保险公司赔付一定金额运费至钱包(保单生效以下单为准)","icon":{"url_list":["https://lf3-cm.ecombdstatic.com/obj/eden-cn/nupfupebo/services/FreightInsurance.png"]}},{"tag_id":"refund_speed","title":"极速退款","content":"支付后6小时内,待发货状态下,提交退款申请将立即退款","icon":{"url_list":["https://lf6-cm.ecombdstatic.com/obj/eden-cn/nupfupebo/services/QuickRefund.png"]}},{"tag_id":"ondoor_pickup","title":"上门取件","content":"消费者退货寄件方式选择上门取件,即可享受快递上门服务(目前生鲜,大件等特殊类目暂不支持,具体以售后页面为准)","icon":{"url_list":["https://lf3-cm.ecombdstatic.com/obj/eden-cn/ulkl_ajbkvyw_tvjl/ljhwZthlaukjlkulzlp/detail/get_home.png"]}},{"tag_id":"customer_protection","title":"消费者保障服务","content":"该卖家已缴纳保证金,如有商品质量问题,描述不符等,您有权申请退款或退货","icon":{"url_list":["https://lf26-cm.ecombdstatic.com/obj/temai/comsumer_protect.png"]}}]},"commission_ticket_tag":false,"public_tiered_cos":false,"tag_list":[{"type":5,"title":"买样返款"}],"is_pk_competition":false,"douyin_goods_info":{"tag_id":1,"icon":{"url_list":["https://lf26-cm.ecombdstatic.com/obj/cmp-ecom-alliance/product_tag/douyin_goods.png"]},"douyin_goods_info_detail":[{"tag_id":"douyin_goods_DuXiangBiaoQian","title":"独享标签","content":"获得 \"精选好物\" 标签,提升消费者的信任感,促进成单转化率","icon":{"url_list":["https://lf3-cm.ecombdstatic.com/obj/cmp-ecom-alliance/product_tag/DuXiangBiaoQian.png"]}},{"tag_id":"douyin_goods_LiuLiangQingXie","title":"流量倾斜","content":"获得平台流量倾斜","icon":{"url_list":["https://lf6-cm.ecombdstatic.com/obj/cmp-ecom-alliance/product_tag/LiuLiangQingXie.png"]}},{"tag_id":"douyin_goods_GuanFangBuTie","title":"官方补贴","content":"成为平台大型活动推荐商品,享受官方补贴","icon":{"url_list":["https://lf3-cm.ecombdstatic.com/obj/cmp-ecom-alliance/product_tag/GuanFangBuTie.png"]}},{"tag_id":"douyin_goods_TiShengHaoHuoFen","title":"提升好货分","content":"有效提升达人好货分","icon":{"url_list":["https://lf3-cm.ecombdstatic.com/obj/cmp-ecom-alliance/product_tag/TiShengHaoHuoFen.png"]}}]},"pic_product_tag":[{"type":"douingoodv2","pic":"https://lf6-cm.ecombdstatic.com/obj/cmp-ecom-alliance/product_tag/douyin_goods.png"},{"type":"anxingou","pic":"https://lf6-cm.ecombdstatic.com/obj/temai/buy_at_ease_v1.png"}],"text_product_tag":[{"type":"SampleRebate","text":{"text":"买样返款"},"border_color":"rgba(255, 112, 29, 0.34)"},{"type":"insurance_freight","text":{"text":"运费险"},"border_color":"rgba(255, 112, 29, 0.34)"},{"type":"refund_speed","text":{"text":"极速退款"},"border_color":"rgba(255, 112, 29, 0.34)"},{"type":"FreightFree","text":{"text":"包邮"},"border_color":"rgba(255, 112, 29, 0.34)"}]}]}} + var jObj = JObject.Parse(result.Html); var batch_shop_manage_promotions = jObj["data"]?["batch_shop_manage_promotions"]?.ToArray(); if (batch_shop_manage_promotions != null && batch_shop_manage_promotions.Length > 0) @@ -714,13 +543,6 @@ html = {html}"); HttpResult result = http.GetHtml(item); html = result.Html; - - if (html.Contains("Too big request header")) - { - LogHelper.GetSingleObj().Error("抖音返利", $@"promotion_id = {promotion_id} ,头部超长,({JsonConvert.SerializeObject(item)})"); - Thread.Sleep(500); - continue; - } break; } @@ -780,6 +602,7 @@ html = {html}"); }; item.Header.Add("x-secsdk-csrf-request", "1"); HttpResult result = http.GetHtml(item); + Member.cookies = result.UpdateCookies(Member.cookies); var token = string.Empty; @@ -820,7 +643,7 @@ html = {html}"); item.Header.Add("x-secsdk-csrf-token", token);//设置请求头信息(Header) result = http.GetHtml(item); - Member.cookies = Member.cookies.SimpleCookies(); + //Member.cookies = Member.cookies.SimpleCookies(); html = result.Html; //{"st":0,"code":0,"msg":"成功添加1件商品至橱窗","log_id":"202202091007460101501661640711ACE3","data":{"success_count":1,"failure_count":0,"failure_list":[]}} @@ -969,12 +792,7 @@ html = {html}"); ResultType = ResultType.String, }; HttpResult result = http.GetHtml(item); - //if (!string.IsNullOrWhiteSpace(result.Cookie)) - //{ - // Member.cookies = HttpHelper.GetSmallCookie(result.UpdateCookies(Member.cookies)); - //} - //Member.cookies = result.UpdateCookies(Member.cookies); - //{"code":0,"st":0,"msg":"success","error_type":0,"data":{},"log_id":"202107011223480101980650882E822E5B"} + html = result.Html; if (!string.IsNullOrWhiteSpace(html)) { @@ -1061,8 +879,7 @@ html = {html}"); HttpResult result = http.GetHtml(item); html = result.Html; - //Console.WriteLine(); - //continue; + #region 数据结构 //{"code":0,"data":[{"promotion_id":"3461130275701011777","product_id":"3454352531717751823","promotion_source":4,"coupon_amount":"","price":9990,"cos_fee":3996,"cos_ratio":40,"title":" 【辉腾】直播落地支架 直播支架 直播落地三脚架 户外落地支架","detail_url":"https://haohuo.jinritemai.com/views/product/item2?id=3454352531717751823\u0026origin_type=2002170010\u0026origin_id=1460607342872671_3461130275701011777\u0026alkey=1128_1460607342872671_0_3461130275701011777_011\u0026sec_author_id=MS4wLjABAAAAEnpGkVpQS-WLtu18Me9lZ-9A284xvNbstU-HGyQK3vn2Pi-WtDWPRAXLCnSRvDsF\u0026buyin_track=COgIEN-Q0K6ijcwCGgQIABAAIgAoj4iI8LXqlPgvMAE\u0026c_biz_combo=2","cover":"temai/c9a03a89407ec53f6dc06fb949a9a7bcwww800-800","images":["temai/c9a03a89407ec53f6dc06fb949a9a7bcwww800-800","temai/bd81e0f3a80b8ef97228454fcd243157www800-800","temai/7575df4d88e28769e16ebd13ec48c14awww800-800","temai/0bdd668c8dad2dd2605dc62b51b9f509www800-800","temai/b25524e60b62f6b768995a2c4910cd91www800-800"],"elastic_title":"","elastic_images":["temai/c9a03a89407ec53f6dc06fb949a9a7bcwww800-800","temai/bd81e0f3a80b8ef97228454fcd243157www800-800","temai/7575df4d88e28769e16ebd13ec48c14awww800-800","temai/0bdd668c8dad2dd2605dc62b51b9f509www800-800","temai/b25524e60b62f6b768995a2c4910cd91www800-800"],"ies_category":12,"sales":0,"pic_audit_status":null,"brand_icon":"","original_promotion_source":0,"cos_type":0,"cos_type_name":"","live_elastic_title":"","full_discount":[],"shop_label":null,"shop_id":9868340,"tax_price":0,"is_haitao":false,"hide_status":2,"pool_type":"","industry_cid":7,"industry_cname":"智能家居"}],"extra":{"log_id":"2021070109250001019806620216778C63","now":1625102701000},"msg":"success","st":0,"total":1} #endregion @@ -1218,14 +1035,13 @@ html = {html}"); var html = result.Html; - if (result.Header.AllKeys.Contains("set-cookie")) + if (result.Header.AllKeys.Contains("Set-Cookie")) { var msTokenStr = result.Header["set-cookie"].ToString(); var reg = Regex.Match(msTokenStr, @"(msToken=.+?;)", RegexOptions.IgnoreCase); if (reg.Success) { - Member.cookies = Member.cookies.SimpleCookies(); - Member.cookies = Member.cookies.SimpleCookies() + (Member.cookies.Trim().EndsWith(";") ? "" : ";") + reg.Groups[1].Value; + Member.cookies = UpCKMsToken(Member.cookies, reg.Groups[1].Value); } } @@ -1237,10 +1053,10 @@ html = {html}"); try { - if (html.ToLower().Contains("400 Request Header".ToLower())) - { - Member.cookies = Member.cookies.SimpleCookies(); - } + //if (html.ToLower().Contains("400 Request Header".ToLower())) + //{ + // Member.cookies = Member.cookies.SimpleCookies(); + //} jObj = JObject.Parse(html); @@ -1386,6 +1202,35 @@ html = {html}"); #endregion } + + private string UpCKMsToken(string ck, string newMsToken) + { + ck = ck.Trim(); + ck = ck + (ck.EndsWith(";") ? "" : ";"); + var regs = Regex.Matches(ck, @"(?<值>msToken=[^;]+;)", RegexOptions.IgnoreCase); + List msTokens = new List(); + foreach (Match r in regs) + { + var msToken = r.Groups["值"].Value; + msTokens.Add(msToken); + } + + ck = Regex.Replace(ck, @"(?<值>msToken=[^;]+;)", "", RegexOptions.IgnoreCase); + + int index = 0; + foreach (var ms in msTokens) + { + index++; + if (index == 1) + { + ck += newMsToken; + continue; + } + ck += ms; + } + return ck; + } + private static Dictionary SlidingBlockCache = new Dictionary(); #region 滑块 @@ -2289,6 +2134,98 @@ html = {html}"); #endregion + internal void UpdateCookies() + { + try + { + string cookie = Member.cookies; + cookie = cookie.Trim(); + if (!cookie.EndsWith(";")) + { + cookie += ";"; + } + + List msTokenlist = new List(); + var regs = Regex.Matches(cookie, "(?<值>msToken=[^;]+;)", RegexOptions.IgnoreCase); + foreach (Match reg in regs) + { + if (reg.Success) + { + msTokenlist.Add(reg.Groups["值"].Value); + } + } + + var msToken = string.Empty; + if (msTokenlist.Any()) + { + msToken = msTokenlist[msTokenlist.Count - 1].Replace(";", ""); + } + + var url = $"https://buyin.jinritemai.com/index/getUser?"; + var param = $@"{msToken}"; + var sign = GetSign(param, Member.other); + + if (!string.IsNullOrWhiteSpace(sign)) + { + param = $"{param}&_signature={sign}"; + } + + var xb = GetXbogus(param, Member.other); + + HttpHelper http = new HttpHelper(); + HttpItem item = new HttpItem() + { + URL = $"{url}{param}&X-Bogus={xb}", + Method = "get", + IsToLower = false, + Cookie = cookie, + Referer = "https://buyin.jinritemai.com/dashboard/merch-picking-hall", + Postdata = "", + Timeout = 5000, + ReadWriteTimeout = 5000 * 2, + UserAgent = Member.other, + Accept = "application/json, text/plain, */*", // 可选项有默认值 + ContentType = "application/json", //返回类型 可选项有默认值 + Allowautoredirect = false, + ProxyIp = "", + ResultType = ResultType.String, + Host = "buyin.jinritemai.com" + }; + + item.Header.Add("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,mt;q=0.5"); + item.Header.Add("Accept-Encoding", "deflate"); + + //item.Header["Connection"] = "keep-alive"; + //item.Header.Add("Sec-Fetch-Dest", "empty"); + //item.Header.Add("Sec-Fetch-Mode", "cors"); + //item.Header.Add("Sec-Fetch-Site", "same-origin"); + //item.Header.Add("TE", "trailers"); + + HttpResult result = http.GetHtml(item); + var html = result.Html; + + if (result.Header != null && result.Header.AllKeys != null && result.Header.AllKeys.Contains("Set-Cookie")) + { + var msTokenStr = result.Header["Set-Cookie"]; + //SASID=SID2_7202968622522761529; Path=/; Domain=buyin.jinritemai.com,BUYIN_SASID=SID2_7202968622522761529; Path=/; Domain=jinritemai.com,buyin_shop_type=24; Path=/; Domain=buyin.jinritemai.com,buyin_account_child_type=1128; Path=/; Domain=buyin.jinritemai.com,buyin_app_id=1128; Path=/; Domain=buyin.jinritemai.com,msToken=EAqbQpQogG-g2KDuYeWpu_9Ymd5IhPE6lUifMJOQmMUB6BKpX9GvIwkyI_h37kgVRBPclqqP1S6WTe8JfsPP6IrTq8vInnjrjMcrV0xsBTZgJN4aU1kB; Path=/; Domain=jinritemai.com; Expires=Wed, 01 Mar 2023 13:19:08 GMT; Secure; SameSite=None + var reg = Regex.Match(msTokenStr, "(SASID=[^;]+;)", RegexOptions.IgnoreCase); + if (reg.Success) + { + var asaid = reg.Groups[1].Value; + var newCookie = Regex.Replace(cookie, "(SASID=[^;]+;)", asaid, RegexOptions.IgnoreCase); + Member.cookies = newCookie; + + var session = ApiClient.GetSession(); + session.Saveable(Member).ExecuteCommand(); + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex); + } + } + /// /// 订单下载-官方 /// diff --git a/类库/Api.Framework/Timers/Update_CpsStatus.cs b/类库/Api.Framework/Timers/Update_CpsStatus.cs index cd22608..eae0892 100644 --- a/类库/Api.Framework/Timers/Update_CpsStatus.cs +++ b/类库/Api.Framework/Timers/Update_CpsStatus.cs @@ -19,6 +19,23 @@ namespace Api.Framework.Timers public override void Run(object state, bool timeout) { count++; + //更新抖音CK + if (count == 1 || count % 12 == 0) + { + try + { + var members = CpsClient.Members.Where(f => f.cpstype == CpsType.抖音联盟 && f.online); + foreach (var item in members) + { + var api = CpsClient.CreateDouyinRequest(item); + api.UpdateCookies(); + } + } + catch (Exception ex) + { + EventClient.OnEvent(this, $"ERROR-:{this.GetType()}-{System.Reflection.MethodBase.GetCurrentMethod().Name}->Dy->{ex.Message}"); + } + } //更新多多进宝状态 if (count == 0 || count % 24 == 0) { @@ -35,6 +52,8 @@ namespace Api.Framework.Timers { EventClient.OnEvent(this, $"ERROR-:{this.GetType()}-{System.Reflection.MethodBase.GetCurrentMethod().Name}->Pdd->{ex.Message}"); } + + } //判断阿里妈妈状态 @@ -69,6 +88,8 @@ namespace Api.Framework.Timers { EventClient.OnEvent(this, $"ERROR:{this.GetType()}-{System.Reflection.MethodBase.GetCurrentMethod().Name}- >TB->{ex.Message}"); } + + } } } diff --git a/类库/Chat.Framework/QQSdk/QQEventManage.cs b/类库/Chat.Framework/QQSdk/QQEventManage.cs index 8f8b5fe..2d86463 100644 --- a/类库/Chat.Framework/QQSdk/QQEventManage.cs +++ b/类库/Chat.Framework/QQSdk/QQEventManage.cs @@ -30,7 +30,8 @@ namespace Chat.Framework.QQSdk { try { - var c = Grant.Framework.GrantClient.Get().Login(e.QQBase.QQ.ToString(), e.QQBase.Nickname, 1002, "3782F5365510E5B25F4FA6FFC04255CB"); + var qq = e.QQBase.QQ.ToString(); + var c = Grant.Framework.GrantClient.Get().Login(qq, e.QQBase.Nickname, 1002, "3782F5365510E5B25F4FA6FFC04255CB"); //e.QQClient.User.LoginTime = DateTime.Parse(c.endTime); Console.WriteLine("登陆状态改变: " + e.Message); }