2872 lines
178 KiB
C#
2872 lines
178 KiB
C#
using Api.Framework.EntityTmp.Douyin;
|
||
using Api.Framework.Enums;
|
||
using Api.Framework.Model;
|
||
using Api.Framework.Tools;
|
||
using Api.Framework.Utils;
|
||
using CsharpHttpHelper;
|
||
using CsharpHttpHelper.Enum;
|
||
using Microsoft.ClearScript.V8;
|
||
using Newtonsoft.Json;
|
||
using Newtonsoft.Json.Linq;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Security.Cryptography;
|
||
using System.Text;
|
||
using System.Text.RegularExpressions;
|
||
using System.Threading;
|
||
using System.Threading.Tasks;
|
||
using System.Web;
|
||
|
||
namespace Api.Framework.Cps
|
||
{
|
||
public class DouyinApiV2 : BaseCpsApi
|
||
{
|
||
internal DouyinApiV2(fl_cps_member member) : base(member) { }
|
||
|
||
#region 接口
|
||
/// <summary>
|
||
/// 添加商品至橱柜
|
||
/// </summary>
|
||
private const string AddGoods_WindowUrl = @"https://buyin.jinritemai.com/pc/selection/window/pmt/add?_signature={0}";
|
||
|
||
private const string AnalysisCmdUrl = @"https://aweme.snssdk.com/aweme/v2/platform/share/command/trans/?command={0}";
|
||
|
||
/// <summary>
|
||
/// 橱窗商品列表搜索地址
|
||
/// </summary>
|
||
private const string ShopWindowUrl = @"https://buyin.jinritemai.com/api/shop/search?hide_status=0&promotion_source=0&title={0}&page=1&pageSize=20&_signature={1}";
|
||
|
||
/// <summary>
|
||
/// 搜索关键词
|
||
/// </summary>
|
||
private const string SearchUrl = @"https://buyin.jinritemai.com/pc/selection/search/pmt?page=1&page_size=60&search_text=";
|
||
|
||
public static fl_cps_member GetUserInfo(string html, string ck)
|
||
{
|
||
try
|
||
{
|
||
var jObj = JObject.Parse(html);
|
||
if (jObj["code"] == null || jObj["code"].Value<int>() != 0)
|
||
{
|
||
if (jObj["msg"]?.Value<string>() == "Something went wrong, please refresh")
|
||
{
|
||
throw new Exception("账号尚未开通商品分享功能");
|
||
}
|
||
throw new Exception(html);
|
||
}
|
||
|
||
var db = ApiClient.GetSession();
|
||
var username = jObj["data"]?["outer_id"]?.ToString();
|
||
var m = db.Queryable<fl_cps_member>().First(f => f.cpstype == CpsType.抖音联盟 && f.username == username);
|
||
if (m == null)
|
||
{
|
||
m = new fl_cps_member();
|
||
}
|
||
|
||
m.cookies = ck;
|
||
m.usernick = jObj["data"]?["nickname"]?.ToString() ?? string.Empty;
|
||
m.username = username;
|
||
m.logintime = DateTime.Now;
|
||
m.other2 = jObj["data"]?["author_id"]?.ToString() ?? jObj["data"]?["biz_account_id"]?.ToString();
|
||
m.online = true;
|
||
m.is_valid = true;
|
||
m.cpstype = CpsType.抖音联盟;
|
||
return m;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
return null;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 将抖音口令解析成商品id
|
||
/// </summary>
|
||
/// <param name="kl">要解析的口令</param>
|
||
/// <returns></returns>
|
||
internal static string AnalysisCmdToGoodsUrl(string kl, out string promotion_id)
|
||
{
|
||
promotion_id = string.Empty;
|
||
var html = string.Empty;
|
||
try
|
||
{
|
||
var analysisCmdUrl = string.Format(AnalysisCmdUrl, HttpHelper.URLEncode(kl), HttpExtend.GetTimeStamp(), Guid.NewGuid().ToString()) + $"&sign={HttpExtend.GetMD5String(Guid.NewGuid().ToString("N"))}";
|
||
|
||
for (int i = 0; i < 3; i++)
|
||
{
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = analysisCmdUrl,
|
||
Method = "get",
|
||
IsToLower = false,
|
||
Cookie = "",
|
||
Referer = "",
|
||
Postdata = "",
|
||
Timeout = 100000,
|
||
ReadWriteTimeout = 30000,
|
||
UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",
|
||
ContentType = "text/html",
|
||
Allowautoredirect = false,
|
||
ProxyIp = "",
|
||
ResultType = ResultType.String
|
||
};
|
||
HttpResult result = http.GetHtml(item);
|
||
html = result.Html;
|
||
if (html.Contains("status_code"))
|
||
{
|
||
var jobj = JObject.Parse(html);
|
||
if (jobj["status_code"].ToString() == "0")
|
||
break;
|
||
}
|
||
Thread.Sleep(200);
|
||
}
|
||
var jObj = JObject.Parse(html);
|
||
if (html.Contains("schema"))
|
||
{
|
||
var schema = HttpHelper.URLDecode(jObj["schema"].ToString());
|
||
|
||
var reg = Regex.Match(schema, @"promotion_id=(?<推广id>\d+)", RegexOptions.IgnoreCase);
|
||
if (reg.Success)
|
||
{
|
||
var promotion_id_tmp = reg.Groups["推广id"].Value;//临时
|
||
reg = Regex.Match(schema, @"item_id=(?<商品id>\d+)");
|
||
if (reg.Success)
|
||
{
|
||
var groupid = reg.Groups["商品id"].Value;
|
||
if (groupid == "0")//某种情况下该item_id为0的时候,promotion_id为商品id
|
||
{
|
||
groupid = promotion_id_tmp;
|
||
var cps = CpsClient.Members.FirstOrDefault(f => f.online && f.cpstype == CpsType.抖音联盟);
|
||
if (cps == null)
|
||
{
|
||
return string.Empty;
|
||
}
|
||
string goodid = new DouyinApiV2(cps).GetPromotionId(groupid);
|
||
if (!string.IsNullOrWhiteSpace(goodid))
|
||
{
|
||
return goodid;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
reg = Regex.Match(schema, @"product_id=(?<商品id>\d+)");
|
||
if (reg.Success)
|
||
{
|
||
var product_id = reg.Groups["商品id"].Value;
|
||
if (!string.IsNullOrWhiteSpace(product_id) && product_id != "0")
|
||
{
|
||
if (promotion_id_tmp == product_id)
|
||
{
|
||
promotion_id = string.Empty;
|
||
return product_id;
|
||
}
|
||
else
|
||
{
|
||
promotion_id = promotion_id_tmp;
|
||
return product_id;
|
||
}
|
||
}
|
||
}
|
||
//promotion_id = promotion_id_tmp;
|
||
}
|
||
promotion_id = promotion_id_tmp;
|
||
}
|
||
return promotion_id;
|
||
}
|
||
else
|
||
{
|
||
//{\"status_code\":4,\"status_msg\":\"啊哦,服务器打瞌睡了,再试一次吧~\",\"log_pb\":{\"impr_id\":\"202203231247040102081051452B082DD6\"}}
|
||
|
||
LogHelper.GetSingleObj().Error("抖音返利", $@"抖音口令解析_:
|
||
kl:{kl}
|
||
|
||
html = {html}");
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.GetSingleObj().Error("抖音返利", $@"抖音口令解析异常:{ex.Message} - {ex.StackTrace}
|
||
kl:{kl}
|
||
|
||
html = {html}");
|
||
throw ex;
|
||
}
|
||
finally
|
||
{
|
||
|
||
|
||
LogHelper.GetSingleObj().Debug("抖音返利调试", $@"抖音口令解析
|
||
html = {html}");
|
||
}
|
||
return string.Empty;
|
||
}
|
||
|
||
#region 抖音原始信息解析 新
|
||
|
||
public string GetDyGoodsID(string mess, out string promotion_id)
|
||
{
|
||
var product_id = string.Empty;
|
||
promotion_id = string.Empty;
|
||
try
|
||
{
|
||
|
||
#region
|
||
if (string.IsNullOrWhiteSpace(mess) ||
|
||
Regex.IsMatch(mess, @"\[图片=(.+?)\]") ||
|
||
Regex.IsMatch(mess, @"\[视频=(.+?)\]") ||
|
||
Regex.IsMatch(mess, @"\[卡片=(.+?)\]") ||
|
||
Regex.IsMatch(mess, @"\[公告=(.+?)\]") ||
|
||
Regex.IsMatch(mess, @"\[语音=(.+?)\]")
|
||
)
|
||
return string.Empty;
|
||
#endregion
|
||
|
||
bool flag = false;
|
||
if (mess.ToLower().Contains("goods_id")) flag = true;
|
||
|
||
mess = Regex.Replace(mess, "v.douyin.com", "https://v.douyin.com", RegexOptions.IgnoreCase);//抖音短链接,没有前缀
|
||
//获取链接的正则表达式
|
||
var _url = Regex.Match(mess.Replace("&", "&"), HttpExtend.REGEX_GETURL, RegexOptions.IgnoreCase);
|
||
|
||
//是否需要解析
|
||
var IsResolved = false;
|
||
|
||
//之前的拿不到promotion_id,就先不处理 这种连接: https://haohuo.jinritemai.com/views/product/item2?id=3479881104721353508
|
||
#region 新的
|
||
if (!flag && _url.Success)//有链接的情况
|
||
{
|
||
mess = _url.Groups["链接"].Value;
|
||
if (Regex.IsMatch(mess, "http[s]?://haohuo.", RegexOptions.IgnoreCase))
|
||
{
|
||
if (mess == null || !mess.Contains("?id=")) return string.Empty;
|
||
else
|
||
{
|
||
var reg = Regex.Match(mess, @"\?id=(?<product_id>\d{4,})", RegexOptions.IgnoreCase);
|
||
if (reg.Success)
|
||
{
|
||
promotion_id = product_id = reg.Groups["product_id"].Value;
|
||
IsResolved = true;
|
||
}
|
||
}
|
||
}
|
||
else if (Regex.IsMatch(mess, "http[s]?://www.iesdouyin.", RegexOptions.IgnoreCase))
|
||
{
|
||
if (mess == null || mess.ToLower().Contains("object_id="))
|
||
{
|
||
var reg = Regex.Match(mess, @"object_id=(?:\d+?)_(?<promotion_id>\d+?)_(?<goodid>\d+?)_(?:\d+?)", RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||
if (reg.Success)
|
||
{
|
||
//https://www.iesdouyin.com/?schema_type=20&object_id=1460607342872671_3508329772335892947_3508329411592229101_0
|
||
promotion_id = reg.Groups["promotion_id"].ToString();
|
||
return reg.Groups["goodid"].ToString();
|
||
}
|
||
}
|
||
else flag = true;
|
||
}
|
||
else if (Regex.IsMatch(mess, "(http[s]?://)?v.douyin.com", RegexOptions.IgnoreCase))//链接: https://v.douyin.com/LbN2pka/
|
||
{
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = mess,
|
||
Method = "GET",
|
||
Timeout = 100000,
|
||
ReadWriteTimeout = 30000,
|
||
IsToLower = false,
|
||
Cookie = "",
|
||
UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0",
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "application/x-www-form-urlencoded",
|
||
Referer = "",
|
||
Allowautoredirect = false,
|
||
AutoRedirectCookie = false,
|
||
Postdata = "",
|
||
};
|
||
HttpResult result = http.GetHtml(item);
|
||
|
||
mess = result.Html;
|
||
flag = true;
|
||
}
|
||
else
|
||
flag = true;
|
||
}
|
||
#endregion
|
||
|
||
if (flag)
|
||
{
|
||
var regUrl = Regex.Match(mess, @"(yukhj\.com|m\.tb\.cn|m\.yeeoq\.top|m\.uqlsi|m\.rijni|m\.gkqmj|m\.mulwt|uland\.taobao\.com|sjtm\.me|aa5d\.com|d11a\.com|f61[a-z]\.com|92db\.com|yqt\.so|e22a\.com|f61b\.com|detail\.m\.tmall.hk|k\.83jie\.com|ewqcxz\.com|items\.alitrip\.com|tmqd\.me|detail\.tmall\.hk|url\.cn|taobao\.com|mashort\.cn|tmall\.com|tb\.cn|detail\.yao\.95095\.com|laiwang\.com|dwz\.cn|juhuasuan\.com|detail\.m\.tmall\.com|zmnxbc\.com|s\.click\.taobao|detail\.liangxinyao\.com|m\.tb\.cn)", RegexOptions.IgnoreCase);
|
||
if (!regUrl.Success)
|
||
{
|
||
var messTmp = HttpHelper.URLDecode(HttpHelper.URLDecode(mess)).Replace("&", "&");
|
||
var reg = Regex.Match(messTmp, @"\?id=(?<product_id1>\d+)&alkey=\d+?_\d+?_\d+?_(?<product_id2>\d+)_\d+?", RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||
if (reg.Success)
|
||
{
|
||
var product_id1 = reg.Groups["product_id1"].Value;
|
||
var product_id2 = reg.Groups["product_id2"].Value;
|
||
if (product_id1 == product_id2)//商品id准确的
|
||
{
|
||
////获取promotion_id
|
||
//product_id = GetPromotionId(product_id1, out promotion_id);
|
||
//if (!string.IsNullOrWhiteSpace(product_id) && !string.IsNullOrWhiteSpace(promotion_id))
|
||
//{
|
||
// if (product_id == product_id1)
|
||
// return product_id;
|
||
//}
|
||
|
||
promotion_id = product_id = product_id1;
|
||
IsResolved = true;
|
||
}
|
||
}
|
||
|
||
reg = Regex.Match(messTmp, @"alkey=\d+?_\d+?_\d+?_(?<product_id>\d+)_\d+?", RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||
if (reg.Success)
|
||
{
|
||
promotion_id = product_id = reg.Groups["product_id"].Value;
|
||
IsResolved = true;
|
||
}
|
||
else
|
||
{
|
||
|
||
}
|
||
|
||
//这里可能还有其他的可能
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//var regs1 = Regex.Matches(mess, "[^A-Za-z0-9]?([A-Za-z0-9]{11})[^A-Za-z0-9]?");
|
||
var reg = Regex.Match(mess, "([︽#]{2}[A-Za-z0-9]{11,14}[︽#]{2})");
|
||
if (reg.Success)
|
||
{
|
||
var kl = reg.Groups[1].Value;
|
||
// product_id = KouLingAnalysis(kl);
|
||
var tmpId = DouyinApiV2.AnalysisCmdToGoodsUrl(kl, out promotion_id);
|
||
if (CheckIsGoodsId(tmpId))
|
||
{
|
||
product_id = tmpId;
|
||
promotion_id = GetPromotionId(product_id);
|
||
}
|
||
else
|
||
{
|
||
promotion_id = tmpId;
|
||
var info = FindGoodsInfo(promotion_id);
|
||
if (info != null)
|
||
{
|
||
product_id = info.data?.product_id ?? string.Empty;
|
||
}
|
||
}
|
||
IsResolved = false;
|
||
}
|
||
}
|
||
|
||
if (IsResolved)
|
||
{
|
||
if (!string.IsNullOrWhiteSpace(product_id))
|
||
{
|
||
//大概率上面的正则拿到的是商品id,先判断商品id
|
||
var isGoods = CheckIsGoodsId(product_id);
|
||
if (isGoods)
|
||
{
|
||
promotion_id = GetPromotionId(product_id);
|
||
return product_id;
|
||
}
|
||
|
||
var info = FindGoodsInfo(promotion_id);
|
||
if (info != null)
|
||
{
|
||
product_id = info.data.product_id;
|
||
return product_id;
|
||
}
|
||
//var promotion_idTmp = string.Empty;
|
||
//var product_idTmp = GetPromotionId(product_id, out promotion_idTmp);
|
||
//if (string.IsNullOrWhiteSpace(product_idTmp))
|
||
//{..
|
||
// var goodInfo = FindGoodsInfo(promotion_id ?? promotion_idTmp);
|
||
// if (goodInfo != null && goodInfo.data.promotion_id != goodInfo.data.product_id)//返回的数据要是一致的话,就直接用推广的id查询商品
|
||
// {
|
||
// promotion_id = goodInfo.data.promotion_id;
|
||
// product_id = goodInfo.data.product_id;
|
||
// }
|
||
// else
|
||
// {
|
||
// return product_id;
|
||
// }
|
||
//}
|
||
//else if (!string.IsNullOrWhiteSpace(product_idTmp) && !string.IsNullOrWhiteSpace(promotion_idTmp))
|
||
//{
|
||
// promotion_id = promotion_idTmp;
|
||
// product_id = product_idTmp;
|
||
//}
|
||
//if (product_id != promotion_id)
|
||
//{
|
||
// return product_id;
|
||
//}
|
||
}
|
||
else
|
||
{
|
||
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.GetSingleObj().Error("抖音解析", ex.Message + " - " + ex.StackTrace);
|
||
throw ex;
|
||
}
|
||
return product_id;
|
||
}
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// 检测是否是商品
|
||
/// </summary>
|
||
/// <param name="goodsId"></param>
|
||
/// <returns></returns>
|
||
public bool CheckIsGoodsId(string goodsId)
|
||
{
|
||
var result = new HttpHelper().GetHtml($"https://ec.snssdk.com/product/ajaxitem?b_type_new=0&device_id=0&is_outside=1&id={goodsId}&abParams=0&is_in_app=0");
|
||
//无效商品
|
||
//{"st":10021,"msg":"无返回内容","data":null}
|
||
|
||
//有效商品
|
||
//{"st":0,"msg":"","data":{"sell_num":"","is_stock":1,"show_buyers":1,"user_limit":0,"coupons":[],"has_apply":0,"shop_follow_count":0,"shop_product_count":1,"is_shop_recommend":false,"comments":{"list":[{"id":"1864713324575490360","user_name":"莲**0","user_avatar":"https://p3-ecom-commentpic.byteimg.com/tos-cn-i-fceoirpogb/cc1c3fb06e3052193ecba68814402404.png~tplv-fceoirpogb-image.image","recommend":false,"content":"","shop_reply":"","comment_time":"2022-12-26 19:22:45","sku":"N95口罩50只","rank_product":5,"rank":15,"photos":null,"appends":[],"likes":28,"liked":false}],"count":2,"percent":{"count":2,"value":"100.00"},"tagList":[],"current_count":1},"coupon_string":"","campaignInfo":null,"campaign_info":null}}
|
||
var jObj = JObject.Parse(result.Html);
|
||
if (jObj["st"]?.Value<long>() == 0)
|
||
{
|
||
return true;
|
||
}
|
||
return false;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取推广ID
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
public string GetPromotionId(string goodsId)
|
||
{
|
||
try
|
||
{
|
||
//"https://buyin.jinritemai.com/pc/selection_tool/batch_link?urls=https://haohuo.jinritemai.com/views/product/item2?id=3589938322287552527&msToken=Ayk1uCthVbnPw7G4iOashXNv47zgs7L6OTG0VMBLr7oGLz61YqwqRgZvTgBjZm8iNcd4DgZfxiGy3AB0lisU_YlW13n_BNhfIlgsRD7ba_Ti8i3Zyx1ZUS56u65y0bgj&X-Bogus=DFSzKIVLcNkANJZbSkGZZGO8kJMU&_signature=_02B4Z6wo00001Afq.hgAAIDBG6lAp2f7jvAH-.qAAGJWJUf4DlTz4.3mY1SP6RW2pglNc2dRFLiCWhgzCcZpaKIJqBm6PwJ9hrhr6BD2F4zfmlc6WfklhPa1qqluozJq5jin.T0cheAJdrBHa6"
|
||
var param = $"urls=https://haohuo.jinritemai.com/views/product/item2?id={goodsId}";
|
||
var sign = GetSign(param, Member.other);
|
||
|
||
if (!string.IsNullOrWhiteSpace(sign))
|
||
param = $"{param}&_signature={sign}";
|
||
|
||
var xb = GetXbogus(param, Member.other);
|
||
|
||
var http = new HttpHelper();
|
||
var item = new HttpItem()
|
||
{
|
||
URL = $"https://buyin.jinritemai.com/pc/selection_tool/batch_link?{param}&X-Bogus={xb}",
|
||
Method = "Get",
|
||
Timeout = 10000,
|
||
ReadWriteTimeout = 30000,
|
||
IsToLower = false,
|
||
Cookie = Member.cookies,
|
||
UserAgent = Member.other,
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "application/x-www-form-urlencoded",
|
||
Referer = "https://buyin.jinritemai.com/dashboard/shopwindow/goods-list",
|
||
Allowautoredirect = false,
|
||
AutoRedirectCookie = false,
|
||
Postdata = "",
|
||
ResultType = ResultType.String,
|
||
};
|
||
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)
|
||
{
|
||
var promotion_id = batch_shop_manage_promotions[0]["promotion_id"]?.ToString();
|
||
return promotion_id;
|
||
}
|
||
}
|
||
catch (Exception e)
|
||
{
|
||
}
|
||
return string.Empty;
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 通过商品链接查询商品信息
|
||
/// </summary>
|
||
/// <param name="goodsId">商品id</param>
|
||
/// <returns>返回商品的基础信息</returns>
|
||
public DouyinGoodsInfo FindGoodsInfo(string promotion_id)
|
||
{
|
||
if (string.IsNullOrWhiteSpace(promotion_id))
|
||
{
|
||
return null;
|
||
}
|
||
var html = string.Empty;
|
||
try
|
||
{
|
||
for (int i = 0; i < 5; i++)
|
||
{
|
||
var param = $"promotion_id={promotion_id}";
|
||
var sign = GetSign(param, Member.other);
|
||
if (!string.IsNullOrWhiteSpace(sign))
|
||
param = $"{param}&_signature={sign}";
|
||
|
||
var xb = GetXbogus(param, Member.other);
|
||
|
||
var searchUrl = $"https://buyin.jinritemai.com/pc/decision/detail?";
|
||
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = $"{searchUrl}{param}&X-Bogus={xb}",
|
||
Method = "get",
|
||
IsToLower = false,
|
||
Cookie = Member.cookies,
|
||
Referer = "https://buyin.jinritemai.com/dashboard/shopwindow/goods-list",
|
||
Postdata = "",
|
||
Timeout = 10000,
|
||
ReadWriteTimeout = 10000,
|
||
UserAgent = Member.other,
|
||
ContentType = "application/json",
|
||
Allowautoredirect = false,
|
||
ProxyIp = "",
|
||
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);
|
||
html = result.Html;
|
||
break;
|
||
}
|
||
|
||
//{"code":0,"st":0,"msg":"","data":{"promotions":[{"promotion_id":"3473786827197053067","product_id":"3473587162723782872","title":"【象牙塔】爆款 厚实桌面手机支架 随意旋转上下调节","cover":{"uri":"temai/e7ea85383a76fe7cec7390407fdfa984www1099-1015","url_list":["http://p3.pstatp.com/aweme/720x720/temai/e7ea85383a76fe7cec7390407fdfa984www1099-1015.jpeg","http://pb9.pstatp.com/aweme/720x720/temai/e7ea85383a76fe7cec7390407fdfa984www1099-1015.jpeg","http://pb3.pstatp.com/aweme/720x720/temai/e7ea85383a76fe7cec7390407fdfa984www1099-1015.jpeg"]},"detail_url":"https://haohuo.jinritemai.com/views/product/item2?id=3473587162723782872","promotion_source":4,"brand_icon":{"url_list":["http://p3.pstatp.com/origin/db00001bcc4cfde8d96a"]},"price":990,"market_price":1900,"cos_fee":495,"cos_ratio":5000,"month_sales":7020,"shop_id":14065420,"shop_name":"象牙塔","exp_score":"4.5","in_promotion":true,"in_shop":false,"sales":0}],"has_more":false,"search_id":"6979517724091285760"},"total":1,"log_id":"20210630173326010198066204044B8F51"}
|
||
var goodsInfo = JsonConvert.DeserializeObject<DouyinGoodsInfo>(html);
|
||
if (goodsInfo != null && goodsInfo.msg == "用户未登录")
|
||
throw new Exception("商品不存在");
|
||
//没有查到返利提示
|
||
if (goodsInfo == null || goodsInfo.data == null || goodsInfo.msg == "商品没有推广信息" || goodsInfo.code != 0)
|
||
throw new Exception("商品不存在");
|
||
return goodsInfo;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.GetSingleObj().Error("抖音返利", $@"promotion_id = {promotion_id} ,查询商品信息异常,{ex.Message}
|
||
st:{ex.StackTrace}
|
||
|
||
html = {html}");
|
||
Thread.Sleep(500 + new Random(Guid.NewGuid().GetHashCode()).Next(500, 1000));
|
||
throw new Exception(ex.Message);
|
||
}
|
||
finally
|
||
{
|
||
LogHelper.GetSingleObj().Debug("抖音返利调试", $@"promotion_id = {promotion_id} ,查询商品信息
|
||
html = {html}");
|
||
}
|
||
return null;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 绑定关系
|
||
/// </summary>
|
||
/// <param name="product_id"></param>
|
||
/// <returns></returns>
|
||
public bool BindGoods(string product_id, string promotion_id)
|
||
{
|
||
var html = string.Empty;
|
||
try
|
||
{
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = "https://buyin.jinritemai.com/api/shop/bind",
|
||
Method = "head",
|
||
Timeout = 100000,
|
||
ReadWriteTimeout = 30000,
|
||
IsToLower = false,
|
||
Cookie = Member.cookies,
|
||
UserAgent = "Opera/9.27 (Windows NT 5.2; U; zh-cn)",
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "text/json",
|
||
Referer = "https://buyin.jinritemai.com/api/shop/bind",
|
||
Allowautoredirect = true,
|
||
AutoRedirectCookie = false,
|
||
Postdata = "",
|
||
ResultType = ResultType.String,
|
||
};
|
||
item.Header.Add("x-secsdk-csrf-request", "1");
|
||
HttpResult result = http.GetHtml(item);
|
||
|
||
Member.cookies = result.UpdateCookies(Member.cookies);
|
||
|
||
var token = string.Empty;
|
||
if (result.Header.AllKeys.Contains("x-ware-csrf-token"))
|
||
{
|
||
token = result.Header["x-ware-csrf-token"];
|
||
//0,000100000001eaa646767f8d6256ebdfd102948baa96304b4ac337509303bc3337f980350b5416d1c078c655906c,86370000,success
|
||
token = token.Split(',')[1];
|
||
|
||
var postdata = @"{""pmts"":[{""promotion_id"":""" + promotion_id + @""",""bind_source"":""0"",""link_url"":""https://haohuo.jinritemai.com/views/product/item2?id=" + product_id + @"""}],""hide_status"":2}";
|
||
|
||
var sign = GetSign("", Member.other, postdata);
|
||
|
||
var param = string.Empty;
|
||
if (!string.IsNullOrWhiteSpace(sign))
|
||
param = $"_signature={sign}";
|
||
|
||
var xb = GetXbogus(param, Member.other, postdata);
|
||
|
||
http = new HttpHelper();
|
||
item = new HttpItem()
|
||
{
|
||
URL = $"https://buyin.jinritemai.com/api/shop/bind/?X-Bogus={xb}&{param}",
|
||
Method = "POST",
|
||
Timeout = 100000,
|
||
ReadWriteTimeout = 30000,
|
||
IsToLower = false,
|
||
Cookie = Member.cookies,
|
||
UserAgent = Member.other,
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "application/json",
|
||
Referer = "https://buyin.jinritemai.com/dashboard/shopwindow/goods-list",
|
||
Allowautoredirect = false,
|
||
AutoRedirectCookie = false,
|
||
Postdata = postdata,
|
||
ResultType = ResultType.String,//返回数据类型,是Byte还是String
|
||
};
|
||
item.Header.Add("x-secsdk-csrf-token", token);//设置请求头信息(Header)
|
||
result = http.GetHtml(item);
|
||
|
||
//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":[]}}
|
||
//{"st":0,"code":0,"msg":"成功添加0件商品至橱窗","log_id":"202202081526040101501480791706D0B6","data":{"success_count":0,"failure_count":1,"failure_list":[{"bind_status":1,"bind_msg":"绑定失败","bind_reason":"获取推广信息失败","product_id":"","title":""}]}}
|
||
if (string.IsNullOrWhiteSpace(html))
|
||
return false;
|
||
|
||
var jObj = JObject.Parse(html);
|
||
var success_count = (int)jObj["data"]["success_count"];
|
||
if (success_count > 0)
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.GetSingleObj().Error("抖音返利", $@"商品id = {product_id}, 推广id = {promotion_id} ,添加商品到橱柜异常:{ex.Message}
|
||
st:{ex.StackTrace}
|
||
|
||
html = {html}");
|
||
}
|
||
finally
|
||
{
|
||
LogHelper.GetSingleObj().Debug("抖音返利调试", $@"商品id = {product_id}, 推广id = {promotion_id} ,添加商品到橱柜
|
||
html = {html}");
|
||
}
|
||
|
||
return false;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除橱柜商品
|
||
/// </summary>
|
||
/// <param name="promotion_id">推广id</param>
|
||
/// <returns></returns>
|
||
public bool DelGoodsWindowUrls(List<string> promotion_ids)
|
||
{
|
||
var html = string.Empty;
|
||
for (int i = 0; i < 2; i++)
|
||
{
|
||
try
|
||
{
|
||
var pids = string.Join("%2C", promotion_ids);
|
||
|
||
var postdata = $"promotion_ids={pids}";
|
||
|
||
//var sign = GetSign("", Member.other, postdata);
|
||
//var param = string.Empty;
|
||
//if (!string.IsNullOrWhiteSpace(sign))
|
||
// param = $"_signature={sign}";
|
||
|
||
//var xb = GetXbogus(param, Member.other, postdata);
|
||
|
||
//var xb = GetXbogus("", Member.other);
|
||
|
||
var http = new HttpHelper();
|
||
var item = new HttpItem()
|
||
{
|
||
URL = $"https://buyin.jinritemai.com/api/shop/batchUnbind",
|
||
Method = "POST",
|
||
Timeout = 10000,
|
||
ReadWriteTimeout = 30000,
|
||
IsToLower = false,
|
||
Cookie = Member.cookies,
|
||
UserAgent = Member.other,
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "application/x-www-form-urlencoded",
|
||
Referer = "https://buyin.jinritemai.com/dashboard/merch-picking-hall",
|
||
Allowautoredirect = false,
|
||
AutoRedirectCookie = false,
|
||
Postdata = postdata,
|
||
ResultType = ResultType.String,
|
||
};
|
||
HttpResult result = http.GetHtml(item);
|
||
|
||
//{"code":0,"st":0,"msg":"success","error_type":0,"data":{},"log_id":"202107011223480101980650882E822E5B"}
|
||
html = result.Html;
|
||
var jObj = JObject.Parse(html);
|
||
if (html.Contains("code"))
|
||
{
|
||
var code = (int)jObj["code"];
|
||
if (code == 0)
|
||
{
|
||
if (Regex.IsMatch(jObj["msg"].ToString(), @"成功删除\d+个商品"))
|
||
return true;
|
||
}
|
||
else
|
||
{
|
||
LogHelper.GetSingleObj().Error("抖音返利", $@"删除所有商品橱窗异常:{html}");
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.GetSingleObj().Error("抖音返利", $@"删除橱窗商品列表:{string.Join(",", promotion_ids)}");
|
||
}
|
||
finally
|
||
{
|
||
LogHelper.GetSingleObj().Debug("抖音返利", $@"删除橱窗商品列表:{string.Join(",", promotion_ids)}");
|
||
}
|
||
Thread.Sleep(1000);
|
||
}
|
||
return false;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除橱柜商品
|
||
/// </summary>
|
||
/// <param name="promotion_id">推广id</param>
|
||
/// <returns></returns>
|
||
public List<string> FindGoodsWindowUrls(out int total)
|
||
{
|
||
total = 0;
|
||
List<string> list = new List<string>();
|
||
var html = string.Empty;
|
||
for (int i = 0; i < 2; i++)
|
||
{
|
||
try
|
||
{
|
||
var param = "hide_status=0&page=1&pageSize=20&promotion_source=0";
|
||
var sign = GetSign(param, Member.other);
|
||
//param = $"{param}&_signature={sign}";
|
||
|
||
if (!string.IsNullOrWhiteSpace(sign))
|
||
param = $"{param}&_signature={sign}";
|
||
|
||
var xb = GetXbogus(param, Member.other);
|
||
|
||
var http = new HttpHelper();
|
||
var item = new HttpItem()
|
||
{
|
||
URL = $"https://buyin.jinritemai.com/api/shop/search?{param}&X-Bogus={xb}",
|
||
Method = "Get",
|
||
Timeout = 10000,
|
||
ReadWriteTimeout = 30000,
|
||
IsToLower = false,
|
||
Cookie = Member.cookies,
|
||
UserAgent = Member.other,
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "application/x-www-form-urlencoded",
|
||
Referer = "https://buyin.jinritemai.com/dashboard/shopwindow/goods-list",
|
||
Allowautoredirect = false,
|
||
AutoRedirectCookie = false,
|
||
Postdata = "",
|
||
ResultType = ResultType.String,
|
||
};
|
||
HttpResult result = http.GetHtml(item);
|
||
|
||
html = result.Html;
|
||
if (!string.IsNullOrWhiteSpace(html))
|
||
{
|
||
var regs = Regex.Matches(html, @"promotion_id"":\s?""(?<promotion_id>\d+)""", RegexOptions.IgnoreCase);
|
||
for (int z = 0; z < regs.Count; z++)
|
||
{
|
||
list.Add(regs[z].Groups["promotion_id"].Value);
|
||
}
|
||
var reg = Regex.Match(html, @"""total"":\s?(?<total>\d+)", RegexOptions.IgnoreCase);
|
||
if (reg.Success)
|
||
total = int.Parse(reg.Groups["total"].Value);
|
||
return list;
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.GetSingleObj().Error("抖音返利", $@"获取橱窗商品列表异常,{ex.Message}");
|
||
}
|
||
finally
|
||
{
|
||
LogHelper.GetSingleObj().Debug("抖音返利", $@"获取橱窗商品列表:{string.Join(",", list)}");
|
||
}
|
||
Thread.Sleep(1000);
|
||
}
|
||
return list;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 通过商品id查询橱柜中的商品,获取推广链接
|
||
/// </summary>
|
||
/// <param name="goodsid">商品id</param>
|
||
/// <returns></returns>
|
||
public string GetShopWindow_PromotionUrlToGoodsId(string goodsid, string promotion_id)
|
||
{
|
||
var html = string.Empty;
|
||
try
|
||
{
|
||
for (int i = 0; i < 10; i++)
|
||
{
|
||
var param = $@"hide_status=0&promotion_source=0&title={goodsid}&page=1&pageSize=20";
|
||
var sign = GetSign(param, Member.other);
|
||
//var sign = string.Empty;
|
||
|
||
if (!string.IsNullOrWhiteSpace(sign))
|
||
param = $"{param}&_signature={sign}";
|
||
|
||
var xb = GetXbogus(param, Member.other);
|
||
|
||
var searchUrl = "https://buyin.jinritemai.com/api/shop/search?";
|
||
|
||
var ck = Member.cookies;
|
||
|
||
//ck = CkRelpace(ck, "");
|
||
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = $"{searchUrl}{param}&X-Bogus={xb}",
|
||
//URL = $"{searchUrl}{param}",
|
||
Method = "get",
|
||
IsToLower = false,
|
||
Cookie = ck,
|
||
Referer = "https://buyin.jinritemai.com/dashboard/shopwindow/goods-list",
|
||
Postdata = "",
|
||
Timeout = 100000,
|
||
ReadWriteTimeout = 30000,
|
||
UserAgent = Member.other,
|
||
Accept = "text/html, application/xhtml+xml, */*",// 可选项有默认值
|
||
ContentType = "application/json",//返回类型 可选项有默认值
|
||
Allowautoredirect = false,
|
||
ProxyIp = "",
|
||
ResultType = ResultType.String,
|
||
Host = "buyin.jinritemai.com"
|
||
//IsUpdateCookie = true
|
||
};
|
||
|
||
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");
|
||
//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);
|
||
html = result.Html;
|
||
|
||
#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
|
||
|
||
var jObj = JObject.Parse(html);
|
||
if (html.Contains("code"))
|
||
{
|
||
var code = (int)jObj["code"];
|
||
if (code == 0)
|
||
{
|
||
var jArr = (JArray)jObj["data"];
|
||
if (jArr.Count != 0)
|
||
{
|
||
var jTok = jArr[0];
|
||
|
||
//var shopUrl = jTok["detail_url"].ToString();
|
||
//if (!shopUrl.Contains("sec_author_id"))
|
||
//{
|
||
// var buyin_track = GetBuyinTrack(promotion_id, goodsid);
|
||
// shopUrl = $"{shopUrl}&sec_author_id={GetSecAuthorId()}&origin_id={goodsid}_{promotion_id}&buyin_track={buyin_track}";
|
||
//}
|
||
var shopUrl = GetDetailUrl(promotion_id, goodsid);
|
||
|
||
return shopUrl;
|
||
}
|
||
}
|
||
else if (code == 9001)
|
||
{
|
||
//LogHelper.GetSingleObj().Debug("抖音下载", $"html={html},出验证码了.正在滑块");
|
||
if (i % 3 == 0 && result.Header.AllKeys.Contains("X-Buyin-Sec-Verify-Code"))
|
||
{
|
||
var VerifyCode = result.Header["X-Buyin-Sec-Verify-Code"].ToString();
|
||
var webId = SlidingBlock(Member.cookies, VerifyCode);
|
||
if (!string.IsNullOrWhiteSpace(webId))
|
||
{
|
||
Member.cookies = CkRelpace(Member.cookies, webId);
|
||
ApiClient.GetSession().Saveable(Member).ExecuteCommand();
|
||
continue;
|
||
}
|
||
}
|
||
else
|
||
throw new Exception(html);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
LogHelper.GetSingleObj().Debug("抖音返利", $@"goodsid = {goodsid} ,{html}");
|
||
}
|
||
Thread.Sleep(1000);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.GetSingleObj().Error("抖音返利", $@"获取推广链接异常:{ex.Message}
|
||
st:{ex.StackTrace}
|
||
|
||
html = {html}");
|
||
}
|
||
finally
|
||
{
|
||
LogHelper.GetSingleObj().Debug("抖音返利调试", $@"获取推广链接 goodsid:{goodsid}
|
||
html = {html}");
|
||
}
|
||
return string.Empty;
|
||
}
|
||
|
||
private static string CkRelpace(string ck, string wVWebId)
|
||
{
|
||
ck = Regex.Replace(ck, "(;s_v_web_id=[^;]+)", "");
|
||
ck += wVWebId;
|
||
return ck;
|
||
}
|
||
|
||
public static string GetLoginUserInfo(string cookies, string UserAgent)
|
||
{
|
||
var param = $"PIGEON_BIZ_TYPE=5";
|
||
|
||
var sign = GetSign(param, UserAgent);
|
||
|
||
if (!string.IsNullOrWhiteSpace(sign))
|
||
param = $"{param}&_signature={sign}";
|
||
|
||
var xb = GetXbogus(param, UserAgent);
|
||
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = $"https://darenim.jinritemai.com/chat/api/sd/by/account?{param}&X-Bogus={xb}",
|
||
Method = "GET",
|
||
Timeout = 5000,
|
||
ReadWriteTimeout = 5000 * 2,
|
||
IsToLower = false,
|
||
Cookie = cookies,
|
||
UserAgent = UserAgent,
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "text/html",
|
||
Referer = "",
|
||
Allowautoredirect = false,
|
||
AutoRedirectCookie = false,
|
||
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;
|
||
|
||
return html;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取抖客账号信息
|
||
/// </summary>
|
||
/// <param name="cookies"></param>
|
||
/// <param name="UserAgent"></param>
|
||
/// <returns></returns>
|
||
public static string GetDoukeAccessInfo(string cookies, string UserAgent)
|
||
{
|
||
var param = $"";
|
||
var sign = GetSign(param, UserAgent);
|
||
|
||
if (!string.IsNullOrWhiteSpace(sign))
|
||
param = $"_signature={sign}";
|
||
|
||
var xb = GetXbogus(param, UserAgent);
|
||
|
||
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = $"https://buyin.jinritemai.com/api/hybrid/account/info?{param}&X-Bogus={xb}",
|
||
Method = "GET",
|
||
Timeout = 5000,
|
||
ReadWriteTimeout = 5000 * 2,
|
||
IsToLower = false,
|
||
Cookie = cookies,
|
||
UserAgent = UserAgent,
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "text/html",
|
||
Referer = "https://buyin.jinritemai.com/dashboard?new_enter_from=",
|
||
Allowautoredirect = false,
|
||
AutoRedirectCookie = false,
|
||
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;
|
||
|
||
return html;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取抖客账号信息
|
||
/// </summary>
|
||
/// <param name="cookies"></param>
|
||
/// <param name="UserAgent"></param>
|
||
/// <returns></returns>
|
||
public static string GetDoukeUserInfo(string cookies, string UserAgent)
|
||
{
|
||
var param = $"";
|
||
var sign = GetSign(param, UserAgent);
|
||
|
||
if (!string.IsNullOrWhiteSpace(sign))
|
||
param = $"_signature={sign}";
|
||
|
||
var xb = GetXbogus(param, UserAgent);
|
||
|
||
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = $"https://buyin.jinritemai.com/index/getUser?{param}&X-Bogus={xb}",
|
||
Method = "GET",
|
||
Timeout = 5000,
|
||
ReadWriteTimeout = 5000 * 2,
|
||
IsToLower = false,
|
||
Cookie = cookies,
|
||
UserAgent = UserAgent,
|
||
Accept = "application/json, text/plain, */*",
|
||
ContentType = "text/html",
|
||
Referer = "https://buyin.jinritemai.com/dashboard/douke/merch-picking-hall",
|
||
Allowautoredirect = false,
|
||
AutoRedirectCookie = false,
|
||
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;
|
||
|
||
return html;
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 检查抖音App授权时间
|
||
/// </summary>
|
||
/// <param name="input"></param>
|
||
/// <returns></returns>
|
||
/// <exception cref="BusinessException"></exception>
|
||
/// <exception cref="Exception"></exception>
|
||
public static bool CheckAppAuthTime(string cookies, string userAgent)
|
||
{
|
||
var param = $"page=1&page_size=21&auth_status=0";
|
||
|
||
var sign = GetSign(param, userAgent);
|
||
|
||
if (!string.IsNullOrWhiteSpace(sign))
|
||
{
|
||
param = $"{param}&_signature={sign}";
|
||
}
|
||
|
||
var xb = GetXbogus(param, userAgent);
|
||
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = $"https://buyin.jinritemai.com/api/kol/doudian/app/list?{param}&X-Bogus={xb}",
|
||
Method = "GET",
|
||
Timeout = 5000,
|
||
ReadWriteTimeout = 5000 * 2,
|
||
IsToLower = false,
|
||
Cookie = cookies,
|
||
UserAgent = userAgent,
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "application/x-www-form-urlencoded",
|
||
Referer = "https://buyin.jinritemai.com/dashboard/shopwindow/goods-list",
|
||
Allowautoredirect = false,
|
||
AutoRedirectCookie = false,
|
||
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))
|
||
{
|
||
throw new Exception("数据异常");
|
||
}
|
||
|
||
var jObj = JObject.Parse(html);
|
||
|
||
if (jObj == null)
|
||
{
|
||
throw new Exception("获取失败");
|
||
}
|
||
|
||
if (jObj["code"]?.Value<int>() == 0)
|
||
{
|
||
var jArr = jObj["data"].ToArray();
|
||
foreach (var tmp in jArr)
|
||
{
|
||
if (tmp["app_id"]?.Value<string>() == "7066380295942964749")
|
||
{
|
||
if (DateTime.TryParse(tmp["expire_time"]?.Value<string>(), out var expireTime))
|
||
{
|
||
if (expireTime > DateTime.Now)
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
|
||
|
||
public List<string> DownOrder(DateTime start_time, DateTime end_time, int _page_index, DouyinQueryOrderType type)
|
||
{
|
||
int num = 0;
|
||
Next:
|
||
num++;
|
||
var pageSize = 50;
|
||
#region
|
||
List<string> list = new List<string>();
|
||
try
|
||
{
|
||
var page = _page_index;
|
||
JObject jObj = null;
|
||
|
||
var param = $"time_type={(int)type}&page={page}&pageSize={pageSize}&author_app_id=1128&user_id={Member.other2}&start_time={HttpExtend.GetTimeStamp(start_time)}&end_time={HttpExtend.GetTimeStamp(end_time)}";
|
||
var sign = GetSign(param, Member.other);
|
||
|
||
if (!string.IsNullOrWhiteSpace(sign))
|
||
param = $"{param}&_signature={sign}";
|
||
|
||
var xb = GetXbogus(param, Member.other);
|
||
|
||
try
|
||
{
|
||
Thread.Sleep(500 + new Random(Guid.NewGuid().GetHashCode()).Next(500, 1000));
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = $"https://buyin.jinritemai.com/api/author/order/details?{param}&X-Bogus={xb}",//&X-Bogus={xb}",
|
||
Method = "GET",
|
||
Timeout = 100000,
|
||
ReadWriteTimeout = 30000,
|
||
IsToLower = false,
|
||
Cookie = Member.cookies,
|
||
UserAgent = Member.other,
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "application/json",
|
||
Referer = "",
|
||
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);
|
||
|
||
var html = result.Html;
|
||
|
||
if (result.Header.AllKeys.Contains("Set-Cookie") || 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 = UpCKMsToken(Member.cookies, reg.Groups[1].Value);
|
||
}
|
||
}
|
||
|
||
var log = $@"抖音订单1请求时间:{DateTime.Now:yyyy-MM-dd HH:mm:ss} ,订单时间:{start_time:yyyy-MM-dd HH:mm:ss} - {end_time:yyyy-MM-dd HH:mm:ss},{type.ToString()},{page}页
|
||
|
||
{html}";
|
||
System.Diagnostics.Debug.WriteLine(log);
|
||
LogHelper.GetSingleObj().Debug("抖音下载", log);
|
||
|
||
try
|
||
{
|
||
//if (html.ToLower().Contains("400 Request Header".ToLower()))
|
||
//{
|
||
// Member.cookies = Member.cookies.SimpleCookies();
|
||
//}
|
||
|
||
jObj = JObject.Parse(html);
|
||
|
||
if (jObj["code"] != null)
|
||
{
|
||
var code = (int)jObj["code"];
|
||
if (code == 0)
|
||
{
|
||
if (jObj["total"] != null && (int)jObj["total"] != 0)
|
||
list.Add(html);
|
||
}
|
||
else
|
||
{
|
||
//{"st":0,"code":9001,"msg":"操作异常","log_id":"2022010221313001020404907424DA1368","data":[]}
|
||
//{"st":401,"code":401,"msg":"请重新登录","extra":{"now":1641130324000,"log_id":"2022010221320401021213604714D95647"},"data":[]}
|
||
if (code == 401)
|
||
throw new Exception(html);
|
||
else if (code == 9001)
|
||
{
|
||
Thread.Sleep(2000);
|
||
//LogHelper.GetSingleObj().Debug("抖音下载", $"html={html},出验证码了.正在滑块");
|
||
|
||
if (num <= 3 && result.Header.AllKeys.Contains("X-Buyin-Sec-Verify-Code"))
|
||
{
|
||
var VerifyCode = result.Header["X-Buyin-Sec-Verify-Code"].ToString();
|
||
var webId = SlidingBlock(Member.cookies, VerifyCode);
|
||
if (!string.IsNullOrWhiteSpace(webId))
|
||
{
|
||
Member.cookies = CkRelpace(Member.cookies, webId);
|
||
ApiClient.GetSession().Saveable(Member).ExecuteCommand();
|
||
goto Next;
|
||
}
|
||
}
|
||
else
|
||
throw new Exception(html);
|
||
}
|
||
jObj = null;
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
|
||
if (jObj != null)
|
||
{
|
||
var total = (int)jObj["total"];
|
||
|
||
if (total > pageSize)
|
||
{
|
||
var value = (decimal)total / (decimal)pageSize;
|
||
var rate = (int)Math.Ceiling(value);
|
||
for (int i = 1; i < rate; i++)
|
||
{
|
||
try
|
||
{
|
||
Thread.Sleep(5000 + new Random(Guid.NewGuid().GetHashCode()).Next(1000, 2000));
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = $"https://buyin.jinritemai.com/api/author/order/details?time_type={(int)type}&page={i}&pageSize={pageSize}&author_app_id=1128&user_id={Member.username}&start_time={HttpExtend.GetTimeStamp(start_time)}&end_time={HttpExtend.GetTimeStamp(end_time)}",
|
||
Method = "GET",
|
||
Timeout = 100000,
|
||
ReadWriteTimeout = 30000,
|
||
IsToLower = false,
|
||
Cookie = Member.cookies,
|
||
UserAgent = Member.other,
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "application/x-www-form-urlencoded",
|
||
Referer = "",
|
||
Allowautoredirect = false,
|
||
AutoRedirectCookie = false,
|
||
Postdata = "",
|
||
ResultType = ResultType.String
|
||
};
|
||
HttpResult result = http.GetHtml(item);
|
||
|
||
var html = result.Html;
|
||
|
||
var log = $@"抖音订单2请求时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} ,订单时间:{start_time.ToString("yyyy-MM-dd HH:mm:ss")} - {end_time.ToString("yyyy-MM-dd HH:mm:ss")},{type.ToString()},{page}页
|
||
|
||
{html}";
|
||
System.Diagnostics.Debug.WriteLine(log);
|
||
LogHelper.GetSingleObj().Debug("抖音下载2", log);
|
||
|
||
try
|
||
{
|
||
jObj = JObject.Parse(html);
|
||
|
||
if (jObj["code"] != null)
|
||
{
|
||
var code = (int)jObj["code"];
|
||
if (code == 0)
|
||
{
|
||
list.Add(html);
|
||
}
|
||
else
|
||
{
|
||
Thread.Sleep(2000 + new Random(Guid.NewGuid().GetHashCode()).Next(500, 1000));
|
||
//{"st":0,"code":9001,"msg":"操作异常","log_id":"2022010221313001020404907424DA1368","data":[]}
|
||
//{"st":401,"code":401,"msg":"请重新登录","extra":{"now":1641130324000,"log_id":"2022010221320401021213604714D95647"},"data":[]}
|
||
if (code == 401)
|
||
{
|
||
Member.online = false;//离线
|
||
throw new Exception("重新登录");
|
||
}
|
||
else if (code == 9001)
|
||
{
|
||
LogHelper.GetSingleObj().Debug("抖音下载", $"html={html},可能是验证码");
|
||
}
|
||
jObj = null;
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
finally
|
||
{
|
||
Thread.Sleep(500);
|
||
}
|
||
return list;
|
||
#endregion
|
||
}
|
||
|
||
|
||
private string UpCKMsToken(string ck, string newMsToken)
|
||
{
|
||
ck = ck.Trim();
|
||
ck = ck + (ck.EndsWith(";") ? "" : ";");
|
||
var regs = Regex.Matches(ck, @"(?<值>msToken=[^;]+;)", RegexOptions.IgnoreCase);
|
||
List<string> msTokens = new List<string>();
|
||
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<string, DateTime> SlidingBlockCache = new Dictionary<string, DateTime>();
|
||
|
||
/// <summary>
|
||
/// 用户账号ID缓存
|
||
/// </summary>
|
||
private static Dictionary<string, string> SecAuthorIdDic = new Dictionary<string, string>();
|
||
|
||
/// <summary>
|
||
/// 获取用户id
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
public string GetSecAuthorId()
|
||
{
|
||
if (SecAuthorIdDic.ContainsKey(Member.username))
|
||
{
|
||
return SecAuthorIdDic[Member.username];
|
||
}
|
||
|
||
var id = RequestSecAuthorId();
|
||
if (string.IsNullOrWhiteSpace(id))
|
||
{
|
||
return string.Empty;
|
||
}
|
||
|
||
SecAuthorIdDic[Member.username] = id;
|
||
return id;
|
||
}
|
||
|
||
public string RequestSecAuthorId()
|
||
{
|
||
try
|
||
{
|
||
var param = "uid=&works_type=1&special_price_id=";
|
||
var xb = GetXbogus(param, Member.other);
|
||
var url = "https://buyin.jinritemai.com/api/authorStatData/authorProfile?uid=&works_type=1&special_price_id=&X-Bogus=";
|
||
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = $"{url}{xb}",
|
||
Method = "GET",
|
||
Cookie = Member.cookies,
|
||
UserAgent = Member.other,
|
||
Referer = "https://buyin.jinritemai.com/dashboard/merch-picking-hall",
|
||
Accept = "application/json, text/plain, */*",
|
||
ContentType = "application/json",
|
||
Postdata = "",
|
||
ResultType = ResultType.String,
|
||
Host = "buyin.jinritemai.com"
|
||
};
|
||
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;
|
||
|
||
var jObj = JObject.Parse(html);
|
||
var web_homepage_url = jObj["data"]?["web_homepage_url"]?.Value<string>();
|
||
|
||
var id = web_homepage_url.Replace("https://www.douyin.com/user/", "");
|
||
return id;
|
||
}
|
||
catch (Exception e)
|
||
{
|
||
LogHelper.GetSingleObj().Debug("抖音返利调试", $@"获取用户账户值异常");
|
||
}
|
||
return string.Empty;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取推广链接
|
||
/// </summary>
|
||
/// <param name="promotion_id"></param>
|
||
/// <param name="product_id"></param>
|
||
/// <returns></returns>
|
||
public string GetDetailUrl(string promotion_id, string product_id)
|
||
{
|
||
try
|
||
{
|
||
var param = $"promotion_id={promotion_id}&product_id={product_id}";
|
||
var xb = GetXbogus(param, Member.other);
|
||
var url = $"https://buyin.jinritemai.com/api/shop/detail?{param}&X-Bogus=";
|
||
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
URL = $"{url}{xb}",
|
||
Method = "GET",
|
||
Cookie = Member.cookies,
|
||
UserAgent = Member.other,
|
||
Referer = "https://buyin.jinritemai.com/dashboard/merch-picking-hall",
|
||
Accept = "application/json, text/plain, */*",
|
||
ContentType = "application/json",
|
||
Postdata = "",
|
||
ResultType = ResultType.String,
|
||
Host = "buyin.jinritemai.com"
|
||
};
|
||
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;
|
||
|
||
var jObj = JObject.Parse(html);
|
||
var detailUrl = jObj["data"]?["detail_url"]?.Value<string>() ?? string.Empty;
|
||
|
||
//var id = web_homepage_url.Replace("https://www.douyin.com/user/", "");
|
||
return detailUrl;
|
||
}
|
||
catch (Exception e)
|
||
{
|
||
LogHelper.GetSingleObj().Debug("抖音返利调试", $@"获取用户账户值异常");
|
||
}
|
||
return string.Empty;
|
||
}
|
||
|
||
#region 滑块
|
||
private static string SlidingBlock(string ck, string verify_conf)
|
||
{
|
||
try
|
||
{
|
||
var reg = Regex.Match(ck, "SASID=([^;]+)", RegexOptions.IgnoreCase);
|
||
if (!reg.Success)
|
||
{
|
||
return string.Empty;
|
||
}
|
||
var dyId = reg.Groups[1].Value;
|
||
|
||
if (SlidingBlockCache.ContainsKey(dyId))
|
||
{
|
||
if (SlidingBlockCache[dyId] > DateTime.Now)
|
||
{
|
||
return string.Empty;
|
||
}
|
||
}
|
||
|
||
SlidingBlockCache[dyId] = DateTime.Now.AddHours(1);
|
||
|
||
for (int i = 0; i < 3; i++)
|
||
{
|
||
var html = RequestSlidingBlock(ck, verify_conf);
|
||
if (!string.IsNullOrWhiteSpace(html))
|
||
{
|
||
//{"code":0,"msg":"\u6ed1\u5757\u6210\u529f\uff1averify_l0zvp97r_IBaMz2Mf_0DLB_4XuM_80gw_4AQDyhfXT50Q"}
|
||
var jObj = JObject.Parse(html);
|
||
if (jObj != null)
|
||
{
|
||
var code = (int)jObj["code"];
|
||
if (200 == code)
|
||
{
|
||
var jObj1 = JObject.Parse(verify_conf);
|
||
var fp = jObj1["fp"]?.ToString();
|
||
LogHelper.GetSingleObj().Debug("抖音滑块", "抖音滑块成功");
|
||
|
||
return $";s_v_web_id={fp}";
|
||
}
|
||
if (-1 == code)//{"code":-1,"msg":"call: coderL"}
|
||
{
|
||
Thread.Sleep(3000);
|
||
LogHelper.GetSingleObj().Debug("抖音滑块", $"抖音滑块失败 {(i + 1)} => html = {html}");
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.GetSingleObj().Error("滑块异常", ex.Message + " - " + ex.StackTrace);
|
||
}
|
||
return string.Empty;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 请求滑块
|
||
/// </summary>
|
||
/// <param name="ck"></param>
|
||
/// <param name="verify_conf"></param>
|
||
/// <returns></returns>
|
||
private static string RequestSlidingBlock(string ck, string verify_conf)
|
||
{
|
||
//ck = CkRelpace(ck, ";s_v_web_id=verify_l7bcxz5e_JTtVMCp0_uz88_4Cgb_9i8l_2dqOYZFURkt1");
|
||
|
||
ck = CkRelpace(ck, "");
|
||
|
||
//ck += ";s_v_web_id=verify_l7bcxz5e_JTtVMCp0_uz88_4Cgb_9i8l_2dqOYZFURkt1";
|
||
//var verify_conf1 = verify_conf.Replace("\\", "\\\\").Replace(@"""", @"\""");
|
||
//var postData = @"{""cookie"":""" + ck + @""",""verify_conf"":""" + verify_conf1 + @"""}";
|
||
var postData2 = JsonConvert.SerializeObject(new { cookie = ck, verify_conf = verify_conf });
|
||
|
||
var sign = HttpExtend.GetMD5String("Cc" + verify_conf + "_*54R56@%");
|
||
|
||
HttpHelper http = new HttpHelper();
|
||
HttpItem item = new HttpItem()
|
||
{
|
||
//URL = "http://139.155.92.148:5511/dy_slide?sign=" + sign,
|
||
URL = "http://132.232.9.33:5511/dy_slide?sign=CF8EC9D97984579FF840FDB523F3AEA6",
|
||
Method = "POST",
|
||
Timeout = 50000,
|
||
ReadWriteTimeout = 30000,
|
||
IsToLower = false,
|
||
Cookie = "",
|
||
UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0",
|
||
Accept = "text/html, application/xhtml+xml, */*",
|
||
ContentType = "application/json",
|
||
Referer = "",
|
||
Allowautoredirect = false,
|
||
AutoRedirectCookie = false,
|
||
Postdata = postData2,
|
||
ResultType = ResultType.String,
|
||
};
|
||
|
||
HttpResult result = http.GetHtml(item);
|
||
string html = result.Html;
|
||
return html;
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region 计算xb
|
||
private static string _js_xbcode = "";
|
||
private static string Js_Xbcode
|
||
{
|
||
get
|
||
{
|
||
if (string.IsNullOrEmpty(_js_xbcode))
|
||
{
|
||
StringBuilder builer = new StringBuilder();
|
||
builer.Append("var key_1 = \"Dkdpgh4ZKsQB80/Mfvw36XI1R25-WUAlEi7NLboqYTOPuzmFjJnryx9HVGcaStCe=\"").Append("\r\n");
|
||
builer.Append("var key_2 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\"").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("function _0x2b1419(_0x1a3c83) {").Append("\r\n");
|
||
builer.Append(" var _0x408a74 = {").Append("\r\n");
|
||
builer.Append(" 'exports': {}").Append("\r\n");
|
||
builer.Append(" };").Append("\r\n");
|
||
builer.Append(" return _0x1a3c83(_0x408a74, _0x408a74['exports']),").Append("\r\n");
|
||
builer.Append(" _0x408a74['exports'];").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("var _0x522be9 = _0x2b1419(function (_0x5338f3) {").Append("\r\n");
|
||
builer.Append(" !function () {").Append("\r\n");
|
||
builer.Append(" var _0x10d7cc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'").Append("\r\n");
|
||
builer.Append(" , _0x485084 = {").Append("\r\n");
|
||
builer.Append(" 'rotl': function (_0x399d32, _0xbcfbfb) {").Append("\r\n");
|
||
builer.Append(" return _0x399d32 << _0xbcfbfb | _0x399d32 >>> -0x8dc + -0x8 * -0x13a + 0x6a * -0x2 - _0xbcfbfb;").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'rotr': function (_0x34bbe0, _0x39326b) {").Append("\r\n");
|
||
builer.Append(" return _0x34bbe0 << -0x962 + 0x1ef6 + -0x1574 - _0x39326b | _0x34bbe0 >>> _0x39326b;").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'endian': function (_0x18b9a6) {").Append("\r\n");
|
||
builer.Append(" if (_0x18b9a6['constructor'] == Number)").Append("\r\n");
|
||
builer.Append(" return -0x6c1d8b + 0xabd * 0x102b + -0x1 * -0xbd80cb & _0x485084['rotl'](_0x18b9a6, 0x1f0c + 0x17d + 0x35 * -0x9d) | 0x123 * -0x151f537 + -0x133507d4 + 0x2925fc459 & _0x485084['rotl'](_0x18b9a6, -0x1d81 + 0x1 * -0xf8f + 0x2d28);").Append("\r\n");
|
||
builer.Append(" for (var _0x2b9dac = -0x2b * -0xc5 + -0x1297 * -0x2 + -0x4645 * 0x1; _0x2b9dac < _0x18b9a6['length']; _0x2b9dac++)").Append("\r\n");
|
||
builer.Append(" _0x18b9a6[_0x2b9dac] = _0x485084['endian'](_0x18b9a6[_0x2b9dac]);").Append("\r\n");
|
||
builer.Append(" return _0x18b9a6;").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'randomBytes': function (_0x243867) {").Append("\r\n");
|
||
builer.Append(" for (var _0x53efd7 = []; _0x243867 > 0xc32 + 0x19fe + -0x2630; _0x243867--)").Append("\r\n");
|
||
builer.Append(" _0x53efd7['push'](Math['floor']((0x14b1 * -0x1 + -0xe80 + 0x2431) * Math['random']()));").Append("\r\n");
|
||
builer.Append(" return _0x53efd7;").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'bytesToWords': function (_0x4b67bc) {").Append("\r\n");
|
||
builer.Append(" for (var _0x52088d = [], _0x414454 = -0x2 * 0x67 + -0x2346 + -0x1 * -0x2414, _0x1ccc46 = -0xd * 0x2de + -0x1 * 0xcc + 0x2 * 0x1309; _0x414454 < _0x4b67bc['length']; _0x414454++,").Append("\r\n");
|
||
builer.Append(" _0x1ccc46 += -0x1 * -0x1e4f + -0x1e1e + 0x29 * -0x1)").Append("\r\n");
|
||
builer.Append(" _0x52088d[_0x1ccc46 >>> -0x9e * 0x35 + -0x24f * 0x1 + -0x5 * -0x702] |= _0x4b67bc[_0x414454] << 0x1f14 + 0x2500 + 0x394 * -0x13 - _0x1ccc46 % (-0x11c + 0x1a50 * 0x1 + -0x1914);").Append("\r\n");
|
||
builer.Append(" return _0x52088d;").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'wordsToBytes': function (_0x389d89) {").Append("\r\n");
|
||
builer.Append(" for (var _0x533c36 = [], _0x1d361a = 0x1 * -0x24fa + -0x10d1 + 0x35cb; _0x1d361a < (0x25de + -0x789 + 0xd1 * -0x25) * _0x389d89['length']; _0x1d361a += 0xf19 + 0x2321 * -0x1 + -0xc * -0x1ac)").Append("\r\n");
|
||
builer.Append(" _0x533c36['push'](_0x389d89[_0x1d361a >>> -0x10d2 + -0x232d + 0x3404] >>> 0x1a12 + -0x74 + -0x252 * 0xb - _0x1d361a % (-0x34d + -0x19fb + 0xeb4 * 0x2) & 0x286 * 0xc + 0x2c9 + -0x2012);").Append("\r\n");
|
||
builer.Append(" return _0x533c36;").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'bytesToHex': function (_0x563df3) {").Append("\r\n");
|
||
builer.Append(" for (var _0x1ff846 = [], _0x1b16d2 = -0xa * 0x14b + 0x2dd * 0xd + -0x184b; _0x1b16d2 < _0x563df3['length']; _0x1b16d2++)").Append("\r\n");
|
||
builer.Append(" _0x1ff846['push']((_0x563df3[_0x1b16d2] >>> -0x19 * 0x81 + 0x3 * -0x8a1 + 0x2680)['toString'](0x1 * -0x264c + -0x185 * -0x6 + -0x1 * -0x1d3e)),").Append("\r\n");
|
||
builer.Append(" _0x1ff846['push']((-0xdd5 + 0x511 + 0xfb * 0x9 & _0x563df3[_0x1b16d2])['toString'](0x3d * -0x5f + -0x1ed5 + 0x3588));").Append("\r\n");
|
||
builer.Append(" return _0x1ff846['join']('');").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'hexToBytes': function (_0x18dd40) {").Append("\r\n");
|
||
builer.Append(" for (var _0x283d66 = [], _0x447560 = -0x23fd + -0x4 * -0x5af + 0xd41; _0x447560 < _0x18dd40['length']; _0x447560 += -0x25fc + 0xf9 * -0xc + 0x31aa)").Append("\r\n");
|
||
builer.Append(" _0x283d66['push'](parseInt(_0x18dd40['substr'](_0x447560, -0x217e + -0x18d * -0x19 + -0x545 * 0x1), 0x71 * -0x43 + 0x1fb6 + -0x213));").Append("\r\n");
|
||
builer.Append(" return _0x283d66;").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'bytesToBase64': function (_0x5c9156) {").Append("\r\n");
|
||
builer.Append(" for (var _0x4571f8 = [], _0x3d51bf = 0x321 * 0x1 + 0x6df * -0x1 + 0x3be; _0x3d51bf < _0x5c9156['length']; _0x3d51bf += 0x2ce * 0x6 + -0xbf9 + -0x4d8)").Append("\r\n");
|
||
builer.Append(" for (var _0xe1b6c2 = _0x5c9156[_0x3d51bf] << 0x218c + 0x167a + -0x37f6 | _0x5c9156[_0x3d51bf + (0x1 * -0x2db + 0x3 * 0x54d + -0x459 * 0x3)] << -0x3a * 0x39 + -0x69 * -0x36 + -0x24d * 0x4 | _0x5c9156[_0x3d51bf + (0x7b9 + 0x18bf + -0x2076 * 0x1)], _0x3aa643 = -0x18cf * -0x1 + 0x240d + 0xa * -0x616; _0x3aa643 < -0x3d * 0x11 + -0x448 + 0x859; _0x3aa643++)").Append("\r\n");
|
||
builer.Append(" (0x1f2b + 0x1a4 + -0xaed * 0x3) * _0x3d51bf + (0x2525 + 0x1405 + -0x45 * 0xd4) * _0x3aa643 <= (-0x1de4 + 0x191b * 0x1 + -0x19b * -0x3) * _0x5c9156['length'] ? _0x4571f8['push'](_0x10d7cc['charAt'](_0xe1b6c2 >>> (-0x261c + 0x1 * -0xdc3 + 0x33e5) * (-0x15d9 + -0x10 * -0x163 + -0x3 * 0x1c - _0x3aa643) & -0x1b8 * 0x3 + -0x15fa + 0x2b * 0xa3)) : _0x4571f8['push']('=');").Append("\r\n");
|
||
builer.Append(" return _0x4571f8['join']('');").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'base64ToBytes': function (_0x4f0ceb) {").Append("\r\n");
|
||
builer.Append(" _0x4f0ceb = _0x4f0ceb['replace'](/[^A-Z0-9+\\/]/gi, '');").Append("\r\n");
|
||
builer.Append(" for (var _0x953172 = [], _0x19d29a = -0x1ec5 + 0x443 * -0x2 + -0x59d * -0x7, _0x5bec73 = 0x1 * -0x1242 + -0x3f * -0x22 + 0x9e4; _0x19d29a < _0x4f0ceb['length']; _0x5bec73 = ++_0x19d29a % (-0xddc + 0x10 * -0x1de + 0x2bc0))").Append("\r\n");
|
||
builer.Append(" -0x1bd7 + 0x1 * 0x7df + 0x13f8 != _0x5bec73 && _0x953172['push']((_0x10d7cc['indexOf'](_0x4f0ceb['charAt'](_0x19d29a - (0x260e + -0x1057 * 0x2 + -0x55f))) & Math['pow'](-0x2 * -0x10d5 + 0x1a * -0x58 + 0x388 * -0x7, -(-0x1e4 * 0x8 + 0x262b + -0x1709) * _0x5bec73 + (-0xaa7 + 0x26bf + -0x1c10)) - (-0x11c9 + -0x24ab + 0x3675)) << (0x1 * -0x551 + 0x1 * 0xdc8 + 0x1 * -0x875) * _0x5bec73 | _0x10d7cc['indexOf'](_0x4f0ceb['charAt'](_0x19d29a)) >>> 0x511 * -0x1 + -0x3d9 + 0x8f0 - (-0x2076 + 0x206e + 0xa) * _0x5bec73);").Append("\r\n");
|
||
builer.Append(" return _0x953172;").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" };").Append("\r\n");
|
||
builer.Append(" _0x5338f3['exports'] = _0x485084;").Append("\r\n");
|
||
builer.Append(" }();").Append("\r\n");
|
||
builer.Append("})").Append("\r\n");
|
||
builer.Append(" , _0x43f7d5 = {").Append("\r\n");
|
||
builer.Append(" 'utf8': {").Append("\r\n");
|
||
builer.Append(" 'stringToBytes': function (_0x3ecb9e) {").Append("\r\n");
|
||
builer.Append(" return _0x43f7d5['bin']['stringToBytes'](unescape(encodeURIComponent(_0x3ecb9e)));").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'bytesToString': function (_0x577703) {").Append("\r\n");
|
||
builer.Append(" return decodeURIComponent(escape(_0x43f7d5['bin']['bytesToString'](_0x577703)));").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'bin': {").Append("\r\n");
|
||
builer.Append(" 'stringToBytes': function (_0x2b796a) {").Append("\r\n");
|
||
builer.Append(" for (var _0x83a3c1 = [], _0x2b558b = 0x1597 + -0x20a5 + 0xb0e; _0x2b558b < _0x2b796a['length']; _0x2b558b++)").Append("\r\n");
|
||
builer.Append(" _0x83a3c1['push'](0x50f + 0x6 * -0x10 + 0xec * -0x4 & _0x2b796a['charCodeAt'](_0x2b558b));").Append("\r\n");
|
||
builer.Append(" return _0x83a3c1;").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'bytesToString': function (_0x2f2515) {").Append("\r\n");
|
||
builer.Append(" for (var _0x56610e = [], _0x3415a9 = -0x40d + -0x17d * -0x4 + -0x1e7 * 0x1; _0x3415a9 < _0x2f2515['length']; _0x3415a9++)").Append("\r\n");
|
||
builer.Append(" console.log('from_CharCode_10', String['fromCharCode'](_0x2f2515[_0x3415a9]), _0x2f2515[_0x3415a9])").Append("\r\n");
|
||
builer.Append(" _0x56610e['push'](String['fromCharCode'](_0x2f2515[_0x3415a9]));").Append("\r\n");
|
||
builer.Append(" return _0x56610e['join']('');").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append(" , _0x15dd40 = _0x43f7d5").Append("\r\n");
|
||
builer.Append(" , _0x34cd71 = function (_0x51f280) {").Append("\r\n");
|
||
builer.Append(" return null != _0x51f280 && (_0x1b5b56(_0x51f280) || _0x16238e(_0x51f280) || !!_0x51f280['_isBuffer']);").Append("\r\n");
|
||
builer.Append("};").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("function _0x1b5b56(_0x1b9428) {").Append("\r\n");
|
||
builer.Append(" return !!_0x1b9428['constructor'] && 'function' == typeof _0x1b9428['constructor']['isBuffer'] && _0x1b9428['constructor']['isBuffer'](_0x1b9428);").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("function _0x16238e(_0x23735f) {").Append("\r\n");
|
||
builer.Append(" return 'function' == typeof _0x23735f['readFloatLE'] && 'function' == typeof _0x23735f['slice'] && _0x1b5b56(_0x23735f['slice'](-0x11ba + 0x1e7e + 0x13 * -0xac, 0x12e7 * -0x1 + 0x1545 + -0x65 * 0x6));").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("var _0xf220d2 = _0x2b1419(function (_0x18e32f) {").Append("\r\n");
|
||
builer.Append(" !function () {").Append("\r\n");
|
||
builer.Append(" var _0x16e6ad = _0x522be9").Append("\r\n");
|
||
builer.Append(" , _0x5e1216 = _0x15dd40['utf8']").Append("\r\n");
|
||
builer.Append(" , _0x2fc35f = _0x34cd71").Append("\r\n");
|
||
builer.Append(" , _0x37dba4 = _0x15dd40['bin']").Append("\r\n");
|
||
builer.Append(" , _0x3c1bff = function (_0x3481d8, _0x53f008) {").Append("\r\n");
|
||
builer.Append(" _0x3481d8['constructor'] == String ? _0x3481d8 = _0x53f008 && 'binary' === _0x53f008['encoding'] ? _0x37dba4['stringToBytes'](_0x3481d8) : _0x5e1216['stringToBytes'](_0x3481d8) : _0x2fc35f(_0x3481d8) ? _0x3481d8 = Array['prototype']['slice']['call'](_0x3481d8, 0x41 * 0x2 + -0x2271 * 0x1 + -0x1ff * -0x11) : Array['isArray'](_0x3481d8) || _0x3481d8['constructor'] === Uint8Array || (_0x3481d8 = _0x3481d8['toString']());").Append("\r\n");
|
||
builer.Append(" for (var _0x14f8b4 = _0x16e6ad['bytesToWords'](_0x3481d8), _0x500746 = (-0x1 * -0x16cf + 0x6e8 + -0x1daf) * _0x3481d8['length'], _0x58fa30 = -0x1a1b8a * 0xe1 + -0x2 * 0x1f6998d9 + 0xbd0a88fd, _0x5a63d0 = -(0x157c81bf + 0x2 * 0x8984bb + -0x45aa * 0x1763), _0xfa952 = -(0xe * 0xe0dfabd + 0x1d2f084 * 0x2f + 0x2cce2ee4 * -0x4), _0x38d239 = -0x105d7743 + 0x154a5 * 0x16f5 + 0x2039bd0, _0x474622 = 0x13a0 + -0x1bf7 + -0x1 * -0x857; _0x474622 < _0x14f8b4['length']; _0x474622++)").Append("\r\n");
|
||
builer.Append(" _0x14f8b4[_0x474622] = -0x427a7e + 0x2 * 0x61326d + -0x7f16a3 * -0x1 & (_0x14f8b4[_0x474622] << -0x2706 + 0x215e + 0x5b * 0x10 | _0x14f8b4[_0x474622] >>> -0x9 * 0xa1 + -0x1 * -0x125b + -0xc9a) | -0x1e69bded8 + -0x2 * -0xd0ed9297 + 0x143c1b8aa & (_0x14f8b4[_0x474622] << 0x1a0d + -0x7b + -0xcbd * 0x2 | _0x14f8b4[_0x474622] >>> 0x1e8a + 0x89d + -0x7d3 * 0x5);").Append("\r\n");
|
||
builer.Append(" _0x14f8b4[_0x500746 >>> 0x152a + -0x2632 + 0x110d] |= -0x1a5e + -0x80a + 0x22e8 << _0x500746 % (-0xa5 * -0xb + -0x1dae + -0x1 * -0x16b7),").Append("\r\n");
|
||
builer.Append(" _0x14f8b4[0x20ff + 0x3 * -0xba + -0x1ec3 + (_0x500746 + (0x84e + 0x4 * -0x251 + 0x136) >>> 0x12 * 0x137 + -0x255 + 0x9c0 * -0x2 << -0xcee * -0x2 + -0x2568 + 0xb90)] = _0x500746;").Append("\r\n");
|
||
builer.Append(" var _0x140544 = _0x3c1bff['_ff']").Append("\r\n");
|
||
builer.Append(" , _0x25553e = _0x3c1bff['_gg']").Append("\r\n");
|
||
builer.Append(" , _0x236490 = _0x3c1bff['_hh']").Append("\r\n");
|
||
builer.Append(" , _0x45bb0a = _0x3c1bff['_ii'];").Append("\r\n");
|
||
builer.Append(" for (_0x474622 = 0x1c22 + 0xac8 + -0x26ea; _0x474622 < _0x14f8b4['length']; _0x474622 += 0x4 * 0x6d2 + 0x1985 * -0x1 + -0x1b3) {").Append("\r\n");
|
||
builer.Append(" var _0x235199 = _0x58fa30").Append("\r\n");
|
||
builer.Append(" , _0x365440 = _0x5a63d0").Append("\r\n");
|
||
builer.Append(" , _0x56f863 = _0xfa952").Append("\r\n");
|
||
builer.Append(" , _0x54bd03 = _0x38d239;").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x140544(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (-0xc0 * 0x34 + -0x22f8 + 0x49f8)], -0x1605 + -0x5fb * -0x6 + -0xdd6, -(-0x4f2596b * -0xc + 0x474cdc87 * 0x1 + -0x5a13b203)),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x140544(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (0x11 * 0x208 + 0x1 * 0x70d + -0x3 * 0xddc)], -0xba3 + -0x13f7 + 0x1fa6, -(0x1d7 * 0x13a989 + -0x2 * -0x140bb7ac + -0xfbc63 * 0x35f)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x140544(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (0xec6 + 0xfdb + -0x367 * 0x9)], 0x1f8b + -0x3 * 0xc86 + 0x618, 0x2fa10109 + -0x451ed7dc + -0x6383 * -0x943a),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x140544(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (-0xc6d * 0x2 + -0x19d + -0x1 * -0x1a7a)], 0x1138 + -0x1fe4 * 0x1 + 0xec2, -(-0x2dbf0c5e + -0x279eacea + 0x808b3f * 0x126)),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x140544(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (-0x1021 * 0x2 + 0xce * 0xc + 0x243 * 0xa)], -0x3a * -0x91 + 0x999 + -0x2a6c, -(0x884d053 + 0x5d92c26 + 0x1ed0614 * -0x2)),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x140544(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (0x6df * 0x4 + -0x6ee + -0x1489)], -0x5 * 0x22a + 0x2128 + -0x76e * 0x3, -0x5bc8729f + -0x339 * 0x28e523 + -0xd9c * -0x15af13),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x140544(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (-0x9f1 + -0x12 * -0x118 + -0x9b9)], -0x22b7 * 0x1 + -0x2677 * -0x1 + -0x3af, -(-0x44575f2f + -0x212f4838 + 0xbd566154)),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x140544(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (-0x1b9 + -0x2177 + 0x2337)], -0x23a3 + 0x2 * 0xeed + -0x1 * -0x5df, -(-0x3fcc1dd + -0x5205b96 * 0x1 + 0xbd68872)),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x140544(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (-0x11b * 0x17 + 0x1 * 0x2549 + -0xbd4)], -0x2 * 0x65 + -0xcf9 + 0xdca, 0x153322f * -0x6e + 0xc6d549ce + -0x50d62a * -0xa6),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x140544(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (0xa62 + -0x14dc + 0x381 * 0x3)], 0x9ef * 0x1 + 0x1517 + -0x1efa, -(-0x9b * -0x160b8ce + -0x25fe74a8 + 0x71bb7 * -0x847)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x140544(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (0xff2 + -0xb5c + -0x48c)], -0x10e2 + 0xbf2 + 0x501, -(0xbfd + 0x406d + 0x57e5)),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x140544(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (0xc26 + -0xe * -0x243 + 0x2bc5 * -0x1)], -0x1a8c * -0x1 + -0x41 + -0x1a35, -(0x815afa87 + 0xab446624 + 0xb5fc3869 * -0x1)),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x140544(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (0x1fcb + 0x1cb2 + -0x1 * 0x3c71)], 0x1f8f + 0x14ee + 0x55 * -0x9e, 0x136d91b * 0x11 + -0x418a30f1 + 0x9875d748),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x140544(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (0x1 * 0xd0b + -0x1a06 + 0xd08)], -0x122 * 0x7 + -0x3f7 * 0x5 + 0x1bcd, -(-0x129fb8 + 0xb531d * -0x3b + 0x28b2aea * 0x2)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x140544(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (0x2 * 0x1d0 + 0x18cc + -0x1c5e)], -0x5f8 * -0x6 + -0x894 * -0x1 + 0x2c53 * -0x1, -(-0x3bd8480a * 0x1 + -0x9b91a191 + 0x130f0a60d)),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x25553e(_0x58fa30, _0x5a63d0 = _0x140544(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (0x490 + -0x1586 + -0x1105 * -0x1)], 0xeeb + 0x1995 + -0x286a, -0xb6f * 0x13316 + -0x9064344f + -0xb * -0x1512d92e), _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (-0x13a1 + 0x89 * -0x14 + 0x1e56)], -0x176c + 0x17db + -0x2 * 0x35, -(0x3f1 * 0x1a470 + 0x7f16e2e + 0x193b8 * -0x2e0)),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x25553e(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (0x7 * 0x1c1 + 0x1 * 0x55d + 0xa * -0x1c3)], -0x4d + 0x71d + -0x6c7, -(-0x99f9c0 + -0x3cd103bf + 0x239 * 0x385037)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x25553e(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (-0x1 * 0x2f5 + 0x6d * -0x31 + 0x17dd)], -0x1e + -0x10f + 0x13b, -0x40e13c7d + 0x375 * 0x10b6f7 + -0xf27b0f9 * -0x3),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x25553e(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (-0x15f * 0x19 + 0x23cf + -0x188)], 0x40e + 0x2a * 0xb3 + -0xc2 * 0x2c, -(-0x236e70c9 + 0xe13fa72 + 0x2ba3aead)),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x25553e(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (-0x1 * -0x2417 + -0x275 * -0x1 + -0x2687)], 0xc6 + 0x9f2 + 0xf9 * -0xb, -(0x6d6cd * 0x369 + 0x4cd42122 + 0x5c * -0xa252a3)),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x25553e(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (-0x110a + 0x214 * -0xe + -0x2 * -0x1716)], 0x1fcd + -0x2 * 0xb1a + -0x990, 0x2 * -0x206ac6a + 0xe665f * -0x3d + -0x116 * -0x8fa4f),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x25553e(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (-0x1 * -0x10ed + -0x1 * 0x3fd + 0x3 * -0x44b)], -0x5f0 * -0x5 + -0x264f + -0x1 * -0x8ad, -(-0x2245d187 + -0x22da86c0 + 0xad971c7 * 0xa)),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x25553e(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (0x4 * 0x267 + -0x2469 + 0x1ad1)], 0x1904 + 0x3 * 0x474 + -0x264c, -(0x1f1de099 * -0x1 + 0x1 * 0x60e3f1f + -0x2cb7 * -0x119de)),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x25553e(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (0x1877 * -0x1 + 0x1613 + -0x9 * -0x45)], -0x3bb + -0x36e + 0x72e, 0xf9f176 * -0x2b + 0x33b0fae5 + -0x1 * -0x182c61d3),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x25553e(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (-0x739 + -0x1825 + 0x1f6c)], -0x37 * 0x25 + 0xb * 0x28f + -0x1429, -(-0x2 * -0x37a04f82 + -0x20b43a75 + -0x1 * 0x11c36c65)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x25553e(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (0x1a84 + 0xda * -0xe + 0x1 * -0xe95)], 0x2 * -0x11fb + 0x1 * 0x1771 + 0x1d * 0x6f, -(-0x1a47a8d + -0xa951477 + 0x1764817d)),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x25553e(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (-0x1c0d + 0x1d05 + -0xf0)], 0x18fc + -0x1 * 0x1d21 + -0x439 * -0x1, -0x198a4fe8 * -0x2 + 0x1e773750 + 0xc31c233 * -0x1),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x25553e(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (0xe13 + 0x227 * 0x3 + -0x147b)], 0x12fa + -0xfde * -0x2 + -0x32b1, -(0x30f6 * 0x336c9 + 0x939c46fb + -0xdadc8526)),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x25553e(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (0x1b05 + -0xbb8 + -0xf4b)], 0x1623 + 0x4 * -0x5b3 + 0x59 * 0x2, -(0x2ddda05 + 0x5e33987 * -0x1 + -0x534e * -0x12b3)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x25553e(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (-0x20de + 0x2070 + -0xd * -0x9)], -0x467 * 0x2 + 0x1e6 + 0x6 * 0x129, -0x1 * -0x1926ea91 + -0x23908a46 + 0x71d8a28e),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x236490(_0x58fa30, _0x5a63d0 = _0x25553e(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (0x1 * 0x2308 + -0x19ef + -0x1 * 0x90d)], 0xb * -0x52 + 0x3 * 0x4f1 + -0xb39, -(0x1 * -0x8456ffce + -0x5 * -0x27503b8f + 0x329b8979)), _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (0x1 * -0x67f + -0x17 * -0x5f + 0xb * -0x2f)], 0x1af2 + -0x1bda + 0x4 * 0x3b, -(0x147 * 0x551 + -0x4e532 * 0x2 + 0x8c6ab * 0x1)),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x236490(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (-0x24fa + 0x9a4 * 0x1 + -0x3e * -0x71)], -0x149b + 0x2634 + -0x8c7 * 0x2, -(-0x9 * 0x29f6320 + 0x1d10fb93 * -0x7 + -0x56e7d9a9 * -0x4)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x236490(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (0x1 * 0x1e0d + -0xd * -0x1f3 + -0x3759)], -0x110e + -0x199c * -0x1 + 0x1 * -0x87e, -0x2 * 0x5b779ef4 + 0x4a1 * -0x2bf7c2 + 0x1f012780c),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x236490(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (-0x2 * -0xdd3 + -0x15f7 + 0x83 * -0xb)], -0xdae + -0xd1 * -0x7 + -0x407 * -0x2, -(0xccd739 + -0x387862c + 0x4d576e7)),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x236490(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (-0x1f72 + -0x1d21 + 0x3c94)], 0x1f8e + -0x1138 + -0x3 * 0x4c6, -(-0x616353e3 + 0x1b873 * 0x107f + -0x17 * -0x6f7c53e)),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x236490(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (-0x3d6 * 0x1 + -0xf * -0xcd + -0x1 * 0x829)], 0x1a4d + 0x231e + -0x2 * 0x1eb0, 0x5b1a66fd + 0x1aa19916 + -0x29dd306a),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x236490(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (-0x2486 + -0x1ef9 + 0x4386)], -0x73e * -0x5 + 0x175e + 0x1dc2 * -0x2, -(0x1442234 + 0x43 * -0x1321ab + -0x3d * -0x3698b1)),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x236490(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (-0x1 * 0x253d + -0x8e1 * -0x1 + 0xe33 * 0x2)], -0x35 * -0x11 + -0x255d * -0x1 + -0x28cb, -(0xd1028 * 0x1eb + -0x3bdbbf9f + 0x640e0677)),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x236490(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (0x69 * 0x32 + -0x44f + -0x1026)], -0x2 * 0x12b9 + 0x60 * -0x28 + 0x3476, 0x4132d95 * -0x9 + 0xc9db7d5 + -0x766 * -0x8bd8d),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x236490(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (0xec9 + 0x21a9 * -0x1 + 0x12e0)], 0x11 * -0x34 + 0x21cc + -0x1e4d, -(-0xe95d9 * -0x11f + -0x2187d73b + 0x268cb0fa)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x236490(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (-0x17e9 + 0x221 + 0x15cb)], 0x202 * -0x5 + -0x1e0f + 0x45 * 0x95, -(-0x163dae24 + 0x1 * -0x391868b2 + 0x187afadd * 0x5)),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x236490(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (-0xd38 + -0x3ca + -0x1b4 * -0xa)], 0xb39 * -0x1 + 0x17 * 0x18d + -0x185b * 0x1, 0x5006610 + -0x3 * -0x10a59b1 + -0x397561e),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x236490(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (-0x1e07 + 0x1 * -0x15cf + 0x33df * 0x1)], 0x2403 * -0x1 + -0x191 + 0x2598, -(0x1f4bcdce + -0x11311842 + 0x18107a3b)),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x236490(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (-0x67 * -0x7 + -0x144b + 0x2 * 0x8c3)], 0x2382 + 0x258 + -0x1 * 0x25cf, -(-0x37 * -0xad9c25 + 0x7a * -0x516f11 + 0x2 * 0xd536421)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x236490(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (0x18a9 + 0xbeb + 0x2485 * -0x1)], 0x50e + -0x1511 + 0x1013, -0x17d3161f * -0x1 + -0xf549 * 0x11fe + 0x190c9e47),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x45bb0a(_0x58fa30, _0x5a63d0 = _0x236490(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (-0x18aa + 0x8 * -0x475 + -0x57c * -0xb)], -0x7e9 + -0x475 + -0xc75 * -0x1, -(-0x1 * -0x63cb03d3 + -0x3fe6c634 + 0x176f6bfc)), _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (0x2 * -0x75b + 0x1 * 0x1e23 + -0xf6d)], -0x1 * -0x1994 + 0x1c * 0x9a + -0x2 * 0x1533, -(0x33d9a * 0x58a + -0x1 * 0x670901f + 0x13 * 0x46ead)),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x45bb0a(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (-0x210d + -0xd83 * 0x1 + 0x2e97)], -0x1 * 0x21b7 + 0x248c + -0x2cb, -0x20e6f140 + -0x133 * -0x3d26bf + -0xd1 * -0x20bfaa),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x45bb0a(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (-0xa7 * -0xd + 0x2384 + -0x7 * 0x647)], 0x19 * -0x138 + -0xc8 * -0x2 + 0x1cf7, -(0x7c2d271f * 0x1 + -0xa615d099 + 0x7e5485d3)),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x45bb0a(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (-0xa * -0x39d + 0x2cf * -0xd + 0x1 * 0x66)], -0x3c4 + 0x1d * -0x1 + 0xd * 0x4e, -(0x3 * 0x51c3b1 + -0xb03c7d * 0x3 + 0x487ca2b)),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x45bb0a(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (-0x24f5 + -0x1b5 * -0x7 + 0x3 * 0x85a)], -0x1 * 0x1f53 + 0x2 * 0xeef + 0x17b, -0x6d292286 + 0xd * -0x1e597a + 0xd40f077b),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x45bb0a(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (-0x15a * 0x13 + 0x482 * 0x8 + 0x3b * -0x2d)], -0x26 * -0xd6 + 0xfba + -0x2 * 0x17ba, -(-0x2 * -0x603a0bef + -0xb8f41cb1 + 0x69733841)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x45bb0a(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (-0xfa9 + 0x3d * -0x1a + 0x15e5)], 0x1692 + -0x1ec4 + -0x841 * -0x1, -(0x2433 * -0x6f + 0x1a686a + 0x55536)),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x45bb0a(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (-0x125 + -0x1 * -0x1843 + -0x171d)], 0x679 + 0x4 * 0x2e2 + 0x4 * -0x47b, -(0xfc44093 * -0x3 + -0x3 * -0x404df487 + -0x4a04b89 * 0x5)),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x45bb0a(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (0xec2 + 0x54 + -0x2f * 0x52)], 0x1a2e + -0x31 * -0xa1 + -0x38f9, -0x13 * 0x10d9a53 + 0x5c155c66 + 0x1 * 0x27959612),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x45bb0a(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (-0x25ec + -0x1 * -0x1319 + 0x12e2)], 0x12f6 + 0x25cc + -0x38b8, -(0xafdd37 * 0x5 + -0x2818c33 + 0x830b0 * 0x1c)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x45bb0a(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (0xe6 + 0xbf * -0x10 + 0x6 * 0x1d8)], -0x1b15 + -0x52 * -0x29 + -0x2 * -0x701, -(-0xb1a8b580 + 0x5e800adf + -0xb027678d * -0x1)),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x45bb0a(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (-0x2 * -0x12ef + 0x897 + -0x78 * 0x63)], -0xacb + -0x132b + 0x1e0b * 0x1, 0x879b228b + 0x40b23 * 0x17ff + -0xea30ef * 0xa9),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x45bb0a(_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239, _0x14f8b4[_0x474622 + (-0x11d4 + 0x1 * -0xe35 + -0x1 * -0x200d)], 0x2409 + 0x20 * -0x12d + 0x19d * 0x1, -(-0x5df8b1 * 0x25 + 0x7cd632d + 0xe740fe6)),").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x45bb0a(_0x38d239, _0x58fa30, _0x5a63d0, _0xfa952, _0x14f8b4[_0x474622 + (-0x209d + 0x1 * -0x12cb + 0x3373)], -0x1 * -0x1bbb + -0x3f * 0x5 + -0x6 * 0x469, -(0xe8 * 0x565186 + 0x2f * -0x2a8bd63 + 0xc7 * 0x920a38)),").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0x45bb0a(_0xfa952, _0x38d239, _0x58fa30, _0x5a63d0, _0x14f8b4[_0x474622 + (-0x141 * -0x1f + 0x25 * 0x9a + -0x3d1f)], 0x4db + 0x5b + -0x1 * 0x527, -0x681c5b3 * -0x5 + 0x5e9 * 0x1b0e3 + 0x5088a1),").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x45bb0a(_0x5a63d0, _0xfa952, _0x38d239, _0x58fa30, _0x14f8b4[_0x474622 + (0x27 * -0xf + -0x36 * 0xd + 0x3 * 0x1b0)], 0xab * 0x1 + 0x1f53 + -0x1fe9, -(-0x27eed9db + -0x7c2dd5 * 0x9 + 0x40c5a2c7)),").Append("\r\n");
|
||
builer.Append(" _0x58fa30 = _0x58fa30 + _0x235199 >>> -0x3 * -0x6b + -0x1471 * -0x1 + 0xad9 * -0x2,").Append("\r\n");
|
||
builer.Append(" _0x5a63d0 = _0x5a63d0 + _0x365440 >>> 0x1 * 0x2702 + -0x160e + 0x1f * -0x8c,").Append("\r\n");
|
||
builer.Append(" _0xfa952 = _0xfa952 + _0x56f863 >>> -0x14 * 0x99 + -0x1 * -0x1751 + -0xb5d * 0x1,").Append("\r\n");
|
||
builer.Append(" _0x38d239 = _0x38d239 + _0x54bd03 >>> -0x1 * 0x22bb + 0x2a6 + 0x1 * 0x2015;").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" return _0x16e6ad['endian']([_0x58fa30, _0x5a63d0, _0xfa952, _0x38d239]);").Append("\r\n");
|
||
builer.Append(" };").Append("\r\n");
|
||
builer.Append(" _0x3c1bff['_ff'] = function (_0x39d6ff, _0xf44b81, _0x6e1fd8, _0x537a5d, _0x473a43, _0x1d47fe, _0x396c93) {").Append("\r\n");
|
||
builer.Append(" var _0x20d237 = _0x39d6ff + (_0xf44b81 & _0x6e1fd8 | ~_0xf44b81 & _0x537a5d) + (_0x473a43 >>> 0x1644 + -0x5 * -0x757 + -0x3af7 * 0x1) + _0x396c93;").Append("\r\n");
|
||
builer.Append(" return (_0x20d237 << _0x1d47fe | _0x20d237 >>> -0x1 * 0x1c51 + -0x1bb + 0x1e2c - _0x1d47fe) + _0xf44b81;").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" ,").Append("\r\n");
|
||
builer.Append(" _0x3c1bff['_gg'] = function (_0x38be71, _0x46f056, _0xcdfe0b, _0x28f534, _0x15caff, _0x2e1b18, _0x2b54bf) {").Append("\r\n");
|
||
builer.Append(" var _0xe03481 = _0x38be71 + (_0x46f056 & _0x28f534 | _0xcdfe0b & ~_0x28f534) + (_0x15caff >>> 0xb3f + -0x1a85 + 0xf46) + _0x2b54bf;").Append("\r\n");
|
||
builer.Append(" return (_0xe03481 << _0x2e1b18 | _0xe03481 >>> 0x6b * 0x9 + 0x2642 + -0x29e5 - _0x2e1b18) + _0x46f056;").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" ,").Append("\r\n");
|
||
builer.Append(" _0x3c1bff['_hh'] = function (_0x47b307, _0x45f56f, _0x277ce6, _0x483b1b, _0xd50cbf, _0x164d53, _0x459b9f) {").Append("\r\n");
|
||
builer.Append(" var _0x9e8d61 = _0x47b307 + (_0x45f56f ^ _0x277ce6 ^ _0x483b1b) + (_0xd50cbf >>> 0x2 * -0xaf3 + 0xe * -0xb6 + 0x1fda) + _0x459b9f;").Append("\r\n");
|
||
builer.Append(" return (_0x9e8d61 << _0x164d53 | _0x9e8d61 >>> -0x5 * -0x3d + -0xb * -0x1a1 + -0x2 * 0x97e - _0x164d53) + _0x45f56f;").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" ,").Append("\r\n");
|
||
builer.Append(" _0x3c1bff['_ii'] = function (_0x17a9fb, _0x5a4323, _0x49d45d, _0x3cbe9a, _0x301e85, _0x19e288, _0x53cfd0) {").Append("\r\n");
|
||
builer.Append(" var _0x5a8ab2 = _0x17a9fb + (_0x49d45d ^ (_0x5a4323 | ~_0x3cbe9a)) + (_0x301e85 >>> -0xe71 + -0x8e3 + 0x1754) + _0x53cfd0;").Append("\r\n");
|
||
builer.Append(" return (_0x5a8ab2 << _0x19e288 | _0x5a8ab2 >>> -0x13 * -0x144 + 0x1e4e + -0x363a * 0x1 - _0x19e288) + _0x5a4323;").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" ,").Append("\r\n");
|
||
builer.Append(" _0x3c1bff['_blocksize'] = 0x1c71 + 0x2497 + -0x207c * 0x2,").Append("\r\n");
|
||
builer.Append(" _0x3c1bff['_digestsize'] = -0x1 * 0x1b3b + -0x1 * -0xc28 + 0xf23,").Append("\r\n");
|
||
builer.Append(" _0x18e32f['exports'] = function (_0x369546, _0x237ff3) {").Append("\r\n");
|
||
builer.Append(" if (null == _0x369546)").Append("\r\n");
|
||
builer.Append(" throw new Error('Illegal\\x20argument\\x20' + _0x369546);").Append("\r\n");
|
||
builer.Append(" var _0x1869a2 = _0x16e6ad['wordsToBytes'](_0x3c1bff(_0x369546, _0x237ff3));").Append("\r\n");
|
||
builer.Append(" return _0x237ff3 && _0x237ff3['asBytes'] ? _0x1869a2 : _0x237ff3 && _0x237ff3['asString'] ? _0x37dba4['bytesToString'](_0x1869a2) : _0x16e6ad['bytesToHex'](_0x1869a2);").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" ;").Append("\r\n");
|
||
builer.Append(" }();").Append("\r\n");
|
||
builer.Append("});").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("for (var _0x5d6614 = {").Append("\r\n");
|
||
builer.Append(" 'boe': !(0x122a + 0x4fd + 0x2 * -0xb93),").Append("\r\n");
|
||
builer.Append(" 'aid': 0x0,").Append("\r\n");
|
||
builer.Append(" 'dfp': !(-0x17 * -0x17f + 0x71a * -0x2 + -0x1434),").Append("\r\n");
|
||
builer.Append(" 'sdi': !(0x57 * 0x37 + 0xb17 * 0x1 + -0x1dc7),").Append("\r\n");
|
||
builer.Append(" 'enablePathList': [],").Append("\r\n");
|
||
builer.Append(" '_enablePathListRegex': [],").Append("\r\n");
|
||
builer.Append(" 'urlRewriteRules': [],").Append("\r\n");
|
||
builer.Append(" '_urlRewriteRules': [],").Append("\r\n");
|
||
builer.Append(" 'initialized': !(-0x13 * 0x1a1 + 0x1 * 0x963 + 0x1591 * 0x1),").Append("\r\n");
|
||
builer.Append(" 'enableTrack': !(0x667 * 0x3 + 0x1a4f * 0x1 + -0x2d83),").Append("\r\n");
|
||
builer.Append(" 'track': {").Append("\r\n");
|
||
builer.Append(" 'unitTime': 0x0,").Append("\r\n");
|
||
builer.Append(" 'unitAmount': 0x0,").Append("\r\n");
|
||
builer.Append(" 'fre': 0x0").Append("\r\n");
|
||
builer.Append(" },").Append("\r\n");
|
||
builer.Append(" 'triggerUnload': !(-0x95 * -0x20 + 0x1c82 + -0x2f21),").Append("\r\n");
|
||
builer.Append(" 'region': '',").Append("\r\n");
|
||
builer.Append(" 'regionConf': {},").Append("\r\n");
|
||
builer.Append(" 'umode': 0x0,").Append("\r\n");
|
||
builer.Append(" 'v': !(0x35e * 0x5 + -0x585 + 0xb50 * -0x1),").Append("\r\n");
|
||
builer.Append(" 'perf': !(-0x11e9 + -0x1 * -0x16a9 + -0x4bf)").Append("\r\n");
|
||
builer.Append("}, _0x15f587 = {").Append("\r\n");
|
||
builer.Append(" 'debug': function (_0x41ffc1, _0x5bbbc8) {").Append("\r\n");
|
||
builer.Append(" let _0xcd8973 = !(0x1cdc + 0x154 * -0xe + 0x25 * -0x47);").Append("\r\n");
|
||
builer.Append(" _0xcd8973 = _0x5d6614['boe'];").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append("}, _0x55fe31 = '0123456789abcdef'['split'](''), _0x3c6322 = [], _0x50ff23 = [], _0x4059b2 = 0x81 * -0x9 + 0xf * 0x281 + -0x2106; _0x4059b2 < 0x3e * -0xd + -0x96a + 0xd90; _0x4059b2++)").Append("\r\n");
|
||
builer.Append(" _0x3c6322[_0x4059b2] = _0x55fe31[_0x4059b2 >> 0xa6 * -0xb + -0x11 * -0xef + 0x1 * -0x8b9 & -0xb * 0x227 + 0x240b + -0xc4f] + _0x55fe31[-0x506 + -0xa7d * -0x1 + -0x1 * 0x568 & _0x4059b2],").Append("\r\n");
|
||
builer.Append(" _0x4059b2 < -0xbd2 + 0x1e5f + -0x127d && (_0x4059b2 < -0x214d + -0xf47 * 0x1 + 0x309e ? _0x50ff23[0xd7c * -0x1 + -0x574 * 0x4 + 0x2f5 * 0xc + _0x4059b2] = _0x4059b2 : _0x50ff23[-0x170b + 0x2 * -0x5cf + 0x7 * 0x500 + _0x4059b2] = _0x4059b2);").Append("\r\n");
|
||
builer.Append("var encode = function (_0x5ac7ec) {").Append("\r\n");
|
||
builer.Append(" for (var _0x34905b = _0x5ac7ec['length'], _0x44b5b7 = '', _0x68d4f2 = -0x3 * 0x605 + 0x1020 + 0x1ef; _0x68d4f2 < _0x34905b;)").Append("\r\n");
|
||
builer.Append(" _0x44b5b7 += _0x3c6322[_0x5ac7ec[_0x68d4f2++]];").Append("\r\n");
|
||
builer.Append(" return _0x44b5b7;").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append("var decode = function (_0x5c3d2a) {").Append("\r\n");
|
||
builer.Append(" for (var _0x1204d6 = _0x5c3d2a['length'] >> 0xa1e * -0x2 + 0x1937 + 0x4fa * -0x1, _0x700552 = _0x1204d6 << 0x68 + -0xa29 + 0x9c2, _0x1673dd = new Uint8Array(_0x1204d6), _0x19eb71 = 0xe9e + -0x167 + -0xd37, _0x249396 = 0x1 * 0x104a + 0xaa9 + 0x1af3 * -0x1; _0x249396 < _0x700552;)").Append("\r\n");
|
||
builer.Append(" _0x1673dd[_0x19eb71++] = _0x50ff23[_0x5c3d2a['charCodeAt'](_0x249396++)] << -0x1938 + 0x10c4 * -0x1 + 0x2a00 | _0x50ff23[_0x5c3d2a['charCodeAt'](_0x249396++)];").Append("\r\n");
|
||
builer.Append(" return _0x1673dd;").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("function _0x238632(_0x4cdef5, _0x268c9c) {").Append("\r\n");
|
||
builer.Append(" let _0x2b4641, _0xbb44d8 = [], _0x138ea3 = 0x140 + -0x2038 + -0x7be * -0x4, _0xc9f8ff = '';").Append("\r\n");
|
||
builer.Append(" for (let _0x332e7e = 0x17 * -0x8 + -0x910 + 0x2 * 0x4e4; _0x332e7e < 0x24e + -0x2533 + 0xbf7 * 0x3; _0x332e7e++)").Append("\r\n");
|
||
builer.Append(" _0xbb44d8[_0x332e7e] = _0x332e7e;").Append("\r\n");
|
||
builer.Append(" for (let _0x369701 = 0x77a * -0x5 + -0x3 * 0x689 + -0x12ff * -0x3; _0x369701 < 0x1b3 * 0x12 + -0x1e3 + 0x3f5 * -0x7; _0x369701++)").Append("\r\n");
|
||
builer.Append(" _0x138ea3 = (_0x138ea3 + _0xbb44d8[_0x369701] + _0x4cdef5['charCodeAt'](_0x369701 % _0x4cdef5['length'])) % (0x16d0 + 0x12 * -0xf4 + 0x254 * -0x2),").Append("\r\n");
|
||
builer.Append(" _0x2b4641 = _0xbb44d8[_0x369701],").Append("\r\n");
|
||
builer.Append(" _0xbb44d8[_0x369701] = _0xbb44d8[_0x138ea3],").Append("\r\n");
|
||
builer.Append(" _0xbb44d8[_0x138ea3] = _0x2b4641;").Append("\r\n");
|
||
builer.Append(" let _0x1a0256 = 0x1ca3 + 0x1a34 + -0x36d7;").Append("\r\n");
|
||
builer.Append(" _0x138ea3 = 0xdc * 0x28 + -0x15d * 0x1 + 0x3ab * -0x9;").Append("\r\n");
|
||
builer.Append(" for (let _0x1b288d = 0x9 * 0x349 + 0x1e7f + -0x3c10 * 0x1; _0x1b288d < _0x268c9c['length']; _0x1b288d++)").Append("\r\n");
|
||
builer.Append(" _0x1a0256 = (_0x1a0256 + (0x14ef * -0x1 + -0x1752 + -0x37 * -0xce)) % (-0x312 + 0x171d + -0x130b),").Append("\r\n");
|
||
builer.Append(" _0x138ea3 = (_0x138ea3 + _0xbb44d8[_0x1a0256]) % (0x3 * 0x66d + -0x3 * -0x13d + -0x15fe),").Append("\r\n");
|
||
builer.Append(" _0x2b4641 = _0xbb44d8[_0x1a0256],").Append("\r\n");
|
||
builer.Append(" _0xbb44d8[_0x1a0256] = _0xbb44d8[_0x138ea3],").Append("\r\n");
|
||
builer.Append(" _0xbb44d8[_0x138ea3] = _0x2b4641,").Append("\r\n");
|
||
builer.Append(" _0xc9f8ff += String['fromCharCode'](_0x268c9c['charCodeAt'](_0x1b288d) ^ _0xbb44d8[(_0xbb44d8[_0x1a0256] + _0xbb44d8[_0x138ea3]) % (-0x1db3 + 0x1 * -0x733 + -0x15 * -0x1ce)]);").Append("\r\n");
|
||
builer.Append(" return _0xc9f8ff;").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("function _0x22a2b6(_0x59d7ab, _0x151cde, _0x1e0c94, _0x54aa83, _0x76d8ab, _0x550bdb, _0xb90041, _0x44b16d, _0x28659f, _0x252c2c, _0x365218, _0x48af11, _0x25e3db, _0x34084f, _0x4f0729, _0x46a34c, _0x1f67f1, _0x5cd529, _0x53097b) {").Append("\r\n");
|
||
builer.Append(" let _0xa0a6ac = new Uint8Array(0x21ed + 0x25dc + -0x47b6 * 0x1);").Append("\r\n");
|
||
builer.Append(" return _0xa0a6ac[-0x1 * -0x2192 + 0x11b * 0x5 + -0x2719 * 0x1] = _0x59d7ab,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[0x4a * 0x3 + -0x6d * 0xb + -0x1e9 * -0x2] = _0x365218,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[-0x59f * -0x3 + -0x46c * -0x4 + -0x228b] = _0x151cde,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[0x11a1 + 0xf3d * -0x1 + 0x3 * -0xcb] = _0x48af11,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[-0x1 * -0xa37 + 0x13 * 0x173 + -0x25bc] = _0x1e0c94,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[-0x4 * -0x59f + -0x669 * 0x4 + 0x32d] = _0x25e3db,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[-0x1b42 + 0x10 * -0x24 + 0x1d88] = _0x54aa83,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[0x2245 + 0x335 * 0x6 + -0x357c] = _0x34084f,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[0x3fb + 0x18e1 + -0x1cd4] = _0x76d8ab,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[0x3 * 0x7a + 0x1 * 0x53f + 0x154 * -0x5] = _0x4f0729,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[0x25a * -0x9 + 0x11f6 + 0xa6 * 0x5] = _0x550bdb,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[-0x1b * -0x147 + -0x21e9 * -0x1 + 0x445b * -0x1] = _0x46a34c,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[-0x2f * 0xaf + 0x22f0 + -0x2c3] = _0xb90041,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[0x2f * 0x16 + 0x17 * 0x19 + -0x63c] = _0x1f67f1,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[-0x46a * 0x1 + 0xb * -0x97 + 0xaf5] = _0x44b16d,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[0x47 * 0x4f + -0x8cb * -0x4 + -0x3906] = _0x5cd529,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[-0x7 * 0x40e + 0xb8b + 0x10e7] = _0x28659f,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[0x6f9 + 0x196b + 0x5 * -0x677] = _0x53097b,").Append("\r\n");
|
||
builer.Append(" _0xa0a6ac[-0xa78 + 0x1b89 + 0xe5 * -0x13] = _0x252c2c,").Append("\r\n");
|
||
builer.Append(" String['fromCharCode']['apply'](null, _0xa0a6ac);").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("function get_arr(arr) {").Append("\r\n");
|
||
builer.Append(" arr.push(eval(arr.toString().replace(/,/g, \"^\")))").Append("\r\n");
|
||
builer.Append(" let arr_1 = [], arr_2 = [];").Append("\r\n");
|
||
builer.Append(" for (let i = 0; i < arr.length; i += 2) {").Append("\r\n");
|
||
builer.Append(" arr_1.push(arr[i]);").Append("\r\n");
|
||
builer.Append(" if (arr[i + 1]>=0) {").Append("\r\n");
|
||
builer.Append(" arr_2.push(arr[i + 1])").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" arr_3 = arr_1.concat(arr_2)").Append("\r\n");
|
||
builer.Append(" console.log(arr_3, arr_3.length)").Append("\r\n");
|
||
builer.Append(" return arr_3").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("function md5_slice_1(string) {").Append("\r\n");
|
||
builer.Append(" md5_arr = decode(_0xf220d2(decode(_0xf220d2(string))))").Append("\r\n");
|
||
builer.Append(" return [md5_arr[md5_arr.length - 2], md5_arr[md5_arr.length - 1]]").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("function md5_slice_2(string) {").Append("\r\n");
|
||
builer.Append(" md5_arr = decode(_0xf220d2(string))").Append("\r\n");
|
||
builer.Append(" return [md5_arr[md5_arr.length - 2], md5_arr[md5_arr.length - 1]]").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("function bytes2string(key, bytes) {").Append("\r\n");
|
||
builer.Append(" let result = \"\"").Append("\r\n");
|
||
builer.Append(" for (let i = 0; i < bytes.length / 3; i++) {").Append("\r\n");
|
||
builer.Append(" if (bytes.charCodeAt(i * 3 + 1)) {").Append("\r\n");
|
||
builer.Append(" const num = (bytes.charCodeAt(i * 3) << 16) + (bytes.charCodeAt(i * 3 + 1) << 8) + (bytes.charCodeAt(i * 3 + 2))").Append("\r\n");
|
||
builer.Append(" result += key.charAt((num & 16515072) >> 18)").Append("\r\n");
|
||
builer.Append(" result += key.charAt((num & 258048) >> 12)").Append("\r\n");
|
||
builer.Append(" result += key.charAt((num & 4032) >> 6)").Append("\r\n");
|
||
builer.Append(" result += key.charAt(num & 63)").Append("\r\n");
|
||
builer.Append(" } else {").Append("\r\n");
|
||
builer.Append(" const num = (bytes.charCodeAt(i * 3) << 16)").Append("\r\n");
|
||
builer.Append(" result += key.charAt((num & 16515072) >> 18)").Append("\r\n");
|
||
builer.Append(" result += key.charAt((num & 258048) >> 12)").Append("\r\n");
|
||
builer.Append(" result += \"=\"").Append("\r\n");
|
||
builer.Append(" result += \"=\"").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" return result").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
builer.Append("").Append("\r\n");
|
||
builer.Append("function get_x_bogus(params, body,user_agent) {").Append("\r\n");
|
||
builer.Append(" time_13=new Date / 1000 ^ 0").Append("\r\n");
|
||
builer.Append(" canvas = 2691034029").Append("\r\n");
|
||
builer.Append(" calc_arr = [1, 1, 8]").Append("\r\n");
|
||
builer.Append(" str_ua = bytes2string(key_2,_0x238632(String.fromCharCode.apply(String, calc_arr), user_agent))").Append("\r\n");
|
||
builer.Append(" console.log(str_ua)").Append("\r\n");
|
||
builer.Append(" arr_4_1 = md5_slice_1(params)").Append("\r\n");
|
||
builer.Append(" if (body) {").Append("\r\n");
|
||
builer.Append(" arr_4_2 = md5_slice_1(body)").Append("\r\n");
|
||
builer.Append(" } else {").Append("\r\n");
|
||
builer.Append(" arr_4_2 = md5_slice_1('')").Append("\r\n");
|
||
builer.Append(" }").Append("\r\n");
|
||
builer.Append(" arr_4_3 = md5_slice_2(str_ua)").Append("\r\n");
|
||
builer.Append(" arr_4_4 = [time_13 >> 24 & 255, time_13 >> 16 & 255, time_13 >> 8 & 255, time_13 >> 0 & 255]").Append("\r\n");
|
||
builer.Append(" arr_4_5 = [canvas >> 24 & 255, canvas >> 16 & 255, canvas >> 8 & 255, canvas >> 0 & 255]").Append("\r\n");
|
||
builer.Append(" _0x30af53 = get_arr([64].concat(calc_arr).concat(arr_4_1).concat(arr_4_2).concat(arr_4_3).concat(arr_4_4).concat(arr_4_5))").Append("\r\n");
|
||
builer.Append(" ss = String.fromCharCode.apply(null,[2,255]) + _0x238632(String.fromCharCode(255), _0x22a2b6['apply'](null, _0x30af53))").Append("\r\n");
|
||
builer.Append(" var X_Bogus = bytes2string(key_1,ss)").Append("\r\n");
|
||
builer.Append(" console.log(X_Bogus)").Append("\r\n");
|
||
builer.Append(" return X_Bogus").Append("\r\n");
|
||
builer.Append("}").Append("\r\n");
|
||
_js_xbcode = builer.ToString();
|
||
}
|
||
return _js_xbcode;
|
||
}
|
||
}
|
||
|
||
private static string _js_sign = "";
|
||
private static string Js_Sign
|
||
{
|
||
get
|
||
{
|
||
if (string.IsNullOrEmpty(_js_sign))
|
||
{
|
||
StringBuilder builder = new StringBuilder();
|
||
builder.Append($"function t_1(add, string) {{").AppendLine();
|
||
builder.Append($" for (let x of string) {{").AppendLine();
|
||
builder.Append($" add = ((add ^ x.charCodeAt()) * 65599) >>> 0").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($" return add").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function t_2(num_1, num_2) {{").AppendLine();
|
||
builder.Append($" let a = num_1 % 65521").AppendLine();
|
||
builder.Append($" let b = a * 65521").AppendLine();
|
||
builder.Append($" let c = num_2 ^ b").AppendLine();
|
||
builder.Append($" let d = c >>> 0").AppendLine();
|
||
builder.Append($" let e = d.toString(2)").AppendLine();
|
||
builder.Append($" if (e.length < 33) {{").AppendLine();
|
||
builder.Append($" let qq = '0'.repeat(32 - e.length)").AppendLine();
|
||
builder.Append($" f = 10000000110000 + qq").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($" let g = f + e").AppendLine();
|
||
builder.Append($" return parseInt(g, 2).toString()").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function t_3(data_url) {{").AppendLine();
|
||
builder.Append($" num_1 = data_url.charCodeAt()").AppendLine();
|
||
builder.Append($" for (var i = 0; i < 31; i++) {{").AppendLine();
|
||
builder.Append($" let a = num_1 * 65599").AppendLine();
|
||
builder.Append($" let b = num_1 % data_url.length").AppendLine();
|
||
builder.Append($" let c = data_url.charCodeAt(b)").AppendLine();
|
||
builder.Append($" num_1 = a + c >>> 0").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($" return num_1").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function t_4(ua) {{").AppendLine();
|
||
builder.Append($" num_1 = ua.charCodeAt()").AppendLine();
|
||
builder.Append($" let aa = aaaaaaaaa ^ num_1").AppendLine();
|
||
builder.Append($" let add = ''").AppendLine();
|
||
builder.Append($" for (var i = 1; i < ua.length + 1; i++) {{").AppendLine();
|
||
builder.Append($" let b = aa * 65599").AppendLine();
|
||
builder.Append($" let c = b >>> 0").AppendLine();
|
||
builder.Append($" let d = ua.charCodeAt(i)").AppendLine();
|
||
builder.Append($" add = c").AppendLine();
|
||
builder.Append($" aa = c ^ d").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($" return add").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function t_5(url) {{").AppendLine();
|
||
builder.Append($" let aa = url.charCodeAt()").AppendLine();
|
||
builder.Append($" for (var i = 1; i < url.length + 1; i++) {{").AppendLine();
|
||
builder.Append($" let b = aa * 65599").AppendLine();
|
||
builder.Append($" let c = b >>> 0").AppendLine();
|
||
builder.Append($" let d = url.charCodeAt(i)").AppendLine();
|
||
builder.Append($" aa = c ^ d").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($" return aa").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function get_5(c_3) {{").AppendLine();
|
||
builder.Append($" let a = c_3 / 4294967296").AppendLine();
|
||
builder.Append($" return a >>> 0").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function a(num) {{").AppendLine();
|
||
builder.Append($" if (num < 26) {{").AppendLine();
|
||
builder.Append($" return num + 65").AppendLine();
|
||
builder.Append($" }} else if (num < 52) {{").AppendLine();
|
||
builder.Append($" return num + 71").AppendLine();
|
||
builder.Append($" }} else if (num < 62) {{").AppendLine();
|
||
builder.Append($" return num + -4").AppendLine();
|
||
builder.Append($" }} else {{").AppendLine();
|
||
builder.Append($" return num + -17").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function s1(str_1) {{").AppendLine();
|
||
builder.Append($" str_2 = str_1 >> 2").AppendLine();
|
||
builder.Append($" str_3 = str_2 >> 24").AppendLine();
|
||
builder.Append($" str_4 = str_3 & 63").AppendLine();
|
||
builder.Append($" str_5 = a(str_4)").AppendLine();
|
||
builder.Append($" str_6 = String.fromCharCode(str_5)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_7 = str_2 >> 18").AppendLine();
|
||
builder.Append($" str_8 = str_7 & 63").AppendLine();
|
||
builder.Append($" str_9 = a(str_8)").AppendLine();
|
||
builder.Append($" str_10 = String.fromCharCode(str_9)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_11 = str_2 >> 12").AppendLine();
|
||
builder.Append($" str_12 = str_11 & 63").AppendLine();
|
||
builder.Append($" str_13 = a(str_12)").AppendLine();
|
||
builder.Append($" str_14 = String.fromCharCode(str_13)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_15 = str_2 >> 6").AppendLine();
|
||
builder.Append($" str_16 = str_15 & 63").AppendLine();
|
||
builder.Append($" str_17 = a(str_16)").AppendLine();
|
||
builder.Append($" str_18 = String.fromCharCode(str_17)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_19 = str_2").AppendLine();
|
||
builder.Append($" str_20 = str_19 & 63").AppendLine();
|
||
builder.Append($" str_21 = a(str_20)").AppendLine();
|
||
builder.Append($" str_22 = String.fromCharCode(str_21)").AppendLine();
|
||
builder.Append($" return str_6 + str_10 + str_14 + str_18 + str_22").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function s2(str_1) {{").AppendLine();
|
||
builder.Append($" str_2 = str_1 << 28").AppendLine();
|
||
builder.Append($" str_3 = str_2 | get_5(str_1) >>> 4").AppendLine();
|
||
builder.Append($" str_4 = str_3 >> 24").AppendLine();
|
||
builder.Append($" str_5 = str_4 & 63").AppendLine();
|
||
builder.Append($" str_5 = a(str_5)").AppendLine();
|
||
builder.Append($" str_6 = String.fromCharCode(str_5)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_7 = str_3 >> 18").AppendLine();
|
||
builder.Append($" str_8 = str_7 & 63").AppendLine();
|
||
builder.Append($" str_9 = a(str_8)").AppendLine();
|
||
builder.Append($" str_10 = String.fromCharCode(str_9)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_11 = str_3 >> 12").AppendLine();
|
||
builder.Append($" str_12 = str_11 & 63").AppendLine();
|
||
builder.Append($" str_13 = a(str_12)").AppendLine();
|
||
builder.Append($" str_14 = String.fromCharCode(str_13)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_15 = str_3 >> 6").AppendLine();
|
||
builder.Append($" str_16 = str_15 & 63").AppendLine();
|
||
builder.Append($" str_17 = a(str_16)").AppendLine();
|
||
builder.Append($" str_18 = String.fromCharCode(str_17)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_19 = str_3").AppendLine();
|
||
builder.Append($" str_20 = str_19 & 63").AppendLine();
|
||
builder.Append($" str_21 = a(str_20)").AppendLine();
|
||
builder.Append($" str_22 = String.fromCharCode(str_21)").AppendLine();
|
||
builder.Append($" return str_6 + str_10 + str_14 + str_18 + str_22").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function s3(str_1) {{").AppendLine();
|
||
builder.Append($" aa = c_4 ^ str_1").AppendLine();
|
||
builder.Append($" str1 = aa >>> 6").AppendLine();
|
||
builder.Append($" str_2 = get_5(str_1) << 26").AppendLine();
|
||
builder.Append($" str_3 = str_2 | str1").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_4 = str_3 >> 24").AppendLine();
|
||
builder.Append($" str_5 = str_4 & 63").AppendLine();
|
||
builder.Append($" str_5 = a(str_5)").AppendLine();
|
||
builder.Append($" str_6 = String.fromCharCode(str_5)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_7 = str_3 >> 18").AppendLine();
|
||
builder.Append($" str_8 = str_7 & 63").AppendLine();
|
||
builder.Append($" str_9 = a(str_8)").AppendLine();
|
||
builder.Append($" str_10 = String.fromCharCode(str_9)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_11 = str_3 >> 12").AppendLine();
|
||
builder.Append($" str_12 = str_11 & 63").AppendLine();
|
||
builder.Append($" str_13 = a(str_12)").AppendLine();
|
||
builder.Append($" str_14 = String.fromCharCode(str_13)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_15 = str_3 >> 6").AppendLine();
|
||
builder.Append($" str_16 = str_15 & 63").AppendLine();
|
||
builder.Append($" str_17 = a(str_16)").AppendLine();
|
||
builder.Append($" str_18 = String.fromCharCode(str_17)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_19 = str_3").AppendLine();
|
||
builder.Append($" str_20 = str_19 & 63").AppendLine();
|
||
builder.Append($" str_21 = a(str_20)").AppendLine();
|
||
builder.Append($" str_22 = String.fromCharCode(str_21)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_23 = c_4 ^ str_1").AppendLine();
|
||
builder.Append($" str_24 = str_23 & 63").AppendLine();
|
||
builder.Append($" str_25 = a(str_24)").AppendLine();
|
||
builder.Append($" str_26 = String.fromCharCode(str_25)").AppendLine();
|
||
builder.Append($" return str_6 + str_10 + str_14 + str_18 + str_22 + str_26").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function s4(str_1) {{").AppendLine();
|
||
builder.Append($" str_4 = str_1 >> 2").AppendLine();
|
||
builder.Append($" str_5 = str_4 >> 24").AppendLine();
|
||
builder.Append($" str_6 = str_5 & 63").AppendLine();
|
||
builder.Append($" str_7 = a(str_6)").AppendLine();
|
||
builder.Append($" str_8 = String.fromCharCode(str_7)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_9 = str_4 >> 18").AppendLine();
|
||
builder.Append($" str_10 = str_9 & 63").AppendLine();
|
||
builder.Append($" str_11 = a(str_10)").AppendLine();
|
||
builder.Append($" str_12 = String.fromCharCode(str_11)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_13 = str_4 >> 12").AppendLine();
|
||
builder.Append($" str_14 = str_13 & 63").AppendLine();
|
||
builder.Append($" str_15 = a(str_14)").AppendLine();
|
||
builder.Append($" str_16 = String.fromCharCode(str_15)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_17 = str_4 >> 6").AppendLine();
|
||
builder.Append($" str_18 = str_17 & 63").AppendLine();
|
||
builder.Append($" str_19 = a(str_18)").AppendLine();
|
||
builder.Append($" str_20 = String.fromCharCode(str_19)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_21 = str_4").AppendLine();
|
||
builder.Append($" str_22 = str_21 & 63").AppendLine();
|
||
builder.Append($" str_23 = a(str_22)").AppendLine();
|
||
builder.Append($" str_24 = String.fromCharCode(str_23)").AppendLine();
|
||
builder.Append($" return str_8 + str_12 + str_16 + str_20 + str_24").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function s5(str_1) {{").AppendLine();
|
||
builder.Append($" let cc = 2 << 4").AppendLine();
|
||
builder.Append($" let bb = 1 << 8 // 65792").AppendLine();
|
||
builder.Append($" str_q = bb | cc").AppendLine();
|
||
builder.Append($" str_2 = b << 28").AppendLine();
|
||
builder.Append($" let oo = str_q ^ str_1").AppendLine();
|
||
builder.Append($" let qqq = oo >>> 4").AppendLine();
|
||
builder.Append($" str_3 = str_2 | qqq").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_4 = str_3 >> 24").AppendLine();
|
||
builder.Append($" str_5 = str_4 & 63").AppendLine();
|
||
builder.Append($" str_5 = a(str_5)").AppendLine();
|
||
builder.Append($" str_6 = String.fromCharCode(str_5)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_7 = str_3 >> 18").AppendLine();
|
||
builder.Append($" str_8 = str_7 & 63").AppendLine();
|
||
builder.Append($" str_9 = a(str_8)").AppendLine();
|
||
builder.Append($" str_10 = String.fromCharCode(str_9)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_11 = str_3 >> 12").AppendLine();
|
||
builder.Append($" str_12 = str_11 & 63").AppendLine();
|
||
builder.Append($" str_13 = a(str_12)").AppendLine();
|
||
builder.Append($" str_14 = String.fromCharCode(str_13)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_15 = str_3 >> 6").AppendLine();
|
||
builder.Append($" str_16 = str_15 & 63").AppendLine();
|
||
builder.Append($" str_17 = a(str_16)").AppendLine();
|
||
builder.Append($" str_18 = String.fromCharCode(str_17)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_19 = str_3").AppendLine();
|
||
builder.Append($" str_20 = str_19 & 63").AppendLine();
|
||
builder.Append($" str_21 = a(str_20)").AppendLine();
|
||
builder.Append($" str_22 = String.fromCharCode(str_21)").AppendLine();
|
||
builder.Append($" return str_6 + str_10 + str_14 + str_18 + str_22").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function s6(str_1) {{").AppendLine();
|
||
builder.Append($" str_2 = str_1 % 65521").AppendLine();
|
||
builder.Append($" str_3 = str_2 >> 24").AppendLine();
|
||
builder.Append($" str_4 = str_3 & 63").AppendLine();
|
||
builder.Append($" str_5 = a(str_4)").AppendLine();
|
||
builder.Append($" str_6 = String.fromCharCode(str_5)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_7 = str_2 >> 18").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_8 = str_7 & 63").AppendLine();
|
||
builder.Append($" str_9 = a(str_8)").AppendLine();
|
||
builder.Append($" str_10 = String.fromCharCode(str_9)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_11 = str_2 >> 12").AppendLine();
|
||
builder.Append($" str_12 = str_11 & 63").AppendLine();
|
||
builder.Append($" str_13 = a(str_12)").AppendLine();
|
||
builder.Append($" str_14 = String.fromCharCode(str_13)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_15 = str_2 >> 6").AppendLine();
|
||
builder.Append($" str_16 = str_15 & 63").AppendLine();
|
||
builder.Append($" str_17 = a(str_16)").AppendLine();
|
||
builder.Append($" str_18 = String.fromCharCode(str_17)").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" str_19 = str_2").AppendLine();
|
||
builder.Append($" str_20 = str_19 & 63").AppendLine();
|
||
builder.Append($" str_21 = a(str_20)").AppendLine();
|
||
builder.Append($" str_22 = String.fromCharCode(str_21)").AppendLine();
|
||
builder.Append($" return str_6 + str_10 + str_14 + str_18 + str_22").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function s7(sign) {{").AppendLine();
|
||
builder.Append($" num_1 = sign.charCodeAt()").AppendLine();
|
||
builder.Append($" for (var i = 1; i < 45; i++) {{").AppendLine();
|
||
builder.Append($" let a = num_1 * 65599").AppendLine();
|
||
builder.Append($" let c = sign.charCodeAt(i)").AppendLine();
|
||
builder.Append($" num_1 = a + c >>> 0").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($" return num_1.toString(16).slice(6, 8)").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function url_sort(url) {{").AppendLine();
|
||
builder.Append($" if (url.indexOf('http')!=-1){{").AppendLine();
|
||
builder.Append($" let a = url.split('?')").AppendLine();
|
||
builder.Append($" let b = a[0]").AppendLine();
|
||
builder.Append($" let c = a[1] // 参数").AppendLine();
|
||
builder.Append($" let d = b.split('buyin.jinritemai.com')[1] // pathname=/aweme/v1/web/search/item/").AppendLine();
|
||
builder.Append($" let f = c.split('&')").AppendLine();
|
||
builder.Append($" let g = {{}}").AppendLine();
|
||
builder.Append($" for (x of f) {{").AppendLine();
|
||
builder.Append($" g[x.split('=')[0]] = x.split('=')[1]").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($" let h = Object.keys(g).sort()").AppendLine();
|
||
builder.Append($" let j = []").AppendLine();
|
||
builder.Append($" for (x of h) {{").AppendLine();
|
||
builder.Append($" let q = x + '=' + g[x]").AppendLine();
|
||
builder.Append($" j.push(q)").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($" j.push('pathname=' + d)").AppendLine();
|
||
builder.Append($" j.push('tt_webid=' + '')").AppendLine();
|
||
builder.Append($" j.push('uuid=' + '')").AppendLine();
|
||
builder.Append($" k = j.join('&')").AppendLine();
|
||
builder.Append($" }}else {{").AppendLine();
|
||
builder.Append($" k=url").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($" return k").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function body_hash(url) {{").AppendLine();
|
||
builder.Append($" url = JSON.stringify(url)").AppendLine();
|
||
builder.Append($" let aa = url.charCodeAt()").AppendLine();
|
||
builder.Append($" for (var i = 1; i < url.length; i++) {{").AppendLine();
|
||
builder.Append($" let b = aa * 65599").AppendLine();
|
||
builder.Append($" let d = url.charCodeAt(i)").AppendLine();
|
||
builder.Append($" aa = b + d >>> 0").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($" return 'body_hash=' + aa + '&'").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($"function get_sign_url(url, body, user_agent) {{").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" canvas = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAQCAYAAABQrvyxAAACNklEQVRIS8WWP0iVYRTGf3cJcmjJrS0Ht4TWdElIdHFwCNIgcnALnKO64SQIgiB6wa0/0NDQFBIEYi4OQdDSFkHaUIuL4KI8cg4cj+/3ebncm9/y3e/9c97zPM95znsbnH2O07c+GzamOf9dWPbfhwaB2VJCnmhOOIPrJZjrwBtgLNHSAuaBQ+AcgBL7vj8nexlq3AHuAguWVFGBEuuxhCIhvVQg1+NVYBl4D0wBc7agVWI2b67yQAQ7DTw0dp4DT4AfgMZfAxpz5hRf7L0DhjyRUBolMynOzUKMcx6oU0CBSz6QtF9CIl+B28A68AB4CywGUF7fArQDOLvbVvcZgJIfMYB9yRtFBdphPLMvdj7byarTG8AB8AH4C6wEABGwKxOTlEH1OFCBjOo5wFoTC4SzHX97W41zfpDmdNAq8AIYB54C/QmAl1AElQE8AwRU4/8qGnQRgCcb3146pbmmBfe3DtXha8AtA6SDYrLa4us8wZICkenoFx+fUTlFE1e10axAJEQG3QI2bNAT+wm8shqPAH5ZN1EX2QwMVwHIQP1s983vi1phXb/X3L6VyrcAQIaOyUUAWjYB7JpSFykgNeUt+SA/itusUqBdD3wC7oXIbtDYNqsUOC0B21ungDx139pyrQL5L0RkvzT3B3gMfKwwWbeG853hcYelTFYgGzV2HZ+7Zi3S57qVaEdxSh64AhxVRJPUS3ZJvezoxC5vKgGYBB7ZBbRn98EAMAp8ty7S67JpG+YJtseqHtBfgugAAAAASUVORK5CYII='").AppendLine();
|
||
builder.Append($" host = 'buyin.jinritemai.com/'").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" timestamp = parseInt(new Date().getTime() / 1000).toString()").AppendLine();
|
||
builder.Append($"").AppendLine();
|
||
builder.Append($" c_1 = t_1('', timestamp)").AppendLine();
|
||
builder.Append($" c_2 = t_1(c_1, host)").AppendLine();
|
||
builder.Append($" c_3 = t_2(c_2, timestamp)").AppendLine();
|
||
builder.Append($" c_4 = t_3(canvas)").AppendLine();
|
||
builder.Append($" aaaaaaaaa = t_5(c_3)").AppendLine();
|
||
builder.Append($" x1 = t_4(user_agent)").AppendLine();
|
||
builder.Append($" if (body) {{").AppendLine();
|
||
builder.Append($" body_ = body_hash(body)").AppendLine();
|
||
builder.Append($" }} else {{").AppendLine();
|
||
builder.Append($" body_ = ''").AppendLine();
|
||
builder.Append($" }}").AppendLine();
|
||
builder.Append($" url = url_sort(url)").AppendLine();
|
||
builder.Append($" x2 = t_4(body_ + url)").AppendLine();
|
||
builder.Append($" s_1 = s1(c_3)").AppendLine();
|
||
builder.Append($" s_2 = s2(c_3)").AppendLine();
|
||
builder.Append($" s_3 = s3(c_3)").AppendLine();
|
||
builder.Append($" str__1 = x1 % 65521").AppendLine();
|
||
builder.Append($" str__2 = x2 % 65521").AppendLine();
|
||
builder.Append($" str__3 = str__1 << 16").AppendLine();
|
||
builder.Append($" b = str__3 | str__2").AppendLine();
|
||
builder.Append($" s_4 = s4(b)").AppendLine();
|
||
builder.Append($" s_5 = s5(c_3)").AppendLine();
|
||
builder.Append($" s_6 = s6(c_2)").AppendLine();
|
||
builder.Append($" sign_1 = '_02B4Z6wo00101' + s_1 + s_2 + s_3 + s_4 + s_5 + s_6").AppendLine();
|
||
builder.Append($" sign_2 = s7(sign_1)").AppendLine();
|
||
builder.Append($" return sign_1 + sign_2").AppendLine();
|
||
builder.Append($"}}").AppendLine();
|
||
_js_sign = builder.ToString();
|
||
}
|
||
return _js_sign;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 使用V8引擎执行JS代码
|
||
/// </summary>
|
||
/// <param name="JsCode">JS代码</param>
|
||
/// <param name="JsParam">当前方法需要的参数</param>
|
||
/// <param name="JsMethodName">执行的JS方法名</param>
|
||
/// <returns></returns>
|
||
private static string V8Method(string JsCode, string JsParam, string JsMethodName)
|
||
{
|
||
string result = string.Empty;
|
||
try
|
||
{
|
||
using (var engine = new V8ScriptEngine())
|
||
{
|
||
V8Script script = engine.Compile(JsCode);
|
||
engine.Execute(script);
|
||
result = engine.ExecuteCommand(string.Format("{0}({1})", JsMethodName, JsParam));
|
||
//其他写法
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
//result = ex.Message.ToString();
|
||
}
|
||
return result;
|
||
}
|
||
|
||
//function get_sign_url(url, body, user_agent)
|
||
private static string GetSign(string Param, string UserAgent, string PostData = "")
|
||
{
|
||
return V8Method(Js_Sign, $"'{Param}','{PostData}','{UserAgent}'", "get_sign_url");
|
||
}
|
||
|
||
|
||
|
||
private static string GetXbogus(string Param, string UserAgent, string PostData = "")
|
||
{
|
||
return V8Method(Js_Xbcode, $"'{Param}','{PostData}','{UserAgent}'", "get_x_bogus");
|
||
}
|
||
#endregion
|
||
|
||
#endregion
|
||
|
||
internal void UpdateCookies()
|
||
{
|
||
try
|
||
{
|
||
string cookie = Member.cookies;
|
||
cookie = cookie.Trim();
|
||
if (!cookie.EndsWith(";"))
|
||
{
|
||
cookie += ";";
|
||
}
|
||
|
||
List<string> msTokenlist = new List<string>();
|
||
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);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 订单下载-官方
|
||
/// </summary>
|
||
/// <param name="start_time"></param>
|
||
/// <param name="end_time"></param>
|
||
/// <param name="pid"></param>
|
||
/// <returns></returns>
|
||
public List<DyOrderInfo> DownOrderApi(DateTime start_time, DateTime end_time, string pid)
|
||
{
|
||
var list = new List<DyOrderInfo>();
|
||
var cursor = "0";
|
||
|
||
DyOrderInfo order = null;
|
||
do
|
||
{
|
||
JToken jToken = null;
|
||
if (!string.IsNullOrWhiteSpace(pid))
|
||
{
|
||
jToken = SendData("buyin.kolOrderAds", new { start_time = start_time.ToString("yyyy-MM-dd HH:mm:ss"), end_time = end_time.ToString("yyyy-MM-dd HH:mm:ss"), pid = pid, size = 20, cursor = cursor, distribution_type = "ProductDetail" });
|
||
}
|
||
else
|
||
{
|
||
jToken = SendData("buyin.kolOrderAds", new { start_time = start_time.ToString("yyyy-MM-dd HH:mm:ss"), end_time = end_time.ToString("yyyy-MM-dd HH:mm:ss"), size = 20, cursor = cursor, distribution_type = "ProductDetail" });
|
||
}
|
||
|
||
if (jToken == null) return list;
|
||
|
||
var data = jToken["data"];
|
||
if (data != null)
|
||
{
|
||
order = Util.ToObj<DyOrderInfo>(data);
|
||
|
||
if (order == null || order.orders == null || order.orders.Count == 0) return list;
|
||
list.Add(order);
|
||
cursor = order.cursor;
|
||
}
|
||
else
|
||
break;
|
||
Thread.Sleep(1);
|
||
} while (order != null && !string.IsNullOrWhiteSpace(cursor));
|
||
return list;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取抖音推广位信息
|
||
/// </summary>
|
||
/// <param name="page">第一页</param>
|
||
/// <param name="pageSize">每页大小</param>
|
||
/// <returns></returns>
|
||
public KolPidList FindPidList(int page = 1, int pageSize = 100)
|
||
{
|
||
var jToken = SendData("buyin.kolPidList", new { page = page, page_size = pageSize });
|
||
|
||
if (jToken == null) return null;
|
||
|
||
var data = jToken["data"];
|
||
if (data != null)
|
||
{
|
||
return Util.ToObj<KolPidList>(data);
|
||
}
|
||
return null;
|
||
}
|
||
|
||
///// <summary>
|
||
///// 官方口令解析
|
||
///// </summary>
|
||
///// <param name="command">口令</param>
|
||
///// <returns></returns>
|
||
//public string KouLingAnalysis(string command)
|
||
//{
|
||
// var jToken = SendData("buyin.commonShareCommandParse", new { command = command });
|
||
|
||
// if (jToken == null) return null;
|
||
|
||
// var product_id = jToken["data"]?["common_share_command_parse_info"]?["product_info"]?["product_id"]?.ToString();
|
||
// if (product_id != null)
|
||
// {
|
||
// return product_id;
|
||
// }
|
||
// return string.Empty;
|
||
//}
|
||
|
||
/// <summary>
|
||
/// 查询商品信息
|
||
/// </summary>
|
||
/// <param name="itemid">商品id</param>
|
||
/// <param name="with_share_status">返回可分销状态 sharable 字段</param>
|
||
public DyItemInfo FindItemInfo(string itemid, bool with_share_status = true)
|
||
{
|
||
try
|
||
{
|
||
var jToken = SendData("alliance.materialsProductsDetails", new { product_ids = $"[{itemid}]", with_share_status = with_share_status });
|
||
|
||
if (jToken == null) return null;
|
||
|
||
var data = jToken["data"];
|
||
if (data != null)
|
||
{
|
||
return Util.ToObj<DyItemInfo>(data);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
return null;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 转链
|
||
/// </summary>
|
||
/// <param name="product_url">商品连接</param>
|
||
/// <param name="pid">达人PID</param>
|
||
/// <param name="external_info">自定义参数</param>
|
||
public ShareInfo ConvertUrl(string product_url, string pid, string external_info)
|
||
{
|
||
try
|
||
{
|
||
var productUrl = DyRegimentHelper.GetRegimentUrl(product_url);
|
||
|
||
var jToken = SendData("buyin.kolProductShare", new { product_url = productUrl, pid = pid, external_info = external_info });
|
||
|
||
if (jToken == null) return null;
|
||
|
||
var data = jToken["data"];
|
||
if (data != null)
|
||
{
|
||
return Util.ToObj<ShareInfo>(data);
|
||
}
|
||
else
|
||
throw new Exception(JsonConvert.SerializeObject(jToken));
|
||
//{"code":50002,"err_no":7,"log_id":"202202231957160101330351311C082EFF","message":"当前商品暂不支持站外分享","msg":"业务处理失败","sub_code":"isv.business-failed:276","sub_msg":"当前商品暂不支持站外分享"}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
return null;
|
||
}
|
||
|
||
public bool CreateKolPid(int media_type, string site_name)
|
||
{
|
||
try
|
||
{
|
||
var media_name = "微信推广";
|
||
var jToken = SendData("buyin.kolPidCreate", new { media_type = media_type, media_name = media_name, site_name = site_name });
|
||
|
||
if (jToken == null) return false;
|
||
|
||
var pid = jToken["data"]["pid"].ToString();
|
||
if (!string.IsNullOrWhiteSpace(pid))
|
||
return true;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
}
|
||
return false;
|
||
}
|
||
|
||
|
||
//private const string Appid = "7066380295942964749";
|
||
//private const string Appsecret = "5723f45c-1493-46bd-a0d9-1e4bb65b77d0";
|
||
|
||
//private string access_token = "64706dde-57a3-4a6b-9760-bf3064610d17";
|
||
|
||
|
||
//public static string LoginUrl { get { return $"https://buyin.jinritemai.com/dashboard/institution/through-power?app_id={Appid}&state=xx"; } }
|
||
|
||
public JToken SendData(string ApiName, object Data, bool ThrowException = false)
|
||
{
|
||
int number = 0;
|
||
var html = string.Empty;
|
||
Next:
|
||
|
||
number++;
|
||
|
||
try
|
||
{
|
||
//var access_token = string.Empty;
|
||
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||
|
||
// 序列化参数
|
||
var param_json = Marshal(Data);
|
||
|
||
// 计算签名
|
||
var signVal = Sign(Token.appid, Token.appkey, ApiName, timestamp, param_json);
|
||
//var signVal = Sign(Appid, Appsecret, ApiName, timestamp, param_json);
|
||
|
||
var url = string.Empty;
|
||
if (ApiName == "token.create")
|
||
{
|
||
url = $"{host}/{ApiName.Replace('.', '/')}?app_key={Token.appid}&method={ApiName}¶m_json={HttpUtility.UrlEncode(param_json, Encoding.UTF8)}×tamp={HttpUtility.UrlEncode(timestamp, Encoding.UTF8)}&v={Ver}&sign={signVal}&sign_method={sign_method}";
|
||
//url = $"{host}/{ApiName.Replace('.', '/')}?app_key={Appid}&method={ApiName}¶m_json={HttpUtility.UrlEncode(param_json, Encoding.UTF8)}×tamp={HttpUtility.UrlEncode(timestamp, Encoding.UTF8)}&v={Ver}&sign={signVal}&sign_method={sign_method}";
|
||
}
|
||
else
|
||
url = $"{host}/{ApiName.Replace('.', '/')}?app_key={Token.appid}&method={ApiName}&access_token={Token.access_token}¶m_json={HttpUtility.UrlEncode(param_json, Encoding.UTF8)}×tamp={HttpUtility.UrlEncode(timestamp, Encoding.UTF8)}&v={Ver}&sign={signVal}&sign_method={sign_method}";
|
||
//url = $"{host}/{ApiName.Replace('.', '/')}?app_key={Appid}&method={ApiName}&access_token={access_token}¶m_json={HttpUtility.UrlEncode(param_json, Encoding.UTF8)}×tamp={HttpUtility.UrlEncode(timestamp, Encoding.UTF8)}&v={Ver}&sign={signVal}&sign_method={sign_method}";
|
||
|
||
// 发起请求
|
||
var methodPath = ApiName;
|
||
var http = new HttpHelper();
|
||
var item = new HttpItem()
|
||
{
|
||
URL = url,
|
||
Method = "get",
|
||
ContentType = "application/json;charset=UTF-8",
|
||
Timeout = 5000,
|
||
};
|
||
html = http.GetHtml(item).Html;
|
||
|
||
if (html.ToLower().Contains("access_token") || html.ToLower().Contains("invalid"))
|
||
throw new Exception("失效");
|
||
|
||
var jObj = JObject.Parse(html);
|
||
|
||
if ((int)jObj["code"] != 10000)
|
||
throw new Exception(html);
|
||
return jObj;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
//{"code":90000,"err_no":7,"log_id":"20220307142917010150154220048FFC84","message":"获取用户客户端账户信息失败","msg":"未知错误,此错误会逐步细化明确,请不要依赖sub_code或sub_msg做业务判断","sub_code":"isp.unknown-error","sub_msg":"4158:获取用户客户端账户信息失败"}
|
||
|
||
//{"code":40003,"err_no":30005,"log_id":"2022022811520301013214610523A49FAD","message":"access_token不存在,请使用最新的access_token访问","msg":"操作权限不足","sub_code":"isv.access-token-no-existed","sub_msg":"access_token不存在,请使用最新的access_token访问"}
|
||
if (ex.Message == "失效")
|
||
{
|
||
if (number < 3 && this.Member != null && RefToken() && this.Member.is_valid) goto Next;
|
||
Member.is_valid = false;
|
||
}
|
||
LogHelper.GetSingleObj().Debug("抖音请求", ApiName + ":" + ex.Message);
|
||
throw ex;
|
||
}
|
||
finally
|
||
{
|
||
LogHelper.GetSingleObj().Info("抖音Api请求", $"Api:{ApiName},{html}");
|
||
}
|
||
}
|
||
|
||
#region 抖音签名算法
|
||
private const string host = "https://openapi-fxg.jinritemai.com";
|
||
private const int Ver = 2;
|
||
private const string sign_method = "hmac-sha256";
|
||
|
||
//private const string Appid = "7066380295942964749";
|
||
//private const string Appsecret = "5723f45c-1493-46bd-a0d9-1e4bb65b77d0";
|
||
|
||
|
||
// 序列化参数
|
||
// 这一步看上去冗余,实际很重要。如果要自己实现,则必须保证这三点:
|
||
// 1、保证JSON所有层级上Key的有序性
|
||
// 2、保证JSON的所有数值不带多余的小数点
|
||
// 3、保证转义逻辑与这段代码一致
|
||
public static string Marshal(object o)
|
||
{
|
||
var raw = JsonConvert.SerializeObject(o);
|
||
|
||
// 反序列化为JObject
|
||
var dict = JsonConvert.DeserializeObject(raw);
|
||
|
||
// 重新序列化
|
||
var settings = new JsonSerializerSettings();
|
||
settings.Converters = new List<JsonConverter> { new JObjectConverter(), new JValueConverter() };
|
||
return JsonConvert.SerializeObject(dict, Formatting.None, settings);
|
||
}
|
||
|
||
// 计算签名
|
||
public static string Sign(string appKey, string appSecret, string method, string timestamp, string paramJson)
|
||
{
|
||
// 按给定规则拼接参数
|
||
var paramPattern = "app_key" + appKey + "method" + method + "param_json" + paramJson + "timestamp" +
|
||
timestamp + "v" + Ver;
|
||
var signPattern = appSecret + paramPattern + appSecret;
|
||
//Console.WriteLine("sign_pattern:" + signPattern);
|
||
|
||
return Hmac(signPattern, appSecret);
|
||
}
|
||
|
||
// 计算hmac
|
||
public static string Hmac(string plainText, string appSecret)
|
||
{
|
||
var h = new HMACSHA256(Encoding.UTF8.GetBytes(appSecret));
|
||
var sum = h.ComputeHash(Encoding.UTF8.GetBytes(plainText));
|
||
|
||
var sb = new StringBuilder();
|
||
foreach (byte b in sum)
|
||
{
|
||
sb.Append(b.ToString("x2"));
|
||
}
|
||
return sb.ToString();
|
||
}
|
||
|
||
// 自定义JObject的序列化方法,确保对象的Key按字典序输出
|
||
class JObjectConverter : JsonConverter
|
||
{
|
||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||
{
|
||
var val = value as JObject;
|
||
var props = val.Properties().OrderBy(i => i.Name).ToList();
|
||
writer.WriteStartObject();
|
||
foreach (var p in props)
|
||
{
|
||
writer.WritePropertyName(p.Name);
|
||
serializer.Serialize(writer, p.Value);
|
||
}
|
||
|
||
writer.WriteEndObject();
|
||
}
|
||
|
||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue,
|
||
JsonSerializer serializer)
|
||
{
|
||
throw new NotImplementedException();
|
||
}
|
||
|
||
public override bool CanConvert(Type objectType)
|
||
{
|
||
return objectType == typeof(JObject);
|
||
}
|
||
}
|
||
|
||
// 自定义JValue的序列化方法,确保浮点数输出时移除小数点后多余的零
|
||
class JValueConverter : JsonConverter
|
||
{
|
||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||
{
|
||
var val = value as JValue;
|
||
if (val.Type == JTokenType.Float)
|
||
{
|
||
var d = Convert.ToDouble(val.Value);
|
||
var i = (long)d;
|
||
if (Math.Abs(i - d) == 0) // 针对float,如果小数点后的零是多余的,那么按整数方式输出
|
||
{
|
||
writer.WriteValue(i);
|
||
return;
|
||
}
|
||
}
|
||
writer.WriteValue(value); // 否则按原逻辑
|
||
}
|
||
|
||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||
{
|
||
throw new NotImplementedException();
|
||
}
|
||
|
||
public override bool CanConvert(Type objectType)
|
||
{
|
||
return objectType == typeof(JValue);
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
}
|
||
}
|