This commit is contained in:
Faker
2022-08-01 11:20:13 +08:00
parent bebe8c9e0d
commit 5f5ceabf81
29 changed files with 1933 additions and 2791 deletions

View File

@@ -1,16 +1,29 @@
if (!["card","car"].includes(process.env.FS_LEVEL)) {
console.log("请设置通用加购/开卡环境变量FS_LEVEL为\"car\"(或\"card\"开卡+加购)来运行加购脚本")
return
}
/*
#jd_joyjd_open通用ID任务多个活动用@连接任务连接https://jdjoy.jd.com/module/task/v2/doTask
JoyJd任务脚本
已支持IOS双京东账号,Node.js支持N个京东账号
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
jd_joyjd_open通用ID任务多个活动用@连接任务连接https://jdjoy.jd.com/module/task/v2/doTask
export comm_activityIDList="af2b3d56e22d43afa0c50622c45ca2a3"
export comm_endTimeList="1639756800000"
export comm_tasknameList="京东工业品抽奖"
即时任务无需cron,短期或者长期请参考活动规则设置cron
============Quantumultx===============
[task_local]
#JoyJd任务脚本
5 2,18 * * * https://raw.githubusercontent.com/KingRan/JDJB/main/jd_joyjd_open.js, tag=JoyJd任务脚本, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
================Loon==============
[Script]
cron "5 2,18 * * *" script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_joyjd_open.js,tag=JoyJd任务脚本
===============Surge=================
JoyJd任务脚本 = type=cron,cronexp="5 2,18 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_joyjd_open.js
============小火箭=========
JoyJd任务脚本 = type=cron,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_joyjd_open.js, cronexpr="5 2,18 * * *", timeout=3600, enable=true
*/
const $ = new Env('jd_joyjd_open通用ID任务');
const $ = new Env('JoyJd任务脚本');
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
const notify = $.isNode() ? require('./sendNotify') : '';
let cookiesArr = [];
@@ -43,10 +56,7 @@ if ($.isNode()) {
}
if (!activityIDList) {
$.log(`没有通用ID任务尝试获取远程`);
let data = await getData("https://raw.githubusercontent.com/Ca11back/scf-experiment/master/json/joyjd_open.json")
if (!data) {
data = await getData("https://raw.fastgit.org/Ca11back/scf-experiment/master/json/joyjd_open.json")
}
let data = await getData("https://cdn.jsdelivr.net/gh/KingRan/shareCodes@master/joyjd_open.json")
if (data.activityIDList && data.activityIDList.length) {
$.log(`获取到远程且有数据`);
activityIDList = data.activityIDList.join('@')
@@ -66,7 +76,7 @@ if ($.isNode()) {
$.oldcookie = cookiesArr[i];
$.isLogin = true;
$.nickName = '';
await TotalBean();
//await TotalBean();
$.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
console.log(`\n*****开始【京东账号${$.index}${$.nickName || $.UserName}*****\n`);
if (!$.isLogin) {