From 90865181211a96b69c41afeab2a7329e386ae2e4 Mon Sep 17 00:00:00 2001 From: EvineDeng Date: Mon, 14 Dec 2020 09:04:06 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E5=88=A0=E9=99=A4Docker=E7=9A=84PUBG?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=9B=9B=E5=85=B8=E6=B4=BB=E5=8A=A8=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/crontab_list.sh | 2 -- docker/crontab_list_ts.sh | 2 -- 2 files changed, 4 deletions(-) diff --git a/docker/crontab_list.sh b/docker/crontab_list.sh index 3e14761..2de5a48 100644 --- a/docker/crontab_list.sh +++ b/docker/crontab_list.sh @@ -8,8 +8,6 @@ 40 8 * * * node /scripts/jd_ms_redrain.js >> /scripts/logs/jd_ms_redrain.log 2>&1 # 健康抽奖机(2020.12.31活动过期) 10 0 * * * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1 -# PUBG游戏盛典(2020.12.13活动过期) -8 1,20 * * * node /scripts/jd_pubg.js >> /scripts/logs/jd_pubg.log 2>&1 # 苹果超品日互动抽奖机(2020.12.14活动过期) 8 0,20 * * * node /scripts/jd_apple_live.js >> /scripts/logs/jd_apple_live.log 2>&1 diff --git a/docker/crontab_list_ts.sh b/docker/crontab_list_ts.sh index 82b8d35..2037119 100644 --- a/docker/crontab_list_ts.sh +++ b/docker/crontab_list_ts.sh @@ -8,8 +8,6 @@ 40 8 * * * node /scripts/jd_ms_redrain.js | ts >> /scripts/logs/jd_ms_redrain.log 2>&1 # 健康抽奖机(2020.12.31活动过期) 10 0 * * * node /scripts/jd_health.js | ts >> /scripts/logs/jd_health.log 2>&1 -# PUBG游戏盛典(2020.12.13活动过期) -8 1,20 * * * node /scripts/jd_pubg.js | ts >> /scripts/logs/jd_pubg.log 2>&1 # 苹果超品日互动抽奖机(2020.12.14活动过期) 8 0,20 * * * node /scripts/jd_apple_live.js | ts >> /scripts/logs/jd_apple_live.log 2>&1 From 1d2ddd7ecff732adf678c34555fd850971562232 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Mon, 14 Dec 2020 17:36:02 +0800 Subject: [PATCH 02/16] update --- Loon/lxk0301_LoonTask.conf | 5 ++--- Surge/lxk0301_Task.sgmodule.sgmodule | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Loon/lxk0301_LoonTask.conf b/Loon/lxk0301_LoonTask.conf index 6cd3ab3..7be4012 100644 --- a/Loon/lxk0301_LoonTask.conf +++ b/Loon/lxk0301_LoonTask.conf @@ -90,9 +90,6 @@ http-response ^https:\/\/jdjoy\.jd\.com\/pet\/getPetTreasureBox|^https:\/\/draw\ # 小米运动获取Token http-response ^https:\/\/account\.huami\.com\/v2\/client\/login script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, requires-body=true, timeout=10, tag=小米运动获取Token -# 苹果抽奖机 -cron "10 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_apple_live.js,tag=苹果抽奖机 - # 京东代属 cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属 @@ -113,3 +110,5 @@ cron "10-20/5 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd # 金融打卡领年终奖 cron "10 6 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖 +# 健康抽奖机 +cron "10 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机 \ No newline at end of file diff --git a/Surge/lxk0301_Task.sgmodule.sgmodule b/Surge/lxk0301_Task.sgmodule.sgmodule index 92260c5..b9e3b3a 100644 --- a/Surge/lxk0301_Task.sgmodule.sgmodule +++ b/Surge/lxk0301_Task.sgmodule.sgmodule @@ -65,5 +65,9 @@ cron "20 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scri cron "20 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, timeout=750, wake-system=1, tag=京东直播 #秒杀红包雨 cron "20 9 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, timeout=750, wake-system=1, tag=秒杀红包雨 +# 以下为短期活动 #金融打卡领年终奖 cron "30 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, timeout=750, wake-system=1, tag=金融打卡领年终奖 +#健康抽奖机 +cron "30 2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, timeout=750, wake-system=1, tag=健康抽奖机 + From 055077bc9bf27aeffdfef172cb219fed0d59ce6e Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Mon, 14 Dec 2020 17:40:39 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9C=88x=20task?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QuantumultX/lxk0301_gallery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QuantumultX/lxk0301_gallery.json b/QuantumultX/lxk0301_gallery.json index 112edb3..bef46b0 100644 --- a/QuantumultX/lxk0301_gallery.json +++ b/QuantumultX/lxk0301_gallery.json @@ -29,7 +29,7 @@ "20 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_car.png", "10 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js, tag=京东快递签到, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_kd.png", "30 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_ds.png", - "10 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_apple_live.js, tag=苹果抽奖机, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", + "30 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, tag=健康抽奖机, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", "10-20/5 12 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", "10 12 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=京东金融打卡, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", "15 17 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png" From 3ce4f82a0461de1ad26cdeca2024e0351036ddf5 Mon Sep 17 00:00:00 2001 From: shylocks Date: Mon, 14 Dec 2020 19:12:31 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E5=85=B3=E9=97=AD=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- activity/jd_live_redrain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activity/jd_live_redrain.js b/activity/jd_live_redrain.js index a190ff6..725c1dd 100644 --- a/activity/jd_live_redrain.js +++ b/activity/jd_live_redrain.js @@ -25,7 +25,7 @@ const $ = new Env('直播红包雨'); const notify = $.isNode() ? require('../sendNotify') : ''; //Node.js用户请在jdCookie.js处填写京东ck; const jdCookieNode = $.isNode() ? require('../jdCookie.js') : ''; -let jdNotify = false;//是否关闭通知,false打开通知推送,true关闭通知推送 +let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 //IOS等用户直接用NobyDa的jd cookie let cookiesArr = [], cookie = '', message; if ($.isNode()) { From 42d04d8deeaa4c664e25d331d9dd86a2d7e34d5e Mon Sep 17 00:00:00 2001 From: DoveBoy <393366046@qq.com> Date: Mon, 14 Dec 2020 19:27:57 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=A4=8D=E6=B4=BB?= =?UTF-8?q?=E7=9A=84=E6=B4=BB=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 迁移复活的活动脚本 --- activity/jd_live_redrain.js => jd_live_redrain.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename activity/jd_live_redrain.js => jd_live_redrain.js (100%) diff --git a/activity/jd_live_redrain.js b/jd_live_redrain.js similarity index 100% rename from activity/jd_live_redrain.js rename to jd_live_redrain.js From fbc23998b60f6b71d42e8bd92e117c24dd9b9f28 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Mon, 14 Dec 2020 21:26:12 +0800 Subject: [PATCH 06/16] Update jd_live_redrain.js --- jd_live_redrain.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/jd_live_redrain.js b/jd_live_redrain.js index 725c1dd..8e7a38f 100644 --- a/jd_live_redrain.js +++ b/jd_live_redrain.js @@ -22,9 +22,9 @@ cron "0 0,9,11,13,15,17,19,20,21,23 * * *" script-path=https://raw.githubusercon */ const $ = new Env('直播红包雨'); -const notify = $.isNode() ? require('../sendNotify') : ''; +const notify = $.isNode() ? require('./sendNotify') : ''; //Node.js用户请在jdCookie.js处填写京东ck; -const jdCookieNode = $.isNode() ? require('../jdCookie.js') : ''; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 //IOS等用户直接用NobyDa的jd cookie let cookiesArr = [], cookie = '', message; @@ -34,6 +34,24 @@ if ($.isNode()) { }) if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { }; + process.env.TZ = "Asia/Shanghai"; + Date.prototype.TimeZone = new Map([ + ['Asia/Shanghai',+8], + ]) + Date.prototype.zoneDate = function(){ + if(process.env.TZ === undefined){ + return new Date(); + }else{ + for (let item of this.TimeZone.entries()) { + if(item[0] === process.env.TZ){ + let d = new Date(); + d.setHours(d.getHours()+item[1]); + return d; + } + } + return new Date(); + } + } } else { let cookiesData = $.getdata('CookiesJD') || "[]"; cookiesData = jsonParse(cookiesData); @@ -51,7 +69,6 @@ const JD_API_HOST = 'https://api.m.jd.com/api'; await getRedRain(); if(!$.activityId) return let nowTs = new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000 - message = `【${new Date($.st).getHours()}点红包雨】` if (!($.st <= nowTs && nowTs < $.ed)) { console.log(`不在红包雨时间之内`) return @@ -63,6 +80,7 @@ const JD_API_HOST = 'https://api.m.jd.com/api'; $.index = i + 1; $.isLogin = true; $.nickName = ''; + message = `【${new Date($.st).getHours()}点${$.name}】` await TotalBean(); console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); if (!$.isLogin) { @@ -239,4 +257,4 @@ function jsonParse(str) { } } // prettier-ignore -function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} +function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} \ No newline at end of file From e099ba245ec5bff331d400f7060440da39988faf Mon Sep 17 00:00:00 2001 From: EvineDeng Date: Mon, 14 Dec 2020 23:05:08 +0800 Subject: [PATCH 07/16] =?UTF-8?q?Docker=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=A2=9E=E5=8A=A0=E7=9B=B4=E6=92=AD=E7=BA=A2=E5=8C=85?= =?UTF-8?q?=E9=9B=A8=EF=BC=9B=E4=BA=AC=E4=B8=9C=E9=87=91=E8=9E=8D=E6=89=93?= =?UTF-8?q?=E5=8D=A1=E9=A2=86=E5=B9=B4=E7=BB=88=E5=A5=96=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E5=88=B0=E7=9F=AD=E6=9C=9F=E4=BB=BB=E5=8A=A1=EF=BC=9B=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=8B=B9=E6=9E=9C=E8=B6=85=E5=93=81=E6=97=A5=E4=BA=92?= =?UTF-8?q?=E5=8A=A8=E6=8A=BD=E5=A5=96=E6=9C=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/crontab_list.sh | 8 ++++---- docker/crontab_list_ts.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/crontab_list.sh b/docker/crontab_list.sh index 2de5a48..abab90a 100644 --- a/docker/crontab_list.sh +++ b/docker/crontab_list.sh @@ -8,8 +8,10 @@ 40 8 * * * node /scripts/jd_ms_redrain.js >> /scripts/logs/jd_ms_redrain.log 2>&1 # 健康抽奖机(2020.12.31活动过期) 10 0 * * * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1 -# 苹果超品日互动抽奖机(2020.12.14活动过期) -8 0,20 * * * node /scripts/jd_apple_live.js >> /scripts/logs/jd_apple_live.log 2>&1 +# 直播红包雨(2020.12.31活动过期) +0 0,9,11,13,15,17,19,20,21,23 * * * node /scripts/jd_live_redrain.js >> /scripts/logs/jd_live_redrain.log 2>&1 +# 京东金融打卡领年终奖(2020.12.31活动过期) +10 6 * * * node /scripts/jr_sign.js >> /scripts/logs/jr_sign.log 2>&1 ##############长期活动############## # 签到 @@ -74,5 +76,3 @@ 33 4 * * * node /scripts/jd_bean_home.js >> /scripts/logs/jd_bean_home.log 2>&1 # 京东直播(每日18豆) 10-20/5 11 * * * node /scripts/jd_live.js >> /scripts/logs/jd_live.log 2>&1 -# 京东金融签到 -10 6 * * * node /scripts/jr_sign.js >> /scripts/logs/jr_sign.log 2>&1 diff --git a/docker/crontab_list_ts.sh b/docker/crontab_list_ts.sh index 2037119..2942119 100644 --- a/docker/crontab_list_ts.sh +++ b/docker/crontab_list_ts.sh @@ -8,8 +8,10 @@ 40 8 * * * node /scripts/jd_ms_redrain.js | ts >> /scripts/logs/jd_ms_redrain.log 2>&1 # 健康抽奖机(2020.12.31活动过期) 10 0 * * * node /scripts/jd_health.js | ts >> /scripts/logs/jd_health.log 2>&1 -# 苹果超品日互动抽奖机(2020.12.14活动过期) -8 0,20 * * * node /scripts/jd_apple_live.js | ts >> /scripts/logs/jd_apple_live.log 2>&1 +# 直播红包雨(2020.12.31活动过期) +0 0,9,11,13,15,17,19,20,21,23 * * * node /scripts/jd_live_redrain.js | ts >> /scripts/logs/jd_live_redrain.log 2>&1 +# 京东金融打卡领年终奖(2020.12.31活动过期) +10 6 * * * node /scripts/jr_sign.js | ts >> /scripts/logs/jr_sign.log 2>&1 ##############长期活动############## # 签到 @@ -74,5 +76,3 @@ 33 4 * * * node /scripts/jd_bean_home.js | ts >> /scripts/logs/jd_bean_home.log 2>&1 # 京东直播(每日18豆) 10-20/5 11 * * * node /scripts/jd_live.js | ts >> /scripts/logs/jd_live.log 2>&1 -# 京东金融签到 -10 6 * * * node /scripts/jr_sign.js | ts >> /scripts/logs/jr_sign.log 2>&1 From 0421bfcab9a9a65383397a78fd28c0ce0cc2aabe Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Mon, 14 Dec 2020 23:06:25 +0800 Subject: [PATCH 08/16] Update jd_live_redrain.js --- jd_live_redrain.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jd_live_redrain.js b/jd_live_redrain.js index 8e7a38f..cf76694 100644 --- a/jd_live_redrain.js +++ b/jd_live_redrain.js @@ -2,23 +2,23 @@ 直播红包雨 每天0,9,11,13,15,17,19,20,21,23可领,每日上限未知 活动时间:2020-12-14 到 2020-12-31 -更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/activity/jd_live_redrain.js +更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js 已支持IOS双京东账号, Node.js支持N个京东账号 脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js ============Quantumultx=============== [task_local] #直播红包雨 -0 0,9,11,13,15,17,19,20,21,23 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/activity/jd_live_redrain.js, tag=直播红包雨, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png, enabled=true +0 0,9,11,13,15,17,19,20,21,23 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png, enabled=true ================Loon============== [Script] -cron "0 0,9,11,13,15,17,19,20,21,23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/activity/jd_live_redrain.js, tag=直播红包雨 +cron "0 0,9,11,13,15,17,19,20,21,23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨 ===============Surge================= -直播红包雨 = type=cron,cronexp="0 0,9,11,13,15,17,19,20,21,23 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/activity/jd_live_redrain.js +直播红包雨 = type=cron,cronexp="0 0,9,11,13,15,17,19,20,21,23 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js ============小火箭========= -直播红包雨 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/activity/jd_live_redrain.js, cronexpr="0 0,9,11,13,15,17,19,20,21,23 * * *", timeout=200, enable=true +直播红包雨 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, cronexpr="0 0,9,11,13,15,17,19,20,21,23 * * *", timeout=200, enable=true */ const $ = new Env('直播红包雨'); From a1b4fccc93d725f9bc2fb68343c917111289b524 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 15 Dec 2020 09:34:31 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E4=B8=89=E5=A4=A7task=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E7=9B=B4=E6=92=AD=E7=BA=A2=E5=8C=85=E9=9B=A8?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=8C=E6=B4=BB=E5=8A=A831=E6=97=A5?= =?UTF-8?q?=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Loon/lxk0301_LoonTask.conf | 2 ++ QuantumultX/lxk0301_gallery.json | 1 + Surge/lxk0301_Task.sgmodule.sgmodule | 10 ++++++---- activity/jd_818.js | 2 +- activity/jd_digital_floor.js | 2 +- activity/jd_jxstory.js | 2 +- activity/jd_pubg.js | 2 +- activity/jd_split.js | 2 +- activity/jd_xtg.js | 2 +- jd_apple_live.js | 2 +- jd_bean_change.js | 2 +- jd_bean_home.js | 2 +- jd_blueCoin.js | 2 +- jd_car.js | 2 +- jd_club_lottery.js | 2 +- jd_daily_egg.js | 2 +- jd_dreamFactory.js | 2 +- jd_ds.js | 2 +- jd_health.js | 2 +- jd_jdfactory.js | 2 +- jd_joy.js | 2 +- jd_joy_feedPets.js | 2 +- jd_joy_reward.js | 2 +- jd_joy_run.js | 2 +- jd_kd.js | 2 +- jd_live.js | 2 +- jd_live_redrain.js | 2 +- jd_moneyTree.js | 2 +- jd_ms_redrain.js | 2 +- jd_necklace.js | 2 +- jd_pigPet.js | 2 +- jd_redPacket.js | 2 +- jd_shop.js | 2 +- jd_small_home.js | 2 +- jd_speed.js | 2 +- jd_superMarket.js | 2 +- jd_syj.js | 2 +- jd_unsubscribe.js | 2 +- jr_sign.js | 2 +- 39 files changed, 45 insertions(+), 40 deletions(-) diff --git a/Loon/lxk0301_LoonTask.conf b/Loon/lxk0301_LoonTask.conf index 7be4012..7b6efb2 100644 --- a/Loon/lxk0301_LoonTask.conf +++ b/Loon/lxk0301_LoonTask.conf @@ -108,6 +108,8 @@ cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scrip # 京东直播 cron "10-20/5 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播 +#直播红包雨 +cron "0 0,9,11,13,15,17,19,20,21,23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨 # 金融打卡领年终奖 cron "10 6 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖 # 健康抽奖机 diff --git a/QuantumultX/lxk0301_gallery.json b/QuantumultX/lxk0301_gallery.json index bef46b0..e25de23 100644 --- a/QuantumultX/lxk0301_gallery.json +++ b/QuantumultX/lxk0301_gallery.json @@ -31,6 +31,7 @@ "30 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_ds.png", "30 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, tag=健康抽奖机, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", "10-20/5 12 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", + "0 0,9,11,13,15,17,19,20,21,23 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", "10 12 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=京东金融打卡, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", "15 17 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png" ] diff --git a/Surge/lxk0301_Task.sgmodule.sgmodule b/Surge/lxk0301_Task.sgmodule.sgmodule index b9e3b3a..3c50904 100644 --- a/Surge/lxk0301_Task.sgmodule.sgmodule +++ b/Surge/lxk0301_Task.sgmodule.sgmodule @@ -61,13 +61,15 @@ cron "30 10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scri cron "30 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, timeout=750, wake-system=1, tag=京东汽车 #京东快递签到 cron "20 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js, timeout=750, wake-system=1, tag=京东快递签到 -#京东直播 +#京东直播(活动结束时间未知) cron "20 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, timeout=750, wake-system=1, tag=京东直播 -#秒杀红包雨 -cron "20 9 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, timeout=750, wake-system=1, tag=秒杀红包雨 -# 以下为短期活动 +#以下为短期活动 #金融打卡领年终奖 cron "30 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, timeout=750, wake-system=1, tag=金融打卡领年终奖 #健康抽奖机 cron "30 2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, timeout=750, wake-system=1, tag=健康抽奖机 +#直播红包雨(2020-12-31活动结束) +cron "0 0,9,11,13,15,17,19,20,21,23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, timeout=750, wake-system=1, tag=直播红包雨 +#秒杀红包雨(2020-12-31活动结束) +cron "20 9 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, timeout=750, wake-system=1, tag=秒杀红包雨 diff --git a/activity/jd_818.js b/activity/jd_818.js index c349530..3975350 100644 --- a/activity/jd_818.js +++ b/activity/jd_818.js @@ -926,7 +926,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/activity/jd_digital_floor.js b/activity/jd_digital_floor.js index 648c1e9..5520493 100644 --- a/activity/jd_digital_floor.js +++ b/activity/jd_digital_floor.js @@ -418,7 +418,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/activity/jd_jxstory.js b/activity/jd_jxstory.js index 2f99b33..2153299 100644 --- a/activity/jd_jxstory.js +++ b/activity/jd_jxstory.js @@ -661,7 +661,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/activity/jd_pubg.js b/activity/jd_pubg.js index e787e25..e009ecb 100644 --- a/activity/jd_pubg.js +++ b/activity/jd_pubg.js @@ -508,7 +508,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/activity/jd_split.js b/activity/jd_split.js index efaaf75..ae798b8 100644 --- a/activity/jd_split.js +++ b/activity/jd_split.js @@ -306,7 +306,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/activity/jd_xtg.js b/activity/jd_xtg.js index a68fe6b..0e9e59b 100644 --- a/activity/jd_xtg.js +++ b/activity/jd_xtg.js @@ -396,7 +396,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_apple_live.js b/jd_apple_live.js index 49b40a2..02c284d 100644 --- a/jd_apple_live.js +++ b/jd_apple_live.js @@ -411,7 +411,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_bean_change.js b/jd_bean_change.js index 0eacf7b..426a706 100644 --- a/jd_bean_change.js +++ b/jd_bean_change.js @@ -212,7 +212,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_bean_home.js b/jd_bean_home.js index 136287d..b236949 100644 --- a/jd_bean_home.js +++ b/jd_bean_home.js @@ -453,7 +453,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_blueCoin.js b/jd_blueCoin.js index 503d3a8..43dbd0f 100644 --- a/jd_blueCoin.js +++ b/jd_blueCoin.js @@ -425,7 +425,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_car.js b/jd_car.js index 2eb6849..58e46cb 100644 --- a/jd_car.js +++ b/jd_car.js @@ -327,7 +327,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_club_lottery.js b/jd_club_lottery.js index 724c977..ed8d10a 100644 --- a/jd_club_lottery.js +++ b/jd_club_lottery.js @@ -387,7 +387,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_daily_egg.js b/jd_daily_egg.js index c4c595d..7250fd1 100644 --- a/jd_daily_egg.js +++ b/jd_daily_egg.js @@ -232,7 +232,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_dreamFactory.js b/jd_dreamFactory.js index 39d8fe6..12efd54 100644 --- a/jd_dreamFactory.js +++ b/jd_dreamFactory.js @@ -1460,7 +1460,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_ds.js b/jd_ds.js index b07f736..cd8204a 100644 --- a/jd_ds.js +++ b/jd_ds.js @@ -205,7 +205,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_health.js b/jd_health.js index 5443c20..5ebae0b 100644 --- a/jd_health.js +++ b/jd_health.js @@ -393,7 +393,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_jdfactory.js b/jd_jdfactory.js index 295ad39..1ec93e6 100644 --- a/jd_jdfactory.js +++ b/jd_jdfactory.js @@ -749,7 +749,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_joy.js b/jd_joy.js index e237938..bf0ae49 100644 --- a/jd_joy.js +++ b/jd_joy.js @@ -821,7 +821,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_joy_feedPets.js b/jd_joy_feedPets.js index b1a6c49..f26ee07 100644 --- a/jd_joy_feedPets.js +++ b/jd_joy_feedPets.js @@ -192,7 +192,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_joy_reward.js b/jd_joy_reward.js index 1e4b769..cf9e9f9 100644 --- a/jd_joy_reward.js +++ b/jd_joy_reward.js @@ -281,7 +281,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_joy_run.js b/jd_joy_run.js index 26a5729..05f4a94 100644 --- a/jd_joy_run.js +++ b/jd_joy_run.js @@ -407,7 +407,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_kd.js b/jd_kd.js index 9709153..c3ef994 100644 --- a/jd_kd.js +++ b/jd_kd.js @@ -204,7 +204,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_live.js b/jd_live.js index 4d1d3b3..cc27374 100644 --- a/jd_live.js +++ b/jd_live.js @@ -303,7 +303,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_live_redrain.js b/jd_live_redrain.js index cf76694..6c83ead 100644 --- a/jd_live_redrain.js +++ b/jd_live_redrain.js @@ -251,7 +251,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_moneyTree.js b/jd_moneyTree.js index 54a2c13..4257b02 100644 --- a/jd_moneyTree.js +++ b/jd_moneyTree.js @@ -654,7 +654,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_ms_redrain.js b/jd_ms_redrain.js index 2a84a2f..258f0dc 100644 --- a/jd_ms_redrain.js +++ b/jd_ms_redrain.js @@ -194,7 +194,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_necklace.js b/jd_necklace.js index c16cce3..109f3f4 100644 --- a/jd_necklace.js +++ b/jd_necklace.js @@ -354,7 +354,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_pigPet.js b/jd_pigPet.js index 7c66c4f..2b14939 100644 --- a/jd_pigPet.js +++ b/jd_pigPet.js @@ -676,7 +676,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_redPacket.js b/jd_redPacket.js index d0dc2aa..1a3fa4b 100644 --- a/jd_redPacket.js +++ b/jd_redPacket.js @@ -326,7 +326,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_shop.js b/jd_shop.js index 857e930..6500735 100644 --- a/jd_shop.js +++ b/jd_shop.js @@ -211,7 +211,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_small_home.js b/jd_small_home.js index 1358ea1..a5e2ad7 100644 --- a/jd_small_home.js +++ b/jd_small_home.js @@ -893,7 +893,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_speed.js b/jd_speed.js index 32cec98..6d7a970 100644 --- a/jd_speed.js +++ b/jd_speed.js @@ -523,7 +523,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_superMarket.js b/jd_superMarket.js index 7286eb8..38c8739 100644 --- a/jd_superMarket.js +++ b/jd_superMarket.js @@ -1457,7 +1457,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_syj.js b/jd_syj.js index 4514dc5..ef3bce8 100644 --- a/jd_syj.js +++ b/jd_syj.js @@ -209,7 +209,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jd_unsubscribe.js b/jd_unsubscribe.js index fa1fbcd..7c3f9d8 100644 --- a/jd_unsubscribe.js +++ b/jd_unsubscribe.js @@ -342,7 +342,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } diff --git a/jr_sign.js b/jr_sign.js index 6fe325a..ff74cf2 100644 --- a/jr_sign.js +++ b/jr_sign.js @@ -184,7 +184,7 @@ function jsonParse(str) { return JSON.parse(str); } catch (e) { console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') return []; } } From 84d7caf0dcb917c387b387bbf8402ef500110808 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 15 Dec 2020 09:51:38 +0800 Subject: [PATCH 10/16] fix --- jd_joy_steal.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/jd_joy_steal.js b/jd_joy_steal.js index 9dc3d77..021c43a 100644 --- a/jd_joy_steal.js +++ b/jd_joy_steal.js @@ -532,5 +532,16 @@ function timeFormat(time) { } return date.getFullYear() + '-' + ((date.getMonth() + 1) >= 10 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)) + '-' + (date.getDate() >= 10 ? date.getDate() : '0' + date.getDate()); } +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} // prettier-ignore function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,o)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=e&&e.timeout?e.timeout:o;const[r,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":r,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),o=JSON.stringify(this.data);s?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(e,o):this.fs.writeFileSync(t,o)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return s;return o}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),o=s?this.getval(s):"";if(o)try{const t=JSON.parse(o);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(e),r=this.getval(i),h=i?"null"===r?null:r||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,o,t),s=this.setval(JSON.stringify(e),i)}catch(e){const r={};this.lodash_set(r,o,t),s=this.setval(JSON.stringify(r),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t))}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",o){const r=t=>{if(!t||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,r(o)):this.isQuanX()&&$notify(e,s,i,r(o)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} \ No newline at end of file From a11179ae801daeddcd305b792f0b85cdd89773cb Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 15 Dec 2020 11:11:28 +0800 Subject: [PATCH 11/16] update --- Surge/lxk0301_Task.sgmodule.sgmodule | 2 +- jdFruitShareCodes.js | 2 +- jd_blueCoin.js | 37 +++++++++++++++------------- jd_dreamFactory.js | 3 ++- jd_fruit.js | 12 +++++++-- jd_moneyTree.js | 3 ++- jd_pet.js | 2 +- 7 files changed, 37 insertions(+), 24 deletions(-) diff --git a/Surge/lxk0301_Task.sgmodule.sgmodule b/Surge/lxk0301_Task.sgmodule.sgmodule index 3c50904..74c8b45 100644 --- a/Surge/lxk0301_Task.sgmodule.sgmodule +++ b/Surge/lxk0301_Task.sgmodule.sgmodule @@ -12,7 +12,7 @@ #东东农场 cron "40 8-18/5 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js,timeout=530, wake-system=1, tag=东东农场 #东东萌宠 -cron "20 7-19/6 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js,timeout=530, wake-system=1, tag=东东萌宠 +cron "20 8-18/5 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js,timeout=530, wake-system=1, tag=东东萌宠 #京东种豆得豆 cron "50 7-21/2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js,timeout=630, wake-system=1, tag=京东种豆得豆 #宠汪汪 diff --git a/jdFruitShareCodes.js b/jdFruitShareCodes.js index 17199e0..4ddbd3d 100644 --- a/jdFruitShareCodes.js +++ b/jdFruitShareCodes.js @@ -8,7 +8,7 @@ // 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 // 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 let FruitShareCodes = [ - '0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6',//账号一的好友shareCode,不同好友中间用@符号隔开 + '0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a',//账号一的好友shareCode,不同好友中间用@符号隔开 '6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3',//账号二的好友shareCode,不同好友中间用@符号隔开 ] // 判断github action里面是否有水果互助码 diff --git a/jd_blueCoin.js b/jd_blueCoin.js index 43dbd0f..4d4b2e6 100644 --- a/jd_blueCoin.js +++ b/jd_blueCoin.js @@ -1,7 +1,7 @@ /* 京小超兑换奖品 脚本地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js 感谢@yangtingxiao提供PR -更新时间:2020-11-23 +更新时间:2020-12-15 支持京东多个账号 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js ======================quantumultx=============== @@ -337,24 +337,27 @@ function smtgHome() { } //通知 -async function msgShow() { +function msgShow() { // $.msg($.name, ``, `【京东账号${$.index}】${$.nickName}\n【收取蓝币】${$.coincount ? `${$.coincount}个` : $.coinerr }${coinToBeans ? `\n【兑换京豆】${ $.beanscount ? `${$.beanscount}个` : $.beanerr}` : ""}`); - $.log(`\n【京东账号${$.index}】${$.nickName}\n${coinToBeans ? `【兑换${$.title}】${$.beanscount ? `成功` : $.beanerr}` : "您设置的是不兑换奖品"}\n`); - let ctrTemp; - if ($.isNode() && process.env.MARKET_REWARD_NOTIFY) { - ctrTemp = `${process.env.MARKET_REWARD_NOTIFY}` === 'false'; - } else if ($.getdata('jdSuperMarketRewardNotify')) { - ctrTemp = $.getdata('jdSuperMarketRewardNotify') === 'false'; - } else { - ctrTemp = `${jdNotify}` === 'false'; - } - //默认只在兑换奖品成功后弹窗提醒。情况情况加,只打印日志,不弹窗 - if ($.beanscount && ctrTemp) { - $.msg($.name, ``, `【京东账号${$.index}】${$.nickName}\n${coinToBeans ? `【兑换${$.title}】${ $.beanscount ? `成功,数量:${$.beanscount}个` : $.beanerr}` : "您设置的是不兑换奖品"}`); - if ($.isNode()) { - await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.UserName}\n${coinToBeans ? `【兑换${$.title}】${$.beanscount ? `成功,数量:${$.beanscount}个` : $.beanerr}` : "您设置的是不兑换奖品"}`) + return new Promise(async resolve => { + $.log(`\n【京东账号${$.index}】${$.nickName}\n${coinToBeans ? `【兑换${$.title}】${$.beanscount ? `成功` : $.beanerr}` : "您设置的是不兑换奖品"}\n`); + let ctrTemp; + if ($.isNode() && process.env.MARKET_REWARD_NOTIFY) { + ctrTemp = `${process.env.MARKET_REWARD_NOTIFY}` === 'false'; + } else if ($.getdata('jdSuperMarketRewardNotify')) { + ctrTemp = $.getdata('jdSuperMarketRewardNotify') === 'false'; + } else { + ctrTemp = `${jdNotify}` === 'false'; } - } + //默认只在兑换奖品成功后弹窗提醒。情况情况加,只打印日志,不弹窗 + if ($.beanscount && ctrTemp) { + $.msg($.name, ``, `【京东账号${$.index}】${$.nickName}\n${coinToBeans ? `【兑换${$.title}】${ $.beanscount ? `成功,数量:${$.beanscount}个` : $.beanerr}` : "您设置的是不兑换奖品"}`); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.UserName}\n${coinToBeans ? `【兑换${$.title}】${$.beanscount ? `成功,数量:${$.beanscount}个` : $.beanerr}` : "您设置的是不兑换奖品"}`) + } + } + resolve() + }) } function TotalBean() { return new Promise(async resolve => { diff --git a/jd_dreamFactory.js b/jd_dreamFactory.js index 12efd54..eb03538 100644 --- a/jd_dreamFactory.js +++ b/jd_dreamFactory.js @@ -347,7 +347,8 @@ function hireAward(date, type = 0) { }) } async function helpFriends() { - if ($.canHelpFlag) { + let Hours = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).getHours(); + if ($.canHelpFlag && Hours >= 6) { await shareCodesFormat(); for (let code of $.newShareCodes) { if (code) { diff --git a/jd_fruit.js b/jd_fruit.js index 9902fd0..aa3c08e 100644 --- a/jd_fruit.js +++ b/jd_fruit.js @@ -1,6 +1,6 @@ /* 东东水果:脚本更新地址 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js -更新时间:2020-11-30 +更新时间:2020-12-15 东东农场活动链接:https://h5.m.jd.com/babelDiy/Zeus/3KSjXqQabiTuD1cJ28QskrpWoBKT/index.html 已支持IOS双京东账号,Node.js支持N个京东账号 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js @@ -29,7 +29,7 @@ let cookiesArr = [], cookie = '', jdFruitShareArr = [], isBox = false, notify, n //下面给出两个账号的填写示例(iOS只支持2个京东账号) let shareCodes = [ // 这个列表填入你要助力的好友的shareCode //账号一的好友shareCode,不同好友的shareCode中间用@符号隔开 - '0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6', + '0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a', //账号二的好友shareCode,不同好友的shareCode中间用@符号隔开 'b1638a774d054a05a30a17d3b4d364b8@f92cb56c6a1349f5a35f0372aa041ea0@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3', ] @@ -725,6 +725,14 @@ async function clockInIn() { } } } + if ($.clockInInit.todaySigned && $.clockInInit.totalSigned === 7) { + console.log('开始领取--惊喜礼包38g水滴'); + await gotClockInGift(); + if ($.gotClockInGiftRes.code === '0') { + // message += `【惊喜礼包】获得${$.gotClockInGiftRes.amount}g💧\n`; + console.log(`【惊喜礼包】获得${$.gotClockInGiftRes.amount}g💧\n`); + } + } // 限时关注得水滴 if ($.clockInInit.themes && $.clockInInit.themes.length > 0) { for (let item of $.clockInInit.themes) { diff --git a/jd_moneyTree.js b/jd_moneyTree.js index 4257b02..4ad187f 100644 --- a/jd_moneyTree.js +++ b/jd_moneyTree.js @@ -121,7 +121,8 @@ function user_info() { // message += `【我的金币数量】${userInfo.treeInfo.coin}\n`; // message += `【距离${userInfo.treeInfo.level + 1}级摇钱树还差】${userInfo.treeInfo.progressLeft}\n`; } else { - $.msg($.name, `【提示】京东账号${$.index}${$.UserName}运行失败`, '此账号未实名认证或者未参与过此活动\n①如未参与活动,请先去京东app参加摇钱树活动\n入口:我的->游戏与互动->查看更多\n②如未实名认证,请进行实名认证', {"open-url": "openApp.jdMobile://"}); + $.log(`京东账号${$.index}${$.UserName}运行失败\n此账号未实名认证或者未参与过此活动\n①如未参与活动,请先去京东app参加摇钱树活动\n入口:我的->游戏与互动->查看更多\n②如未实名认证,请进行实名认证`) + // $.msg($.name, `【提示】京东账号${$.index}${$.UserName}运行失败`, '此账号未实名认证或者未参与过此活动\n①如未参与活动,请先去京东app参加摇钱树活动\n入口:我的->游戏与互动->查看更多\n②如未实名认证,请进行实名认证', {"open-url": "openApp.jdMobile://"}); } } } else { diff --git a/jd_pet.js b/jd_pet.js index 4fac23d..c0b342f 100644 --- a/jd_pet.js +++ b/jd_pet.js @@ -32,7 +32,7 @@ let shareCodes = [ // IOS本地脚本用户这个列表填入你要助力的好 //账号一的好友shareCode,不同好友的shareCode中间用@符号隔开 'MTAxODc2NTEzNTAwMDAwMDAwMjg3MDg2MA==@MTAxODc2NTEzMzAwMDAwMDAyNzUwMDA4MQ==@MTAxODc2NTEzMjAwMDAwMDAzMDI3MTMyOQ==@MTAxODc2NTEzNDAwMDAwMDAzMDI2MDI4MQ==@MTAxODcxOTI2NTAwMDAwMDAxOTQ3MjkzMw==', //账号二的好友shareCode,不同好友的shareCode中间用@符号隔开 - 'MTAxODc2NTEzMjAwMDAwMDAzMDI3MTMyOQ==@MTAxODcxOTI2NTAwMDAwMDAyNjA4ODQyMQ==@MTAxODc2NTEzOTAwMDAwMDAyNzE2MDY2NQ==', + 'MTAxODc2NTEzMjAwMDAwMDAzMDI3MTMyOQ==@MTAxODcxOTI2NTAwMDAwMDAyNjA4ODQyMQ==@MTAxODc2NTEzOTAwMDAwMDAyNzE2MDY2NQ==@MTE1NDUyMjEwMDAwMDAwNDI0MDM2MDc=', ] let message = '', subTitle = '', option = {}; let jdNotify = false;//是否关闭通知,false打开通知推送,true关闭通知推送 From 2543b41608066352e60ac5d8891bc92e6f8ce52a Mon Sep 17 00:00:00 2001 From: DoveBoy <393366046@qq.com> Date: Tue, 15 Dec 2020 11:37:26 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 迁移过期活动脚本 --- jd_apple_live.js => activity/jd_apple_live.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jd_apple_live.js => activity/jd_apple_live.js (100%) diff --git a/jd_apple_live.js b/activity/jd_apple_live.js similarity index 100% rename from jd_apple_live.js rename to activity/jd_apple_live.js From bc11b22c78369dac68c2492e8702c70a90ba80ab Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 15 Dec 2020 14:16:23 +0800 Subject: [PATCH 13/16] update --- Loon/lxk0301_LoonTask.conf | 6 +++--- QuantumultX/lxk0301_gallery.json | 6 +++--- Surge/lxk0301_Task.sgmodule.sgmodule | 8 ++++---- docker/crontab_list.sh | 8 ++++---- docker/crontab_list_ts.sh | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Loon/lxk0301_LoonTask.conf b/Loon/lxk0301_LoonTask.conf index 7b6efb2..e4cbc78 100644 --- a/Loon/lxk0301_LoonTask.conf +++ b/Loon/lxk0301_LoonTask.conf @@ -109,8 +109,8 @@ cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scrip cron "10-20/5 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播 #直播红包雨 -cron "0 0,9,11,13,15,17,19,20,21,23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨 +cron "0 0,20,9-23/2 15-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨 # 金融打卡领年终奖 -cron "10 6 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖 +cron "10 6 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖 # 健康抽奖机 -cron "10 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机 \ No newline at end of file +cron "10 0 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机 \ No newline at end of file diff --git a/QuantumultX/lxk0301_gallery.json b/QuantumultX/lxk0301_gallery.json index e25de23..dee1233 100644 --- a/QuantumultX/lxk0301_gallery.json +++ b/QuantumultX/lxk0301_gallery.json @@ -31,8 +31,8 @@ "30 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_ds.png", "30 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, tag=健康抽奖机, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", "10-20/5 12 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", - "0 0,9,11,13,15,17,19,20,21,23 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", - "10 12 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=京东金融打卡, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", - "15 17 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png" + "0 0,20,9-23/2 15-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", + "10 12 1-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=京东金融打卡, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", + "15 17 1-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png" ] } diff --git a/Surge/lxk0301_Task.sgmodule.sgmodule b/Surge/lxk0301_Task.sgmodule.sgmodule index 74c8b45..9fda572 100644 --- a/Surge/lxk0301_Task.sgmodule.sgmodule +++ b/Surge/lxk0301_Task.sgmodule.sgmodule @@ -65,11 +65,11 @@ cron "20 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scri cron "20 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, timeout=750, wake-system=1, tag=京东直播 #以下为短期活动 #金融打卡领年终奖 -cron "30 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, timeout=750, wake-system=1, tag=金融打卡领年终奖 +cron "30 7 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, timeout=750, wake-system=1, tag=金融打卡领年终奖 #健康抽奖机 -cron "30 2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, timeout=750, wake-system=1, tag=健康抽奖机 +cron "30 2 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, timeout=750, wake-system=1, tag=健康抽奖机 #直播红包雨(2020-12-31活动结束) -cron "0 0,9,11,13,15,17,19,20,21,23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, timeout=750, wake-system=1, tag=直播红包雨 +cron "0 0,20,9-23/2 15-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, timeout=750, wake-system=1, tag=直播红包雨 #秒杀红包雨(2020-12-31活动结束) -cron "20 9 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, timeout=750, wake-system=1, tag=秒杀红包雨 +cron "20 9 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, timeout=750, wake-system=1, tag=秒杀红包雨 diff --git a/docker/crontab_list.sh b/docker/crontab_list.sh index abab90a..fe20f5e 100644 --- a/docker/crontab_list.sh +++ b/docker/crontab_list.sh @@ -5,13 +5,13 @@ ##############短期活动############## # 秒杀红包雨(2020.12.31活动过期) -40 8 * * * node /scripts/jd_ms_redrain.js >> /scripts/logs/jd_ms_redrain.log 2>&1 +40 8 1-31 12 * node /scripts/jd_ms_redrain.js >> /scripts/logs/jd_ms_redrain.log 2>&1 # 健康抽奖机(2020.12.31活动过期) -10 0 * * * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1 +10 0 1-31 12 * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1 # 直播红包雨(2020.12.31活动过期) -0 0,9,11,13,15,17,19,20,21,23 * * * node /scripts/jd_live_redrain.js >> /scripts/logs/jd_live_redrain.log 2>&1 +0 0,20,9-23/2 15-31 12 * node /scripts/jd_live_redrain.js >> /scripts/logs/jd_live_redrain.log 2>&1 # 京东金融打卡领年终奖(2020.12.31活动过期) -10 6 * * * node /scripts/jr_sign.js >> /scripts/logs/jr_sign.log 2>&1 +10 6 1-31 12 * node /scripts/jr_sign.js >> /scripts/logs/jr_sign.log 2>&1 ##############长期活动############## # 签到 diff --git a/docker/crontab_list_ts.sh b/docker/crontab_list_ts.sh index 2942119..31f4708 100644 --- a/docker/crontab_list_ts.sh +++ b/docker/crontab_list_ts.sh @@ -5,13 +5,13 @@ ##############短期活动############## # 秒杀红包雨(2020.12.31活动过期) -40 8 * * * node /scripts/jd_ms_redrain.js | ts >> /scripts/logs/jd_ms_redrain.log 2>&1 +40 8 1-31 12 * node /scripts/jd_ms_redrain.js | ts >> /scripts/logs/jd_ms_redrain.log 2>&1 # 健康抽奖机(2020.12.31活动过期) -10 0 * * * node /scripts/jd_health.js | ts >> /scripts/logs/jd_health.log 2>&1 +10 0 1-31 12 * node /scripts/jd_health.js | ts >> /scripts/logs/jd_health.log 2>&1 # 直播红包雨(2020.12.31活动过期) -0 0,9,11,13,15,17,19,20,21,23 * * * node /scripts/jd_live_redrain.js | ts >> /scripts/logs/jd_live_redrain.log 2>&1 +0 0,20,9-23/2 15-31 12 * node /scripts/jd_live_redrain.js | ts >> /scripts/logs/jd_live_redrain.log 2>&1 # 京东金融打卡领年终奖(2020.12.31活动过期) -10 6 * * * node /scripts/jr_sign.js | ts >> /scripts/logs/jr_sign.log 2>&1 +10 6 1-31 12 * node /scripts/jr_sign.js | ts >> /scripts/logs/jr_sign.log 2>&1 ##############长期活动############## # 签到 From 49448e4803e57fca3c9272d00fe2722f066fb9c1 Mon Sep 17 00:00:00 2001 From: DoveBoy <393366046@qq.com> Date: Tue, 15 Dec 2020 14:37:29 +0800 Subject: [PATCH 14/16] =?UTF-8?q?fix=E4=BA=91=E5=87=BD=E6=95=B0=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=BD=BF=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix云函数无法使用的问题 --- jd_live_redrain.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jd_live_redrain.js b/jd_live_redrain.js index 6c83ead..c17a32a 100644 --- a/jd_live_redrain.js +++ b/jd_live_redrain.js @@ -68,7 +68,7 @@ const JD_API_HOST = 'https://api.m.jd.com/api'; } await getRedRain(); if(!$.activityId) return - let nowTs = new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000 + let nowTs = new Date().getTime() if (!($.st <= nowTs && nowTs < $.ed)) { console.log(`不在红包雨时间之内`) return @@ -178,7 +178,7 @@ function receiveRedRain() { function taskUrl(function_id, body = {}) { return { - url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&_=${new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000}`, + url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&_=${new Date().getTime()}`, headers: { "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br", @@ -257,4 +257,4 @@ function jsonParse(str) { } } // prettier-ignore -function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} \ No newline at end of file +function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} From 449e5c0ff7e50a27205ad63234913f543d54a14b Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 15 Dec 2020 16:31:58 +0800 Subject: [PATCH 15/16] fix --- QuantumultX/lxk0301_gallery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QuantumultX/lxk0301_gallery.json b/QuantumultX/lxk0301_gallery.json index dee1233..d759cf4 100644 --- a/QuantumultX/lxk0301_gallery.json +++ b/QuantumultX/lxk0301_gallery.json @@ -33,6 +33,6 @@ "10-20/5 12 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", "0 0,20,9-23/2 15-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", "10 12 1-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=京东金融打卡, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", - "15 17 1-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png" + "15 17 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png" ] } From 8d3e779a60275f83dae36e432b58f75cbfb75d29 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 15 Dec 2020 17:19:09 +0800 Subject: [PATCH 16/16] debug --- jd_live_redrain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jd_live_redrain.js b/jd_live_redrain.js index c17a32a..31e9530 100644 --- a/jd_live_redrain.js +++ b/jd_live_redrain.js @@ -118,7 +118,7 @@ async function showMsg() { function getRedRain() { return new Promise(resolve => { $.get({ - url: "http://ql4kk90rw.hb-bkt.clouddn.com/jd_live_redRain.json", + url: "http://ql4kk90rw.hb-bkt.clouddn.com/jd_live_redRain.json?" + Date.now(), }, (err, resp, data) => { try { if (err) {