MCPcopy Create free account
hub / github.com/Semporia/Scripts / FlashSaleDivide

Function FlashSaleDivide

JD_DailyBonus.js:938–984  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

936}
937
938function FlashSaleDivide(s) {
939 return new Promise(resolve => {
940 setTimeout(() => {
941 const Url = {
942 url: 'https://api.m.jd.com/client.action?functionId=partitionJdShare',
943 headers: {
944 Cookie: KEY
945 },
946 body: "body=%7B%22version%22%3A%22v2%22%7D&client=apple&clientVersion=9.0.8&openudid=1fce88cd05c42fe2b054e846f11bdf33f016d676&sign=49baa3b3899b02bbf06cdf41fe191986&st=1597682588351&sv=111"
947 };
948 $nobyda.post(Url, function(error, response, data) {
949 try {
950 if (error) {
951 throw new Error(error)
952 } else {
953 const Details = LogDetails ? "response:\n" + data : '';
954 const cc = JSON.parse(data)
955 if (cc.result.code == 0) {
956 merge.JDFSale.success = 1
957 merge.JDFSale.bean = cc.result.jdBeanNum || 0
958 merge.JDFSale.notify = "京东闪购-瓜分: 成功, 明细: " + (merge.JDFSale.bean || "无") + "京豆 🐶"
959 console.log("\n" + "京东闪购-瓜分签到成功 " + Details)
960 } else {
961 merge.JDFSale.fail = 1
962 console.log("\n" + "京东闪购-瓜分签到失败 " + Details)
963 if (data.match(/已参与|已领取|\"2006\"/)) {
964 merge.JDFSale.notify = "京东闪购-瓜分: 失败, 原因: 已瓜分 ⚠️"
965 } else if (data.match(/不存在|已结束|未开始|\"2008\"|\"2012\"/)) {
966 merge.JDFSale.notify = "京东闪购-瓜分: 失败, 原因: 活动已结束 ⚠️"
967 } else if (data.match(/\"code\":\"1003\"|未获取/)) {
968 merge.JDFSale.notify = "京东闪购-瓜分: 失败, 原因: Cookie失效‼️"
969 } else {
970 const msg = data.match(/\"msg\":\"([\u4e00-\u9fa5].+?)\"/)
971 merge.JDFSale.notify = `京东闪购-瓜分: 失败, ${msg ? msg[1] : `原因: 未知`} ⚠️`
972 }
973 }
974 }
975 } catch (eor) {
976 $nobyda.AnError("京东闪购-瓜分", "JDFSale", eor, response, data)
977 } finally {
978 resolve()
979 }
980 })
981 }, s)
982 if (out) setTimeout(resolve, out + s)
983 });
984}
985
986function JingDongCash(s) {
987 merge.JDCash = {};

Callers 1

JDFlashSaleFunction · 0.85

Calls 2

postMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected