mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 02:48:44 +08:00
update
This commit is contained in:
parent
0cbc7267c9
commit
d2fbf154fc
1
function/dylank.js
Normal file
1
function/dylank.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
144
jd_bean_home.js
144
jd_bean_home.js
@ -1,35 +1,16 @@
|
|||||||
/*
|
/*
|
||||||
领京豆额外奖励&抢京豆
|
领京豆额外奖励
|
||||||
脚本自带助力码,介意者可将 29行 helpAuthor 变量设置为 false
|
|
||||||
活动入口:京东APP首页-领京豆
|
活动入口:京东APP首页-领京豆
|
||||||
更新地址:https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_bean_home.js
|
cron "25 2,14 * * *" script-path=https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_bean_home.js, tag=领京豆额外奖励
|
||||||
已支持IOS双京东账号, Node.js支持N个京东账号
|
|
||||||
脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js
|
|
||||||
============Quantumultx===============
|
|
||||||
[task_local]
|
|
||||||
#领京豆额外奖励
|
|
||||||
23 1,18 * * * https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_bean_home.js, tag=领京豆额外奖励, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_bean_home.png, enabled=true
|
|
||||||
|
|
||||||
================Loon==============
|
|
||||||
[Script]
|
|
||||||
cron "23 1,18 * * *" script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_bean_home.js, tag=领京豆额外奖励
|
|
||||||
|
|
||||||
===============Surge=================
|
|
||||||
领京豆额外奖励 = type=cron,cronexp="23 1,18 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_bean_home.js
|
|
||||||
|
|
||||||
============小火箭=========
|
|
||||||
领京豆额外奖励 = type=cron,script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_bean_home.js, cronexpr="23 1,18 * * *", timeout=3600, enable=true
|
|
||||||
*/
|
*/
|
||||||
const $ = new Env('领京豆额外奖励');
|
const $ = new Env('领京豆-升级赚豆');
|
||||||
|
|
||||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||||
let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
|
|
||||||
const helpAuthor = false; // 是否帮助作者助力,false打开通知推送,true关闭通知推送
|
|
||||||
//IOS等用户直接用NobyDa的jd cookie
|
//IOS等用户直接用NobyDa的jd cookie
|
||||||
|
const ua = require('./USER_AGENTS');
|
||||||
let cookiesArr = [], cookie = '', uuid = '', message;
|
let cookiesArr = [], cookie = '', uuid = '', message;
|
||||||
$.outFlag = false
|
|
||||||
if ($.isNode()) {
|
if ($.isNode()) {
|
||||||
Object.keys(jdCookieNode).forEach((item) => {
|
Object.keys(jdCookieNode).forEach((item) => {
|
||||||
cookiesArr.push(jdCookieNode[item])
|
cookiesArr.push(jdCookieNode[item])
|
||||||
@ -54,7 +35,9 @@ const JD_API_HOST = 'https://api.m.jd.com/';
|
|||||||
$.isLogin = true;
|
$.isLogin = true;
|
||||||
$.nickName = '';
|
$.nickName = '';
|
||||||
message = '';
|
message = '';
|
||||||
uuid = randomString()
|
uuid = randomString();
|
||||||
|
$.UA = ua.UARAM ? ua.UARAM() : ua.USER_AGENT;
|
||||||
|
$.av = $.UA.split(';')[2];
|
||||||
await TotalBean();
|
await TotalBean();
|
||||||
console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
|
console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
|
||||||
if (!$.isLogin) {
|
if (!$.isLogin) {
|
||||||
@ -66,52 +49,9 @@ const JD_API_HOST = 'https://api.m.jd.com/';
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
await jdBeanHome();
|
await jdBeanHome();
|
||||||
await $.wait(parseInt(Math.random() * 5000 + 8000, 10))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// for (let i = 0; i < cookiesArr.length; i++) {
|
|
||||||
// $.index = i + 1;
|
|
||||||
// if (cookiesArr[i]) {
|
|
||||||
// cookie = cookiesArr[i];
|
|
||||||
// $.canHelp = true;
|
|
||||||
// $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
|
||||||
// if ($.newShareCodes.length > 1) {
|
|
||||||
// console.log(`\n【抢京豆】 ${$.UserName} 去助力排名第一的cookie`);
|
|
||||||
// // let code = $.newShareCodes[(i + 1) % $.newShareCodes.length]
|
|
||||||
// // await help(code[0], code[1])
|
|
||||||
// let code = $.newShareCodes[0];
|
|
||||||
// if(code[2] && code[2] === $.UserName){
|
|
||||||
// //不助力自己
|
|
||||||
// } else {
|
|
||||||
// await help(code[0], code[1]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (helpAuthor && $.authorCode && $.canHelp) {
|
|
||||||
// console.log(`\n【抢京豆】${$.UserName} 去帮助作者`)
|
|
||||||
// for (let code of $.authorCode) {
|
|
||||||
// const helpRes = await help(code.shareCode, code.groupCode);
|
|
||||||
// if (helpRes && helpRes['code'] === '0') {
|
|
||||||
// if (helpRes && helpRes.data && helpRes.data.respCode === 'SG209') {
|
|
||||||
// console.log(`${helpRes.data.helpToast}\n`);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// console.log(`助力异常:${JSON.stringify(helpRes)}\n`);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// for (let j = 1; j < $.newShareCodes.length && $.canHelp; j++) {
|
|
||||||
// let code = $.newShareCodes[j];
|
|
||||||
// if(code[2] && code[2] === $.UserName){
|
|
||||||
// //不助力自己
|
|
||||||
// } else {
|
|
||||||
// console.log(`【抢京豆】${$.UserName} 去助力账号 ${j + 1}`);
|
|
||||||
// await help(code[0], code[1]);
|
|
||||||
// await $.wait(2000);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
})()
|
})()
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
$.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
|
$.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
|
||||||
@ -123,39 +63,34 @@ const JD_API_HOST = 'https://api.m.jd.com/';
|
|||||||
async function jdBeanHome() {
|
async function jdBeanHome() {
|
||||||
try {
|
try {
|
||||||
$.doneState = false
|
$.doneState = false
|
||||||
// for (let i = 0; i < 3; ++i) {
|
$.flag = true
|
||||||
// await doTask2()
|
|
||||||
// await $.wait(1000)
|
|
||||||
// if ($.doneState) break
|
|
||||||
// }
|
|
||||||
$.outFlag = false
|
|
||||||
do {
|
do {
|
||||||
await doTask2()
|
await doTask2()
|
||||||
if ($.outFlag) break
|
await $.wait(3000)
|
||||||
await $.wait(5000)
|
} while (!$.doneState && $.flag)
|
||||||
} while (!$.doneState)
|
if ($.flag) {
|
||||||
await $.wait(1000)
|
await $.wait(1000)
|
||||||
await award("feeds")
|
await award("feeds")
|
||||||
await $.wait(1000)
|
await $.wait(1000)
|
||||||
await getUserInfo()
|
await getUserInfo()
|
||||||
await $.wait(1000)
|
await $.wait(1000)
|
||||||
await getTaskList();
|
//await getTaskList();
|
||||||
await receiveJd2();
|
//await receiveJd2();
|
||||||
|
}
|
||||||
//await morningGetBean()
|
//await morningGetBean()
|
||||||
//await $.wait(1000)
|
await $.wait(1000)
|
||||||
|
|
||||||
await beanTaskList(1)
|
await beanTaskList(1)
|
||||||
await $.wait(2000)
|
await $.wait(1000)
|
||||||
await queryCouponInfo()
|
await queryCouponInfo()
|
||||||
$.doneState = false
|
$.doneState = false
|
||||||
let num = 0
|
let num = 0
|
||||||
do {
|
do {
|
||||||
await $.wait(3000)
|
await $.wait(2000)
|
||||||
await beanTaskList(2)
|
await beanTaskList(2)
|
||||||
num++
|
num++
|
||||||
} while (!$.doneState && num < 5)
|
} while (!$.doneState && num < 5)
|
||||||
await $.wait(3000)
|
await $.wait(2000)
|
||||||
if ($.doneState) await beanTaskList(3)
|
if ($.doneState) await beanTaskList(3)
|
||||||
|
|
||||||
await showMsg();
|
await showMsg();
|
||||||
@ -175,9 +110,9 @@ function morningGetBean() {
|
|||||||
} else {
|
} else {
|
||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.data.awardResultFlag === "1") {
|
if (data.data?.awardResultFlag === "1") {
|
||||||
console.log(`早起福利领取成功:${data.data.bizMsg}`)
|
console.log(`早起福利领取成功:${data.data.bizMsg}`)
|
||||||
} else if (data.data.awardResultFlag === "2") {
|
} else if (data.data?.awardResultFlag === "2") {
|
||||||
console.log(`早起福利领取失败:${data.data.bizMsg}`)
|
console.log(`早起福利领取失败:${data.data.bizMsg}`)
|
||||||
} else {
|
} else {
|
||||||
console.log(`早起福利领取失败:${data.data.bizMsg}`)
|
console.log(`早起福利领取失败:${data.data.bizMsg}`)
|
||||||
@ -204,6 +139,7 @@ async function beanTaskList(type) {
|
|||||||
} else {
|
} else {
|
||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
|
if (!data.errorMessage) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 1:
|
case 1:
|
||||||
console.log(`当前等级:${data.data.curLevel} 下一级可领取:${data.data.nextLevelBeanNum || 0}京豆`)
|
console.log(`当前等级:${data.data.curLevel} 下一级可领取:${data.data.nextLevelBeanNum || 0}京豆`)
|
||||||
@ -254,6 +190,9 @@ async function beanTaskList(type) {
|
|||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
console.log(data.errorMessage)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -392,13 +331,12 @@ function getRandomInt(min, max) {
|
|||||||
}
|
}
|
||||||
function doTask2() {
|
function doTask2() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const body = {"awardFlag": false, "skuId": `${getRandomInt(10000000,20000000)}`, "source": "feeds", "type": '1'};
|
const body = { "awardFlag": false, "skuId": `${getRandomInt(1000000000, 2000000000)}`, "source": "feeds", "type": '1' };
|
||||||
$.post(taskUrl('beanHomeTask', body), (err, resp, data) => {
|
$.get(taskGetUrl('beanHomeTask', body), (err, resp, data) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
$.outFlag = true
|
$.flag = false
|
||||||
console.log(`${JSON.stringify(err)}`)
|
//console.log(`doTask2 API请求失败,请检查网路重试`)
|
||||||
console.log(`doTask2 API请求失败,请检查网路重试`)
|
|
||||||
} else {
|
} else {
|
||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
@ -463,7 +401,7 @@ function getUserInfo() {
|
|||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(`${JSON.stringify(err)}`)
|
console.log(`${JSON.stringify(err)}`)
|
||||||
console.log(`getUserInfo API请求失败,请检查网路重试`)
|
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
} else {
|
} else {
|
||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
@ -501,7 +439,7 @@ function hitGroup() {
|
|||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(`${JSON.stringify(err)}`)
|
console.log(`${JSON.stringify(err)}`)
|
||||||
console.log(`hitGroup API请求失败,请检查网路重试`)
|
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
} else {
|
} else {
|
||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
@ -583,7 +521,7 @@ function getTaskList() {
|
|||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(`${JSON.stringify(err)}`)
|
console.log(`${JSON.stringify(err)}`)
|
||||||
console.log(`getTaskList API请求失败,请检查网路重试`)
|
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
} else {
|
} else {
|
||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
@ -648,7 +586,6 @@ function award(source="home") {
|
|||||||
if (err) {
|
if (err) {
|
||||||
console.log(`${JSON.stringify(err)}`)
|
console.log(`${JSON.stringify(err)}`)
|
||||||
console.log(`award API请求失败,请检查网路重试`)
|
console.log(`award API请求失败,请检查网路重试`)
|
||||||
$.outFlag = true
|
|
||||||
} else {
|
} else {
|
||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
@ -689,8 +626,7 @@ function receiveJd2() {
|
|||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(`${JSON.stringify(err)}`)
|
console.log(`${JSON.stringify(err)}`)
|
||||||
console.log(`receiveJd2 API请求失败,请检查网路重试`)
|
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
$.outFlag = true
|
|
||||||
} else {
|
} else {
|
||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
@ -712,13 +648,13 @@ function receiveJd2() {
|
|||||||
}
|
}
|
||||||
function taskGetUrl(function_id, body) {
|
function taskGetUrl(function_id, body) {
|
||||||
return {
|
return {
|
||||||
url: `${JD_API_HOST}client.action?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld&clientVersion=9.2.0`,
|
url: `${JD_API_HOST}client.action?functionId=${function_id}&body=${encodeURIComponent(JSON.stringify(body))}&appid=ld&client=android&clientVersion=${$.av}`,
|
||||||
headers: {
|
headers: {
|
||||||
'Cookie': cookie,
|
'Cookie': cookie,
|
||||||
'Host': 'api.m.jd.com',
|
'Host': 'api.m.jd.com',
|
||||||
'Accept': '*/*',
|
'Accept': '*/*',
|
||||||
'Connection': 'keep-alive',
|
'Connection': 'keep-alive',
|
||||||
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;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-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9',
|
'Accept-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
'Content-Type': "application/x-www-form-urlencoded"
|
'Content-Type': "application/x-www-form-urlencoded"
|
||||||
@ -728,13 +664,13 @@ function taskGetUrl(function_id, body) {
|
|||||||
|
|
||||||
function taskBeanUrl(function_id, body = {}) {
|
function taskBeanUrl(function_id, body = {}) {
|
||||||
return {
|
return {
|
||||||
url: `${JD_API_HOST}client.action?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld&client=apple&clientVersion=10.0.8&uuid=${uuid}&openudid=${uuid}`,
|
url: `${JD_API_HOST}client.action?functionId=${function_id}&body=${encodeURIComponent(JSON.stringify(body))}&appid=ld&client=apple&clientVersion=${$.av}&uuid=${uuid}&openudid=${uuid}`,
|
||||||
headers: {
|
headers: {
|
||||||
'Cookie': cookie,
|
'Cookie': cookie,
|
||||||
'Host': 'api.m.jd.com',
|
'Host': 'api.m.jd.com',
|
||||||
'Accept': '*/*',
|
'Accept': '*/*',
|
||||||
'Connection': 'keep-alive',
|
'Connection': 'keep-alive',
|
||||||
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;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-Language': 'zh-cn',
|
'Accept-Language': 'zh-cn',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
"Referer": "https://h5.m.jd.com/"
|
"Referer": "https://h5.m.jd.com/"
|
||||||
@ -748,13 +684,13 @@ function taskUrl(function_id, body) {
|
|||||||
body["monitor_refer"] = "";
|
body["monitor_refer"] = "";
|
||||||
return {
|
return {
|
||||||
url: JD_API_HOST,
|
url: JD_API_HOST,
|
||||||
body: `functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld&client=apple&area=5_274_49707_49973&build=167283&clientVersion=9.1.0`,
|
body: `functionId=${function_id}&body=${encodeURIComponent(JSON.stringify(body))}&appid=ld&client=apple&clientVersion=${$.av}`,
|
||||||
headers: {
|
headers: {
|
||||||
'Cookie': cookie,
|
'Cookie': cookie,
|
||||||
'Host': 'api.m.jd.com',
|
'Host': 'api.m.jd.com',
|
||||||
'Accept': '*/*',
|
'Accept': '*/*',
|
||||||
'Connection': 'keep-alive',
|
'Connection': 'keep-alive',
|
||||||
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;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-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9',
|
'Accept-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
'Content-Type': "application/x-www-form-urlencoded"
|
'Content-Type': "application/x-www-form-urlencoded"
|
||||||
@ -781,7 +717,7 @@ function TotalBean() {
|
|||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(`${JSON.stringify(err)}`)
|
console.log(`${JSON.stringify(err)}`)
|
||||||
console.log(`TotalBean API请求失败,请检查网路重试`)
|
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
} else {
|
} else {
|
||||||
if (data) {
|
if (data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
|
145
jd_cashsign.js
145
jd_cashsign.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
10
jd_gwfd.js
Normal file
10
jd_gwfd.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
12
jd_sghelp.js
Normal file
12
jd_sghelp.js
Normal file
File diff suppressed because one or more lines are too long
260
jd_speed_sign.js
260
jd_speed_sign.js
@ -1,15 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
京东极速版签到+赚现金任务
|
赚金币任务
|
||||||
每日9毛左右,满3,10,50可兑换无门槛红包
|
|
||||||
⚠️⚠️⚠️一个号需要运行20多分钟左右
|
|
||||||
活动时间:长期
|
活动时间:长期
|
||||||
活动入口:京东极速版app-现金签到
|
活动入口:京喜特价app-百元生活费-赚金币
|
||||||
已支持IOS双京东账号,Node.js支持N个京东账号
|
已支持IOS双京东账号,Node.js支持N个京东账号
|
||||||
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
||||||
============Quantumultx===============
|
============Quantumultx===============
|
||||||
[task_local]
|
[task_local]
|
||||||
#京东极速版
|
#京东极速版
|
||||||
5 0,8 * * * jd_speed_sign.js,
|
15 2,14 * * * jd_speed_sign.js,
|
||||||
================Loon==============
|
================Loon==============
|
||||||
[Script]
|
[Script]
|
||||||
cron "15 2,14 * * *" script-path=jd_speed_sign.js,tag=京东极速版
|
cron "15 2,14 * * *" script-path=jd_speed_sign.js,tag=京东极速版
|
||||||
@ -18,7 +16,7 @@ cron "15 2,14 * * *" script-path=jd_speed_sign.js,tag=京东极速版
|
|||||||
============小火箭=========
|
============小火箭=========
|
||||||
京东极速版 = type=cron,script-path=jd_speed_sign.js, cronexpr="15 2,14 * * *", timeout=33600, enable=true
|
京东极速版 = type=cron,script-path=jd_speed_sign.js, cronexpr="15 2,14 * * *", timeout=33600, enable=true
|
||||||
*/
|
*/
|
||||||
const $ = new Env('京东极速版');
|
const $ = new Env('京喜特价赚金币');
|
||||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||||
@ -77,16 +75,16 @@ const JD_API_HOST = 'https://api.m.jd.com/', actCode = 'visa-card-001';
|
|||||||
|
|
||||||
async function jdGlobal() {
|
async function jdGlobal() {
|
||||||
try {
|
try {
|
||||||
await richManIndex()
|
//await richManIndex()
|
||||||
|
|
||||||
await wheelsHome()
|
//await wheelsHome()
|
||||||
await apTaskList()
|
//await apTaskList()
|
||||||
await wheelsHome()
|
//await wheelsHome()
|
||||||
|
|
||||||
// await signInit()
|
// await signInit()
|
||||||
// await sign()
|
// await sign()
|
||||||
await invite()
|
//await invite()
|
||||||
await invite2()
|
//await invite2()
|
||||||
$.score = 0
|
$.score = 0
|
||||||
$.total = 0
|
$.total = 0
|
||||||
await taskList()
|
await taskList()
|
||||||
@ -112,67 +110,67 @@ function showMsg() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function signInit() {
|
// async function signInit() {
|
||||||
return new Promise(resolve => {
|
// return new Promise(resolve => {
|
||||||
$.get(taskUrl('speedSignInit', {
|
// $.get(taskUrl('speedSignInit', {
|
||||||
"activityId": "8a8fabf3cccb417f8e691b6774938bc2",
|
// "activityId": "8a8fabf3cccb417f8e691b6774938bc2",
|
||||||
"kernelPlatform": "RN",
|
// "kernelPlatform": "RN",
|
||||||
"inviterId":"wXX9SjXOdYMWe5Ru/1+x9A=="
|
// "inviterId": "wXX9SjXOdYMWe5Ru/1+x9A=="
|
||||||
}), async (err, resp, data) => {
|
// }), async (err, resp, data) => {
|
||||||
try {
|
// try {
|
||||||
if (err) {
|
// if (err) {
|
||||||
console.log(`${JSON.stringify(err)}`)
|
// console.log(`${JSON.stringify(err)}`)
|
||||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
// console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
} else {
|
// } else {
|
||||||
if (safeGet(data)) {
|
// if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
// data = JSON.parse(data);
|
||||||
//console.log(data)
|
// //console.log(data)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
$.logErr(e, resp)
|
// $.logErr(e, resp)
|
||||||
} finally {
|
// } finally {
|
||||||
resolve(data);
|
// resolve(data);
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
async function sign() {
|
// async function sign() {
|
||||||
return new Promise(resolve => {
|
// return new Promise(resolve => {
|
||||||
$.get(taskUrl('speedSign', {
|
// $.get(taskUrl('speedSign', {
|
||||||
"kernelPlatform": "RN",
|
// "kernelPlatform": "RN",
|
||||||
"activityId": "8a8fabf3cccb417f8e691b6774938bc2",
|
// "activityId": "8a8fabf3cccb417f8e691b6774938bc2",
|
||||||
"noWaitPrize": "false"
|
// "noWaitPrize": "false"
|
||||||
}),
|
// }),
|
||||||
async (err, resp, data) => {
|
// async (err, resp, data) => {
|
||||||
try {
|
// try {
|
||||||
if (err) {
|
// if (err) {
|
||||||
console.log(`${JSON.stringify(err)}`)
|
// console.log(`${JSON.stringify(err)}`)
|
||||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
// console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
} else {
|
// } else {
|
||||||
if (safeGet(data)) {
|
// if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
// data = JSON.parse(data);
|
||||||
if (data.subCode === 0) {
|
// if (data.subCode === 0) {
|
||||||
console.log(`签到获得${data.data.signAmount}现金,共计获得${data.data.cashDrawAmount}`)
|
// console.log(`签到获得${data.data.signAmount}现金,共计获得${data.data.cashDrawAmount}`)
|
||||||
} else {
|
// } else {
|
||||||
console.log(`签到失败,${data.msg}`)
|
// console.log(`签到失败,${data.msg}`)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
$.logErr(e, resp)
|
// $.logErr(e, resp)
|
||||||
} finally {
|
// } finally {
|
||||||
resolve(data);
|
// resolve(data);
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
async function taskList() {
|
async function taskList() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
$.get(taskUrl('ClientHandleService.execute', {
|
$.get(taskUrl('ClientHandleService.execute', {
|
||||||
"version": "3.1.0",
|
//"version": "3.1.0",
|
||||||
"method": "newTaskCenterPage",
|
"method": "newTaskCenterPage",
|
||||||
"data": { "channel": 1 }
|
"data": { "channel": 1 }
|
||||||
}),
|
}),
|
||||||
@ -188,15 +186,20 @@ async function taskList() {
|
|||||||
$.taskName = task.taskInfo.mainTitle
|
$.taskName = task.taskInfo.mainTitle
|
||||||
if (task.taskInfo.status === 0) {
|
if (task.taskInfo.status === 0) {
|
||||||
if (task.taskType >= 1000) {
|
if (task.taskType >= 1000) {
|
||||||
|
await $.wait(800);
|
||||||
await doTask(task.taskType)
|
await doTask(task.taskType)
|
||||||
await $.wait(1000)
|
await $.wait(500);
|
||||||
} else {
|
} else {
|
||||||
$.canStartNewItem = true
|
$.canStartNewItem = true
|
||||||
while ($.canStartNewItem) {
|
while ($.canStartNewItem) {
|
||||||
if (task.taskType !== 3) {
|
if (task.taskType !== 3) {
|
||||||
await queryItem(task.taskType)
|
await $.wait(500);
|
||||||
|
await queryItem(task.taskType);
|
||||||
|
await $.wait(500);
|
||||||
} else {
|
} else {
|
||||||
await startItem("", task.taskType)
|
await $.wait(500);
|
||||||
|
await startItem("", task.taskType);
|
||||||
|
await $.wait(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,7 +237,7 @@ async function doTask(taskId) {
|
|||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.code === 0) {
|
if (data.code === 0) {
|
||||||
console.log(`${data.data.taskInfo.mainTitle}任务完成成功,预计获得${data.data.reward}金币`)
|
console.log(`${data.data.taskInfo.mainTitle}任务完成成功,获得${data.data.reward}金币`)
|
||||||
} else {
|
} else {
|
||||||
console.log(`任务完成失败,${data.message}`)
|
console.log(`任务完成失败,${data.message}`)
|
||||||
}
|
}
|
||||||
@ -262,8 +265,9 @@ async function queryJoy() {
|
|||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.data.taskBubbles)
|
if (data.data.taskBubbles)
|
||||||
for (let task of data.data.taskBubbles) {
|
for (let task of data.data.taskBubbles) {
|
||||||
await rewardTask(task.id, task.activeType)
|
await $.wait(500);
|
||||||
await $.wait(500)
|
await rewardTask(task.id, task.activeType);
|
||||||
|
await $.wait(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -315,13 +319,16 @@ async function queryItem(activeType = 1) {
|
|||||||
}), async (err, resp, data) => {
|
}), async (err, resp, data) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(`${JSON.stringify(err)}`)
|
console.log(`${JSON.stringify(err)}`);
|
||||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
console.log(`${$.name} API请求失败,请检查网路重试`);
|
||||||
|
await $.wait(1000);
|
||||||
} else {
|
} else {
|
||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.code === 0 && data.data) {
|
if (data.code === 0 && data.data) {
|
||||||
await startItem(data.data.nextResource, activeType)
|
await $.wait(800);
|
||||||
|
await startItem(data.data.nextResource, activeType);
|
||||||
|
await $.wait(500);
|
||||||
} else {
|
} else {
|
||||||
console.log(`商品任务开启失败,${data.message}`)
|
console.log(`商品任务开启失败,${data.message}`)
|
||||||
$.canStartNewItem = false
|
$.canStartNewItem = false
|
||||||
@ -365,7 +372,8 @@ async function startItem(activeId, activeType) {
|
|||||||
videoBrowsing = activeType === 1 ? 5 : 10
|
videoBrowsing = activeType === 1 ? 5 : 10
|
||||||
console.log(`【${taskCompletionProgress + 1}/${taskCompletionLimit}】浏览商品任务记录成功,等待${videoBrowsing}秒`)
|
console.log(`【${taskCompletionProgress + 1}/${taskCompletionLimit}】浏览商品任务记录成功,等待${videoBrowsing}秒`)
|
||||||
await $.wait(videoBrowsing * 1000)
|
await $.wait(videoBrowsing * 1000)
|
||||||
await endItem(data.data.uuid, activeType, activeId, activeType === 3 ? videoBrowsing : "")
|
await endItem(data.data.uuid, activeType, activeId, activeType === 3 ? videoBrowsing : "");
|
||||||
|
await $.wait(1000);
|
||||||
} else {
|
} else {
|
||||||
console.log(`${$.taskName}任务已达上限`)
|
console.log(`${$.taskName}任务已达上限`)
|
||||||
$.canStartNewItem = false
|
$.canStartNewItem = false
|
||||||
@ -408,7 +416,9 @@ async function endItem(uuid, activeType, activeId = "", videoTimeLength = "") {
|
|||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.code === 0 && data.isSuccess) {
|
if (data.code === 0 && data.isSuccess) {
|
||||||
await rewardItem(uuid, activeType, activeId, videoTimeLength)
|
await $.wait(500);
|
||||||
|
await rewardItem(uuid, activeType, activeId, videoTimeLength);
|
||||||
|
await $.wait(500);
|
||||||
} else {
|
} else {
|
||||||
console.log(`${$.taskName}任务结束失败,${data.message}`)
|
console.log(`${$.taskName}任务结束失败,${data.message}`)
|
||||||
}
|
}
|
||||||
@ -486,65 +496,7 @@ async function cash() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 大转盘
|
|
||||||
function wheelsHome() {
|
|
||||||
return new Promise(resolve => {
|
|
||||||
$.get(taskGetUrl('wheelsHome',
|
|
||||||
{"linkId":"toxw9c5sy9xllGBr3QFdYg"}),
|
|
||||||
async (err, resp, data) => {
|
|
||||||
try {
|
|
||||||
if (err) {
|
|
||||||
console.log(`${JSON.stringify(err)}`)
|
|
||||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
|
||||||
} else {
|
|
||||||
if (safeGet(data)) {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
if(data.code ===0){
|
|
||||||
console.log(`【幸运大转盘】剩余抽奖机会:${data.data.lotteryChances}`)
|
|
||||||
while(data.data.lotteryChances--) {
|
|
||||||
await wheelsLottery()
|
|
||||||
await $.wait(500)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
$.logErr(e, resp)
|
|
||||||
} finally {
|
|
||||||
resolve(data);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 大转盘
|
|
||||||
function wheelsLottery() {
|
|
||||||
return new Promise(resolve => {
|
|
||||||
$.get(taskGetUrl('wheelsLottery',
|
|
||||||
{"linkId":"toxw9c5sy9xllGBr3QFdYg"}),
|
|
||||||
async (err, resp, data) => {
|
|
||||||
try {
|
|
||||||
if (err) {
|
|
||||||
console.log(`${JSON.stringify(err)}`)
|
|
||||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
|
||||||
} else {
|
|
||||||
if (safeGet(data)) {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
if(data.data && data.data.rewardType){
|
|
||||||
console.log(`幸运大转盘抽奖获得:【${data.data.couponUsedValue}-${data.data.rewardValue}${data.data.couponDesc}】\n`)
|
|
||||||
message += `幸运大转盘抽奖获得:【${data.data.couponUsedValue}-${data.data.rewardValue}${data.data.couponDesc}】\n`
|
|
||||||
}else{
|
|
||||||
console.log(`幸运大转盘抽奖获得:空气`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
$.logErr(e, resp)
|
|
||||||
} finally {
|
|
||||||
resolve(data);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 大转盘任务
|
// 大转盘任务
|
||||||
function apTaskList() {
|
function apTaskList() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
@ -743,9 +695,7 @@ function taskGetUrl(function_id, body) {
|
|||||||
|
|
||||||
function invite2() {
|
function invite2() {
|
||||||
let inviterIdArr = [
|
let inviterIdArr = [
|
||||||
"wXX9SjXOdYMWe5Ru/1+x9A==",
|
"wXX9SjXOdYMWe5Ru/1+x9A=="
|
||||||
"wXX9SjXOdYMWe5Ru/1+x9A==",
|
|
||||||
"4AVQao+eH8Q8kvmXnWmkG8ef/fNr5fdejnD9+9Ugbec="
|
|
||||||
]
|
]
|
||||||
let inviterId = inviterIdArr[Math.floor((Math.random() * inviterIdArr.length))]
|
let inviterId = inviterIdArr[Math.floor((Math.random() * inviterIdArr.length))]
|
||||||
let options = {
|
let options = {
|
||||||
@ -768,34 +718,6 @@ function invite2() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function invite() {
|
|
||||||
let t = +new Date()
|
|
||||||
let inviterIdArr = [
|
|
||||||
"wXX9SjXOdYMWe5Ru/1+x9A==",
|
|
||||||
"wXX9SjXOdYMWe5Ru/1+x9A==",
|
|
||||||
"4AVQao+eH8Q8kvmXnWmkG8ef/fNr5fdejnD9+9Ugbec="
|
|
||||||
]
|
|
||||||
let inviterId = inviterIdArr[Math.floor((Math.random() * inviterIdArr.length))]
|
|
||||||
let options = {
|
|
||||||
url: `https://api.m.jd.com/?t=${t}`,
|
|
||||||
body: `functionId=InviteFriendChangeAssertsService&body=${JSON.stringify({"method":"attendInviteActivity","data":{"inviterPin":encodeURIComponent(inviterId),"channel":1,"token":"","frontendInitStatus":""}})}&referer=-1&eid=eidI9b2981202fsec83iRW1nTsOVzCocWda3YHPN471AY78%2FQBhYbXeWtdg%2F3TCtVTMrE1JjM8Sqt8f2TqF1Z5P%2FRPGlzA1dERP0Z5bLWdq5N5B2VbBO&aid=&client=ios&clientVersion=14.4.2&networkType=wifi&fp=-1&uuid=ab048084b47df24880613326feffdf7eee471488&osVersion=14.4.2&d_brand=iPhone&d_model=iPhone10,2&agent=-1&pageClickKey=-1&platform=3&lang=zh_CN&appid=market-task-h5&_t=${t}`,
|
|
||||||
headers: {
|
|
||||||
"Host": "api.m.jd.com",
|
|
||||||
"Accept": "application/json, text/plain, */*",
|
|
||||||
"Content-type": "application/x-www-form-urlencoded",
|
|
||||||
"Origin": "https://invite-reward.jd.com",
|
|
||||||
"Accept-Language": "zh-CN,zh-Hans;q=0.9",
|
|
||||||
"User-Agent": $.isNode() ? (process.env.JS_USER_AGENT ? process.env.JS_USER_AGENT : (require('./JS_USER_AGENTS').USER_AGENT)) : ($.getdata('JSUA') ? $.getdata('JSUA') : "'jdltapp;iPad;3.1.0;14.4;network/wifi;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
|
|
||||||
"Referer": 'https://invite-reward.jd.com/',
|
|
||||||
"Accept-Encoding": "gzip, deflate, br",
|
|
||||||
"Cookie": cookie
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$.post(options, (err, resp, data) => {
|
|
||||||
//console.log(data)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function TotalBean() {
|
function TotalBean() {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
const options = {
|
const options = {
|
||||||
|
11
jd_ttlhb.js
Normal file
11
jd_ttlhb.js
Normal file
File diff suppressed because one or more lines are too long
16
jd_ttqdlxj.js
Normal file
16
jd_ttqdlxj.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user