更新iOS端3大软件订阅配置 by lxk0301 Github Action

This commit is contained in:
lxk0301
2021-01-24 06:44:49 +00:00
8 changed files with 483 additions and 51 deletions

View File

@@ -136,6 +136,9 @@ cron "1 7-21/2 * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_s
# 京东全民开红包
cron "1 1 * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_redPacket.js, tag=京东全民开红包
# 闪购盲盒
cron "20 8 * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_sgmh.js, tag=闪购盲盒
# 进店领豆
cron "10 0 * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_shop.js,tag=进店领豆

View File

@@ -39,6 +39,7 @@
"12 * * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_pigPet.js, tag=京东金融养猪猪, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyz.png, enabled=true",
"1 7-21/2 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_plantBean.js, tag=种豆得豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzd.png, enabled=true",
"1 1 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_redPacket.js, tag=京东全民开红包, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png, enabled=true",
"20 8 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_sgmh.js, tag=闪购盲盒, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_sgmh.png, enabled=true",
"10 0 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_shop.js, tag=进店领豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_shop.png, enabled=true",
"16 22 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_small_home.js, tag=东东小窝, img-url=https://raw.githubusercontent.com/58xinian/icon/master/ddxw.png, enabled=true",
"8 0-23/3 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_speed.js, tag=京东天天加速, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdjs.png, enabled=true",

View File

@@ -51,6 +51,7 @@ crazyJoy任务 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=3600,scrip
京东金融养猪猪 = type=cron,cronexp="12 * * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_pigPet.js
京东种豆得豆 = type=cron,cronexp="1 7-21/2 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_plantBean.js
京东全民开红包 = type=cron,cronexp=1 1 * * *,wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_redPacket.js
闪购盲盒 = type=cron,cronexp="20 8 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_sgmh.js
进店领豆 = type=cron,cronexp="10 0 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_shop.js
东东小窝 = type=cron,cronexp="16 22 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_small_home.js
天天加速 = type=cron,cronexp="8 0-23/3 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_speed.js

View File

@@ -81,17 +81,18 @@ const inviteCodes = [
}
}
})()
.catch((e) => {
$.log('', `${$.name}, 失败! 原因: ${e}!`, '')
})
.finally(() => {
$.done();
})
.catch((e) => {
$.log('', `${$.name}, 失败! 原因: ${e}!`, '')
})
.finally(() => {
$.done();
})
async function jdNian() {
try {
$.risk = false
await getHomeData()
if($.risk) return
if ($.risk) return
await getTaskList($.cor)
await $.wait(2000)
await helpFriends()
@@ -102,6 +103,7 @@ async function jdNian() {
$.logErr(e)
}
}
function showMsg() {
return new Promise(resolve => {
message += `本次运行获得${$.earn}金币,当前${$.coin}金币`
@@ -113,6 +115,7 @@ function showMsg() {
resolve()
})
}
async function helpFriends() {
for (let code of $.newShareCodes) {
if (!code) continue
@@ -120,9 +123,10 @@ async function helpFriends() {
await $.wait(2000)
}
}
function doTask(itemToken) {
return new Promise((resolve) => {
$.post(taskPostUrl('mcxhd_brandcity_doTask',{itemToken:itemToken},'mcxhd_brandcity_doTask'), async (err, resp, data) => {
$.post(taskPostUrl('mcxhd_brandcity_doTask', {itemToken: itemToken}, 'mcxhd_brandcity_doTask'), async (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
@@ -130,15 +134,14 @@ function doTask(itemToken) {
} else {
data = JSON.parse(data);
if (data && data['retCode'] === "200") {
if(data.result.score)
if (data.result.score)
console.log(`任务完成成功,获得${data.result.score}金币`)
else if(data.result.taskToken)
else if (data.result.taskToken)
console.log(`任务请求成功,等待${$.duration}`)
else{
else {
console.log(`任务请求结果未知`)
}
}
else{
} else {
console.log(data.retMessage)
}
}
@@ -150,14 +153,15 @@ function doTask(itemToken) {
})
})
}
function doTask2(taskToken) {
let body = {
"dataSource":"newshortAward",
"method":"getTaskAward",
"reqParams":`{\"taskToken\":\"${taskToken}\"}`
"dataSource": "newshortAward",
"method": "getTaskAward",
"reqParams": `{\"taskToken\":\"${taskToken}\"}`
}
return new Promise(resolve => {
$.post(taskPostUrl2("qryViewkitCallbackResult", body, ), async (err, resp, data) => {
$.post(taskPostUrl2("qryViewkitCallbackResult", body,), async (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
@@ -167,8 +171,7 @@ function doTask2(taskToken) {
data = JSON.parse(data);
if (data.code === "0") {
console.log(data.toast.subTitle)
}
else{
} else {
console.log(`任务完成失败,错误信息:${JSON.stringify(data)}`)
}
}
@@ -181,7 +184,8 @@ function doTask2(taskToken) {
})
})
}
function getHomeData(info=false) {
function getHomeData(info = false) {
return new Promise((resolve) => {
$.post(taskPostUrl('mcxhd_brandcity_homePage'), async (err, resp, data) => {
try {
@@ -192,14 +196,13 @@ function getHomeData(info=false) {
data = JSON.parse(data);
if (data && data['retCode'] === "200") {
const {userCoinNum} = data.result
if(info){
if (info) {
$.earn = userCoinNum - $.coin
}else {
} else {
console.log(`当前用户金币${userCoinNum}`)
}
$.coin = userCoinNum
}
else{
} else {
$.risk = true
console.log(`账号被风控,无法参与活动`)
message += `账号被风控,无法参与活动\n`
@@ -214,7 +217,7 @@ function getHomeData(info=false) {
})
}
function getTaskList(body={}) {
function getTaskList(body = {}) {
return new Promise(resolve => {
$.post(taskPostUrl("mcxhd_brandcity_taskList", body, "mcxhd_brandcity_taskList"), async (err, resp, data) => {
@@ -228,16 +231,16 @@ function getTaskList(body={}) {
$.tasks = []
if (data.retCode === '200') {
$.tasks = data.result.tasks
for(let vo of $.tasks){
if(vo.taskType==="1" || vo.taskType==="2" || vo.taskType==="5" || vo.taskType==="3") {
for (let vo of $.tasks) {
if (vo.taskType === "13" || vo.taskType === "2" || vo.taskType === "5" || vo.taskType === "3") {
// 签到,逛一逛
for (let i = vo.times, j = 0; i < vo.maxTimes && j < vo.subItem.length; ++i, ++j) {
console.log(`去做${vo.taskName}任务,${i + 1}/${vo.maxTimes}`)
let item = vo['subItem'][j]
await doTask(item['itemToken'])
await $.wait((vo.waitDuration?vo.waitDuration:5 + 1) * 1000)
await $.wait((vo.waitDuration ? vo.waitDuration : 5 + 1) * 1000)
}
}else if(vo.taskType==="7" || vo.taskType==="9") {
} else if (vo.taskType === "7" || vo.taskType === "9") {
// 浏览店铺,会场
for (let i = vo.times, j = 0; i < vo.maxTimes; ++i, ++j) {
console.log(`去做${vo.taskName}任务,${i + 1}/${vo.maxTimes}`)
@@ -247,11 +250,11 @@ function getTaskList(body={}) {
await $.wait((vo.waitDuration + 1) * 1000)
await doTask2(item['taskToken'])
}
}else if(vo.taskType==="6") {
} else if (vo.taskType === "6") {
// 邀请好友
if (vo.subItem.length){
if (vo.subItem.length) {
console.log(`您的好友助力码为${vo.subItem[0].itemToken}`)
}else{
} else {
console.log(`无法查询您的好友助力码`)
}
}
@@ -271,7 +274,10 @@ function getTaskList(body={}) {
function readShareCode() {
console.log(`开始`)
return new Promise(async resolve => {
$.get({url: `http://jd.turinglabs.net/api/v2/jd/immortal/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => {
$.get({
url: `http://jd.turinglabs.net/api/v2/jd/immortal/read/${randomCount}/`,
'timeout': 10000
}, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
@@ -292,6 +298,7 @@ function readShareCode() {
resolve()
})
}
//格式化助力码
function shareCodesFormat() {
return new Promise(async resolve => {
@@ -312,6 +319,7 @@ function shareCodesFormat() {
resolve();
})
}
function requireConfig() {
return new Promise(async resolve => {
console.log(`开始获取${$.name}配置文件\n`);
@@ -332,9 +340,9 @@ function requireConfig() {
$.shareCodesArr.push(shareCodes[item])
}
})
$.cor = process.env.JD_IMMORTAL_LATLON?JSON.parse(process.env.JD_IMMORTAL_LATLON):(await getLatLng())
}else{
$.cor = $.getdata("IMMORTAL_LATLON")?JSON.parse($.getdata("IMMORTAL_LATLON")):{}
$.cor = process.env.JD_IMMORTAL_LATLON ? JSON.parse(process.env.JD_IMMORTAL_LATLON) : (await getLatLng())
} else {
$.cor = $.getdata("IMMORTAL_LATLON") ? JSON.parse($.getdata("IMMORTAL_LATLON")) : {}
}
console.log(`您提供的地理位置信息为${JSON.stringify($.cor)}`)
console.log(`您提供了${$.shareCodesArr.length}个账号的${$.name}助力码\n`);
@@ -380,7 +388,7 @@ function taskPostUrl(function_id, body = {}, function_id2) {
if (function_id2) {
url += `?functionId=${function_id2}`;
}
body = {...body,"token":'jd17919499fb7031e5'}
body = {...body, "token": 'jd17919499fb7031e5'}
return {
url,
body: `functionId=${function_id}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&appid=publicUseApi`,
@@ -393,6 +401,7 @@ function taskPostUrl(function_id, body = {}, function_id2) {
}
}
}
function taskPostUrl2(function_id, body = {}, function_id2) {
let url = `${JD_API_HOST}`;
if (function_id2) {
@@ -410,6 +419,7 @@ function taskPostUrl2(function_id, body = {}, function_id2) {
}
}
}
function TotalBean() {
return new Promise(async resolve => {
const options = {
@@ -450,6 +460,7 @@ function TotalBean() {
})
})
}
function safeGet(data) {
try {
if (typeof JSON.parse(data) == "object") {
@@ -461,6 +472,7 @@ function safeGet(data) {
return false;
}
}
function jsonParse(str) {
if (typeof str == "string") {
try {

View File

@@ -118,10 +118,14 @@ async function jdWish() {
let task = $.taskList[i]
if (task['taskId'] === 1 && task['status'] !== 2) {
console.log(`去做任务:${task.taskName}`)
await doTask({"taskId": task['taskId']})
await doTask({"taskId": task['taskId'],"mpVersion":"3.4.0"})
} else if (task['taskId'] !== 3 && task['status'] !== 2) {
console.log(`去做任务:${task.taskName}`)
await doTask({"taskId": task['taskId']})
if(task['itemId'])
await doTask({"itemId":task['itemId'],"taskId":task['taskId'],"mpVersion":"3.4.0"})
else
await doTask({"taskId": task['taskId'],"mpVersion":"3.4.0"})
await $.wait(3000)
}
}
await getTaskList();
@@ -330,7 +334,7 @@ function doTask(body, func = "doInteractTask") {
async function helpFriends() {
for (let code of $.newShareCodes) {
if (!code) continue
await doTask({"itemId": code, "taskId": "3", "mpVersion": "3.1.0"}, "doHelpTask")
await doTask({"itemId": code, "taskId": "3", "mpVersion": "3.4.0"}, "doHelpTask")
}
}
function readShareCode() {

View File

@@ -568,19 +568,27 @@ function helpShareCode(smp, active, joinnum) {
const {ret, retmsg = ''} = JSON.parse(res);
$.log(`助力结果ret=${ret} retmsg="${retmsg ? retmsg : 'OK'}"`);
// ret=0 助力成功
// ret=1021 cannot help self 不能助力自己
// ret=1011 active 不同
// ret=1012 has complete 已完成
// ret=1013 retmsg="has expired" 已过期
// ret=1009 retmsg="today has help p2p" 今天已助力过
// ret=1021 cannot help self 不能助力自己
// ret=1032 retmsg="err operate env" 被助力者为 APP 专属种子,当前助力账号未配置 TOKEN
if (ret === 0 || ret === 1009 || ret === 1011 || ret === 1021 || ret === 1032) {
resolve(true);
// if (ret === 0 || ret === 1009 || ret === 1011 || ret === 1012 || ret === 1021 || ret === 1032) {
// resolve(true);
// return;
// }
// ret 1016 当前账号达到助力上限
// ret 147 filter 当前账号黑号了
if (ret === 147 || ret === 1016) {
if (ret === 147) {
$.log(`\n\n !!!!!!!! 当前账号黑号了 !!!!!!!! \n\n`);
}
resolve(false);
return;
}
// ret 1016 助力上限
// ret 147 filter 当前账号黑号了
if (ret === 147) {
$.log(`\n\n !!!!!!!! 当前账号黑号了 !!!!!!!! \n\n`);
}
resolve(true);
return;
} catch (e) {
$.logErr(e, resp);
} finally {

View File

@@ -161,6 +161,7 @@ async function doTask() {
if (task.status === 1) {
await collectScore(item.taskId, task.itemId);
}
await $.wait(3000)
}
} else if (item.status === 2) {
console.log(`${item.taskName}已做完`)
@@ -174,6 +175,7 @@ async function doTask() {
if (task.status === 1) {
await collectScore(item.taskId, task.itemId, 1);
}
await $.wait(3000)
}
} else if(item.status===2){
console.log(`${item.taskName}已做完`)
@@ -190,6 +192,13 @@ async function doTask() {
} else if(item.status===2){
console.log(`${item.taskName}已做完`)
}
}else if (item.taskType === 13) {
if (item.status === 1) {
console.log(`准备做此任务:${item.taskName}`)
await collectScore(item.taskId, "1");
} else if(item.status===2){
console.log(`${item.taskName}已做完`)
}
}
}
}
@@ -259,7 +268,7 @@ function getHomeData(info=false) {
$.secretp = null
return
}
console.log(`当前爆竹${$.userInfo.raiseInfo.remainScore}🧨,下一关需要${$.userInfo.raiseInfo.nextLevelScore}🧨`)
console.log(`当前爆竹${$.userInfo.raiseInfo.remainScore}🧨,下一关需要${$.userInfo.raiseInfo.nextLevelScore-$.userInfo.raiseInfo.curLevelStartScore}🧨`)
if(info) {
message += `当前爆竹${$.userInfo.raiseInfo.remainScore}🧨\n`
@@ -269,8 +278,8 @@ function getHomeData(info=false) {
console.log(`可收取的爆竹大于0去收取爆竹`)
await collectProduceScore()
}
if(parseInt($.userInfo.raiseInfo.remainScore) >= parseInt($.userInfo.raiseInfo.curLevelStartScore)){
console.log(`去升级`)
if(parseInt($.userInfo.raiseInfo.remainScore) >= parseInt($.userInfo.raiseInfo.nextLevelScore-$.userInfo.raiseInfo.curLevelStartScore)){
console.log(`当前爆竹🧨大于升级所需爆竹🧨,去升级`)
await $.wait(2000)
await raise()
}

394
jd_sgmh.js Normal file

File diff suppressed because one or more lines are too long