mirror of
https://github.com/lan-tianxiang/clone_scripts.git
synced 2025-07-17 17:33:47 +08:00
更新于 07-13 19:48
This commit is contained in:
@@ -46,7 +46,15 @@ if ($.isNode()) {
|
||||
}
|
||||
|
||||
$.appid = 'o2_act';
|
||||
const UA = $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "JD4iPhone/9.3.5 CFNetwork/1209 Darwin/20.2.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "JD4iPhone/9.3.5 CFNetwork/1209 Darwin/20.2.0")
|
||||
const UA = $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : `jdpingou;iPhone;4.11.0;${Math.ceil(Math.random() * 2 + 12)}.${Math.ceil(Math.random() * 4)};${randomString(40)};`) : ($.getdata('JDUA') ? $.getdata('JDUA') : `jdpingou;iPhone;10.0.6;${Math.ceil(Math.random() * 2 + 12)}.${Math.ceil(Math.random() * 4)};${randomString(40)};`)
|
||||
|
||||
function randomString(e) {
|
||||
e = e || 32;
|
||||
let t = "abcdefhijkmnprstwxyz2345678", a = t.length, n = "";
|
||||
for (i = 0; i < e; i++)
|
||||
n += t.charAt(Math.floor(Math.random() * a));
|
||||
return n
|
||||
}
|
||||
|
||||
|
||||
!(async () => {
|
||||
@@ -199,6 +207,7 @@ async function movement() {
|
||||
|
||||
console.log('\n运动\n')
|
||||
$.speedTraining = true;
|
||||
if (!$.hotFlag) {
|
||||
await takePostRequest('olympicgames_startTraining');
|
||||
await $.wait(1000);
|
||||
for (let i = 0; i <= 3; i++) {
|
||||
@@ -209,9 +218,9 @@ async function movement() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
console.log(`\n做任务\n`);
|
||||
await takePostRequest('olympicgames_getTaskDetail');
|
||||
if (!$.hotFlag) await takePostRequest('olympicgames_getTaskDetail');
|
||||
await $.wait(1000);
|
||||
//做任务
|
||||
for (let i = 0; i < $.taskList.length && !$.hotFlag; i++) {
|
||||
@@ -331,7 +340,7 @@ async function movement() {
|
||||
// 店铺
|
||||
console.log(`\n去做店铺任务\n`);
|
||||
$.shopInfoList = [];
|
||||
await takePostRequest('qryCompositeMaterials');
|
||||
if (!$.hotFlag) await takePostRequest('qryCompositeMaterials');
|
||||
for (let i = 0; i < $.shopInfoList.length; i++) {
|
||||
let taskbool = false
|
||||
$.shopSign = $.shopInfoList[i].extension.shopId;
|
||||
@@ -601,15 +610,18 @@ async function dealReturn(type, res) {
|
||||
break;
|
||||
case 'add_car':
|
||||
if (data.code === 0) {
|
||||
if (data.data && data.data.bizCode === 0 && data.data.result && data.data.result.acquiredScore) {
|
||||
let acquiredScore = data.data.result.acquiredScore;
|
||||
if (Number(acquiredScore) > 0) {
|
||||
console.log(`加购成功,获得金币:${acquiredScore}`);
|
||||
} else {
|
||||
console.log(`加购成功`);
|
||||
}
|
||||
} else if (data.data && data.data.bizMsg) {
|
||||
console.log(data.data.bizMsg);
|
||||
} else {
|
||||
console.log(res);
|
||||
console.log(`加购失败`);
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'shHelp':
|
||||
@@ -768,7 +780,7 @@ async function getPostRequest(type, body) {
|
||||
'Cookie': $.cookie,
|
||||
"Origin": "https://wbbny.m.jd.com",
|
||||
"Referer": "https://wbbny.m.jd.com/",
|
||||
"User-Agent": "jdapp;iPhone;9.2.0;14.1;",
|
||||
"User-Agent": UA,
|
||||
|
||||
};
|
||||
return { url: url, method: method, headers: headers, body: body };
|
||||
@@ -786,7 +798,7 @@ function callbackResult(info) {
|
||||
'Connection': `keep-alive`,
|
||||
'Accept': `*/*`,
|
||||
'Host': `api.m.jd.com`,
|
||||
'User-Agent': "jdapp;iPhone;10.0.2;14.3;8a0d1837f803a12eb217fcf5e1f8769cbb3f898d;network/wifi;model/iPhone12,1;addressid/4199175193;appBuild/167694;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||
'User-Agent': UA,
|
||||
'Accept-Encoding': `gzip, deflate, br`,
|
||||
'Accept-Language': `zh-cn`,
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
@@ -821,7 +833,7 @@ function joinjoinjoinhui(url, Referer) {
|
||||
"Host": "api.m.jd.com",
|
||||
"Referer": Referer,
|
||||
"Cookie": $.cookie,
|
||||
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;10.0.2;14.3;8a0d1837f803a12eb217fcf5e1f8769cbb3f898d;network/wifi;model/iPhone12,1;addressid/4199175193;appBuild/167694;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;10.0.2;14.3;8a0d1837f803a12eb217fcf5e1f8769cbb3f898d;network/wifi;model/iPhone12,1;addressid/4199175193;appBuild/167694;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
|
||||
"User-Agent": UA,
|
||||
}
|
||||
}
|
||||
$.get(taskjiaruUrl, async (err, resp, data) => {
|
||||
|
Reference in New Issue
Block a user