Merge remote-tracking branch 'origin/master'

This commit is contained in:
any
2021-01-25 21:36:37 +08:00
9 changed files with 61 additions and 27 deletions

View File

@@ -5,7 +5,7 @@
# Loon的Task&Cookies脚本订阅链接: https://raw.githubusercontent.com/LXK9301/jd_scripts/master/Loon/lxk0301_LoonTask.conf
# 使用方法:打开APP顶部的配置 -> 脚本 -> 订阅脚本- > 点击右上角+号 -> 添加url链接 (https://raw.githubusercontent.com/LXK9301/jd_scripts/master/Loon/lxk0301_LoonTask.conf)
hostname = api.m.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com
hostname = api.m.jd.com, wq.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com
# 获取多账号京东Cookie
http-request https:\/\/wq\.jd\.com\/user_new\/info\/GetJDUserInfoUnion script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/JD_extra_cookie.js, tag=获取多账号京东Cookie
@@ -107,7 +107,7 @@ cron "10 0,20 * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_sc
cron "1 7 * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nh.js,tag=京东年货节
# 京东炸年兽🧨
cron "10 * * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian.js,tag=京东炸年兽🧨
cron "0 9,12,20 * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian.js,tag=京东炸年兽🧨
# 京东炸年兽领爆竹🧨
cron "50 * * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nianCollect.js,tag=京东收🧨

View File

@@ -1,4 +1,4 @@
hostname = api.m.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com
hostname = api.m.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com, wq.jd.com
# 获取多账号京东Cookie
https:\/\/wq\.jd\.com\/user_new\/info\/GetJDUserInfoUnion url script-request-header https://raw.githubusercontent.com/LXK9301/jd_scripts/master/JD_extra_cookie.js

View File

@@ -30,7 +30,7 @@
"3 0-23/2 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_moneyTree.js, tag=京东摇钱树, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyqs.png, enabled=true",
"10 0,20 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_necklace.js, tag=点点券, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png, enabled=true",
"1 7 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nh.js, tag=京东年货节, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png, enabled=true",
"10 * * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian.js, tag=京东炸年兽🧨, img-url=https://raw.githubusercontent.com/yogayyy/Scripts/main/Icon/lxk0301/jd_nian.png, enabled=true",
"0 9,12,20 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian.js, tag=京东炸年兽🧨, img-url=https://raw.githubusercontent.com/yogayyy/Scripts/main/Icon/lxk0301/jd_nian.png, enabled=true",
"50 * * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nianCollect.js, tag=京东收🧨, img-url=https://raw.githubusercontent.com/yogayyy/Scripts/main/Icon/lxk0301/jd_nianCollect.png, enabled=true",
"0 9 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian_ar.js, tag=京东炸年兽AR, img-url=https://raw.githubusercontent.com/yogayyy/Scripts/main/Icon/lxk0301/jd_nian.png, enabled=true",
"30 8 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian_sign.js, tag=京东炸年兽签到任务🧨, img-url=https://raw.githubusercontent.com/yogayyy/Scripts/main/Icon/lxk0301/jd_nian.png, enabled=true",

View File

@@ -41,7 +41,7 @@ crazyJoy任务 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=3600,scrip
京东摇钱树 = type=cron,cronexp="3 0-23/2 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_moneyTree.js
点点券 = type=cron,cronexp="10 0,20 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_necklace.js
京东年货节 = type=cron,cronexp="1 7 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nh.js
京东炸年兽🧨 = type=cron,cronexp="10 * * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian.js
京东炸年兽🧨 = type=cron,cronexp="0 9,12,20 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian.js
京东收🧨 = type=cron,cronexp="50 * * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nianCollect.js
京东炸年兽AR = type=cron,cronexp="0 9 * * *",wake-system=1,timeout=36000,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian_ar.js
京东炸年兽签到任务🧨 = type=cron,cronexp="30 8 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian_sign.js
@@ -64,4 +64,4 @@ crazyJoy任务 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=3600,scrip
小米运动获取Token = type=http-response,pattern=^https:\/\/account\.huami\.com\/v2\/client\/login, requires-body=1, max-size=0, script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/backUp/xmSports.js
[MITM]
hostname = %APPEND% wq.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com
hostname = %APPEND% wq.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com, wq.jd.com

View File

@@ -1,5 +1,5 @@
# 云函数快速部署京东脚本
# 云函数快速部署京东脚本(由于云函数官方升级此方法暂时失效)
>
> - 本地安装依赖使用serverless部署[点这里](tencentscf.md#1-安装-nodejs-环境)
> - Github Action 部署[点这里](tencentscf.md#github-action-部署)
@@ -109,6 +109,9 @@ triggers:
> 将SecretId和SecretKey分别配置在仓库的secrets变量里面 TENCENT_SECRET_ID对应你的SecretId的值TENCENT_SECRET_KEY对应你的SecretKey的值
## 3. 配置自己需要secrets变量[参考这里](githubAction.md#下方提供使用到的-secrets全集合)
目前因为云函数改版升级原GitHub Action部署云函数方案需要作出相应调整secret变量新增`SCF_REGION``TENCENT_FUNCTION_NAME``SCF_REGION`用于控制部署区域的选择,具体参数代码填写可以自行查找官方说明 [地域和可用区](https://cloud.tencent.com/document/product/213/6091) `TENCENT_FUNCTION_NAME`用于控制部署到云函数后函数名的命名。<br>
### __重要的说三遍__
### 如果涉及一个变量配置多个值如多个cookie多个取消订阅关键字去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接
### 如果涉及一个变量配置多个值如多个cookie多个取消订阅关键字去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接
@@ -118,6 +121,9 @@ triggers:
## 4.执行action workflow进行部署workflow未报错即部署成功
**在执行action workflow进行部署前先在需要部署的区域下新建一个空函数名称可以任意比如`jd`此时secret中`TENCENT_FUNCTION_NAME`值也必须是`jd`,保持与云函数的函数名一致,目前部署云函数的策略是覆盖的方式,故而此步骤至关重要。**<br>
![image](https://user-images.githubusercontent.com/6993269/99513289-6a152980-29c5-11eb-9266-3f56ba13d3b2.png)
## 5. 查看和测试
登录后,在 [腾讯云函数地址](https://console.cloud.tencent.com/scf/index) 点击管理控制台,查看最新部署的函数。

View File

@@ -86,6 +86,7 @@
| `JD_WECHAT_USER_AGENT` | 京东炸年兽<br>小程序<br>自定义UA | 非必须 | 强烈推荐使用自定义的小程序UA防止黑号UA示例<br>Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15A148 MicroMessenger/7.0.20(0x17001320) NetType/WIFI Language/zh_CN |
| `DREAMFACTORY_FORBID_ACCOUNT`| 京喜工厂<br>控制哪个京东账号不运行此脚本 | 非必须 | 输入`1`代表第一个京东账号不运行,多个使用`&`连接,例:`1&3`代表账号1和账号3不运行京喜工厂脚本输入`0`,代表全部账号不运行京喜工厂脚本 |
| `JDFACTORY_FORBID_ACCOUNT`| 东东工厂<br>控制哪个京东账号不运行此脚本 | 非必须 | 输入`1`代表第一个京东账号不运行,多个使用`&`连接,例:`1&3`代表账号1和账号3不运行东东工厂脚本输入`0`,代表全部账号不运行东东工厂脚本 |
| `FIRECRACKERS_NOTITY_BEAN`| 集鞭炮赢京豆<br>满足兑换 X 个京豆通知开关 | 非必须 | 默认 0 不通知,输入 120 表示满足兑换 120 个京豆时通知 |
##### 互助码的填写规则

File diff suppressed because one or more lines are too long

View File

@@ -26,6 +26,7 @@ cron "10 8,21 * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_sc
*/
const $ = new Env('集鞭炮赢京豆');
const notify = $.isNode() ? require('./sendNotify') : '';
let notifyBean = $.isNode() ? process.env.FIRECRACKERS_NOTITY_BEAN || 0 : 0; // 账号满足兑换多少京豆时提示 默认 0 不提示格式120 表示能兑换 120 豆子发出通知;
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
//Node.js用户请在jdCookie.js处填写京东ck;
//IOS等用户直接用NobyDa的jd cookie
@@ -92,9 +93,25 @@ async function jdFamily() {
}
function showMsg() {
return new Promise(resolve => {
message += `本次运行获得鞭炮${$.earn},共计${$.total}🧨`
$.log($.name, '', `京东账号${$.index}${$.nickName}\n${message}`);
return new Promise(async resolve => {
subTitle = `【京东账号${$.index}${$.nickName}`;
message += `【鞭炮🧨】本次获得 ${$.earn},共计${$.total}\n`
if ($.total && notifyBean) {
for (let item of $.prize) {
if (notifyBean <= item.beansPerNum) { // 符合预定的京豆档位
if ($.total >= item.prizerank) { // 当前鞭炮满足兑换
message += `【京豆】请手动兑换 ${item.beansPerNum} 个京豆,需消耗花费🧨 ${item.prizerank}`
$.msg($.name, subTitle, message);
if ($.isNode()) {
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `${subTitle}\n${message}`);
resolve();
return;
}
}
}
}
}
$.log(`${$.name}\n\n账号${$.index} - ${$.nickName}\n${subTitle}\n${message}`);
resolve()
})
}
@@ -130,17 +147,22 @@ function getUserInfo(info = false) {
$.userInfo = JSON.parse(data.match(/query\((.*)\n/)[1])
if (info) {
$.earn = $.userInfo.tatalprofits - $.total
} else for (let task of $.info.config.tasks) {
let vo = $.userInfo.tasklist.filter(vo => vo.taskid === task['_id'])
if (vo.length > 0) {
vo = vo[0]
if (vo['isdo'] === 1) {
if (vo['times'] === 0) {
console.log(`去做任务${task['_id']}`)
await doTask(task['_id'])
await $.wait(3000)
} else {
console.log(`${Math.trunc(vo['times'] / 60)}分钟可后做任务${task['_id']}`)
} else {
for (let task of $.info.config.tasks) {
let vo = $.userInfo.tasklist.filter(vo => vo.taskid === task['_id'])
if (vo.length > 0) {
vo = vo[0]
if (vo['isdo'] === 1) {
if (vo['times'] === 0) {
console.log(`去做任务${task['_id']}`)
let res = await doTask(task['_id'])
if (!res) { // 黑号,不再继续执行任务
break;
}
await $.wait(3000)
} else {
console.log(`${Math.trunc(vo['times'] / 60)}分钟可后做任务${task['_id']}`)
}
}
}
}
@@ -165,9 +187,14 @@ function doTask(taskId) {
console.log(`${err},${jsonParse(resp.body)['message']}`)
console.log(`${$.name} API请求失败请检查网路重试`)
} else {
data = JSON.parse(data.match(/query\((.*)\n/)[1])
let res = data.match(/query\((.*)\n/)[1];
data = JSON.parse(res);
if (data.ret === 0) {
console.log(`任务完成成功`)
} else if (data.ret === 1001) {
console.log(`任务完成失败,原因:这个账号黑号了!!!`)
resolve(false);
return;
} else {
console.log(`任务完成失败,原因未知`)
}

View File

@@ -14,12 +14,12 @@ FileQxRe=$WorkDir/QuantumultX/lxk0301_cookies.conf
FileSurge=$WorkDir/Surge/lxk0301_Task.sgmodule.sgmodule
## task清单顶部内容
CommentsLoon="# IOS Loon Task&Cookies配置 By LXK9301\n# GitHub主页(https://github.com/LXK9301/jd_scripts)\n# TG讨论组 (https://t.me/JD_fruit_pet)\n# TG通知频道 (https://t.me/jdfruit)\n# Loon的Task&Cookies脚本订阅链接: https://raw.githubusercontent.com/LXK9301/jd_scripts/master/Loon/lxk0301_LoonTask.conf\n# 使用方法:打开APP顶部的配置 -> 脚本 -> 订阅脚本- > 点击右上角+号 -> 添加url链接 (https://raw.githubusercontent.com/LXK9301/jd_scripts/master/Loon/lxk0301_LoonTask.conf)\n\nhostname = api.m.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com"
CommentsLoon="# IOS Loon Task&Cookies配置 By LXK9301\n# GitHub主页(https://github.com/LXK9301/jd_scripts)\n# TG讨论组 (https://t.me/JD_fruit_pet)\n# TG通知频道 (https://t.me/jdfruit)\n# Loon的Task&Cookies脚本订阅链接: https://raw.githubusercontent.com/LXK9301/jd_scripts/master/Loon/lxk0301_LoonTask.conf\n# 使用方法:打开APP顶部的配置 -> 脚本 -> 订阅脚本- > 点击右上角+号 -> 添加url链接 (https://raw.githubusercontent.com/LXK9301/jd_scripts/master/Loon/lxk0301_LoonTask.conf)\n\nhostname = api.m.jd.com, wq.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com"
CommentsQx='{\n "name": "LXK9301 task gallery",\n "description": "https://github.com/LXK9301/jd_scripts",\n "task": ['
CommentsQxRe="hostname = api.m.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com"
CommentsQxRe="hostname = api.m.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com, wq.jd.com"
CommentsSurgeHead="#!name=LXK9301 iOS Tasks&Cookies Module\n#!desc=iOS Tasks&Cookies 模块配置\n\n# Task&Cookies模块配置 By LXK9301\n# GitHub主页(https://github.com/LXK9301/jd_scripts)\n# TG讨论组 (https://t.me/JD_fruit_pet)\n# TG通知频道 (https://t.me/jdfruit)\n# Surge的Task&Cookies脚本模块地址: https://raw.githubusercontent.com/LXK9301/jd_scripts/master/Surge/lxk0301_Task.sgmodule.sgmodule\n\n[Script]"
CommentsSurgeTail="\n[MITM]\nhostname = %APPEND% wq.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com"
CommentsSurgeTail="\n[MITM]\nhostname = %APPEND% wq.jd.com, draw.jdfcloud.com, jdjoy.jd.com, account.huami.com, wq.jd.com"
## 执行写入