From ce555dfe93ac88fb1264771181688d69fcaf4397 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 16 Oct 2020 21:54:57 +0800 Subject: [PATCH 001/721] --- Task/sendNotify.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Task/sendNotify.js b/Task/sendNotify.js index 040fec63fb..c6b8e9d8ed 100644 --- a/Task/sendNotify.js +++ b/Task/sendNotify.js @@ -261,10 +261,7 @@ module.exports = { DD_BOT_TOKEN, dsjNotifyControl, txnewsNotifyControl, - youthNotifyControl, - YOUTH_NOTIFY_CONTROL, - TXNEWS_NOTIFY_CONTROL, - DSJ_NOTIFY_CONTROL + } // prettier-ignore function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),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}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{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=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"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 e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;$.isMute||(this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o))),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} \ No newline at end of file From 34c4b6f50de1fd017f17f7bbe6c09e2b4372d59d Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 16 Oct 2020 23:13:47 +0800 Subject: [PATCH 002/721] --- Task/midu_Read.js | 1 + Task/youth.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 84f63cdccd..0591df8f41 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -110,6 +110,7 @@ function readTime() { detail += '【阅读时长】失败' $.msg(cookieName, subTitle, detail) } + console.log(" 总计 resolve() } catch (e) { $.msg(cookieName, `阅读时长: 失败`, `说明: ${e}`) diff --git a/Task/youth.js b/Task/youth.js index dd81394782..4bfe1d7ede 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -176,7 +176,7 @@ else if ($.time('HH')>4&&$.time('HH')<8){ await earningsInfo(); await showmsg(); if ($.isNode()) - if(rotaryres.data.remainTurn%50 == 0 && cash >= 10){ + if( rotarytimes && rotarytimes%50 == 0 && cash >= 10){ await notify.sendNotify($.name + " " + nick, "您的余额约为"+cash+"元,已可以提现"+'\n'+`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n${detail}`) } } From c6feeb50569be82b2faccec5034fc24f2a12d991 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 16 Oct 2020 23:19:04 +0800 Subject: [PATCH 003/721] --- Task/midu_Read.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 0591df8f41..0d75677156 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -110,7 +110,7 @@ function readTime() { detail += '【阅读时长】失败' $.msg(cookieName, subTitle, detail) } - console.log(" 总计 + console.log(" 总计金币:"+total_coin+" 现金收益"+readtime.data.popup.corner) resolve() } catch (e) { $.msg(cookieName, `阅读时长: 失败`, `说明: ${e}`) From 206e3e49a0d09cfc44f516aef62d339c18c22475 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 16 Oct 2020 23:46:11 +0800 Subject: [PATCH 004/721] --- Task/midu_Read.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 0d75677156..4364660a29 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -123,11 +123,10 @@ function readTime() { } function drawPrize() { return new Promise((resolve, reject) => { - const drawPrizeurlVal = 'https://apiwz.midukanshu.com/wz/task/drawPrize' + const drawPrizeurlVal = 'https://apiwz.midukanshu.com/wz/task/drawPrize?' + tokenVal const url = { url: drawPrizeurlVal, - headers: {}, - body: drawVal + headers: {} } url.headers['token'] = tokenVal url.headers['Host'] = 'apiwz.midukanshu.com' @@ -153,11 +152,10 @@ function drawPrize() { // 观看视频获取抽奖机会 function prizeTask() { return new Promise((resolve, reject) => { - const prizeTaskurlVal = 'https://apiwz.midukanshu.com/wz/task/prizeTask' + const prizeTaskurlVal = 'https://apiwz.midukanshu.com/wz/task/prizeTask?'+tokenVal const url = { url: prizeTaskurlVal, headers: {}, - body: drawVal } url.headers['token'] = tokenVal url.headers['Host'] = 'apiwz.midukanshu.com' From adc14efdbbe24b842a2e4c600b0024b82d4e3469 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 17 Oct 2020 01:31:09 +0800 Subject: [PATCH 005/721] --- Task/midu_Read.js | 85 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 72 insertions(+), 13 deletions(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 4364660a29..65cbc856ae 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -62,8 +62,10 @@ if ($.isNode()) { $.log(`🔔 ${cookieName}`) await readTime(); await drawPrize(); + await addDraw(); + await taskTime(); await prizeTask(); - await prizeInfo(); + //await prizeInfo(); await dice_roll(); await dice_double(); await signDay(); @@ -80,8 +82,7 @@ function readTime() { let request = { url: "https://apiwz.midukanshu.com/user/readTimeBase/readTime", headers: {'token' : tokenVal,'User-Agent' : `MRSpeedNovel/0918.1649 CFNetwork/1128.0.1 Darwin/19.6.0`,'mobile-brand': 'iPhone','Content-Type': 'application/x-www-form-urlencoded' - }, - body: bodyVal, + }, } $.post(request, (error, response, data) => { try { @@ -94,8 +95,11 @@ function readTime() { const readTotalMinute = readtime.data.readTotalMinute const total_coin = readtime.data.total_coin coin == 0 ? detail += `` : detail += `【阅读时长】获得${coin}💰` - if (readTotalMinute % 20 == 0) { + console.log("总计金币:"+total_coin+" 现金收益"+readtime.data.popup.corner) + if (readTotalMinute) { + console.log("总计阅读时长"+readTotalMinute / 2+"分钟") readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` + $.msg(cookieName, subTitle, detail) } else if ($.getdata('debug') == 'true') { readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` @@ -110,7 +114,7 @@ function readTime() { detail += '【阅读时长】失败' $.msg(cookieName, subTitle, detail) } - console.log(" 总计金币:"+total_coin+" 现金收益"+readtime.data.popup.corner) + resolve() } catch (e) { $.msg(cookieName, `阅读时长: 失败`, `说明: ${e}`) @@ -123,15 +127,15 @@ function readTime() { } function drawPrize() { return new Promise((resolve, reject) => { - const drawPrizeurlVal = 'https://apiwz.midukanshu.com/wz/task/drawPrize?' + tokenVal const url = { - url: drawPrizeurlVal, - headers: {} + url: 'https://apiwz.midukanshu.com/wz/task/drawPrize?' + drawVal, + headers: {}, } url.headers['token'] = tokenVal url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + url.headers['tk'] =`ACI_Pcpc27lK8Y_z9rcY9IZJUOuwRFpono9tZHd6` $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}`) @@ -149,10 +153,67 @@ function drawPrize() { }) } +// 额外奖励 +function addDraw() { + return new Promise((resolve, reject) => { + url = { + url: 'https://apiwz.midukanshu.com/wz/task/weekReward', + headers: {}, + body: drawVal + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + $.post(url, (error, response, data) => { + try { + //$.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}`) + if (data) { + add_Draw = JSON.parse(data) + } + resolve() + } catch (e) { + // $.msg(cookieName, `额外奖励: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} addDraw - 额外奖励失败: ${e}`) + $.log(`❌ ${cookieName} addDraw - response: ${JSON.stringify(response)}`) + resolve() + } + }) + }) +} + +function taskTime() { + return new Promise((resolve, reject) => { + const url = { + url: 'https://apiwz.midukanshu.com/wz/task/time' , + headers: {}, + body: drawVal + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + $.post(url, (error, response, data) => { + try { + $.log(`🐍🐢 ${cookieName} taskTime - response: ${JSON.stringify(response)}`) + if (data) { + drawprize = JSON.parse(data) + } + resolve() + } catch (e) { + $.log(`❌ ${cookieName} taskTime - 抽奖失败: ${e}`) + $.log(`❌ ${cookieName} taskTime - response: ${JSON.stringify(response)}`) + resolve() + } + }) + }) +} + + + + // 观看视频获取抽奖机会 function prizeTask() { return new Promise((resolve, reject) => { - const prizeTaskurlVal = 'https://apiwz.midukanshu.com/wz/task/prizeTask?'+tokenVal + const prizeTaskurlVal = 'https://apiwz.midukanshu.com/wz/task/prizeTask?'+drawVal const url = { url: prizeTaskurlVal, headers: {}, @@ -193,7 +254,7 @@ function prizeInfo() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' $.post(url, (error, response, data) => { try { - // $.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(response)}`) + $.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(response)}`) if (data) { prizeinfo = JSON.parse(data) } @@ -270,11 +331,9 @@ function dice_double() { // 每日签到 function signDay() { return new Promise((resolve, reject) => { - const signurlVal = 'https://apiwz.midukanshu.com/wz/task/signInV2' const url = { - url: signurlVal, + url: "https://apiwz.midukanshu.com/wz/task/signInV2?"+ drawVal, headers: {}, - body: drawVal } url.headers['token'] = tokenVal url.headers['Host'] = 'apiwz.midukanshu.com' From 3c5b483a16695a1df8d2d3e4854241c671142ff0 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 17 Oct 2020 21:02:41 +0800 Subject: [PATCH 006/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=83=E6=97=A5?= =?UTF-8?q?=E7=AD=BE=E5=88=B0=E6=8A=BD=E5=A5=96=E9=9D=92=E8=B1=86=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E6=AF=8F=E7=AD=BE=E5=88=B0=E4=B8=83=E6=97=A5=E8=8E=B7?= =?UTF-8?q?=E5=BE=97=E4=B8=80=E6=AC=A1=E9=9D=92=E8=B1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/txnews2.js | 286 ------------------------------------------------ Task/youth.js | 39 +++++++ 2 files changed, 39 insertions(+), 286 deletions(-) delete mode 100644 Task/txnews2.js diff --git a/Task/txnews2.js b/Task/txnews2.js deleted file mode 100644 index b2bc627025..0000000000 --- a/Task/txnews2.js +++ /dev/null @@ -1,286 +0,0 @@ -/* -更新时间: 2020-09-10 13:30 - -腾讯新闻签到修改版,可以自动阅读文章获取红包,该活动为瓜分百万现金挑战赛,针对幸运用户参与 - -获取Cookie方法: -1.把以下配置复制到响应配置下 -2.打开腾讯新闻app,阅读几篇文章,倒计时结束后即可获取阅读Cookie; -3.看一次推荐视频获取视频地址 -4.可能腾讯有某些限制,有些号码无法领取红包,手动阅读几篇,能领取红包,一般情况下都是正常的, -5.此脚本根据阅读篇数开启通知,默认阅读50篇通知一次,此版本不支持Boxjs ‼️ -版本更新日志: -1.01 修复无法自动获取视频红包,修改通知为阅读篇数间隔,即阅读篇数除以间隔余0时通知,或者自定义常开或常关, -1.02 增加通知跳转链接https://news.qq.com/FERD/cjRedDown.htm,需手动领取此红包 ---------------------- -Surge 4.0 -[Script] -腾讯新闻 = type=cron,cronexp=0 8 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js,script-update-interval=0 - -腾讯新闻 = type=http-request,pattern=https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js, requires-body=true - -~~~~~~~~~~~~~~~~~~~~~ -Loon 2.1.0+ -[Script] -# 本地脚本 -cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js, enabled=true, tag=腾讯新闻 - -http-request https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js, requires-body=true - ------------------ - -QX 1.0.7+ : - [task_local] -0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js, tag=腾讯新闻 - [rewrite_local] -https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js - -~~~~~~~~~~~~~~~~~~ - [MITM] -hostname = api.inews.qq.com - ---------------------------- - -Cookie获取后,请注释掉Cookie地址。 - -*/ -const cookieName = '腾讯新闻'; -let s = 500 // 间隔延迟时间 -const $ = new Env(cookieName); -let notifyInterval =$.getdata('notifynum')||50; //阅读篇数间隔通知开为1,常关为0; - -const signurlVal = $.getdata('sy_signurl_txnews2') -const cookieVal = $.getdata( 'sy_cookie_txnews2') -const videoVal = $.getdata( 'video_txnews2') - -let isGetCookie = typeof $request !== 'undefined' -if (isGetCookie) { - GetCookie() -} else { - -!(async () => { -{ -if(signurlVal){ - ID = signurlVal.match(/devid=[a-zA-Z0-9_-]+/g) -} -$.log("\n开始获取您的活动ID") - await getsign(); - await activity(); - await toRead(); - await lookVideo(); - await StepsTotal(); -if(getreadred > 0){ - redbody = `redpack_type=article&activity_id=${actid}` - await Redpack() -}; -if(getvideored>0){ -redbody = `redpack_type=video&activity_id=${actid}` - await Redpack() -}; - await getTotal(); - await showmsg() - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) -} - -function GetCookie() { -if ($request &&$request.body.indexOf("article_read")> -1) { - const signurlVal = $request.url - const cookieVal = $request.headers['Cookie']; - $.log(`signurlVal:${signurlVal}`) - $.log(`cookieVal:${cookieVal}`) - if (signurlVal) $.setdata(signurlVal, 'sy_signurl_txnews2') - if (cookieVal) $.setdata(cookieVal, 'sy_cookie_txnews2') - $.msg(cookieName, `获取Cookie: 成功🎉`, ``) - } -if ($request &&$request.body.indexOf("video_read")> -1) { - const videoVal = $request.url - $.log(`videoVal:${videoVal}`) - if (videoVal) $.setdata(videoVal, 'video_txnews2') - $.msg(cookieName, `获取视频地址: 成功🎉`, ``) - } - } - - -//签到 -function getsign() { - return new Promise((resolve, reject) => { - const llUrl = { - url: `https://api.inews.qq.com/task/v1/user/signin/add?`,headers:{Cookie: cookieVal} - }; - $.post(llUrl, (error, response, data) => { - const obj = JSON.parse(data) - if (obj.info=="success"){ - next = obj.data.next_points - tip = obj.data.tip_soup||obj.data.share_tip - imgurl= obj.data.share_img - Dictum = tip.replace(/[\<|\.|\>|br]/g,"")+""+obj.data.author.replace(/[\<|\.|\>|br|图|腾讯网友]/g,"") - signinfo = '【签到信息】连续签到' + obj.data.signin_days+'天 '+'明日+'+ next +'金币 成功🎉\n'} - else { - $.msg('签到失败,🉐登录腾讯新闻app获取cookie', "", "") - console.log('签到失败,🉐登录腾讯新闻app获取cookie'+data) - return - } - resolve() - }) - }) -} - -function activity() { - return new Promise((resolve, reject) => { - setTimeout(()=>{ - const actUrl = { - url: `https://api.inews.qq.com/activity/v1/user/activity/get?isJailbreak=0&${ID}`, - headers: {Cookie: cookieVal}}; - $.get(actUrl, function(error,response, data) { - if (error) { - $.msg("获取活动Id失败‼️", "", error) - } else { - const obj = JSON.parse(data) - actid = obj.data.activity.id - console.log(` 您的活动ID为: `+actid+"\n") - } - resolve() - }) - },s) - }) - } - -//阅读阶梯 -function toRead() { - return new Promise((resolve, reject) => { - setTimeout(()=>{ - $.post({url: signurlVal, headers: {Cookie:cookieVal},body: 'event=article_read'},(error, resp, data)=> { - $.log("正在阅读文章\n") - }) - resolve() - },s) - }) -} -function lookVideo() { - return new Promise((resolve, reject) => { - setTimeout(()=>{ - $.post({url: videoVal, headers: {Cookie:cookieVal},body: 'event=video_read'},(error, response, data) =>{ - if (error){ - $.msg(cookieName, '观看视频:'+ error) - }else{ - $.log("正在浏览视频\n") - tolookresult = JSON.parse(data) - } - resolve() - }) - },s*2) - }) -} - -//阅读文章统计 -function StepsTotal() { -return new Promise((resolve, reject) => { - setTimeout(()=>{ - const StepsUrl = { - url: `https://api.inews.qq.com/activity/v1/activity/info/get?activity_id=${actid}&${ID}`, - headers: {Cookie: cookieVal} - } - $.get(StepsUrl, (error, response, data) => { - totalred = JSON.parse(data) - $.log("正在统计阅读数据:") - totalcion = totalred.data.extends.today_total_coin - if (totalred.ret == 0){ - for (i=0;i { - setTimeout(()=>{ - const cashUrl = { - url: `https://api.inews.qq.com/activity/v1/activity/redpack/get?isJailbreak=0&${ID}`, - headers: {Cookie: cookieVal}, - body: redbody - } - $.post(cashUrl, (error, response, data) => { - let rcash = JSON.parse(data) - try{ - redpacks = rcash.data.award.num/100 - if (rcash.ret == 0&&readredpack!=0&&getreadred>0){ - redpackres = `【阅读红包】到账`+readredpack+`元 🌷\n` - $.log("阅读红包到账"+readredpack+"元\n") - } - else if (rcash.ret == 0&&videoredpack!=0&&getvideored>0){ - redpackres = `【视频红包】到账`+videoredpack+`元 🌷\n` - $.log("视频红包到账"+videoredpack+"元\n") - } - } - catch(err){ - $.log("打开红包失败,响应数据: "+ data+"\n错误代码:"+err) - } - - resolve() - }) - },s) - }) -} - - -//收益总计 -function getTotal() { -return new Promise((resolve, reject) => { - const totalUrl = { - url: `https://api.inews.qq.com/activity/v1/usercenter/activity/list?isJailbreak`, - headers: {Cookie: cookieVal}}; - $.post(totalUrl, function(error,response, data) { - if (error) { - $.msg("获取收益信息失败‼️", "", error) - } else { - const obj = JSON.parse(data) - subTile = '【收益总计】'+obj.data.wealth[0].title +'金币 '+"钱包: " +obj.data.wealth[1].title+'元' - $.log("钱包收益共计"+obj.data.wealth[1].title+"元") - } - resolve() - }) - }) - } - -function showmsg() { - return new Promise((resolve, reject) => { - if(readnum||videonum){ - detail = signinfo + `【文章阅读】已读/再读: `+ readnum +`/`+readtitle+` 篇\n`+`【阅读红包】已开/总计: `+openreadred+`/`+readredtotal+` 个🧧\n`+ `【观看视频】已看/再看: `+ videonum +`/`+videotitle+` 分钟\n`+`【视频红包】已开/总计: `+openvideored+`/`+videoredtotal+` 个🧧\n【每日一句】`+Dictum - } - if -(readnum%notifyInterval==0){ - $.msg(cookieName,subTile,detail,{ 'open-url': "https://news.qq.com/FERD/cjRedDown.htm", 'media-url': imgurl } ) - } - else if (openreadred==readredtotal&&openvideored==videoredtotal){ - $.msg(cookieName+` 今日任务已完成✅`,subTile,detail,{ 'open-url': "https://news.qq.com/FERD/cjRedDown.htm", 'media-url': imgurl } ) - } - resolve() - }) -} - -// 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{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||!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,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)} diff --git a/Task/youth.js b/Task/youth.js index 4bfe1d7ede..b88098a1e9 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -165,6 +165,8 @@ if ($.isNode()&& $.time('HH')>20&&$.time('HH')<22){ else if ($.time('HH')>4&&$.time('HH')<8){ await endCard(); } + await SevCont(); + await ArticleShare(); await openbox(); await getAdVideo(); await gameVideo(); @@ -345,6 +347,43 @@ function Cardshare() { }) } +function SevCont() { + return new Promise((resolve, reject) => { + setTimeout(() => { + $.post({url: `${YOUTH_HOST}PunchCard/luckdraw?`, + headers: JSON.parse(signheaderVal), + }, async(error, response, data) => { + sevres = JSON.parse(data) + if (sevres.code == 1) { + + detail += `【七日签到】+${sevres.data.score}青豆 \n` + + }else if (sevres.code == 0){ + //detail += `【七日签到】${sevres.msg}\n` + // $.log(`${boxres.msg}`) + } + resolve() + }) + },s) + }) +} + +function ArticleShare() { + return new Promise((resolve, reject) => { + setTimeout(() => { + const url = { + url: `https://focu.youth.cn/article/s?&uid=46308484&signature=0Z3Jgv96wqmVPeM7obRdNpHXgAmRhxNPJ6y4jpGDnANbo8KXQr`, + headers: JSON.parse(signheaderVal), + } + $.post(url, async(error, response, data) => { + //boxres = JSON.parse(data) + resolve() + }) + },s) + }) +} + + //开启时段宝箱 function openbox() { return new Promise((resolve, reject) => { From 9de71b65ea0e876fbe14667666c1890ec33a1a5b Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 17 Oct 2020 22:02:41 +0800 Subject: [PATCH 007/721] =?UTF-8?q?fix=20=E8=85=BE=E8=AE=AF=E6=96=B0?= =?UTF-8?q?=E9=97=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/txnews.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/txnews.js b/Task/txnews.js index 63dc1b103b..f88f494014 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -290,8 +290,9 @@ function Redpack() { } } catch(error){ - $.log("打开红包失败,响应数据: "+ data+"\n错误代码:"+error) }; + console.log("打开红包失败,响应数据: "+ data) $.msg($.name, "开红包失败,详情请看日志 ❌", error) + }; resolve() }) },s) From 893400539f700b6f756b550fa5513d949c1bebec Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 17 Oct 2020 22:17:00 +0800 Subject: [PATCH 008/721] =?UTF-8?q?fix=E4=B8=AD=E9=9D=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index b88098a1e9..6cc6a1fa07 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -177,7 +177,7 @@ else if ($.time('HH')>4&&$.time('HH')<8){ await rotaryCheck(); await earningsInfo(); await showmsg(); - if ($.isNode()) + if ($.isNode()&&rotaryres.code !== 10010) if( rotarytimes && rotarytimes%50 == 0 && cash >= 10){ await notify.sendNotify($.name + " " + nick, "您的余额约为"+cash+"元,已可以提现"+'\n'+`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n${detail}`) } @@ -372,7 +372,7 @@ function ArticleShare() { return new Promise((resolve, reject) => { setTimeout(() => { const url = { - url: `https://focu.youth.cn/article/s?&uid=46308484&signature=0Z3Jgv96wqmVPeM7obRdNpHXgAmRhxNPJ6y4jpGDnANbo8KXQr`, + url: `https://focu.youth.cn/article/s?signature=0Z3Jgv96wqmVPeM7obRdNpHXgAmRhxNPJ6y4jpGDnANbo8KXQr`, headers: JSON.parse(signheaderVal), } $.post(url, async(error, response, data) => { From 59b6f691b090c6f4386bdacc90b8cce2a7f351cf Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 00:49:17 +0800 Subject: [PATCH 009/721] =?UTF-8?q?=E8=85=BE=E8=AE=AF=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E6=89=93=E5=BC=80=E9=93=BE=E6=8E=A5=E6=B5=8B=E8=AF=95=EF=BC=8C?= =?UTF-8?q?=E5=A4=A7=E6=A6=82=E7=8E=87=E4=B8=8D=E9=80=9A=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/txnews.js | 92 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 74 insertions(+), 18 deletions(-) diff --git a/Task/txnews.js b/Task/txnews.js index f88f494014..8b82aef69e 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -1,6 +1,6 @@ /* -更新时间: 2020-10-16 20:10 +更新时间: 2020-10-18 00:50 腾讯新闻签到修改版,可以自动阅读文章获取红包,该活动为瓜分百万现金挑战赛,针对幸运用户参与 @@ -52,7 +52,7 @@ let notifyInterval =$.getdata('notifynum')||50; //阅读篇数间隔通知开为 const TX_HOST = 'https://api.inews.qq.com/activity/v1/' let SignArr = [],SignUrl = ""; cookiesArr = [],CookieTxnews = ""; - VideoArr = [],SignUrl = ""; + VideoArr = [],SignUrl = "",order = ""; if ($.isNode()) { @@ -114,11 +114,16 @@ if (isGetCookie) { $.index = i + 1; console.log(`-------------------------\n\n开始【腾讯新闻账号${$.index}】`) } - token = signurlVal.match(/devid=[a-zA-Z0-9_-]+/g)[0] + ID = signurlVal.match(/devid=[a-zA-Z0-9_-]+/g)[0] + token = signurlVal.split("&mac")[1] await getsign(); await activity(); await toRead(); await lookVideo(); + await OrderID(); + if(order) { + await Pending(); + }; await StepsTotal(); if(getreadred > 0){ redbody = `redpack_type=article&activity_id=${actid}` @@ -187,11 +192,11 @@ function getsign() { function activity() { return new Promise((resolve, reject) => { setTimeout(()=>{ - $.get({url:`${TX_HOST}user/activity/get?isJailbreak=0&${token}`, headers: {Cookie:cookieVal}}, (error,response, data) =>{ + $.get({url:`${TX_HOST}user/activity/get?isJailbreak=0&${ID}`, headers: {Cookie:cookieVal}}, (error,response, data) =>{ try{ let obj = JSON.parse(data) actid = obj.data.activity.id - console.log(` 您的活动ID为: `+actid+"\n") + console.log(`\n您的活动ID为: `+actid+"\n") } catch(error){ $.msg("获取活动ID失败,详情请看日志","","") console.log("活动ID日志:"+ data) @@ -207,9 +212,16 @@ function toRead() { return new Promise((resolve, reject) => { setTimeout(()=>{ $.post({url: signurlVal, headers: {Cookie:cookieVal}, body: 'event=article_read'},(error, resp, data)=> { - $.log("正在浏览文章"+data) - }) - resolve() + try{ + let obj = JSON.parse(data) + if(obj.ret == 0){ + console.log("本次阅读领取" +obj.data.countdown_timer.countdown_tips+"\n") + } + } catch(error){ + console.log("本次阅读失败"+data+"\n") + } + resolve() + }) },s) }) } @@ -217,24 +229,68 @@ function lookVideo() { return new Promise((resolve, reject) => { setTimeout(()=>{ $.post({url: videoVal, headers: {Cookie:cookieVal},body: 'event=video_read'},(error, response, data) =>{ - if (error){ - $.msg($.name, '观看视频:'+ error) - }else{ - $.log("正在观看视频"+data) - tolookresult = JSON.parse(data) - } + try{ + let obj = JSON.parse(data) + if(obj.ret == 0){ + console.log("本次视频领取" +obj.data.countdown_timer.countdown_tips+"\n") + } + } catch(error){ + console.log("观看视频失败"+data+"\n") + } resolve() - }) + }) },s*2) }) } +function OrderID() { + return new Promise((resolve, reject) => { + $.post({url: `https://api.prize.qq.com/v1/newsapp/rp/common?isJailbreak=0&mac=${token}`, headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded"},body: 'actFrom=wxplugin&actEname=newsapp_cj'},(error, response, data) =>{ + //console.log(data) + if(response.statusCode !== 403){ + try { + let openres = JSON.parse(data) + if (openres.code == 0 ){ + meney = openres.data.money/100 + order = openres.data.orderID + console.log(` 看新闻,领红包,到账: `+meney+'元\n') + } + } catch(error){ + console.log("打开看新闻,领红包失败:"+ data) } + } + resolve() + }) + }) +} + +function Pending() { + console.log(order) + return new Promise((resolve, reject) => { + $.post({url: `https://api.prize.qq.com/v1/newsapp/rp/get_pending?isJailbreak=0&mac=${token}`, + headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded"}, + body: `orderID=${order}`},(error, response, data) =>{ + //console.log(data) + if (response.statusCode !== 403){ + try { + let res = JSON.parse(data) + if (res.code == 0 ){ + console.log( '看新闻,领红包领取成功\n') + } + } catch(error){ + console.log("看新闻,领红包失败:"+ data) + } + } + resolve() + }) + }) +} + //阅读文章统计 function StepsTotal() { return new Promise((resolve, reject) => { setTimeout(()=>{ const StepsUrl = { - url: `${TX_HOST}activity/info/get?activity_id=${actid}&${token}`, + url: `${TX_HOST}activity/info/get?activity_id=${actid}&${ID}`, headers: {Cookie: cookieVal} } $.get(StepsUrl, (error, response, data) => { @@ -272,7 +328,7 @@ function Redpack() { return new Promise((resolve, reject) => { setTimeout(()=>{ const cashUrl = { - url: `${TX_HOST}activity/redpack/get?isJailbreak=0&${token}`, + url: `${TX_HOST}activity/redpack/get?isJailbreak=0&${ID}`, headers: {Cookie: cookieVal}, body: redbody } @@ -335,4 +391,4 @@ function showmsg() { } // 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 98cb32f9d5f9715cf8302ea85fa59319a376c16a Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 00:53:40 +0800 Subject: [PATCH 010/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 6cc6a1fa07..131bc63c44 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -372,7 +372,7 @@ function ArticleShare() { return new Promise((resolve, reject) => { setTimeout(() => { const url = { - url: `https://focu.youth.cn/article/s?signature=0Z3Jgv96wqmVPeM7obRdNpHXgAmRhxNPJ6y4jpGDnANbo8KXQr`, + url: `https://focu.youth.cn/article/s?signature=0Z3Jgv96wqmVPeM7obRdNpHXgAmRhxNPJ6y4jpGDnANbo8KXQr&uid=46308484&phone_code=26170a068d9b9563e7028f197c8a4a2b&scid=33007686&time=1602937887&app_version=1.7.8&sign=d21dd80d0c6563f6f810dd76d7e0aef2`, headers: JSON.parse(signheaderVal), } $.post(url, async(error, response, data) => { From 3a58b715dc035abf9d7cfd8e04137e0136e2ea2e Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 01:14:26 +0800 Subject: [PATCH 011/721] --- .github/workflows/dianshijia.yml | 4 ++-- .github/workflows/jingxi.yml | 4 ++-- .github/workflows/midu_read.yml | 4 ++-- .github/workflows/txnews.yml | 4 ++-- .github/workflows/weibo.yml | 4 ++-- .github/workflows/youth.yml | 4 ++-- .github/workflows/youth_read.yml | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/dianshijia.yml b/.github/workflows/dianshijia.yml index 3811697c12..22e2a29853 100644 --- a/.github/workflows/dianshijia.yml +++ b/.github/workflows/dianshijia.yml @@ -16,10 +16,10 @@ jobs: DSJ_DRAWAL: ${{ secrets.DSJ_DRAWAL }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 10.x + - name: Use Node.js 14.x uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 14.x - name: npm install run: | npm install diff --git a/.github/workflows/jingxi.yml b/.github/workflows/jingxi.yml index 6baff88bfa..2c3b5b521a 100644 --- a/.github/workflows/jingxi.yml +++ b/.github/workflows/jingxi.yml @@ -15,10 +15,10 @@ jobs: JD_COOKIE: ${{ secrets.JD_COOKIE }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 10.x + - name: Use Node.js 14.x uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 14.x - name: npm install run: | npm install diff --git a/.github/workflows/midu_read.yml b/.github/workflows/midu_read.yml index eb2d4c9932..a05b186e84 100644 --- a/.github/workflows/midu_read.yml +++ b/.github/workflows/midu_read.yml @@ -17,10 +17,10 @@ jobs: MIDU_SIGN: ${{ secrets.MIDU_SIGN }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 10.x + - name: Use Node.js 14.x uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 14.x - name: npm install run: | npm install diff --git a/.github/workflows/txnews.yml b/.github/workflows/txnews.yml index d7b75802de..8705933cee 100644 --- a/.github/workflows/txnews.yml +++ b/.github/workflows/txnews.yml @@ -23,10 +23,10 @@ jobs: TXNEWS_VIDEO: ${{ secrets.TXNEWS_VIDEO }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 10.x + - name: Use Node.js 14.x uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 14.x - name: npm install run: | npm install diff --git a/.github/workflows/weibo.yml b/.github/workflows/weibo.yml index afeaabbfd7..f9f24e7a70 100644 --- a/.github/workflows/weibo.yml +++ b/.github/workflows/weibo.yml @@ -16,10 +16,10 @@ jobs: WB_PAY: ${{ secrets.WB_PAY }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 10.x + - name: Use Node.js 14.x uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 14.x - name: npm install if: env.WB_TOKEN run: | diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index f9e765a189..afad4ea1db 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -21,10 +21,10 @@ jobs: YOUTH_TIME: ${{ secrets.YOUTH_TIME }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 10.x + - name: Use Node.js 14.x uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 14.x - name: npm install if: env.YOUTH_HEADER run: | diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index df3dfc7ef7..c6ddde2278 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -20,10 +20,10 @@ jobs: YOUTH_READ4: ${{ secrets.YOUTH_READ4 }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 10.x + - name: Use Node.js 14.x uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 14.x - name: npm install run: | npm install From d1c19748e5072e9587730a5148defb678b68e799 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 16:09:00 +0800 Subject: [PATCH 012/721] fix midu --- Task/midu_Read.js | 146 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 118 insertions(+), 28 deletions(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 65cbc856ae..3da0b20a02 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -2,7 +2,7 @@ const cookieName = '米读阅读时长' const $ = new Env(cookieName) let tokenArr = [], TimeArr = [],SignArr= []; - + const bind = true; if ($.isNode()) { if (process.env.MIDU_TOKEN && process.env.MIDU_TOKEN.indexOf('#') > -1) { miduToken = process.env.MIDU_TOKEN.split('#'); @@ -60,14 +60,25 @@ if ($.isNode()) { $.index = i + 1; console.log(`-------------------------\n\n开始【米读账号${$.index}】`) $.log(`🔔 ${cookieName}`) + tkVal = drawVal.match(/tk=(\w+)/)[1] + for (i=0;i<10;i++){ await readTime(); - await drawPrize(); +} + await prizeInfo(); + if (prizeinfo && prizeinfo.data && prizeinfo.data.total_num) { + await prizeTask() + await drawPrize() + } await addDraw(); await taskTime(); - await prizeTask(); - //await prizeInfo(); + await OthersAd(); await dice_roll(); await dice_double(); + await userInfo(); + bind ? '' : $.setdata('', 'bind'); + if (bind) { + await Bind() + } await signDay(); await signVideo() } @@ -79,14 +90,22 @@ if ($.isNode()) { // 阅读时长 function readTime() { return new Promise((resolve, reject) => { + setTimeout(()=> { let request = { url: "https://apiwz.midukanshu.com/user/readTimeBase/readTime", - headers: {'token' : tokenVal,'User-Agent' : `MRSpeedNovel/0918.1649 CFNetwork/1128.0.1 Darwin/19.6.0`,'mobile-brand': 'iPhone','Content-Type': 'application/x-www-form-urlencoded' - }, + headers: { + 'host': 'apiwz.midukanshu.com', + 'versionName': '1.24.0.0918.1649', + "User-Agent": "MRSpeedNovel/0918.1649 CFNetwork/1128.0.1 Darwin/19.6.0", + "Content-Type": "application/x-www-form-urlencoded; charset=utf-8", + 'token': tokenVal, + 'tk': tkVal + }, + body: bodyVal } $.post(request, (error, response, data) => { try { - $.log(`❕ ${cookieName} readTime - response: ${JSON.stringify(response)}`) + $.log(`❕ ${cookieName} readTime - response: ${JSON.stringify(response)}\n`) readtime = JSON.parse(data) let subTitle = '' let detail = '' @@ -103,7 +122,7 @@ function readTime() { $.msg(cookieName, subTitle, detail) } else if ($.getdata('debug') == 'true') { readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` - $.msg(cookieName, subTitle, detail) + // $.msg(cookieName, subTitle, detail) } @@ -119,10 +138,11 @@ function readTime() { } catch (e) { $.msg(cookieName, `阅读时长: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} readTime - 签到失败: ${e}`) - $.log(`❌ ${cookieName} readTime - response: ${JSON.stringify(response)}`) + $.log(`❌ ${cookieName} readTime - response: ${JSON.stringify(response)}\n`) resolve() } }) + },30000) }) } function drawPrize() { @@ -135,10 +155,10 @@ function drawPrize() { url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' - url.headers['tk'] =`ACI_Pcpc27lK8Y_z9rcY9IZJUOuwRFpono9tZHd6` + url.headers['tk'] = tkVal $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}`) + $.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}\n`) if (data) { drawprize = JSON.parse(data) } @@ -146,12 +166,55 @@ function drawPrize() { } catch (e) { // $.msg(cookieName, `抽奖: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} drawPrize - 抽奖失败: ${e}`) - $.log(`❌ ${cookieName} drawPrize - response: ${JSON.stringify(response)}`) + $.log(`❌ ${cookieName} drawPrize - response: ${JSON.stringify(response)}\n`) resolve() } }) }) } +// 用户信息 +function userInfo() { + return new Promise((resolve, reject) => { + const userInfourlVal = 'https://apiwz.midukanshu.com/wz/user/getInfo?' + bodyVal + const url = { + url: userInfourlVal, + headers: {} + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + $.post(url, (error, response, data) => { + try { + // $.log(`🐍🐢 ${cookieName} userInfo - response: ${JSON.stringify(response)}`) + userInfo = JSON.parse(data) + resolve() + } catch (e) { + $.msg(cookieName, `获取用户信息: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} userInfo - 获取用户信息失败: ${e}`) + $.log(`❌ ${cookieName} userInfo - response: ${JSON.stringify(response)}`) + resolve() + } + }) + }) +} + +function Bind() { + return new Promise((resolve, reject) => { + const url = { + url: 'http://fisson.1sapp.com/nlx/shareLink/tmpBind', + headers: {}, + body: 'app_id=7&act_type=1&act_name=grad_pupil&invite_code=A1051999596&telephone=' + userInfo.data.mobile + } + url.headers['Host'] = 'fisson.1sapp.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + $.post(url, (error, response, data) => { + $.setdata('', 'bind') + resolve() + }) + }) +} + // 额外奖励 function addDraw() { @@ -166,7 +229,7 @@ function addDraw() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { - //$.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}`) + $.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}\n`) if (data) { add_Draw = JSON.parse(data) } @@ -174,7 +237,7 @@ function addDraw() { } catch (e) { // $.msg(cookieName, `额外奖励: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} addDraw - 额外奖励失败: ${e}`) - $.log(`❌ ${cookieName} addDraw - response: ${JSON.stringify(response)}`) + $.log(`❌ ${cookieName} addDraw - response: ${JSON.stringify(response)}\n`) resolve() } }) @@ -193,14 +256,14 @@ function taskTime() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} taskTime - response: ${JSON.stringify(response)}`) + $.log(`🐍🐢 ${cookieName} taskTime - response: ${JSON.stringify(response)}\n`) if (data) { drawprize = JSON.parse(data) } resolve() } catch (e) { $.log(`❌ ${cookieName} taskTime - 抽奖失败: ${e}`) - $.log(`❌ ${cookieName} taskTime - response: ${JSON.stringify(response)}`) + $.log(`❌ ${cookieName} taskTime - response: ${JSON.stringify(response)}\n`) resolve() } }) @@ -224,7 +287,7 @@ function prizeTask() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} prizeTask - response: ${JSON.stringify(response)}`) + $.log(`🐍🐢 ${cookieName} prizeTask - response: ${JSON.stringify(response)}\n`) if (data) { prizetask = JSON.parse(data) } @@ -232,7 +295,7 @@ function prizeTask() { } catch (e) { // $.msg(cookieName, `观看视频抽奖: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} prizeTask - 观看视频抽奖失败: ${e}`) - $.log(`❌ ${cookieName} prizeTask - response: ${JSON.stringify(response)}`) + $.log(`❌ ${cookieName} prizeTask - response: ${JSON.stringify(response)}\n`) resolve() } }) @@ -254,7 +317,7 @@ function prizeInfo() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(response)}`) + // $.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(response)}\n`) if (data) { prizeinfo = JSON.parse(data) } @@ -262,7 +325,7 @@ function prizeInfo() { } catch (e) { // $.msg(cookieName, `抽奖信息: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} prizeInfo - 抽奖信息失败: ${e}`) - $.log(`❌ ${cookieName} prizeInfo - response: ${JSON.stringify(response)}`) + $.log(`❌ ${cookieName} prizeInfo - response: ${JSON.stringify(response)}\n`) resolve() } }) @@ -283,7 +346,7 @@ function dice_roll() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} dice_roll - response: ${JSON.stringify(response)}`) + $.log(`🐍🐢 ${cookieName} dice_roll - response: ${JSON.stringify(response)}\n`) if (JSON.parse(data).code == 0) { rollList=JSON.parse(data) } @@ -291,7 +354,7 @@ function dice_roll() { } catch (e) { $.msg(cookieName, `掷骰子: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} dice_roll - 掷骰子失败: ${e}`) - $.log(`❌ ${cookieName} dice_roll - response: ${JSON.stringify(response)}`) + $.log(`❌ ${cookieName} dice_roll - response: ${JSON.stringify(response)}\n`) resolve() } }) @@ -313,7 +376,7 @@ function dice_double() { url.headers['token'] = tokenVal $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} dice_double - response: ${JSON.stringify(response)}`) + $.log(`🐍🐢 ${cookieName} dice_double - response: ${JSON.stringify(response)}\n`) if (JSON.parse(data).code == 0) { doubleList=JSON.parse(data) } @@ -321,7 +384,7 @@ function dice_double() { } catch (e) { $.msg(cookieName, `骰子双倍奖励: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} dice_double - 骰子双倍奖励失败: ${e}`) - $.log(`❌ ${cookieName} dice_double - response: ${JSON.stringify(response)}`) + $.log(`❌ ${cookieName} dice_double - response: ${JSON.stringify(response)}\n`) resolve() } }) @@ -341,13 +404,13 @@ function signDay() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} signDay - response: ${JSON.stringify(response)}`) + $.log(`🐍🐢 ${cookieName} signDay - response: ${JSON.stringify(response)}\n`) _signDay = JSON.parse(data) resolve() } catch (e) { $.msg(cookieName, `签到结果: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} signDay - 签到失败: ${e}`) - $.log(`❌ ${cookieName} signDay - response: ${JSON.stringify(response)}`) + $.log(`❌ ${cookieName} signDay - response: ${JSON.stringify(response)}\n`) resolve() } }) @@ -369,13 +432,13 @@ function signVideo() { url.headers['token'] = tokenVal $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} signVideo - response: ${JSON.stringify(response)}`) + $.log(`🐍🐢 ${cookieName} signVideo - response: ${JSON.stringify(response)}\n`) _signVideo = JSON.parse(data) resolve() } catch (e) { $.msg(cookieName, `签到视频: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} signVideo - 签到视频失败: ${e}`) - $.log(`❌ ${cookieName} signVideo - response: ${JSON.stringify(response)}`) + $.log(`❌ ${cookieName} signVideo - response: ${JSON.stringify(response)}\n`) resolve() } }) @@ -383,5 +446,32 @@ function signVideo() { } +function OthersAd() { + return new Promise((resolve, reject) => { + const otherVal = 'https://apiwz.midukanshu.com/activity/dividend/videoAdReward' + const url = { + url: otherVal, + headers: {}, + body: drawVal + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + url.headers['token'] = tokenVal + $.post(url, (error, response, data) => { + try { + $.log(`🐍🐢 ${cookieName} OthersAd - response: ${JSON.stringify(response)}\n`) + _signVideo = JSON.parse(data) + resolve() + } catch (e) { + $.msg(cookieName, `额外奖励: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} OthersAd - 额外奖励失败: ${e}`) + $.log(`❌ ${cookieName} OthersAd - response: ${JSON.stringify(response)}\n`) + resolve() + } + }) + }) +} + 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 51f429263fc8413894444089bf27459ab6cd976d Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 16:10:52 +0800 Subject: [PATCH 013/721] --- Task/package.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Task/package.json b/Task/package.json index e8a427d084..60bc42f1ce 100644 --- a/Task/package.json +++ b/Task/package.json @@ -21,10 +21,6 @@ "crypto-js": "^4.0.0", "got": "^11.5.1", "http-server": "^0.12.3", - "node-schedule": "^1.3.2", - "tough-cookie": "^4.0.0", - "download": "^8.0.0", - "request": "^2.88.2", - "request-promise": "^4.2.5" + "tough-cookie": "^4.0.0" } } From 0bd9127808b1f1460e089f3a9edeb18bf11897bc Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 16:16:30 +0800 Subject: [PATCH 014/721] --- .github/workflows/midu_read.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/midu_read.yml b/.github/workflows/midu_read.yml index a05b186e84..6819bef976 100644 --- a/.github/workflows/midu_read.yml +++ b/.github/workflows/midu_read.yml @@ -6,7 +6,7 @@ name: midu_read on: workflow_dispatch: schedule: - - cron: '*/30 1-18/2 * * *' + - cron: '*/1 1-16/2 * * *' jobs: build: From 2f4df1a6ea6c9e3dde13def16c979f7fec393dd6 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 16:19:40 +0800 Subject: [PATCH 015/721] --- Task/midu_Read.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 3da0b20a02..e7183c191a 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -119,7 +119,7 @@ function readTime() { console.log("总计阅读时长"+readTotalMinute / 2+"分钟") readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` - $.msg(cookieName, subTitle, detail) + //$.msg(cookieName, subTitle, detail) } else if ($.getdata('debug') == 'true') { readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` // $.msg(cookieName, subTitle, detail) From 813c1cbdd1bb228719ee49c13b69bcaeeadc09c8 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 16:21:10 +0800 Subject: [PATCH 016/721] --- .github/workflows/midu_read.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/midu_read.yml b/.github/workflows/midu_read.yml index 6819bef976..954ffaefa9 100644 --- a/.github/workflows/midu_read.yml +++ b/.github/workflows/midu_read.yml @@ -6,7 +6,7 @@ name: midu_read on: workflow_dispatch: schedule: - - cron: '*/1 1-16/2 * * *' + - cron: '*/29 1-16/2 * * *' jobs: build: From bbc7bf2e16b0bdf9a43c87a8abdbeb86e28c558d Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 16:36:53 +0800 Subject: [PATCH 017/721] --- .github/workflows/midu_read.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/midu_read.yml b/.github/workflows/midu_read.yml index 954ffaefa9..d0256da7f1 100644 --- a/.github/workflows/midu_read.yml +++ b/.github/workflows/midu_read.yml @@ -6,7 +6,7 @@ name: midu_read on: workflow_dispatch: schedule: - - cron: '*/29 1-16/2 * * *' + - cron: '*/3 1-18 * * *' jobs: build: From 6f26a4685b9e93aeff839e5e53e4585ca13af602 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 16:39:05 +0800 Subject: [PATCH 018/721] --- .github/workflows/midu_read.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/midu_read.yml b/.github/workflows/midu_read.yml index d0256da7f1..6ba0fd7c52 100644 --- a/.github/workflows/midu_read.yml +++ b/.github/workflows/midu_read.yml @@ -6,7 +6,7 @@ name: midu_read on: workflow_dispatch: schedule: - - cron: '*/3 1-18 * * *' + - cron: '*/7 1-18 * * *' jobs: build: From 7a8e9bcec15600c1843582476e61384c81fd080b Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 17:06:33 +0800 Subject: [PATCH 019/721] --- Task/midu_Read.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index e7183c191a..3aba094c99 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -1,11 +1,16 @@ - +/* +MIDU_TOKEN 为 "https://apiwz.midukanshu.com/user/readTimeBase/readTime"此链接请求头内的token; +MIDU_TIME 为 "https://apiwz.midukanshu.com/user/readTimeBase/readTime"此链接请求体,格式为 "dataEncStr=XXX; +MIDU_SIGN 为 "https://apiwz.midukanshu.com/wz/task/" 请求体,格式为 "fullVersion=XXX" +以上全部值不许换行,多账号用#分隔 +*/ const cookieName = '米读阅读时长' const $ = new Env(cookieName) let tokenArr = [], TimeArr = [],SignArr= []; const bind = true; if ($.isNode()) { if (process.env.MIDU_TOKEN && process.env.MIDU_TOKEN.indexOf('#') > -1) { - miduToken = process.env.MIDU_TOKEN.split('#'); + miduToken = process.env.MIDU_TOKEN.split('#'); } else { miduToken = process.env.MIDU_TOKEN.split() }; From 5e409072e0473b7f3e43d2217a68d58650c0db8f Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 17:35:59 +0800 Subject: [PATCH 020/721] --- Task/midu_Read.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 3aba094c99..825db30f09 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -3,6 +3,7 @@ MIDU_TOKEN 为 "https://apiwz.midukanshu.com/user/readTimeBase/readTime"此链 MIDU_TIME 为 "https://apiwz.midukanshu.com/user/readTimeBase/readTime"此链接请求体,格式为 "dataEncStr=XXX; MIDU_SIGN 为 "https://apiwz.midukanshu.com/wz/task/" 请求体,格式为 "fullVersion=XXX" 以上全部值不许换行,多账号用#分隔 +由于运行时间较长,则只在Actions运行 */ const cookieName = '米读阅读时长' const $ = new Env(cookieName) @@ -52,7 +53,7 @@ if ($.isNode()) { return; } if ($.isNode()){ - console.log(`\n============ 脚本执行来自 Github Action ==============\n`) + console.log(`============ 共${tokenArr.length}个米读账号 =============\n`) console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()}=============\n`) }; From 746f0b101a85492863e4cec1fc6513464dcd7f2b Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 17:42:12 +0800 Subject: [PATCH 021/721] --- Task/midu_Read.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 825db30f09..a4096c9f05 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -120,7 +120,7 @@ function readTime() { const readTotalMinute = readtime.data.readTotalMinute const total_coin = readtime.data.total_coin coin == 0 ? detail += `` : detail += `【阅读时长】获得${coin}💰` - console.log("总计金币:"+total_coin+" 现金收益"+readtime.data.popup.corner) + console.log("总计金币:"+total_coin+" 现金收益"+readtime.data.popup.corner+`\n本次获得${coin}`) if (readTotalMinute) { console.log("总计阅读时长"+readTotalMinute / 2+"分钟") readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` From 1e3f091c269029d73b78625e3083a5025498ba44 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 19:46:04 +0800 Subject: [PATCH 022/721] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=B1=B3=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/midu_Read.js | 66 ++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index a4096c9f05..1fcaa60a4d 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -29,17 +29,17 @@ if ($.isNode()) { if (miduToken[item]) { tokenArr.push(miduToken[item]) } - }) + }); Object.keys(ReadBodys).forEach((item) => { if (ReadBodys[item]) { TimeArr.push(ReadBodys[item]) } - }) + }); Object.keys(SignBodys).forEach((item) => { if (SignBodys[item]) { SignArr.push(SignBodys[item]) } - }) + }); } else { tokenArr.push($.getdata('tokenMidu_read')); TimeArr.push($.getdata('senku_readTimebody_midu')); @@ -53,44 +53,45 @@ if ($.isNode()) { return; } if ($.isNode()){ - console.log(`============ 共${tokenArr.length}个米读账号 =============\n`) console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()}=============\n`) + console.log(`============ 共${tokenArr.length}个米读账号 =============\n`) }; for (let i = 0; i < tokenArr.length; i++) { if (tokenArr[i]) { tokenVal = tokenArr[i]; bodyVal = TimeArr[i]; drawVal = SignArr[i]; - //console.log(bodyVal) $.index = i + 1; console.log(`-------------------------\n\n开始【米读账号${$.index}】`) - $.log(`🔔 ${cookieName}`) - tkVal = drawVal.match(/tk=(\w+)/)[1] + tkVal = drawVal.match(/tk=(\w+)/)[1] + console.log(TimeArr) for (i=0;i<10;i++){ - await readTime(); -} - await prizeInfo(); + await readTime() + }; + await prizeInfo(); if (prizeinfo && prizeinfo.data && prizeinfo.data.total_num) { - await prizeTask() - await drawPrize() - } - await addDraw(); - await taskTime(); - await OthersAd(); - await dice_roll(); - await dice_double(); - await userInfo(); - bind ? '' : $.setdata('', 'bind'); - if (bind) { - await Bind() - } - await signDay(); - await signVideo() - } - } + await prizeTask(), + await drawPrize() + }; + await addDraw(); + await taskTime(); + await OthersAd(); + await dice_roll(); + await dice_double(); + await userInfo(); + bind ? '' : $.setdata('', 'bind'); + if (bind) { + await Bind(); + } + await signDay(); + await signVideo() + } + } })() - .catch((e) => $.log(`❌ ${cookieName} 签到失败: ${e}`)) + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + // 阅读时长 @@ -120,9 +121,9 @@ function readTime() { const readTotalMinute = readtime.data.readTotalMinute const total_coin = readtime.data.total_coin coin == 0 ? detail += `` : detail += `【阅读时长】获得${coin}💰` - console.log("总计金币:"+total_coin+" 现金收益"+readtime.data.popup.corner+`\n本次获得${coin}`) + console.log("总计金币:"+total_coin+" 现金收益"+readtime.data.popup.corner) if (readTotalMinute) { - console.log("总计阅读时长"+readTotalMinute / 2+"分钟") + console.log("总计阅读时长"+readTotalMinute / 2+"分钟,本次获得+"+`${coin}金币\n`) readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` //$.msg(cookieName, subTitle, detail) @@ -147,10 +148,11 @@ function readTime() { $.log(`❌ ${cookieName} readTime - response: ${JSON.stringify(response)}\n`) resolve() } - }) + }) },30000) }) } + function drawPrize() { return new Promise((resolve, reject) => { const url = { @@ -216,7 +218,7 @@ function Bind() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' $.post(url, (error, response, data) => { $.setdata('', 'bind') - resolve() + resolve() }) }) } From a00bece2d069a09d392c06629f4e6e54ccb241d5 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 19:53:21 +0800 Subject: [PATCH 023/721] --- Task/midu_Read.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 1fcaa60a4d..7bfe0ce8fa 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -65,7 +65,7 @@ if ($.isNode()) { $.index = i + 1; console.log(`-------------------------\n\n开始【米读账号${$.index}】`) tkVal = drawVal.match(/tk=(\w+)/)[1] - console.log(TimeArr) + //console.log(TimeArr) for (i=0;i<10;i++){ await readTime() }; @@ -80,7 +80,6 @@ if ($.isNode()) { await dice_roll(); await dice_double(); await userInfo(); - bind ? '' : $.setdata('', 'bind'); if (bind) { await Bind(); } @@ -217,7 +216,6 @@ function Bind() { url.headers['Content-Type'] = 'application/x-www-form-urlencoded' url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' $.post(url, (error, response, data) => { - $.setdata('', 'bind') resolve() }) }) From ee22f3fffdf502aef631b33963ec5dad689e3b90 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 20:48:26 +0800 Subject: [PATCH 024/721] --- Task/midu_Read.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 7bfe0ce8fa..1b5c84b6d4 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -66,7 +66,7 @@ if ($.isNode()) { console.log(`-------------------------\n\n开始【米读账号${$.index}】`) tkVal = drawVal.match(/tk=(\w+)/)[1] //console.log(TimeArr) - for (i=0;i<10;i++){ + for (j=0;j<10;j++){ await readTime() }; await prizeInfo(); From 0ce892c8a0365dbfa23eaeb5ab49ba0775334575 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 22:08:05 +0800 Subject: [PATCH 025/721] --- Task/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/package.json b/Task/package.json index 60bc42f1ce..64ae633998 100644 --- a/Task/package.json +++ b/Task/package.json @@ -19,7 +19,7 @@ "homepage": "https://github.com/Sunert/Scripts#readme", "dependencies": { "crypto-js": "^4.0.0", - "got": "^11.5.1", + "got": "^11.7.0", "http-server": "^0.12.3", "tough-cookie": "^4.0.0" } From 3e784f123587ae3d8b8a1945050a53f6a7f66b11 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 18 Oct 2020 22:23:21 +0800 Subject: [PATCH 026/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 131bc63c44..b778db011b 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -177,7 +177,7 @@ else if ($.time('HH')>4&&$.time('HH')<8){ await rotaryCheck(); await earningsInfo(); await showmsg(); - if ($.isNode()&&rotaryres.code !== 10010) + if ($.isNode()&&rotaryres.code !== '10010') if( rotarytimes && rotarytimes%50 == 0 && cash >= 10){ await notify.sendNotify($.name + " " + nick, "您的余额约为"+cash+"元,已可以提现"+'\n'+`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n${detail}`) } From 7a2109cb316c29d989f3f1cd93b68ad91d35b3da Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 19 Oct 2020 01:10:16 +0800 Subject: [PATCH 027/721] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=B1=B3=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/midu_Read.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 1b5c84b6d4..d75d2cb359 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -65,7 +65,6 @@ if ($.isNode()) { $.index = i + 1; console.log(`-------------------------\n\n开始【米读账号${$.index}】`) tkVal = drawVal.match(/tk=(\w+)/)[1] - //console.log(TimeArr) for (j=0;j<10;j++){ await readTime() }; @@ -77,6 +76,7 @@ if ($.isNode()) { await addDraw(); await taskTime(); await OthersAd(); + await ReadDay(); await dice_roll(); await dice_double(); await userInfo(); @@ -221,6 +221,22 @@ function Bind() { }) } +function ReadDay() { + return new Promise((resolve, reject) => { + const url = { + url: 'https://apiwz.midukanshu.com/wz/task/readDays', + headers: {}, + body: drawVal + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + $.post(url, (error, response, data) => { + resolve() + }) + }) +} + // 额外奖励 function addDraw() { @@ -290,7 +306,7 @@ function prizeTask() { url.headers['token'] = tokenVal url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} prizeTask - response: ${JSON.stringify(response)}\n`) @@ -320,7 +336,7 @@ function prizeInfo() { url.headers['token'] = tokenVal url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { // $.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(response)}\n`) @@ -349,7 +365,7 @@ function dice_roll() { } url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} dice_roll - response: ${JSON.stringify(response)}\n`) From c4841f686d91e6d995ca465ba4e23e8013ce1bbe Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 19 Oct 2020 01:24:28 +0800 Subject: [PATCH 028/721] --- Task/midu_Read.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index d75d2cb359..469eaef148 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -129,8 +129,7 @@ function readTime() { } else if ($.getdata('debug') == 'true') { readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` // $.msg(cookieName, subTitle, detail) - - + } } else if (readTime.code != 0) { detail += `【阅读时长】错误代码${readtime.code},错误信息${readtime.message}` @@ -192,7 +191,7 @@ function userInfo() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' $.post(url, (error, response, data) => { try { - // $.log(`🐍🐢 ${cookieName} userInfo - response: ${JSON.stringify(response)}`) + //$.log(`🐍🐢 ${cookieName} userInfo - response: ${JSON.stringify(response)}`) userInfo = JSON.parse(data) resolve() } catch (e) { @@ -293,8 +292,6 @@ function taskTime() { } - - // 观看视频获取抽奖机会 function prizeTask() { return new Promise((resolve, reject) => { @@ -327,11 +324,9 @@ function prizeTask() { // 抽奖信息 function prizeInfo() { return new Promise((resolve, reject) => { - const prizeInfourlVal = 'https://apiwz.midukanshu.com/wz/task/prizeList' const url = { - url: prizeInfourlVal, - headers: {}, - body: drawVal + url: 'https://apiwz.midukanshu.com/wz/task/prizeList?'+drawVal, + headers:{} } url.headers['token'] = tokenVal url.headers['Host'] = 'apiwz.midukanshu.com' From 5289a1a32009e5cb3aa3dfbab4e2ea7439395353 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 19 Oct 2020 21:51:33 +0800 Subject: [PATCH 029/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A5=BF=E7=93=9C?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=8E=BB=E5=B9=BF=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Script/xigua_ad.js | 14 ++++++++++++++ Task/txnews.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 Script/xigua_ad.js diff --git a/Script/xigua_ad.js b/Script/xigua_ad.js new file mode 100644 index 0000000000..8131ab9b79 --- /dev/null +++ b/Script/xigua_ad.js @@ -0,0 +1,14 @@ +/* + 西瓜视频去除内容页广告 +[rewrite_local] +https:\/\/api3-normal-c-hl\.ixigua\.com\/video\/app\/stream\/ url script-response-body xigua_ad.js +[mitm] +hostname = api*-normal-c-hl.ixigua.com +*/ + var obj = JSON.parse($response.body); + for (i=0; i< obj.data.length;i++){ + if(obj.data[i].content.indexOf("ad_label") > -1) { + delete obj.data[i].content + } + } +$done(JSON.stringify(obj)) diff --git a/Task/txnews.js b/Task/txnews.js index 8b82aef69e..67aef58ea4 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -366,7 +366,7 @@ function getTotal() { $.msg("获取收益信息失败‼️", "", error) } else { const Total_Earn = JSON.parse(data) - subTile = '【收益总计】'+Total_Earn.data.wealth[0].title +'金币 '+"钱包: " +Total_Earn.data.wealth[1].title+'元' + subTile = '【收益总计】'+ Total_Earn.data.wealth[0].title +'金币 '+"钱包: " + Total_Earn.data.wealth[1].title+'元' // $.log("钱包收益共计"+obj.data.wealth[1].title+"元") } resolve() From a747df81f0833eadacfc17b3ff4d0136d8797451 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 22 Oct 2020 12:11:28 +0800 Subject: [PATCH 030/721] =?UTF-8?q?=E6=89=93=E5=BC=80=E7=B1=B3=E8=AF=BB?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- Task/midu_Read.js | 3 ++- package.json | 30 ------------------------------ 3 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 package.json diff --git a/README.md b/README.md index 6978379365..f038fbca02 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## 免责声明: -* 本仓库发布的Script项目中涉及的任何解锁和解密分析脚本,仅用于测试和学习研究,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断. +* 本仓库发布的Script项目中涉及的任何解锁和解密分析脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断. * Sunert对任何脚本问题概不负责,包括但不限于由任何脚本错误导致的任何损失或损害. diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 469eaef148..1f6563c81d 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -100,7 +100,7 @@ function readTime() { let request = { url: "https://apiwz.midukanshu.com/user/readTimeBase/readTime", headers: { - 'host': 'apiwz.midukanshu.com', + 'Host': 'apiwz.midukanshu.com', 'versionName': '1.24.0.0918.1649', "User-Agent": "MRSpeedNovel/0918.1649 CFNetwork/1128.0.1 Darwin/19.6.0", "Content-Type": "application/x-www-form-urlencoded; charset=utf-8", @@ -109,6 +109,7 @@ function readTime() { }, body: bodyVal } + console.log("您的:"+tokenVal+'\n'+tkVal+'\n'+bodyVal) $.post(request, (error, response, data) => { try { $.log(`❕ ${cookieName} readTime - response: ${JSON.stringify(response)}\n`) diff --git a/package.json b/package.json deleted file mode 100644 index e8a427d084..0000000000 --- a/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "Sunert", - "version": "1.0.0", - "description": "", - "main": "jingxi.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Sunert/Scripts.git" - }, - "keywords": [], - "author": "", - "license": "ISC", - "bugs": { - "url": "https://github.com/Sunert/Scripts/issues" - }, - "homepage": "https://github.com/Sunert/Scripts#readme", - "dependencies": { - "crypto-js": "^4.0.0", - "got": "^11.5.1", - "http-server": "^0.12.3", - "node-schedule": "^1.3.2", - "tough-cookie": "^4.0.0", - "download": "^8.0.0", - "request": "^2.88.2", - "request-promise": "^4.2.5" - } -} From aa87a71705956396634e3724b0fb37582753916e Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 22 Oct 2020 15:46:17 +0800 Subject: [PATCH 031/721] --- package.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000000..64ae633998 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "Sunert", + "version": "1.0.0", + "description": "", + "main": "jingxi.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Sunert/Scripts.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/Sunert/Scripts/issues" + }, + "homepage": "https://github.com/Sunert/Scripts#readme", + "dependencies": { + "crypto-js": "^4.0.0", + "got": "^11.7.0", + "http-server": "^0.12.3", + "tough-cookie": "^4.0.0" + } +} From 9476771cae407c4c4822cb5070292c9261754bd7 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 22 Oct 2020 21:29:59 +0800 Subject: [PATCH 032/721] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B1=B3=E8=AF=BBMID?= =?UTF-8?q?U=5FTOKEN=E4=B8=BA=E5=AE=8C=E6=95=B4=E8=AF=B7=E6=B1=82=E5=A4=B4?= =?UTF-8?q?=EF=BC=8C=E8=8E=B7=E5=8F=96=E6=96=B9=E6=B3=95=E8=AF=B7=E8=A7=81?= =?UTF-8?q?=E7=94=B5=E6=8A=A5=E7=BE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/midu_Read.js | 106 +++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 67 deletions(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 1f6563c81d..84630e994b 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -1,8 +1,9 @@ /* -MIDU_TOKEN 为 "https://apiwz.midukanshu.com/user/readTimeBase/readTime"此链接请求头内的token; +MIDU_TOKEN 为 "https://apiwz.midukanshu.com/user/readTimeBase/readTime"此链接完整请求头; MIDU_TIME 为 "https://apiwz.midukanshu.com/user/readTimeBase/readTime"此链接请求体,格式为 "dataEncStr=XXX; -MIDU_SIGN 为 "https://apiwz.midukanshu.com/wz/task/" 请求体,格式为 "fullVersion=XXX" -以上全部值不许换行,多账号用#分隔 +MIDU_SIGN 为 "https://apiwz.midukanshu.com/wz/task/" 完整请求体,格式为 "fullVersion=XXX" +以上全部值不许换行,多账号用#分隔; +多账号退出一账号可能某些任务会提示失效,每运行一次,会自动阅读5分钟,即10次阅读 由于运行时间较长,则只在Actions运行 */ const cookieName = '米读阅读时长' @@ -57,17 +58,19 @@ if ($.isNode()) { console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()}=============\n`) console.log(`============ 共${tokenArr.length}个米读账号 =============\n`) }; + for (let i = 0; i < tokenArr.length; i++) { if (tokenArr[i]) { - tokenVal = tokenArr[i]; + headerVal = tokenArr[i]; bodyVal = TimeArr[i]; drawVal = SignArr[i]; $.index = i + 1; + //console.log(tokenArr) console.log(`-------------------------\n\n开始【米读账号${$.index}】`) tkVal = drawVal.match(/tk=(\w+)/)[1] - for (j=0;j<10;j++){ + for (j=0;j<10;j++){ await readTime() - }; + }; await prizeInfo(); if (prizeinfo && prizeinfo.data && prizeinfo.data.total_num) { await prizeTask(), @@ -76,7 +79,6 @@ if ($.isNode()) { await addDraw(); await taskTime(); await OthersAd(); - await ReadDay(); await dice_roll(); await dice_double(); await userInfo(); @@ -99,17 +101,9 @@ function readTime() { setTimeout(()=> { let request = { url: "https://apiwz.midukanshu.com/user/readTimeBase/readTime", - headers: { - 'Host': 'apiwz.midukanshu.com', - 'versionName': '1.24.0.0918.1649', - "User-Agent": "MRSpeedNovel/0918.1649 CFNetwork/1128.0.1 Darwin/19.6.0", - "Content-Type": "application/x-www-form-urlencoded; charset=utf-8", - 'token': tokenVal, - 'tk': tkVal - }, + headers: JSON.parse(headerVal), body: bodyVal } - console.log("您的:"+tokenVal+'\n'+tkVal+'\n'+bodyVal) $.post(request, (error, response, data) => { try { $.log(`❕ ${cookieName} readTime - response: ${JSON.stringify(response)}\n`) @@ -130,7 +124,8 @@ function readTime() { } else if ($.getdata('debug') == 'true') { readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` // $.msg(cookieName, subTitle, detail) - + + } } else if (readTime.code != 0) { detail += `【阅读时长】错误代码${readtime.code},错误信息${readtime.message}` @@ -156,13 +151,8 @@ function drawPrize() { return new Promise((resolve, reject) => { const url = { url: 'https://apiwz.midukanshu.com/wz/task/drawPrize?' + drawVal, - headers: {}, + headers: JSON.parse(headerVal), } - url.headers['token'] = tokenVal - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' - url.headers['tk'] = tkVal $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}\n`) @@ -182,17 +172,13 @@ function drawPrize() { // 用户信息 function userInfo() { return new Promise((resolve, reject) => { - const userInfourlVal = 'https://apiwz.midukanshu.com/wz/user/getInfo?' + bodyVal const url = { - url: userInfourlVal, - headers: {} + url: 'https://apiwz.midukanshu.com/wz/user/getInfo?' + bodyVal, + headers: JSON.parse(headerVal), } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' $.post(url, (error, response, data) => { try { - //$.log(`🐍🐢 ${cookieName} userInfo - response: ${JSON.stringify(response)}`) + $.log(`🐍🐢 ${cookieName} userInfo - response: ${JSON.stringify(response)}`) userInfo = JSON.parse(data) resolve() } catch (e) { @@ -209,28 +195,10 @@ function Bind() { return new Promise((resolve, reject) => { const url = { url: 'http://fisson.1sapp.com/nlx/shareLink/tmpBind', - headers: {}, + headers: JSON.parse(headerVal), body: 'app_id=7&act_type=1&act_name=grad_pupil&invite_code=A1051999596&telephone=' + userInfo.data.mobile } url.headers['Host'] = 'fisson.1sapp.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - $.post(url, (error, response, data) => { - resolve() - }) - }) -} - -function ReadDay() { - return new Promise((resolve, reject) => { - const url = { - url: 'https://apiwz.midukanshu.com/wz/task/readDays', - headers: {}, - body: drawVal - } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { resolve() }) @@ -248,7 +216,7 @@ function addDraw() { } url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}\n`) @@ -275,7 +243,7 @@ function taskTime() { } url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} taskTime - response: ${JSON.stringify(response)}\n`) @@ -293,6 +261,8 @@ function taskTime() { } + + // 观看视频获取抽奖机会 function prizeTask() { return new Promise((resolve, reject) => { @@ -301,10 +271,10 @@ function prizeTask() { url: prizeTaskurlVal, headers: {}, } - url.headers['token'] = tokenVal + //url.headers['token'] = tokenVal url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} prizeTask - response: ${JSON.stringify(response)}\n`) @@ -325,17 +295,19 @@ function prizeTask() { // 抽奖信息 function prizeInfo() { return new Promise((resolve, reject) => { + const prizeInfourlVal = 'https://apiwz.midukanshu.com/wz/task/prizeList' const url = { - url: 'https://apiwz.midukanshu.com/wz/task/prizeList?'+drawVal, - headers:{} + url: prizeInfourlVal, + headers: {}, + body: drawVal } - url.headers['token'] = tokenVal + //url.headers['token'] = tokenVal url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { - // $.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(response)}\n`) + $.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(response)}\n`) if (data) { prizeinfo = JSON.parse(data) } @@ -361,7 +333,7 @@ function dice_roll() { } url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} dice_roll - response: ${JSON.stringify(response)}\n`) @@ -390,8 +362,8 @@ function dice_double() { } url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - url.headers['token'] = tokenVal + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + //url.headers['token'] = tokenVal $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} dice_double - response: ${JSON.stringify(response)}\n`) @@ -416,10 +388,10 @@ function signDay() { url: "https://apiwz.midukanshu.com/wz/task/signInV2?"+ drawVal, headers: {}, } - url.headers['token'] = tokenVal + //url.headers['token'] = tokenVal url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} signDay - response: ${JSON.stringify(response)}\n`) @@ -446,8 +418,8 @@ function signVideo() { } url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - url.headers['token'] = tokenVal + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + //url.headers['token'] = tokenVal $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} signVideo - response: ${JSON.stringify(response)}\n`) @@ -474,8 +446,8 @@ function OthersAd() { } url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - url.headers['token'] = tokenVal + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + //url.headers['token'] = tokenVal $.post(url, (error, response, data) => { try { $.log(`🐍🐢 ${cookieName} OthersAd - response: ${JSON.stringify(response)}\n`) From 189fc6871a73c1e52d9b8001f1c5f0c905eb3298 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 24 Oct 2020 21:01:39 +0800 Subject: [PATCH 033/721] updata --- .github/workflows/midu_read.yml | 2 +- Task/Youth_Read.js | 15 ++- Task/dianshijia.js | 8 +- Task/midu_Read.js | 209 +++++++++++++++++++------------- Task/txnews.js | 4 +- Task/youth.js | 5 +- 6 files changed, 139 insertions(+), 104 deletions(-) diff --git a/.github/workflows/midu_read.yml b/.github/workflows/midu_read.yml index 6ba0fd7c52..4889afdd9d 100644 --- a/.github/workflows/midu_read.yml +++ b/.github/workflows/midu_read.yml @@ -6,7 +6,7 @@ name: midu_read on: workflow_dispatch: schedule: - - cron: '*/7 1-18 * * *' + - cron: '*/15 1-14 * * *' jobs: build: diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 54157ef15b..1fb9c3c951 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -8,7 +8,7 @@ Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk030 */ -let s = 30000 //等待延迟30s +//let s = 30000 //等待延迟30s const $ = new Env("中青看点") //const notify = $.isNode() ? require('./sendNotify') : ''; let ReadArr = [], YouthBody = "",readscore = 0; @@ -40,7 +40,7 @@ let ReadArr = [], YouthBody = "",readscore = 0; $.index = i + 1; console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`) } - await AutoRead(); + await AutoRead(); } console.log(`-------------------------\n\n中青看点共完成${$.index}次阅读,共计获得${readscore}个青豆,阅读请求全部结束`) })() @@ -50,7 +50,6 @@ let ReadArr = [], YouthBody = "",readscore = 0; function AutoRead() { return new Promise((resolve, reject) => { - setTimeout(()=> { let url = { url: `https://ios.baertt.com/v5/article/complete.json`, headers: { @@ -58,12 +57,13 @@ function AutoRead() { }, body: articlebody }; - $.post(url, (error, response, data) => { + $.post(url, async(error, response, data) => { let readres = JSON.parse(data); - console.log(data) + //console.log(data) if (readres.error_code == '0' && typeof readres.items.read_score === 'number') { - console.log(`\n本次阅读获得${readres.items.read_score}个青豆,即将开始下次阅读\n`) - readscore += readres.items.read_score + console.log(`\n本次阅读获得${readres.items.read_score}个青豆,请等待30s后执行下一次阅读\n`); + readscore += readres.items.read_score; + await $.wait(30000); } else if (readres.error_code == '0' && typeof readres.items.score === 'number') { console.log(`\n本次阅读获得${readres.items.score}个青豆,即将开始下次阅读\n`) @@ -77,7 +77,6 @@ function AutoRead() { } resolve() }) - },s) }) } diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 3ebf16ea2a..de6428dbdb 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -44,7 +44,7 @@ const gametimes = "1999"; //游戏时长 const logs = 0 //响应日志开关,默认关闭 const $ = new Env('电视家') const notify = $.isNode() ? require('./sendNotify') : ''; - let sleeping = ""; +let sleeping = "",detail=``,subTitle=``; const dianshijia_API = 'http://api.gaoqingdianshi.com/api' let tokenArr = [], DsjurlArr = [], DrawalArr = [],drawalVal; if ($.isNode()) { @@ -206,7 +206,7 @@ function signinfo() { $.get({ url: `${dianshijia_API}/v4/sign/get`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { if(logs)$.log(`${$.name}, 签到信息: ${data}\n`) - const result = JSON.parse(data) + let result = JSON.parse(data) if (result.errCode == 0) { var d = `${result.data.currentDay}` @@ -226,7 +226,7 @@ function total() { return new Promise((resolve, reject) => { $.get({url: `${dianshijia_API}/coin/info`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { if(logs)$.log(`${$.name}, 总计: ${data}\n`) - const result = JSON.parse(data) + let result = JSON.parse(data) subTitle = `待兑换金币: ${result.data.coin} ` try{ if(result.data.tempCoin){ @@ -247,7 +247,7 @@ function cash() { $.get({ url: `${dianshijia_API}/cash/info`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { if(logs)$.log(`现金: ${data}\n`) - const cashresult = JSON.parse(data) + let cashresult = JSON.parse(data) subTitle += '现金:'+ cashresult.data.amount/100+'元 额度:'+cashresult.data.withdrawalQuota/100+'元' cashtotal = cashresult.data.totalWithdrawn/100 resolve() diff --git a/Task/midu_Read.js b/Task/midu_Read.js index 84630e994b..feb24d3776 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -3,7 +3,7 @@ MIDU_TOKEN 为 "https://apiwz.midukanshu.com/user/readTimeBase/readTime"此链 MIDU_TIME 为 "https://apiwz.midukanshu.com/user/readTimeBase/readTime"此链接请求体,格式为 "dataEncStr=XXX; MIDU_SIGN 为 "https://apiwz.midukanshu.com/wz/task/" 完整请求体,格式为 "fullVersion=XXX" 以上全部值不许换行,多账号用#分隔; -多账号退出一账号可能某些任务会提示失效,每运行一次,会自动阅读5分钟,即10次阅读 +多账号退出一账号可能某些任务会提示失效 由于运行时间较长,则只在Actions运行 */ const cookieName = '米读阅读时长' @@ -55,7 +55,7 @@ if ($.isNode()) { } if ($.isNode()){ console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()}=============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) console.log(`============ 共${tokenArr.length}个米读账号 =============\n`) }; @@ -68,6 +68,7 @@ if ($.isNode()) { //console.log(tokenArr) console.log(`-------------------------\n\n开始【米读账号${$.index}】`) tkVal = drawVal.match(/tk=(\w+)/)[1] + await userInfo(); for (j=0;j<10;j++){ await readTime() }; @@ -79,9 +80,9 @@ if ($.isNode()) { await addDraw(); await taskTime(); await OthersAd(); + await dice_addnum(); await dice_roll(); await dice_double(); - await userInfo(); if (bind) { await Bind(); } @@ -98,15 +99,14 @@ if ($.isNode()) { // 阅读时长 function readTime() { return new Promise((resolve, reject) => { - setTimeout(()=> { let request = { url: "https://apiwz.midukanshu.com/user/readTimeBase/readTime", headers: JSON.parse(headerVal), body: bodyVal } - $.post(request, (error, response, data) => { + $.post(request, async(error, response, data) => { try { - $.log(`❕ ${cookieName} readTime - response: ${JSON.stringify(response)}\n`) + //$.log(`❕ ${cookieName} readTime - response: ${JSON.stringify(data)}\n`) readtime = JSON.parse(data) let subTitle = '' let detail = '' @@ -115,35 +115,24 @@ function readTime() { const readTotalMinute = readtime.data.readTotalMinute const total_coin = readtime.data.total_coin coin == 0 ? detail += `` : detail += `【阅读时长】获得${coin}💰` - console.log("总计金币:"+total_coin+" 现金收益"+readtime.data.popup.corner) - if (readTotalMinute) { - console.log("总计阅读时长"+readTotalMinute / 2+"分钟,本次获得+"+`${coin}金币\n`) + console.log("总计阅读时长"+readTotalMinute / 2+"分钟,本次获得+"+`${coin}金币,请等待30s后执行下一次阅读\n`) readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` + await $.wait(30000); //$.msg(cookieName, subTitle, detail) - } else if ($.getdata('debug') == 'true') { - readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` - // $.msg(cookieName, subTitle, detail) - - } } else if (readTime.code != 0) { detail += `【阅读时长】错误代码${readtime.code},错误信息${readtime.message}` $.msg(cookieName, subTitle, detail) - } else { - detail += '【阅读时长】失败' - $.msg(cookieName, subTitle, detail) - } + } - resolve() } catch (e) { $.msg(cookieName, `阅读时长: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} readTime - 签到失败: ${e}`) - $.log(`❌ ${cookieName} readTime - response: ${JSON.stringify(response)}\n`) - resolve() + $.log(`❌ ${cookieName} readTime - response: ${JSON.stringify(data)}\n`) } + resolve() }) - },30000) }) } @@ -155,17 +144,19 @@ function drawPrize() { } $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}\n`) - if (data) { - drawprize = JSON.parse(data) - } - resolve() + $.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(data)}\n`) + drawprize = JSON.parse(data) + if(drawprize.code==0){ + console.log("转盘抽奖任务:"+drawprize.data.title) + } + } catch (e) { // $.msg(cookieName, `抽奖: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} drawPrize - 抽奖失败: ${e}`) - $.log(`❌ ${cookieName} drawPrize - response: ${JSON.stringify(response)}\n`) - resolve() + $.log(`❌ ${cookieName} drawPrize - response: ${JSON.stringify(data)}\n`) + } + resolve() }) }) } @@ -173,18 +164,27 @@ function drawPrize() { function userInfo() { return new Promise((resolve, reject) => { const url = { - url: 'https://apiwz.midukanshu.com/wz/user/getInfo?' + bodyVal, + url: 'https://apiwz.midukanshu.com/wz/user/getInfo', headers: JSON.parse(headerVal), + body: bodyVal } $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} userInfo - response: ${JSON.stringify(response)}`) - userInfo = JSON.parse(data) + //$.log(`🐍🐢 ${cookieName} userInfo - response: ${JSON.stringify(data)}`) + userinfo = JSON.parse(data) + if (userinfo.code==0){ + nick = userinfo.data.nickname + total_coin = userinfo.data.goldCoin + corner = userinfo.data.goldCoinMoney + invite_code = userinfo.data.invite_code + today_coin = userinfo.data.todayGoldCoin + console.log("总计金币:"+total_coin+" 现金收益"+corner+'\n您今日所得总金币为'+ today_coin+' 您的邀请码为'+ invite_code+'\n') + } resolve() } catch (e) { $.msg(cookieName, `获取用户信息: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} userInfo - 获取用户信息失败: ${e}`) - $.log(`❌ ${cookieName} userInfo - response: ${JSON.stringify(response)}`) + $.log(`❌ ${cookieName} userInfo - data: ${JSON.stringify(data)}`) resolve() } }) @@ -196,7 +196,7 @@ function Bind() { const url = { url: 'http://fisson.1sapp.com/nlx/shareLink/tmpBind', headers: JSON.parse(headerVal), - body: 'app_id=7&act_type=1&act_name=grad_pupil&invite_code=A1051999596&telephone=' + userInfo.data.mobile + body: 'app_id=7&act_type=1&act_name=grad_pupil&invite_code=A1051999596&telephone=' + userinfo.data.mobile } url.headers['Host'] = 'fisson.1sapp.com' $.post(url, (error, response, data) => { @@ -219,15 +219,16 @@ function addDraw() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(response)}\n`) - if (data) { + // $.log(`🐍🐢 ${cookieName} addDraw - response: ${JSON.stringify(data)}\n`) add_Draw = JSON.parse(data) - } + if(add_Draw.code==0){ + console.log("额外奖励:"+add_Draw.data.msg) + } resolve() } catch (e) { // $.msg(cookieName, `额外奖励: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} addDraw - 额外奖励失败: ${e}`) - $.log(`❌ ${cookieName} addDraw - response: ${JSON.stringify(response)}\n`) + $.log(`❌ ${cookieName} addDraw - response: ${JSON.stringify(data)}\n`) resolve() } }) @@ -246,14 +247,15 @@ function taskTime() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} taskTime - response: ${JSON.stringify(response)}\n`) - if (data) { - drawprize = JSON.parse(data) - } + // $.log(`🐍🐢 ${cookieName} taskTime - response: ${JSON.stringify(data)}\n`) + _taskTime = JSON.parse(data) + if(_taskTime.code==0){ + console.log("定时任务:"+"+"+_taskTime.data.amount) + } resolve() } catch (e) { - $.log(`❌ ${cookieName} taskTime - 抽奖失败: ${e}`) - $.log(`❌ ${cookieName} taskTime - response: ${JSON.stringify(response)}\n`) + $.log(`❌ ${cookieName} taskTime - 定时任务失败: ${e}`) + $.log(`❌ ${cookieName} taskTime - response: ${JSON.stringify(data)}\n`) resolve() } }) @@ -261,8 +263,6 @@ function taskTime() { } - - // 观看视频获取抽奖机会 function prizeTask() { return new Promise((resolve, reject) => { @@ -277,15 +277,16 @@ function prizeTask() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} prizeTask - response: ${JSON.stringify(response)}\n`) - if (data) { - prizetask = JSON.parse(data) - } + // $.log(`🐍🐢 ${cookieName} prizeTask - response: ${JSON.stringify(data)}\n`) + prizetask = JSON.parse(data) + if(prizetask.code==0){ + console.log("抽奖次数: "+prizetask.data.title) + } resolve() } catch (e) { // $.msg(cookieName, `观看视频抽奖: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} prizeTask - 观看视频抽奖失败: ${e}`) - $.log(`❌ ${cookieName} prizeTask - response: ${JSON.stringify(response)}\n`) + $.log(`❌ ${cookieName} prizeTask - response: ${JSON.stringify(data)}\n`) resolve() } }) @@ -295,27 +296,26 @@ function prizeTask() { // 抽奖信息 function prizeInfo() { return new Promise((resolve, reject) => { - const prizeInfourlVal = 'https://apiwz.midukanshu.com/wz/task/prizeList' const url = { - url: prizeInfourlVal, + url: 'https://apiwz.midukanshu.com/wz/task/prizeList', headers: {}, body: drawVal } - //url.headers['token'] = tokenVal url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(response)}\n`) + //$.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(data)}\n`) if (data) { prizeinfo = JSON.parse(data) + console.log("今日抽奖信息:"+prizeinfo.data.btnText) } resolve() } catch (e) { // $.msg(cookieName, `抽奖信息: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} prizeInfo - 抽奖信息失败: ${e}`) - $.log(`❌ ${cookieName} prizeInfo - response: ${JSON.stringify(response)}\n`) + $.log(`❌ ${cookieName} prizeInfo - response: ${JSON.stringify(data)}\n`) resolve() } }) @@ -325,9 +325,8 @@ function prizeInfo() { // 掷骰子 function dice_roll() { return new Promise((resolve, reject) => { - const dice_roll_urlVal = 'https://apiwz.midukanshu.com/wz/dice/roll' const url = { - url: dice_roll_urlVal, + url: 'https://apiwz.midukanshu.com/wz/dice/roll', headers: {}, body: drawVal } @@ -336,15 +335,18 @@ function dice_roll() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} dice_roll - response: ${JSON.stringify(response)}\n`) - if (JSON.parse(data).code == 0) { - rollList=JSON.parse(data) + // $.log(`🐍🐢 ${cookieName} dice_roll - response: ${JSON.stringify(data)}\n`) + rollList=JSON.parse(data) + if (rollList.code == 0) { + console.log("掷骰子获得"+rollList.data.roll_coin+"金币") + } else if (rollList.code == '-10203'){ + console.log("掷骰子任务:"+rollList.message) } resolve() } catch (e) { $.msg(cookieName, `掷骰子: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} dice_roll - 掷骰子失败: ${e}`) - $.log(`❌ ${cookieName} dice_roll - response: ${JSON.stringify(response)}\n`) + $.log(`❌ ${cookieName} dice_roll - response: ${JSON.stringify(data)}\n`) resolve() } }) @@ -354,9 +356,8 @@ function dice_roll() { // 骰子双倍奖励 function dice_double() { return new Promise((resolve, reject) => { - const dice_double_urlVal = 'https://apiwz.midukanshu.com/wz/dice/doubleReward' const url = { - url: dice_double_urlVal, + url: 'https://apiwz.midukanshu.com/wz/dice/doubleReward', headers: {}, body: drawVal } @@ -366,20 +367,52 @@ function dice_double() { //url.headers['token'] = tokenVal $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} dice_double - response: ${JSON.stringify(response)}\n`) - if (JSON.parse(data).code == 0) { - doubleList=JSON.parse(data) + $.log(`🐍🐢 ${cookieName} dice_double - response: ${JSON.stringify(data)}\n`) + doubleList=JSON.parse(data) + if (doubleList.code == 0) { + console.log("骰子双倍奖励:"+doubleList.message) + } else if (doubleList.code == '-10205'){ + console.log("骰子双倍奖励:"+doubleList.message) } resolve() } catch (e) { $.msg(cookieName, `骰子双倍奖励: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} dice_double - 骰子双倍奖励失败: ${e}`) - $.log(`❌ ${cookieName} dice_double - response: ${JSON.stringify(response)}\n`) + $.log(`❌ ${cookieName} dice_double - response: ${JSON.stringify(data)}\n`) + resolve() + } + }) + }) +} +//获取骰子次数: +function dice_addnum() { + return new Promise((resolve, reject) => { + const dice_addnum_urlVal = 'https://apiwz.midukanshu.com/wz/dice/addChangeNumByRewardVideo?' + drawVal + const url = { + url: dice_addnum_urlVal, + headers: {} + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 miduapp qapp' + $.post(url, (error, response, data) => { + try { + // $.log(`🐍🐢 ${cookieName} dice_addnum - response: ${JSON.stringify(data)}`) + diceaddnum=JSON.parse(data) + if(diceaddnum.code=='-10208'){ + console.log("获取骰子次数:"+diceaddnum.message) + } + resolve() + } catch (e) { + $.msg(cookieName, `获取骰子次数: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} dice_addnum - 获取骰子次数失败: ${e}`) + $.log(`❌ ${cookieName} dice_addnum - response: ${JSON.stringify(data)}`) resolve() } }) }) } + // 每日签到 function signDay() { @@ -394,13 +427,16 @@ function signDay() { url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} signDay - response: ${JSON.stringify(response)}\n`) + //$.log(`🐍🐢 ${cookieName} signDay - response: ${JSON.stringify(data)}\n`) _signDay = JSON.parse(data) + if(_signDay.code==0){ + console.log("每日签到:"+_signDay.data.amount+"金币") + } resolve() } catch (e) { $.msg(cookieName, `签到结果: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} signDay - 签到失败: ${e}`) - $.log(`❌ ${cookieName} signDay - response: ${JSON.stringify(response)}\n`) + $.log(`❌ ${cookieName} signDay - response: ${JSON.stringify(data)}\n`) resolve() } }) @@ -409,26 +445,26 @@ function signDay() { // 签到视频奖励 function signVideo() { - return new Promise((resolve, reject) => { - const signVideourlVal = 'https://apiwz.midukanshu.com/wz/task/signVideoReward' + return new Promise((resolve, reject) => { const url = { - url: signVideourlVal, + url: 'https://apiwz.midukanshu.com/wz/task/signVideoReward', headers: {}, body: drawVal } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' - //url.headers['token'] = tokenVal $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} signVideo - response: ${JSON.stringify(response)}\n`) + // $.log(`🐍🐢 ${cookieName} signVideo - response: ${JSON.stringify(data)}\n`) _signVideo = JSON.parse(data) + if (_signVideo.code == 0) { + console.log("签到视频奖励得"+_signVideo.data.amount+"金币") + } else { + console.log(_signVideo.message) + } resolve() } catch (e) { $.msg(cookieName, `签到视频: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} signVideo - 签到视频失败: ${e}`) - $.log(`❌ ${cookieName} signVideo - response: ${JSON.stringify(response)}\n`) + $.log(`❌ ${cookieName} signVideo - response: ${JSON.stringify(data)}\n`) resolve() } }) @@ -438,25 +474,24 @@ function signVideo() { function OthersAd() { return new Promise((resolve, reject) => { - const otherVal = 'https://apiwz.midukanshu.com/activity/dividend/videoAdReward' + const otherVal = 'https://apiwz.midukanshu.com/activity/dividend/videoAdReward' const url = { url: otherVal, headers: {}, body: drawVal } - url.headers['Host'] = 'apiwz.midukanshu.com' - url.headers['Content-Type'] = 'application/x-www-form-urlencoded' - url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' - //url.headers['token'] = tokenVal $.post(url, (error, response, data) => { try { - $.log(`🐍🐢 ${cookieName} OthersAd - response: ${JSON.stringify(response)}\n`) - _signVideo = JSON.parse(data) + // $.log(`🐍🐢 ${cookieName} OthersAd - response: ${JSON.stringify(data)}\n`) + _OthersAd = JSON.parse(data) + if(_OthersAd.code==0){ + console.log("额外奖励: "+_OthersAd.data.msg) + } resolve() } catch (e) { $.msg(cookieName, `额外奖励: 失败`, `说明: ${e}`) $.log(`❌ ${cookieName} OthersAd - 额外奖励失败: ${e}`) - $.log(`❌ ${cookieName} OthersAd - response: ${JSON.stringify(response)}\n`) + $.log(`❌ ${cookieName} OthersAd - response: ${JSON.stringify(data)}\n`) resolve() } }) diff --git a/Task/txnews.js b/Task/txnews.js index 67aef58ea4..2bcfcb9232 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -52,8 +52,8 @@ let notifyInterval =$.getdata('notifynum')||50; //阅读篇数间隔通知开为 const TX_HOST = 'https://api.inews.qq.com/activity/v1/' let SignArr = [],SignUrl = ""; cookiesArr = [],CookieTxnews = ""; - VideoArr = [],SignUrl = "",order = ""; - + VideoArr = [],SignUrl = "",order = "", + detail = ``, subTitle = ``; if ($.isNode()) { if (process.env.TXNEWS_COOKIE && process.env.TXNEWS_COOKIE.indexOf('&') > -1) { diff --git a/Task/youth.js b/Task/youth.js index b778db011b..b6d5983c79 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -70,8 +70,9 @@ let logs = $.getdata('zqlogs')||false, signresult; let cookiesArr = [], signheaderVal = '', readArr = [], articlebodyVal ='', timeArr = [], timebodyVal = '', - redpArr = [], redpbodyVal = ''; -let CookieYouth = [] ,ARTBODYs = [], + redpArr = [], redpbodyVal = '', + detail = ``, subTitle = ``; +let CookieYouth = [], ARTBODYs = [], REDBODYs = [], READTIME = []; if ($.isNode()) { if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('#') > -1) { From ad227b55b1f3ccb6f92a35d39185bd8c061d4039 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 27 Oct 2020 20:01:15 +0800 Subject: [PATCH 034/721] --- Task/jdCookie.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Task/jdCookie.js b/Task/jdCookie.js index 3063efcefa..929040fec3 100644 --- a/Task/jdCookie.js +++ b/Task/jdCookie.js @@ -18,9 +18,10 @@ if (process.env.JD_COOKIE) { } else { CookieJDs = process.env.JD_COOKIE.split(); } - console.log(`\n==================脚本执行来自 github action=====================\n`) - console.log(`==================脚本执行-国际标准时间(UTC):${new Date().toLocaleString()}=====================\n`) - console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()}=====================\n`) + console.log(`\n==================== 共有${CookieJDs.length}个京东账号Cookie =========`); + console.log(`\n================== 脚本执行来自 github action =====================\n`) + console.log(`================== 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =====================\n`) + console.log(`================== 脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =====================\n`) } for (let i = 0; i < CookieJDs.length; i++) { const index = (i + 1 === 1) ? '' : (i + 1); From 4646570a9b0678effa094c90f0ac93da04741326 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 28 Oct 2020 00:16:57 +0800 Subject: [PATCH 035/721] --- Task/sunert.boxjs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 3054d95b53..f47570e871 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -105,7 +105,7 @@ "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" }], "author": "@sunert", "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": ["https://raw.githubusercontent.com/Sunert/Quantumult-X/master/Rules/Images/ICON/tvpreview.png", "https://raw.githubusercontent.com/Sunert/Quantumult-X/master/Rules/Images/ICON/tvpreview.png"], + "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/tvpreview.js" }, { From fe86ee317f0bcbefe8b8098dc67f7de2464735de Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 28 Oct 2020 00:26:28 +0800 Subject: [PATCH 036/721] --- Task/sunert.boxjs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index f47570e871..c0893ed4bb 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -105,7 +105,7 @@ "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" }], "author": "@sunert", "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], + "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/tvpreview.js" }, { From b1688fc5e91c55d8141307a261836fa955460ff5 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 30 Oct 2020 21:27:39 +0800 Subject: [PATCH 037/721] --- Task/Env.js | 18 +++++++++++------- Task/Env.min.js | 2 +- Task/dianshijia.js | 18 ++++++++++++++++-- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/Task/Env.js b/Task/Env.js index ee7e7d8197..b23d708ca3 100644 --- a/Task/Env.js +++ b/Task/Env.js @@ -292,7 +292,9 @@ function Env(name, opts) { try { if (resp.headers['set-cookie']) { const ck = resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString() - this.ckjar.setCookieSync(ck, null) + if (ck) { + this.ckjar.setCookieSync(ck, null) + } nextOpts.cookieJar = this.ckjar } } catch (e) { @@ -433,12 +435,14 @@ function Env(name, opts) { $notify(title, subt, desc, toEnvOpts(opts)) } } - let logs = ['', '==============📣系统通知📣=============='] - logs.push(title) - subt ? logs.push(subt) : '' - desc ? logs.push(desc) : '' - console.log(logs.join('\n')) - this.logs = this.logs.concat(logs) + if (!this.isMuteLog) { + let logs = ['', '==============📣系统通知📣=============='] + logs.push(title) + subt ? logs.push(subt) : '' + desc ? logs.push(desc) : '' + console.log(logs.join('\n')) + this.logs = this.logs.concat(logs) + } } log(...logs) { diff --git a/Task/Env.min.js b/Task/Env.min.js index 5ddd120b1f..21673d2cd5 100644 --- a/Task/Env.min.js +++ b/Task/Env.min.js @@ -1 +1 @@ -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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 diff --git a/Task/dianshijia.js b/Task/dianshijia.js index de6428dbdb..15777e0258 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -103,6 +103,7 @@ if (isGetCookie = typeof $request !== 'undefined') { console.log(`开始【电视家${$.index}】`) await signin(); // 签到 await signinfo(); // 签到信息 + await Addsign(); // 额外奖励,默认额度 if (drawalVal != undefined){ await Withdrawal() } else { @@ -121,7 +122,7 @@ if (isGetCookie = typeof $request !== 'undefined') { } } })() - .catch((e) => $.logErr(e)) + .catch((error) => $.logErr(error)) .finally(() => $.done()) function GetCookie() { @@ -483,4 +484,17 @@ function getGametime() { resolve() }) } -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 Addsign() { + return new Promise((resolve, reject) => { + let url = { + url: `${dianshijia_API}/sign/chooseAdditionalReward?rewardId=55`, + headers: JSON.parse(signheaderVal), + } + $.get(url, (error, response, data) => { + if(logs)$.log(`额外签到: ${data}\n`) + }) +resolve() + }) +} + +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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 0fff5f36bdf5ff017857d7f4b27ac5a7a4b7f36a Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 2 Nov 2020 15:02:26 +0800 Subject: [PATCH 038/721] --- Task/weibo.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index c7853188de..c264a5c238 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -104,12 +104,12 @@ if ($.isNode()) { payheaderVal = payArr[i]; $.index = i + 1; console.log(`\n开始【微博签到${$.index}】`) - await getsign(); - await doCard(); - if (payheaderVal !== undefined){ - await paysign() + await getsign(); + await doCard(); + if (payheaderVal !== undefined){ + await paysign() } else { - paybag = `【钱包签到】❌ 未获取Cooiekie` + paybag = `【钱包签到】❌ 未获取Cooiekie` }; $.msg($.name, nickname, wbsign+paybag+docard) if ($.isNode()) { @@ -193,6 +193,7 @@ function paysign() { }, (error, response, data) => { try{ let result = JSON.parse(data) + console.log(data) if (result.status == 1){ paybag = `【微博钱包】 ✅ +`+ result.score+' 分\n' } From eb5507dba32178b6f2df608c1da7fb3c92009dd6 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 2 Nov 2020 15:43:06 +0800 Subject: [PATCH 039/721] --- Task/weibo.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index c264a5c238..40bbcedb77 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -194,10 +194,11 @@ function paysign() { try{ let result = JSON.parse(data) console.log(data) - if (result.status == 1){ + + if (result.code == 0 && result.status == 1){ paybag = `【微博钱包】 ✅ +`+ result.score+' 分\n' } - else if (result.code == 100000){ + else if (result.code == '100000'){ paybag = `【微博钱包】 🔁\n` } } From c6b0862d45ba11e594e7ae88b278e9e64d26c553 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 2 Nov 2020 15:43:48 +0800 Subject: [PATCH 040/721] --- Task/weibo.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index 40bbcedb77..00671942ab 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -201,11 +201,12 @@ function paysign() { else if (result.code == '100000'){ paybag = `【微博钱包】 🔁\n` } + resolve() } catch(error){ paybag = `【钱包签到】❌ Cookie失效`+'\n' + resolve() } - resolve() }) }) } From 47a39392454c1b4317d89723aeac081bf2a78103 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 2 Nov 2020 15:52:55 +0800 Subject: [PATCH 041/721] --- Task/weibo.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index 00671942ab..2d9d984dd0 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -111,10 +111,7 @@ if ($.isNode()) { } else { paybag = `【钱包签到】❌ 未获取Cooiekie` }; - $.msg($.name, nickname, wbsign+paybag+docard) - if ($.isNode()) { - await notify.sendNotify($.name, nickname+'\n'+ wbsign+paybag+docard) - } + await showmsg() } } })() @@ -210,5 +207,15 @@ function paysign() { }) }) } +async function showmsg() { + if (paybag) { + $.msg($.name, nickname, wbsign+paybag+docard); + if ($.isNode()) { + await notify.sendNotify($.name, nickname+'\n'+ wbsign+paybag+docard) + } + } +} + + 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 b14b0a361e799b0368c04e7464b9c967f2c6978e Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 2 Nov 2020 15:56:20 +0800 Subject: [PATCH 042/721] --- Task/weibo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index 2d9d984dd0..e2df028743 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -50,7 +50,7 @@ hostname = api.weibo.cn, pay.sc.weibo.com const $ = new Env('新浪微博') const notify = $.isNode() ? require('./sendNotify') : ''; -let tokenArr = [],payArr = []; +let tokenArr = [],payArr = [],paybag; if (isGetCookie = typeof $request !==`undefined`) { GetCookie(); From 5ab112405353edf680402cf17d9d345047dbd923 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 2 Nov 2020 16:00:08 +0800 Subject: [PATCH 043/721] --- Task/weibo.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index e2df028743..a90268366c 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -188,20 +188,17 @@ function paysign() { return new Promise((resolve, reject) =>{ $.post({url: `https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do?_=${$.startTime+10}`,headers: JSON.parse(payheaderVal) }, (error, response, data) => { - try{ let result = JSON.parse(data) console.log(data) - - if (result.code == 0 && result.status == 1){ + if (result.status == 1){ paybag = `【微博钱包】 ✅ +`+ result.score+' 分\n' } - else if (result.code == '100000'){ + else if (result.status == '2'){ paybag = `【微博钱包】 🔁\n` } - resolve() - } - catch(error){ - paybag = `【钱包签到】❌ Cookie失效`+'\n' + else { + paybag = `【钱包签到】❌ Cookie失效`+'\n' + } resolve() } }) From 26280e18356dacba915b30636c6e227bfc1ae4f2 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 2 Nov 2020 16:01:52 +0800 Subject: [PATCH 044/721] --- Task/weibo.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index a90268366c..d9ff5be0fb 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -200,7 +200,6 @@ function paysign() { paybag = `【钱包签到】❌ Cookie失效`+'\n' } resolve() - } }) }) } From 3a777b2fa70ea362e171ed5a295b7ea2b97f9057 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 2 Nov 2020 16:14:44 +0800 Subject: [PATCH 045/721] =?UTF-8?q?fix=20=E5=BE=AE=E5=8D=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/weibo.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index d9ff5be0fb..6004d19ef8 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -189,7 +189,6 @@ function paysign() { $.post({url: `https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do?_=${$.startTime+10}`,headers: JSON.parse(payheaderVal) }, (error, response, data) => { let result = JSON.parse(data) - console.log(data) if (result.status == 1){ paybag = `【微博钱包】 ✅ +`+ result.score+' 分\n' } From f4e69d05482f4b8353527a11f6dfff02987c4a9a Mon Sep 17 00:00:00 2001 From: Flydreams <543676667@163.com> Date: Mon, 2 Nov 2020 22:18:16 +0800 Subject: [PATCH 046/721] add test.yml for Gitee Go created_at: 2020-11-02 22:18:16 --- .workflow/test.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .workflow/test.yml diff --git a/.workflow/test.yml b/.workflow/test.yml new file mode 100644 index 0000000000..8fbd35db80 --- /dev/null +++ b/.workflow/test.yml @@ -0,0 +1,23 @@ +# ======================================================== +# npm 构建参考流水线样例 +# 功能:输出当前 npm 构建环境的环境信息 +# ======================================================== +name: gitee-go-npm-example # 定义一个唯一 ID 标识为 gitee-go-npm-example,名称为 “npm-流水线示例” 的流水线 +displayName: 'npm-流水线示例' +triggers: # 流水线触发器配置 + push: # 设置 master 分支 在产生代码 push 时精确触发(PRECISE)构建 + - matchType: PRECISE + branch: master +commitMessage: '' # 通过匹配当前提交的 CommitMessage 决定是否执行流水线 +stages: # 构建阶段配置 + - stage: # 定义一个 ID 标识为 npm-build-stage ,名为 “npm Stage” 的阶段 + name: npm-build-stage + displayName: 'npm Stage' + failFast: false # 允许快速失败,即当 Stage 中有任务失败时,直接结束整个 Stage + steps: # 构建步骤配置 + - step: npmbuild@1 # 采用 npm 编译环境 + name: npm-build # 定义一个 ID 标识为 npm-build ,名为 “npm Step” 的阶段 + displayName: 'npm Step' + inputs: # 构建输入参数设定 + nodeVersion: 10.1 # 指定 node 环境版本为 10.1 + goals: "node -v && npm -v" # 输出 构建环境 Node 和 npm 信息 \ No newline at end of file From 5bdaa02c962e2bee2ade23e15019a61948a24d16 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 12:21:17 +0800 Subject: [PATCH 047/721] test --- Task/dianshijia.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 15777e0258..f871ebb71e 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -116,7 +116,7 @@ if (isGetCookie = typeof $request !== 'undefined') { await cash(); // 现金 await cashlist(); // 现金列表 await coinlist(); // 金币列表 - if ($.isNode()&& process.env.DSJ_NOTIFY_CONTROL == false) { + if ($.isNode()&& process.env.DSJ_NOTIFY_CONTROL == false&&sleepres.errCode==0) { await notify.sendNotify($.name, subTitle+'\n'+ detail) } } @@ -335,16 +335,16 @@ function sleep() { $.get(url, (error, response, data) => { try { if(logs)$.log(`睡觉任务: ${data}\n`) - const result = JSON.parse(data) - if (result.errCode==0){ - sleeping = result.data.name+'报名成功 🛌' + const sleepres = JSON.parse(data) + if (sleepres.errCode==0){ + sleeping = sleepres.data.name+'报名成功 🛌' } -else if (result.errCode==4006){ +else if (sleepres.errCode==4006){ sleeping = '睡觉中😴' } else { sleeping = '' - } + } } catch (e) { $.msg($.name, `睡觉结果: 失败`, `说明: ${e}`)} @@ -493,7 +493,7 @@ function Addsign() { $.get(url, (error, response, data) => { if(logs)$.log(`额外签到: ${data}\n`) }) -resolve() + resolve() }) } From 9a5a12da78fa834a3950375475e29fbb419afa66 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 12:43:36 +0800 Subject: [PATCH 048/721] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=B5=E8=A7=86?= =?UTF-8?q?=E5=AE=B6=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/dianshijia.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index f871ebb71e..8e532050b6 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -116,7 +116,7 @@ if (isGetCookie = typeof $request !== 'undefined') { await cash(); // 现金 await cashlist(); // 现金列表 await coinlist(); // 金币列表 - if ($.isNode()&& process.env.DSJ_NOTIFY_CONTROL == false&&sleepres.errCode==0) { + if ($.isNode()&& process.env.DSJ_NOTIFY_CONTROL == false && CountMax == CompCount ) { await notify.sendNotify($.name, subTitle+'\n'+ detail) } } @@ -298,10 +298,13 @@ function dotask(code) { return new Promise((resolve, reject) => { $.get({ url: `${dianshijia_API}/v4/task/complete?code=${code}`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { taskres = JSON.parse(data) + if (taskres.errCode==0){ - console.log('任务代码:'+code+',获得金币:'+taskres.data.getCoin) + CompCount = taskres.data.dayCompCount + CountMax = taskres.data.dayDoCountMax + console.log('任务代码:'+code+',获得金币:'+taskres.data.getCoin) if (code== 'playTask'&&taskres.data.doneStatus == 3) { - detail += `【播放任务】🔕 完成/共计 `+taskres.data.dayCompCount+`/`+taskres.data.dayDoCountMax+` 次\n` + detail += `【播放任务】🔕 完成/共计 `+CompCount+`/`+CountMax+` 次\n` } } if (taskres.errCode==4000){ From f59086a621dabf6c3cba5f937a42fcee70493a9c Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 12:48:55 +0800 Subject: [PATCH 049/721] test --- Task/dianshijia.js | 479 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 478 insertions(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 8e532050b6..1307557ca7 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -500,4 +500,481 @@ function Addsign() { }) } -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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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(name, opts) { + class Http { + constructor(env) { + this.env = env + } + + send(opts, method = 'GET') { + opts = typeof opts === 'string' ? { url: opts } : opts + let sender = this.get + if (method === 'POST') { + sender = this.post + } + return new Promise((resolve, reject) => { + sender.call(this, opts, (err, resp, body) => { + if (err) reject(err) + else resolve(resp) + }) + }) + } + + get(opts) { + return this.send.call(this.env, opts) + } + + post(opts) { + return this.send.call(this.env, opts, 'POST') + } + } + + return new (class { + constructor(name, opts) { + this.name = name + this.http = new Http(this) + this.data = null + this.dataFile = 'box.dat' + this.logs = [] + this.isMute = false + this.isNeedRewrite = false + this.logSeparator = '\n' + this.startTime = new Date().getTime() + Object.assign(this, opts) + this.log('', `🔔${this.name}, 开始!`) + } + + 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(str, defaultValue = null) { + try { + return JSON.parse(str) + } catch { + return defaultValue + } + } + + toStr(obj, defaultValue = null) { + try { + return JSON.stringify(obj) + } catch { + return defaultValue + } + } + + getjson(key, defaultValue) { + let json = defaultValue + const val = this.getdata(key) + if (val) { + try { + json = JSON.parse(this.getdata(key)) + } catch {} + } + return json + } + + setjson(val, key) { + try { + return this.setdata(JSON.stringify(val), key) + } catch { + return false + } + } + + getScript(url) { + return new Promise((resolve) => { + this.get({ url }, (err, resp, body) => resolve(body)) + }) + } + + runScript(script, runOpts) { + return new Promise((resolve) => { + let httpapi = this.getdata('@chavy_boxjs_userCfgs.httpapi') + httpapi = httpapi ? httpapi.replace(/\n/g, '').trim() : httpapi + let httpapi_timeout = this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout') + httpapi_timeout = httpapi_timeout ? httpapi_timeout * 1 : 20 + httpapi_timeout = runOpts && runOpts.timeout ? runOpts.timeout : httpapi_timeout + const [key, addr] = httpapi.split('@') + const opts = { + url: `http://${addr}/v1/scripting/evaluate`, + body: { script_text: script, mock_type: 'cron', timeout: httpapi_timeout }, + headers: { 'X-Key': key, 'Accept': '*/*' } + } + this.post(opts, (err, resp, body) => resolve(body)) + }).catch((e) => this.logErr(e)) + } + + loaddata() { + if (this.isNode()) { + this.fs = this.fs ? this.fs : require('fs') + this.path = this.path ? this.path : require('path') + const curDirDataFilePath = this.path.resolve(this.dataFile) + const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) + const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) + const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) + if (isCurDirDataFile || isRootDirDataFile) { + const datPath = isCurDirDataFile ? curDirDataFilePath : rootDirDataFilePath + try { + return JSON.parse(this.fs.readFileSync(datPath)) + } catch (e) { + return {} + } + } else return {} + } else return {} + } + + writedata() { + if (this.isNode()) { + this.fs = this.fs ? this.fs : require('fs') + this.path = this.path ? this.path : require('path') + const curDirDataFilePath = this.path.resolve(this.dataFile) + const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) + const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) + const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) + const jsondata = JSON.stringify(this.data) + if (isCurDirDataFile) { + this.fs.writeFileSync(curDirDataFilePath, jsondata) + } else if (isRootDirDataFile) { + this.fs.writeFileSync(rootDirDataFilePath, jsondata) + } else { + this.fs.writeFileSync(curDirDataFilePath, jsondata) + } + } + } + + lodash_get(source, path, defaultValue = undefined) { + const paths = path.replace(/\[(\d+)\]/g, '.$1').split('.') + let result = source + for (const p of paths) { + result = Object(result)[p] + if (result === undefined) { + return defaultValue + } + } + return result + } + + lodash_set(obj, path, value) { + if (Object(obj) !== obj) return obj + if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [] + path + .slice(0, -1) + .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[ + path[path.length - 1] + ] = value + return obj + } + + getdata(key) { + let val = this.getval(key) + // 如果以 @ + if (/^@/.test(key)) { + const [, objkey, paths] = /^@(.*?)\.(.*?)$/.exec(key) + const objval = objkey ? this.getval(objkey) : '' + if (objval) { + try { + const objedval = JSON.parse(objval) + val = objedval ? this.lodash_get(objedval, paths, '') : val + } catch (e) { + val = '' + } + } + } + return val + } + + setdata(val, key) { + let issuc = false + if (/^@/.test(key)) { + const [, objkey, paths] = /^@(.*?)\.(.*?)$/.exec(key) + const objdat = this.getval(objkey) + const objval = objkey ? (objdat === 'null' ? null : objdat || '{}') : '{}' + try { + const objedval = JSON.parse(objval) + this.lodash_set(objedval, paths, val) + issuc = this.setval(JSON.stringify(objedval), objkey) + } catch (e) { + const objedval = {} + this.lodash_set(objedval, paths, val) + issuc = this.setval(JSON.stringify(objedval), objkey) + } + } else { + issuc = this.setval(val, key) + } + return issuc + } + + getval(key) { + if (this.isSurge() || this.isLoon()) { + return $persistentStore.read(key) + } else if (this.isQuanX()) { + return $prefs.valueForKey(key) + } else if (this.isNode()) { + this.data = this.loaddata() + return this.data[key] + } else { + return (this.data && this.data[key]) || null + } + } + + setval(val, key) { + if (this.isSurge() || this.isLoon()) { + return $persistentStore.write(val, key) + } else if (this.isQuanX()) { + return $prefs.setValueForKey(val, key) + } else if (this.isNode()) { + this.data = this.loaddata() + this.data[key] = val + this.writedata() + return true + } else { + return (this.data && this.data[key]) || null + } + } + + initGotEnv(opts) { + 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() + if (opts) { + opts.headers = opts.headers ? opts.headers : {} + if (undefined === opts.headers.Cookie && undefined === opts.cookieJar) { + opts.cookieJar = this.ckjar + } + } + } + + get(opts, callback = () => {}) { + if (opts.headers) { + delete opts.headers['Content-Type'] + delete opts.headers['Content-Length'] + } + if (this.isSurge() || this.isLoon()) { + if (this.isSurge() && this.isNeedRewrite) { + opts.headers = opts.headers || {} + Object.assign(opts.headers, { 'X-Surge-Skip-Scripting': false }) + } + $httpClient.get(opts, (err, resp, body) => { + if (!err && resp) { + resp.body = body + resp.statusCode = resp.status + } + callback(err, resp, body) + }) + } else if (this.isQuanX()) { + if (this.isNeedRewrite) { + opts.opts = opts.opts || {} + Object.assign(opts.opts, { hints: false }) + } + $task.fetch(opts).then( + (resp) => { + const { statusCode: status, statusCode, headers, body } = resp + callback(null, { status, statusCode, headers, body }, body) + }, + (err) => callback(err) + ) + } else if (this.isNode()) { + this.initGotEnv(opts) + this.got(opts) + .on('redirect', (resp, nextOpts) => { + try { + if (resp.headers['set-cookie']) { + const ck = resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString() + if (ck) { + this.ckjar.setCookieSync(ck, null) + } + nextOpts.cookieJar = this.ckjar + } + } catch (e) { + this.logErr(e) + } + // this.ckjar.setCookieSync(resp.headers['set-cookie'].map(Cookie.parse).toString()) + }) + .then( + (resp) => { + const { statusCode: status, statusCode, headers, body } = resp + callback(null, { status, statusCode, headers, body }, body) + }, + (err) => { + const { message: error, response: resp } = err + callback(error, resp, resp && resp.body) + } + ) + } + } + + post(opts, callback = () => {}) { + // 如果指定了请求体, 但没指定`Content-Type`, 则自动生成 + if (opts.body && opts.headers && !opts.headers['Content-Type']) { + opts.headers['Content-Type'] = 'application/x-www-form-urlencoded' + } + if (opts.headers) delete opts.headers['Content-Length'] + if (this.isSurge() || this.isLoon()) { + if (this.isSurge() && this.isNeedRewrite) { + opts.headers = opts.headers || {} + Object.assign(opts.headers, { 'X-Surge-Skip-Scripting': false }) + } + $httpClient.post(opts, (err, resp, body) => { + if (!err && resp) { + resp.body = body + resp.statusCode = resp.status + } + callback(err, resp, body) + }) + } else if (this.isQuanX()) { + opts.method = 'POST' + if (this.isNeedRewrite) { + opts.opts = opts.opts || {} + Object.assign(opts.opts, { hints: false }) + } + $task.fetch(opts).then( + (resp) => { + const { statusCode: status, statusCode, headers, body } = resp + callback(null, { status, statusCode, headers, body }, body) + }, + (err) => callback(err) + ) + } else if (this.isNode()) { + this.initGotEnv(opts) + const { url, ..._opts } = opts + this.got.post(url, _opts).then( + (resp) => { + const { statusCode: status, statusCode, headers, body } = resp + callback(null, { status, statusCode, headers, body }, body) + }, + (err) => { + const { message: error, response: resp } = err + callback(error, resp, resp && resp.body) + } + ) + } + } + /** + * + * 示例:$.time('yyyy-MM-dd qq HH:mm:ss.S') + * :$.time('yyyyMMddHHmmssS') + * y:年 M:月 d:日 q:季 H:时 m:分 s:秒 S:毫秒 + * 其中y可选0-4位占位符、S可选0-1位占位符,其余可选0-2位占位符 + * @param {*} fmt 格式化参数 + * + */ + time(fmt) { + let o = { + '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() + } + if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (new Date().getFullYear() + '').substr(4 - RegExp.$1.length)) + for (let k in o) + if (new RegExp('(' + k + ')').test(fmt)) + fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)) + return fmt + } + + /** + * 系统通知 + * + * > 通知参数: 同时支持 QuanX 和 Loon 两种格式, EnvJs根据运行环境自动转换, Surge 环境不支持多媒体通知 + * + * 示例: + * $.msg(title, subt, desc, 'twitter://') + * $.msg(title, subt, desc, { 'open-url': 'twitter://', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) + * $.msg(title, subt, desc, { 'open-url': 'https://bing.com', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) + * + * @param {*} title 标题 + * @param {*} subt 副标题 + * @param {*} desc 通知详情 + * @param {*} opts 通知参数 + * + */ + msg(title = name, subt = '', desc = '', opts) { + const toEnvOpts = (rawopts) => { + if (!rawopts) return rawopts + if (typeof rawopts === 'string') { + if (this.isLoon()) return rawopts + else if (this.isQuanX()) return { 'open-url': rawopts } + else if (this.isSurge()) return { url: rawopts } + else return undefined + } else if (typeof rawopts === 'object') { + if (this.isLoon()) { + let openUrl = rawopts.openUrl || rawopts.url || rawopts['open-url'] + let mediaUrl = rawopts.mediaUrl || rawopts['media-url'] + return { openUrl, mediaUrl } + } else if (this.isQuanX()) { + let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl + let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl + return { 'open-url': openUrl, 'media-url': mediaUrl } + } else if (this.isSurge()) { + let openUrl = rawopts.url || rawopts.openUrl || rawopts['open-url'] + return { url: openUrl } + } + } else { + return undefined + } + } + if (!this.isMute) { + if (this.isSurge() || this.isLoon()) { + $notification.post(title, subt, desc, toEnvOpts(opts)) + } else if (this.isQuanX()) { + $notify(title, subt, desc, toEnvOpts(opts)) + } + } + if (!this.isMuteLog) { + let logs = ['', '==============📣系统通知📣=============='] + logs.push(title) + subt ? logs.push(subt) : '' + desc ? logs.push(desc) : '' + console.log(logs.join('\n')) + this.logs = this.logs.concat(logs) + } + } + + log(...logs) { + if (logs.length > 0) { + this.logs = [...this.logs, ...logs] + } + console.log(logs.join(this.logSeparator)) + } + + logErr(err, msg) { + const isPrintSack = !this.isSurge() && !this.isQuanX() && !this.isLoon() + if (!isPrintSack) { + this.log('', `❗️${this.name}, 错误!`, err) + } else { + this.log('', `❗️${this.name}, 错误!`, err.stack) + } + } + + wait(time) { + return new Promise((resolve) => setTimeout(resolve, time)) + } + + done(val = {}) { + const endTime = new Date().getTime() + const costTime = (endTime - this.startTime) / 1000 + this.log('', `🔔${this.name}, 结束! 🕛 ${costTime} 秒`) + this.log() + if (this.isSurge() || this.isQuanX() || this.isLoon()) { + $done(val) + } + } + })(name, opts) +} From e2cb888a311d62aa50cba864138f051bbcfb78d0 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 12:56:52 +0800 Subject: [PATCH 050/721] --- Task/dianshijia.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 1307557ca7..75d99e794f 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -217,8 +217,8 @@ function signinfo() { {detail += ` 连续签到${d}天\n` } } - resolve() } + resolve() }) }) } @@ -236,10 +236,10 @@ function total() { $.get({ url: `http://api.gaoqingdianshi.com/api/coin/temp/exchange?id=`+coinid, headers: JSON.parse(signheaderVal)}, (error, response, data)) } } - } - catch(err){ - console.log(err) } - resolve() + resolve() + } catch(error){ + console.log(error) } + resolve() }) }) } @@ -277,11 +277,12 @@ function cashlist() { detail += `【提现结果】今日未提现 共计提现:`+cashtotal+`元\n` } } + resolve() } catch (error){ console.log(`提现列表失败,可忽略: ${data}`) + resolve() } - resolve() }) }) } @@ -310,8 +311,8 @@ function dotask(code) { if (taskres.errCode==4000){ //console.log('任务代码:'+code+','+taskres.msg) } + resolve() }) - resolve() }) } @@ -327,7 +328,7 @@ function walk() { { }) } - resolve() + resolve() }) }) } @@ -348,6 +349,7 @@ else if (sleepres.errCode==4006){ else { sleeping = '' } + resolve() } catch (e) { $.msg($.name, `睡觉结果: 失败`, `说明: ${e}`)} @@ -362,8 +364,8 @@ function wakeup() { headers: JSON.parse(signheaderVal)} $.get(url, (error, response, data) => { if(logs)$.log(`睡觉打卡: ${data}\n`) + resolve() }) -resolve() }) } @@ -451,16 +453,16 @@ function CarveUp() { if (result.errCode == 0) { detail += `【金币瓜分】✅ 报名成功\n` } + resolve() }) -resolve() }) } function getCUpcoin() { return new Promise((resolve, reject) => { $.get({ url: `${dianshijia_API}/taskext/getCoin?code=carveUp&coin=0&ext=1`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { if(logs) $.log(`瓜分百万金币: ${data}`) - }) resolve() + }) }) } function Withdrawal() { @@ -483,8 +485,8 @@ function getGametime() { } $.get(url, (error, response, data) => { if(logs)$.log(`游戏时长: ${data}\n`) + resolve() }) -resolve() }) } function Addsign() { @@ -495,8 +497,8 @@ function Addsign() { } $.get(url, (error, response, data) => { if(logs)$.log(`额外签到: ${data}\n`) + resolve() }) - resolve() }) } From 6387f2be0f7a5eb418a6acdf0ff09166fc067ab0 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 13:00:04 +0800 Subject: [PATCH 051/721] --- .github/workflows/dianshijia.yml | 4 ++-- Task/dianshijia.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dianshijia.yml b/.github/workflows/dianshijia.yml index 22e2a29853..e0d1117820 100644 --- a/.github/workflows/dianshijia.yml +++ b/.github/workflows/dianshijia.yml @@ -16,10 +16,10 @@ jobs: DSJ_DRAWAL: ${{ secrets.DSJ_DRAWAL }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 14.x + - name: Use Node.js 12.x uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 12.x - name: npm install run: | npm install diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 75d99e794f..86dafd9fb3 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -259,7 +259,7 @@ function cashlist() { return new Promise((resolve, reject) => { $.get({ url: `${dianshijia_API}/cash/detail`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { - const result = JSON.parse(data) + let result = JSON.parse(data) let totalcash = Number(),cashres = "" var time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 try{ @@ -322,7 +322,7 @@ function walk() { $.get(url, (error, response, data) => { if(logs)$.log(`走路任务: ${data}\n`) - const result = JSON.parse(data) + let result = JSON.parse(data) if (result.data.unGetCoin>10){ $.get({ url: `${dianshijia_API}/taskext/getCoin?code=walk&coin=${result.data.unGetCoin}&ext=1`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { @@ -339,7 +339,7 @@ function sleep() { $.get(url, (error, response, data) => { try { if(logs)$.log(`睡觉任务: ${data}\n`) - const sleepres = JSON.parse(data) + let sleepres = JSON.parse(data) if (sleepres.errCode==0){ sleeping = sleepres.data.name+'报名成功 🛌' } From 99b56da445aff7b0d438f074235ef9673c12c86a Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 13:08:16 +0800 Subject: [PATCH 052/721] --- Task/dianshijia.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 86dafd9fb3..325b4732a7 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -122,7 +122,7 @@ if (isGetCookie = typeof $request !== 'undefined') { } } })() - .catch((error) => $.logErr(error)) + .catch((e) => $.logErr(e)) .finally(() => $.done()) function GetCookie() { @@ -237,8 +237,8 @@ function total() { } } resolve() - } catch(error){ - console.log(error) } + } catch(e){ + console.log(e) } resolve() }) }) @@ -279,7 +279,7 @@ function cashlist() { } resolve() } - catch (error){ + catch (e){ console.log(`提现列表失败,可忽略: ${data}`) resolve() } @@ -431,8 +431,8 @@ function coinlist() { } $.msg($.name+` `+sleeping, subTitle, detail) resolve() - } catch(error) { - console.log(`获取任务金币列表失败,错误代码${error}+ \n响应数据:${data}`) + } catch(e) { + console.log(`获取任务金币列表失败,错误代码${e}+ \n响应数据:${data}`) $.msg($.name+` `+sleeping, subTitle, detail) resolve() } From 9abf52654315f7f2ea24e4402a27bcc85bee2b83 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 13:41:40 +0800 Subject: [PATCH 053/721] --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 325b4732a7..c73ddcab14 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -46,7 +46,7 @@ const $ = new Env('电视家') const notify = $.isNode() ? require('./sendNotify') : ''; let sleeping = "",detail=``,subTitle=``; const dianshijia_API = 'http://api.gaoqingdianshi.com/api' -let tokenArr = [], DsjurlArr = [], DrawalArr = [],drawalVal; +let tokenArr = [], DsjurlArr = [], DrawalArr = [],drawalVal,CountMax,CompCount; if ($.isNode()) { if (process.env.DSJ_HEADERS && process.env.DSJ_HEADERS.indexOf('#') > -1) { Dsjheaders = process.env.DSJ_HEADERS.split('#'); From a003094e389e53161782ac6aff06a56550b710b5 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 14:50:46 +0800 Subject: [PATCH 054/721] --- Task/dianshijia.js | 483 +-------------------------------------------- 1 file changed, 3 insertions(+), 480 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index c73ddcab14..283ea2bf87 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -298,8 +298,8 @@ function tasks(tkcode) { function dotask(code) { return new Promise((resolve, reject) => { $.get({ url: `${dianshijia_API}/v4/task/complete?code=${code}`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { - taskres = JSON.parse(data) - + let taskres = JSON.parse(data) + console.log(data) if (taskres.errCode==0){ CompCount = taskres.data.dayCompCount CountMax = taskres.data.dayDoCountMax @@ -502,481 +502,4 @@ function Addsign() { }) } -function Env(name, opts) { - class Http { - constructor(env) { - this.env = env - } - - send(opts, method = 'GET') { - opts = typeof opts === 'string' ? { url: opts } : opts - let sender = this.get - if (method === 'POST') { - sender = this.post - } - return new Promise((resolve, reject) => { - sender.call(this, opts, (err, resp, body) => { - if (err) reject(err) - else resolve(resp) - }) - }) - } - - get(opts) { - return this.send.call(this.env, opts) - } - - post(opts) { - return this.send.call(this.env, opts, 'POST') - } - } - - return new (class { - constructor(name, opts) { - this.name = name - this.http = new Http(this) - this.data = null - this.dataFile = 'box.dat' - this.logs = [] - this.isMute = false - this.isNeedRewrite = false - this.logSeparator = '\n' - this.startTime = new Date().getTime() - Object.assign(this, opts) - this.log('', `🔔${this.name}, 开始!`) - } - - 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(str, defaultValue = null) { - try { - return JSON.parse(str) - } catch { - return defaultValue - } - } - - toStr(obj, defaultValue = null) { - try { - return JSON.stringify(obj) - } catch { - return defaultValue - } - } - - getjson(key, defaultValue) { - let json = defaultValue - const val = this.getdata(key) - if (val) { - try { - json = JSON.parse(this.getdata(key)) - } catch {} - } - return json - } - - setjson(val, key) { - try { - return this.setdata(JSON.stringify(val), key) - } catch { - return false - } - } - - getScript(url) { - return new Promise((resolve) => { - this.get({ url }, (err, resp, body) => resolve(body)) - }) - } - - runScript(script, runOpts) { - return new Promise((resolve) => { - let httpapi = this.getdata('@chavy_boxjs_userCfgs.httpapi') - httpapi = httpapi ? httpapi.replace(/\n/g, '').trim() : httpapi - let httpapi_timeout = this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout') - httpapi_timeout = httpapi_timeout ? httpapi_timeout * 1 : 20 - httpapi_timeout = runOpts && runOpts.timeout ? runOpts.timeout : httpapi_timeout - const [key, addr] = httpapi.split('@') - const opts = { - url: `http://${addr}/v1/scripting/evaluate`, - body: { script_text: script, mock_type: 'cron', timeout: httpapi_timeout }, - headers: { 'X-Key': key, 'Accept': '*/*' } - } - this.post(opts, (err, resp, body) => resolve(body)) - }).catch((e) => this.logErr(e)) - } - - loaddata() { - if (this.isNode()) { - this.fs = this.fs ? this.fs : require('fs') - this.path = this.path ? this.path : require('path') - const curDirDataFilePath = this.path.resolve(this.dataFile) - const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) - const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) - const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) - if (isCurDirDataFile || isRootDirDataFile) { - const datPath = isCurDirDataFile ? curDirDataFilePath : rootDirDataFilePath - try { - return JSON.parse(this.fs.readFileSync(datPath)) - } catch (e) { - return {} - } - } else return {} - } else return {} - } - - writedata() { - if (this.isNode()) { - this.fs = this.fs ? this.fs : require('fs') - this.path = this.path ? this.path : require('path') - const curDirDataFilePath = this.path.resolve(this.dataFile) - const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) - const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) - const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) - const jsondata = JSON.stringify(this.data) - if (isCurDirDataFile) { - this.fs.writeFileSync(curDirDataFilePath, jsondata) - } else if (isRootDirDataFile) { - this.fs.writeFileSync(rootDirDataFilePath, jsondata) - } else { - this.fs.writeFileSync(curDirDataFilePath, jsondata) - } - } - } - - lodash_get(source, path, defaultValue = undefined) { - const paths = path.replace(/\[(\d+)\]/g, '.$1').split('.') - let result = source - for (const p of paths) { - result = Object(result)[p] - if (result === undefined) { - return defaultValue - } - } - return result - } - - lodash_set(obj, path, value) { - if (Object(obj) !== obj) return obj - if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [] - path - .slice(0, -1) - .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[ - path[path.length - 1] - ] = value - return obj - } - - getdata(key) { - let val = this.getval(key) - // 如果以 @ - if (/^@/.test(key)) { - const [, objkey, paths] = /^@(.*?)\.(.*?)$/.exec(key) - const objval = objkey ? this.getval(objkey) : '' - if (objval) { - try { - const objedval = JSON.parse(objval) - val = objedval ? this.lodash_get(objedval, paths, '') : val - } catch (e) { - val = '' - } - } - } - return val - } - - setdata(val, key) { - let issuc = false - if (/^@/.test(key)) { - const [, objkey, paths] = /^@(.*?)\.(.*?)$/.exec(key) - const objdat = this.getval(objkey) - const objval = objkey ? (objdat === 'null' ? null : objdat || '{}') : '{}' - try { - const objedval = JSON.parse(objval) - this.lodash_set(objedval, paths, val) - issuc = this.setval(JSON.stringify(objedval), objkey) - } catch (e) { - const objedval = {} - this.lodash_set(objedval, paths, val) - issuc = this.setval(JSON.stringify(objedval), objkey) - } - } else { - issuc = this.setval(val, key) - } - return issuc - } - - getval(key) { - if (this.isSurge() || this.isLoon()) { - return $persistentStore.read(key) - } else if (this.isQuanX()) { - return $prefs.valueForKey(key) - } else if (this.isNode()) { - this.data = this.loaddata() - return this.data[key] - } else { - return (this.data && this.data[key]) || null - } - } - - setval(val, key) { - if (this.isSurge() || this.isLoon()) { - return $persistentStore.write(val, key) - } else if (this.isQuanX()) { - return $prefs.setValueForKey(val, key) - } else if (this.isNode()) { - this.data = this.loaddata() - this.data[key] = val - this.writedata() - return true - } else { - return (this.data && this.data[key]) || null - } - } - - initGotEnv(opts) { - 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() - if (opts) { - opts.headers = opts.headers ? opts.headers : {} - if (undefined === opts.headers.Cookie && undefined === opts.cookieJar) { - opts.cookieJar = this.ckjar - } - } - } - - get(opts, callback = () => {}) { - if (opts.headers) { - delete opts.headers['Content-Type'] - delete opts.headers['Content-Length'] - } - if (this.isSurge() || this.isLoon()) { - if (this.isSurge() && this.isNeedRewrite) { - opts.headers = opts.headers || {} - Object.assign(opts.headers, { 'X-Surge-Skip-Scripting': false }) - } - $httpClient.get(opts, (err, resp, body) => { - if (!err && resp) { - resp.body = body - resp.statusCode = resp.status - } - callback(err, resp, body) - }) - } else if (this.isQuanX()) { - if (this.isNeedRewrite) { - opts.opts = opts.opts || {} - Object.assign(opts.opts, { hints: false }) - } - $task.fetch(opts).then( - (resp) => { - const { statusCode: status, statusCode, headers, body } = resp - callback(null, { status, statusCode, headers, body }, body) - }, - (err) => callback(err) - ) - } else if (this.isNode()) { - this.initGotEnv(opts) - this.got(opts) - .on('redirect', (resp, nextOpts) => { - try { - if (resp.headers['set-cookie']) { - const ck = resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString() - if (ck) { - this.ckjar.setCookieSync(ck, null) - } - nextOpts.cookieJar = this.ckjar - } - } catch (e) { - this.logErr(e) - } - // this.ckjar.setCookieSync(resp.headers['set-cookie'].map(Cookie.parse).toString()) - }) - .then( - (resp) => { - const { statusCode: status, statusCode, headers, body } = resp - callback(null, { status, statusCode, headers, body }, body) - }, - (err) => { - const { message: error, response: resp } = err - callback(error, resp, resp && resp.body) - } - ) - } - } - - post(opts, callback = () => {}) { - // 如果指定了请求体, 但没指定`Content-Type`, 则自动生成 - if (opts.body && opts.headers && !opts.headers['Content-Type']) { - opts.headers['Content-Type'] = 'application/x-www-form-urlencoded' - } - if (opts.headers) delete opts.headers['Content-Length'] - if (this.isSurge() || this.isLoon()) { - if (this.isSurge() && this.isNeedRewrite) { - opts.headers = opts.headers || {} - Object.assign(opts.headers, { 'X-Surge-Skip-Scripting': false }) - } - $httpClient.post(opts, (err, resp, body) => { - if (!err && resp) { - resp.body = body - resp.statusCode = resp.status - } - callback(err, resp, body) - }) - } else if (this.isQuanX()) { - opts.method = 'POST' - if (this.isNeedRewrite) { - opts.opts = opts.opts || {} - Object.assign(opts.opts, { hints: false }) - } - $task.fetch(opts).then( - (resp) => { - const { statusCode: status, statusCode, headers, body } = resp - callback(null, { status, statusCode, headers, body }, body) - }, - (err) => callback(err) - ) - } else if (this.isNode()) { - this.initGotEnv(opts) - const { url, ..._opts } = opts - this.got.post(url, _opts).then( - (resp) => { - const { statusCode: status, statusCode, headers, body } = resp - callback(null, { status, statusCode, headers, body }, body) - }, - (err) => { - const { message: error, response: resp } = err - callback(error, resp, resp && resp.body) - } - ) - } - } - /** - * - * 示例:$.time('yyyy-MM-dd qq HH:mm:ss.S') - * :$.time('yyyyMMddHHmmssS') - * y:年 M:月 d:日 q:季 H:时 m:分 s:秒 S:毫秒 - * 其中y可选0-4位占位符、S可选0-1位占位符,其余可选0-2位占位符 - * @param {*} fmt 格式化参数 - * - */ - time(fmt) { - let o = { - '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() - } - if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (new Date().getFullYear() + '').substr(4 - RegExp.$1.length)) - for (let k in o) - if (new RegExp('(' + k + ')').test(fmt)) - fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)) - return fmt - } - - /** - * 系统通知 - * - * > 通知参数: 同时支持 QuanX 和 Loon 两种格式, EnvJs根据运行环境自动转换, Surge 环境不支持多媒体通知 - * - * 示例: - * $.msg(title, subt, desc, 'twitter://') - * $.msg(title, subt, desc, { 'open-url': 'twitter://', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) - * $.msg(title, subt, desc, { 'open-url': 'https://bing.com', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) - * - * @param {*} title 标题 - * @param {*} subt 副标题 - * @param {*} desc 通知详情 - * @param {*} opts 通知参数 - * - */ - msg(title = name, subt = '', desc = '', opts) { - const toEnvOpts = (rawopts) => { - if (!rawopts) return rawopts - if (typeof rawopts === 'string') { - if (this.isLoon()) return rawopts - else if (this.isQuanX()) return { 'open-url': rawopts } - else if (this.isSurge()) return { url: rawopts } - else return undefined - } else if (typeof rawopts === 'object') { - if (this.isLoon()) { - let openUrl = rawopts.openUrl || rawopts.url || rawopts['open-url'] - let mediaUrl = rawopts.mediaUrl || rawopts['media-url'] - return { openUrl, mediaUrl } - } else if (this.isQuanX()) { - let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl - let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl - return { 'open-url': openUrl, 'media-url': mediaUrl } - } else if (this.isSurge()) { - let openUrl = rawopts.url || rawopts.openUrl || rawopts['open-url'] - return { url: openUrl } - } - } else { - return undefined - } - } - if (!this.isMute) { - if (this.isSurge() || this.isLoon()) { - $notification.post(title, subt, desc, toEnvOpts(opts)) - } else if (this.isQuanX()) { - $notify(title, subt, desc, toEnvOpts(opts)) - } - } - if (!this.isMuteLog) { - let logs = ['', '==============📣系统通知📣=============='] - logs.push(title) - subt ? logs.push(subt) : '' - desc ? logs.push(desc) : '' - console.log(logs.join('\n')) - this.logs = this.logs.concat(logs) - } - } - - log(...logs) { - if (logs.length > 0) { - this.logs = [...this.logs, ...logs] - } - console.log(logs.join(this.logSeparator)) - } - - logErr(err, msg) { - const isPrintSack = !this.isSurge() && !this.isQuanX() && !this.isLoon() - if (!isPrintSack) { - this.log('', `❗️${this.name}, 错误!`, err) - } else { - this.log('', `❗️${this.name}, 错误!`, err.stack) - } - } - - wait(time) { - return new Promise((resolve) => setTimeout(resolve, time)) - } - - done(val = {}) { - const endTime = new Date().getTime() - const costTime = (endTime - this.startTime) / 1000 - this.log('', `🔔${this.name}, 结束! 🕛 ${costTime} 秒`) - this.log() - if (this.isSurge() || this.isQuanX() || this.isLoon()) { - $done(val) - } - } - })(name, opts) -} +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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 78821f6451659d28a822d149ef73fb726cf9096c Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 14:54:00 +0800 Subject: [PATCH 055/721] =?UTF-8?q?fix=20=E7=94=B5=E8=A7=86=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/dianshijia.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 283ea2bf87..251cfc1534 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -1,6 +1,6 @@ /* -更新时间: 2020-10-13 21:21 +更新时间: 2020-11-03 14:21 赞赏:电视家邀请码`893988`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于电视家签到,支持Actions多账号运行,请用'#'或者换行隔开‼️ 获取Cookie方法: @@ -116,7 +116,7 @@ if (isGetCookie = typeof $request !== 'undefined') { await cash(); // 现金 await cashlist(); // 现金列表 await coinlist(); // 金币列表 - if ($.isNode()&& process.env.DSJ_NOTIFY_CONTROL == false && CountMax == CompCount ) { + if ($.isNode()&& process.env.DSJ_NOTIFY_CONTROL == false && CountMax == CompCount && taskres.errCode == 0 ) { await notify.sendNotify($.name, subTitle+'\n'+ detail) } } @@ -299,7 +299,6 @@ function dotask(code) { return new Promise((resolve, reject) => { $.get({ url: `${dianshijia_API}/v4/task/complete?code=${code}`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { let taskres = JSON.parse(data) - console.log(data) if (taskres.errCode==0){ CompCount = taskres.data.dayCompCount CountMax = taskres.data.dayDoCountMax From 86d9378d644e7f479e47104862b74015ce9c42c3 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 14:56:43 +0800 Subject: [PATCH 056/721] --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 251cfc1534..2e3df9fd21 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -307,7 +307,7 @@ function dotask(code) { detail += `【播放任务】🔕 完成/共计 `+CompCount+`/`+CountMax+` 次\n` } } - if (taskres.errCode==4000){ + else if (taskres.errCode==4000){ //console.log('任务代码:'+code+','+taskres.msg) } resolve() From e7bedc64fc0ecfbbb510469fd6ee348f89ea1d95 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 20:28:00 +0800 Subject: [PATCH 057/721] --- Task/dianshijia.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 2e3df9fd21..db1896cd2c 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -44,7 +44,7 @@ const gametimes = "1999"; //游戏时长 const logs = 0 //响应日志开关,默认关闭 const $ = new Env('电视家') const notify = $.isNode() ? require('./sendNotify') : ''; -let sleeping = "",detail=``,subTitle=``; +let sleeping = "",detail=``,subTitle=``,taskres = {}; const dianshijia_API = 'http://api.gaoqingdianshi.com/api' let tokenArr = [], DsjurlArr = [], DrawalArr = [],drawalVal,CountMax,CompCount; if ($.isNode()) { @@ -298,8 +298,8 @@ function tasks(tkcode) { function dotask(code) { return new Promise((resolve, reject) => { $.get({ url: `${dianshijia_API}/v4/task/complete?code=${code}`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { - let taskres = JSON.parse(data) - if (taskres.errCode==0){ + let taskres = JSON.parse(data) + if (taskres.errCode == 0){ CompCount = taskres.data.dayCompCount CountMax = taskres.data.dayDoCountMax console.log('任务代码:'+code+',获得金币:'+taskres.data.getCoin) From 410c387bd8a7ea22c76c7abe102ed3207d1bf7fa Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 20:40:01 +0800 Subject: [PATCH 058/721] --- Task/dianshijia.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index db1896cd2c..fb01ef5d3c 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -1,6 +1,6 @@ /* -更新时间: 2020-11-03 14:21 +更新时间: 2020-11-03 20:40 赞赏:电视家邀请码`893988`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于电视家签到,支持Actions多账号运行,请用'#'或者换行隔开‼️ 获取Cookie方法: @@ -116,7 +116,7 @@ if (isGetCookie = typeof $request !== 'undefined') { await cash(); // 现金 await cashlist(); // 现金列表 await coinlist(); // 金币列表 - if ($.isNode()&& process.env.DSJ_NOTIFY_CONTROL == false && CountMax == CompCount && taskres.errCode == 0 ) { + if ($.isNode() && code == 'playTask' && CountMax == CompCount && taskcode == 0 ) { await notify.sendNotify($.name, subTitle+'\n'+ detail) } } @@ -299,7 +299,8 @@ function dotask(code) { return new Promise((resolve, reject) => { $.get({ url: `${dianshijia_API}/v4/task/complete?code=${code}`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { let taskres = JSON.parse(data) - if (taskres.errCode == 0){ + taskcode = taskres.errCode + if (taskcode == 0){ CompCount = taskres.data.dayCompCount CountMax = taskres.data.dayDoCountMax console.log('任务代码:'+code+',获得金币:'+taskres.data.getCoin) @@ -307,7 +308,7 @@ function dotask(code) { detail += `【播放任务】🔕 完成/共计 `+CompCount+`/`+CountMax+` 次\n` } } - else if (taskres.errCode==4000){ + else if (taskcode == '4000'){ //console.log('任务代码:'+code+','+taskres.msg) } resolve() From ec1810ec00c0ec1fe800e77fdf2d325a35bc7cf7 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 20:42:44 +0800 Subject: [PATCH 059/721] --- Task/dianshijia.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index fb01ef5d3c..e745cfd1d1 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -94,13 +94,13 @@ if (isGetCookie = typeof $request !== 'undefined') { $.msg($.name, '【提示】请先获取电视家一cookie') return; } - console.log(`------------- 共${tokenArr.length}个账号\n`) + console.log(`------------- 共${tokenArr.length}个账号`) for (let i = 0; i < tokenArr.length; i++) { if (tokenArr[i]) { signheaderVal = tokenArr[i]; drawalVal = DrawalArr[i]; $.index = i + 1; - console.log(`开始【电视家${$.index}】`) + console.log(`\n\n开始【电视家${$.index}】`) await signin(); // 签到 await signinfo(); // 签到信息 await Addsign(); // 额外奖励,默认额度 From ee0fdc91485313765e076003d3f76f8c5501516b Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 20:54:14 +0800 Subject: [PATCH 060/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=B5=E8=A7=86?= =?UTF-8?q?=E5=AE=B6=E9=A2=9D=E5=A4=96=E7=AD=BE=E5=88=B0=E5=A5=96=E5=8A=B1?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E6=8F=90=E7=8E=B0=E9=A2=9D=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/dianshijia.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index e745cfd1d1..10d906f10f 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -44,7 +44,8 @@ const gametimes = "1999"; //游戏时长 const logs = 0 //响应日志开关,默认关闭 const $ = new Env('电视家') const notify = $.isNode() ? require('./sendNotify') : ''; -let sleeping = "",detail=``,subTitle=``,taskres = {}; +let sleeping = "",detail=``,subTitle=``; +let RewardId = $.getdata('REWARD')||'55'; //额外签到奖励,默认55为兑换0.2元额度,44为兑换1天VIP,42为兑换1888金币 const dianshijia_API = 'http://api.gaoqingdianshi.com/api' let tokenArr = [], DsjurlArr = [], DrawalArr = [],drawalVal,CountMax,CompCount; if ($.isNode()) { @@ -492,7 +493,7 @@ function getGametime() { function Addsign() { return new Promise((resolve, reject) => { let url = { - url: `${dianshijia_API}/sign/chooseAdditionalReward?rewardId=55`, + url: `${dianshijia_API}/sign/chooseAdditionalReward?rewardId=${RewardId}`, headers: JSON.parse(signheaderVal), } $.get(url, (error, response, data) => { From 51f12dcf90d552c48522442a7b798d608aa098c9 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 3 Nov 2020 21:33:21 +0800 Subject: [PATCH 061/721] --- Task/sunert.boxjs.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index c0893ed4bb..81294dd6f2 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -44,6 +44,23 @@ "name": "电视家", "keys": ["sy_signheader_dsj", "drawal_dsj"], "author": "@sunert", + "settings": [{ + "id": "REWARD", + "name": "额外签到奖励", + "val": "55", + "type": "radios", + "desc": "", + "items": [{ + "key": "55", + "label": "提现额度" + }, { + "key": "44", + "label": "1天VIP" + }, { + "key": "42", + "label": "1888金币" + }] + }], "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/dianshijia.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png"], "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/dianshijia.js" From 472b92283c91d639f86d5d73f8c8e037ed2fe705 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 00:54:50 +0800 Subject: [PATCH 062/721] --- Task/jd_starStore.js | 308 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 308 insertions(+) create mode 100644 Task/jd_starStore.js diff --git a/Task/jd_starStore.js b/Task/jd_starStore.js new file mode 100644 index 0000000000..7ddc023a96 --- /dev/null +++ b/Task/jd_starStore.js @@ -0,0 +1,308 @@ +/* +京东星店长 +更新时间:2020-11-03 16:51 +脚本说明: +第一次执行会循环 8--86号店铺,时间比较长,后面会判断,做完86的不再全部做,每天运行一次即可 +使用前请先看下活动介绍,可能会关注店铺,入会是假入会,入会任务可能不会完成 +此脚本仅做任务,需要拉人头才能参与瓜分,请按需使用 +活动进入方式:京东app搜索【星店长】 +5 9 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_starStore.js, tag=京东星店长, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jd.png, enabled=true + +*/ +const $ = new Env('京东星店长'); +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) +} else { + cookiesArr.push($.getdata('CookieJD')); + cookiesArr.push($.getdata('CookieJD2')); +} +const JD_API_HOST = `https://api.m.jd.com/client.action?functionId=`; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + cookie = cookiesArr[i]; + if (cookie) { + console.log('**********************分割线**********************') + initial(); + await QueryJDUserInfo(); + if (!merge.enabled) //cookie不可用 + { + $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 + $.msg($.name, `【提示】京东账号${i + 1} cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + continue; + } + if (Date.now() > Date.parse('2020-11-12')){ + $.msg($.Name,"","活动已结束,请删除或禁用脚本!"); + return + } + let shopId = 0; + let now = new Date(); + await mcxhd_starmall_taskList(86); //做最后一个,看是否做完 + if (!merge.end) { + for (shopId = 8; shopId <86 ; shopId ++ ) { + console.log('\n开始店铺:' + shopId) + await mcxhd_starmall_taskList(shopId); + } + } + merge.end = false; + if (now.getDate() === 3) shopId = 2; + if (now.getDate() === 4) shopId = 2; + if (now.getDate() === 5) shopId = 3; + if (now.getDate() === 6) shopId = 3; + if (now.getDate() === 7) shopId = 4; + if (now.getDate() === 8) shopId = 4; + if (now.getDate() === 9) shopId = 5; + if (now.getDate() === 10) shopId = 6; + if (now.getDate() === 11) shopId = 7; + await mcxhd_starmall_taskList(shopId); + await msgShow(); + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + + +//获取昵称(直接用,勿删) +function QueryJDUserInfo(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + headers : { + 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, + 'Cookie' : cookie + } + } + $.get(url, (err, resp, data) => { + try { + data = JSON.parse(data); + if (data.retcode === 13) { + merge.enabled = false + return + } + merge.nickname = data.base.nickname; + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//查询 +function mcxhd_starmall_taskList(shopId,timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}mcxhd_starmall_taskList&appid=jd_mp_h5&body=%7B%22shopId%22:%22${shopId}%22,%22token%22:%22jd6df03bd53f0f292f%22%7D&loginType=2`, + headers : { + 'Origin' : `https://h5.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/4DEZi5iUgrNLD9EWknrGZhCjNv7V/index.html`, + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + } + } + $.get(url, async (err, resp, data) => { + try { + data = JSON.parse(data); + if (data.retCode !== "200") { + console.log(data.retMessage) + return + } + console.log('\n星店长:'+data.result.starName) + for (let i in data.result.tasks) { + if (merge.end) return ; + //if (data.result.tasks[i].taskType !== "7"){ + // continue + //} else { + // console.log(data.result.tasks[i].subItem[0].itemId) + // return + //} + if (data.result.tasks[i].taskType !== "7") console.log('\n开始做任务:' + data.result.tasks[i].taskName) + if (data.result.tasks[i].status === 0 ) { + for (let j in data.result.tasks[i].subItem) { + await mcxhd_starmall_doTask(shopId,data.result.tasks[i].taskType,data.result.tasks[i].subItem[j].itemId) + } + } else { + if (shopId === 86) { + console.log('最后一个店铺已做完,不再执行所有店铺') + merge.end = true; + } + console.log('已完成') + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//做任务 +function mcxhd_starmall_doTask(shopId,taskType,itemId,timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + if (taskType === "7") itemId = shareCode[shopId];// '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8zYv7WVIxFMVj1lV2pKDjARLLbNU_JV-gpnPfE9HW-02KqFUKGtvxAhB0qpzIrZwdSu-yZTRWQMbBwd4k2XPmFHDqa'; + let url = { + url : `${JD_API_HOST}mcxhd_starmall_doTask&appid=jd_mp_h5&body=%7B%22itemId%22:%22${itemId}%22,%22taskType%22:%22${taskType}%22,%22shopId%22:%22${shopId}%22,%22token%22:%22jd6df03bd53f0f292f%22%7D&loginType=2`, + headers : { + 'Origin' : `https://h5.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `*/*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/4DEZi5iUgrNLD9EWknrGZhCjNv7V/index.html?shopId=${shopId}&inviteId=${shareCode[shopId]}&babelChannel=ttt1`, + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + } + } + $.get(url, async (err, resp, data) => { + try { + //console.log(url.url) + //console.log(data) + data = JSON.parse(data); + if (taskType !== "7") console.log(data.retMessage) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +var shareCode = [ + '', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwzfupaUAaCzThSWkJH-rWzkE1CiSqcKjixdbItXLI36wd2PRn53FF3Qd83QaH-eksFJaOtrv6OeY7ZPZxBlToRqbNRrw', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8zYv7WVIxFMVj1lV2pKDjARLLbNU_JV-gpnPfE9HW-02KqFUKGtvxAhB0qpzIrZwdSu-yZTRWQMbBwd4k2XPmFHDqa', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4zzIuAP9ftTzuEao3sXWuGLLpFCZ5icB_-WvBMpD6Go5-HLIIV5iGRwTgj8stXlkisI8N_5JhwQsD7GQ4LGsgvJ_Wruw', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkzagijopM6HP9i8jM8Hvo2CfFhtPmUIBcG2gmTDdvOg_bCvQS9LROdHNxp2CaqYwdqkm5goAePm-yVeRUMoYj_dRnugg', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgzSEllgoZFO2Qm8oFmt0Q4mow9dCzWpinng8olsX7EMifKAGeDMVk7_oaIVQPCbC9-VtlD_hzdK811DMzScm33McGt', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfszf6XfbSkVmvZ41eDovmsK1hM-13auIalW_2Mj5eLGaScrZA_euWAVL3G95wbuAV8viZaEFCcUPGUmCwe5VZd-mTzilw', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfoza8K0IpL9mvWLveI1os5oJp2dTVcxqcNGK_we7REPVSOQHIRX47scO74cIkYQOB6T_S6RhuILYyMUbS4BPjRvYbO06g', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUzFOD-4F8YdcGyLhJdtLVbkV1zpvhNUdZVO_auO4PKrbCS3XQffPgTvdVQpelJiK3roby2J2TZV9EBDwmkaotEL7jQSQ', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfQzcjir8SeH7RnnwOFgXTwfTeoyrdK7ZaR-SBmLf3RsY--v7DpVA7H5rjSgRFZCgbfm-Z0M6nvxkVmWAzsU3B97Gcw7iA', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwhwhxjv9goOzjcVIHpVqBrcgAu1QDzjWRmis99vVsRXHAfdITKHZWgSKYP4rTiNmILf3hhGBKRt3nwWYelfcfx3tByzQ', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwg1GkpMYts8kEYMM2UgyMYF8s7hGmA3s9SGNYAns7xhs_og6O6QR7O-JtMWGMcG1iEPf-H9L85wein_wFn1mVM-sCA0V8', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwj5lnjD6wrhVGo0oN2nUU-aYNeqA-PDItHq9HQhFppDm8vvcs622gpz-0BVf5ftyaVigNkqZLf2veMaRgeGcEUXv7h8N0', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwiej9xjZP0LbnLloPCge1bsVtIH7k2tYk4mUw-ntWz2Cn46Iy1E4tOhSOL-Dyx-tfnhAPyy2adQ8Jln8-NlLp6iToiNTw', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwlOWoIwiLSKbuDSbp6V-f6tZd5dZ7pHcl1Rmw5UYW8ugOuFtG1obW1eMGitMUo87QRUbPSKilOxYXXGTKDYSU-PU4KTg', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwkEyo_2Xqhtn8UM5huWU49Yu2ogT4bguZxlaguPeK5l2Qj88DZeTmPUVVHY0zW4ov2geKLvKHqO4wHoOFL7Oa1ruI59TQ', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwniukeK0jGMdPRHf7_w5TEv4yKLIq5ifuYOHX9Nv2wVUkOp2OnXrhrMdIuFpPuqY_wUgIgXbV7J1mOnQpHr2dd4SYldQ', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwmXvcUbGY9LbbkDifMWqHOdmpi9ks5VS1KiGauQZjnyuGH8S-1_GTd5IKrecfzbAE24D0QtfSGw8XVQDZv8alrDZ1iFA', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwpBn9H4cZ55ZHQXbHyK64A6XkWjfzxsJNIl7_cgBfmqDGnnQRs2FNDxi-gJ1m-LoBHAYDuaW47H_ON8aBYJDEZohEiLGY', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwoDFjEn_bARCtQnOAU-aQtTTdvLHbUeMcdncaUPqMVCCzAJekDdSDcoFvRdYfLvbGKvnqNfRT1Ra1EjKoNqVzxurhcCw', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8hYAlTUnHWn0lIqm0wmbkyMT_ZiCBePGEwwqUOUokFoSk1PMMwmYHmkd_cq_0uWHy0tEwLkCwBSBRrqTaDDSp80h2aEKo', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8g-ERlkoyFzDfwGNc4ujzFPPpVPDav6KLvNJToaZyngBY1gX8i3LpYkFYTG7UsC0HsdBeHmy_xvECm84qlXHwIoGBV2rk', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8jg4H-3mtslFtHHj5odslZizbzquoy0KJPp_ZcaPJfmEWGakJGkXr0xuLh-5pzESdP7DZDDPuyx7TOk-Vr-GdD9d4MzQ', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8iaLgHXA9kP1Gab0-LjixH1XbYRSyvDh8U_Bz0U2Tjc5JpjuM3Zrub4EcS-nFbaObQiOKOCHIKZuBn1Q91hLblDfQtYx0', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8luvOmnSUBSuwwQV_84Z8bcEt3CRzSTz2RQS016aI8wuaCzgjpnxUxCOtD8lGIGSQfkERRzxW1T2t2qSaOjb4aPEJ-Jx0', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8kbKT3QJERdmecdKDkHSoMoXSniWOQsn-QIAxV6DdMFtaCVtSkaN8ZAbAYsq4ASWNiBuNGGR8kD2cmoSvmIdKnuhztNw', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8nNTbJHovvbC-2gPbI5KOgt2zghQehOj9cRCiG4vCC7JoRTNqmIkjSLhRbbI-UhQQ4qV6VoZuc2opMo3DqGmVV5buJycQ', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8mQGt4VfZKRvRhI5ILdBLkxXar2g51KytOYsbHkHdExbreOWA54eVdlkiPEoaJJMG8LUBZ7iZ8-E5INsHrdA1ZG7deRh4', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8pLXJYHI-a8nHXvxfeGZ4Wx9xbU7BcN19iGczuIIrUqFOS38wC2KeBH1oChm-JIH0EhtlEmUnqzhVLRE-K4mMLWQh72w', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8okmHdcCdskP7LmeBLQiN9reOaSydRb1rl1SrM8gMHJTci93Pjvcls9dqlWalYLm8sBFzieqAVD6nCyBB2G2sPu-PiUmg', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4hOcHPA4zCjLnErqe9LD5c8E8gRs4rBf4KkPYCbKVvgF68nefvxa0BS5SFumwHJsT8wW6RdTd867QCewf4Udlp7-ygiA', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4gv7ktxxXawJyq73ZXSDDO3K3W4XdaPCHnm9Fhi2bH9kAj7wOd_FPpHhoLc9oEHW6JHBVkC15igau8ppEDn6b9PADFmgo', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4jSN_mDWvfNa5RrLTavB-U9YOF-6G0HyZa5RXdQ-QrNmVT9Oo0_SjPOtDWAeBC2hYdlAx-QmhHAXS4yB-3YEGDRJiwf54', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4i59rZPbyugO3dSl_y3r71j5kre0TVzA8Mn_ejcxaF9nszVzBmMcWNFJCv4qR9j9C6y-m4EOA27TJE6lIse8pIqPtiGzM', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4le55QaxXu2zOLDO53A0S5tDUVyoQjqihzMn43fMRajKaMeobc3_lYTJNWRbuufGpzZjbSJqODeeJSIOTkSm-NhFMnsL4', + '活动不存在或已结束,试试其他活动吧~', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4nVvBWxlihhrqqtJhrVGMzep75ykmRsh0RYafgHWA1DJhDcZn12n6L-82KG5NFY3gD7UI5IxliqAoKSj6vhJy7FAtSwA', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4mLJGS2hwyI05jqfoxqpX_fLOBWLhLJedkAZCNWZe_N7n5xIm5_K17KyNSTK2B5Xd-xVXC-vktUvxHJt8QbYDVcRL4OIY', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4pljzS2kzg32QlbdWIhIm4DcTeqsZ46Xehmm3-X5Nk5ZkAwXgLXY98IGZYKVqBmnqetu8iXtOcWKeA3BUeuyjwk2_TiKc', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4oEBZPcxERcmVGNMEUXy8y6E-cqbbfnR63aUrz5H7Yo6vc8L1E0SyHbI3d6N4b2CrQ_cLS8Voux-npXu8WbABWYfrUmQ', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkhDsSrdkcVGK3VTommsDKAvYw0l6HweWIWVOjHViJGyWGC38WVh963S5Ud1PAt4EQlV1MmI7jNTdQ5sk1iG8ZomoiZazQ', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkgy97snot-BF6Y0n9yUo6v0AN7ylo5Jbe0cB5T8A0783IPCGqMCm3yn-rOL395ebEQaM-nw6Da5Ap3Ias-VLHpIxeB8NE', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkjXCW2KTTC26wxgkilM-7gp6oP-EceBlbS7SH5xeHFkR4RmW3VotHe-F9kJFDZRbdGIPd5ATI38KQ6QHShR1zFb0Q3CQU', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkiBmW2WsEkjXxdxhQfNXDc8wfa-p9jwesxxnCOZZ0jBWF1gW5VespnUODpkyKDhz3g2LeKhup9EEdyp0kHoNe-Tm3bDyk', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfklnO45rRYZjmyo0tMWIEQIt2PjL0cEZWiUop4NmuzSvoMvQwamflWB2nR0HUzAq7JBA_lCgRGgpO7f-OSSu4y_bkZXZA', + '活动不存在或已结束,试试其他活动吧~', + '活动不存在或已结束,试试其他活动吧~', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkmCjT4RXQOEO1JuKHUbhTy4jTDchNxUn5-n5HNHX6Mqptvx2i8lOe_cfYziWW_KbwN5iZfGd0mEiOM2qrPkWFayz-VMaw', + '活动不存在或已结束,试试其他活动吧~', + '活动不存在或已结束,试试其他活动吧~', + '活动不存在或已结束,试试其他活动吧~', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfggMxZjZNCAb9v9v2mWjs7bl2RxHBJWrCEV4xjJ9NBSese836v2mfKFfc2tv9SrjmhycjvhTqXR3CBmCrWEVbw_fljmrQ', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgj6GYEtRUHqfbhnsvLlCTSV-jTYvQR_t8SCOOABo2vxzkDDCaRXDDv2MUrOps5NumniB5MDKkoU5BVCxEikisRgsnPYd0', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgitlDQvhA0gqfgXU0UfYkrTuOXJnst9JYdbW5yHLe41n6RtD_pMMp2zc1SBIloFjmNFaeaUP1clWcOGqtV4wbLTeGLAKY', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgl0vbXXC9JdSAWkC-vVrO9vmU82R3qkl1oBmb9pNdjxgiDaklmSNZzhKSfieRcJ-Mn8y0o01XmiLQ6lWg7Tj-RdDyrig', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgkvQ0bu6XWOuaKd5H28f-yXxgdhMmK5RyAW9TzjtIskHb4QHYhqNATons0UdM3YjqizMaOKb5o373TDItVq5gvTG8fat0', + '活动不存在或已结束,试试其他活动吧~', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgmVp8WCv8r_aeQECSQZLMnp4ZxgGpbkZazZQETws2UMPvcMJeYaXH6SBG3ax6bwcmDW73vzOd9Qqcea625puk_oTdAln8', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgpHAaEY1G-5u_B-Hh6N0ua6psMP8lmBLSikCLnYmc5RONZxeHqyruE7TPlV44cwrCYYlS2lakReHT9HZqJ9EZyRhBBN_w', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgozwf1YShpYwumLKrL2ds-Ag81fYt_1cAv52t7qDr42NdQFFaopeqjh6VRtU_aiNImgvJJ32UbedSst8YDL5JSEQ8Jl0Q', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfshzgVN_NDaq8FF1xcXks1Of81nzViBaivBA1KiwyeHh_cXdtE9jJbEpTStq8KmaT9B-LjEJNlR-7sBpUDHhZww7B6iCXM', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfsgP4D0AfC15vH5HIIregOPLqDnr78boGgwDTgIynX7z-CPYc0V5w4G8zRgtIABHbj872nCBjsjr-wsWv1uUZCRMrBs-zk', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfsj0X_ymCa6ASuH9tD9XzpcnvT70DQJ2uYV9vnfYD0eGFFvspksrWau9vCgvsqtg6MUpdoylM6iP27zWfi1Viout7gBv1Y', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfsi-uUhG9sLfW9OhsLAFSwzLYKUWYRV6EzyrqbaOQqgc4gavlWUThHlBPJXBXYgV6Cq318pd01uwwnTdHCmuyePmFGp7w', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfslOA7UpZCFo6gy9F9tsvVD5GIjYRFPS4p9DUzpnlipH-R6Ov_GrQ7t1aUcr7aguuCVti_gXDboLJBrZkCDp_Ck1-zL04w', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfskmMFFOF1YzpVZ-2NGA0v5nDJ5DFdEf24JLCi9vi2RLagqxaIeOEf_cQdqCNyZI3EwfsStEvLuC8wd-bZWpWYDy6Fscr0', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfsnd9UbKcTL-Uh4IvNj847UoVCCAysL3HRqrIqbgYVVuS0A1K9x3IZOfvtLSnjtzpGOMzzcu5XjTB4NT7BQGQx2hjOj9GQ', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfsmTZ3cgqFDSKt8YjYAgC13jJqcd-rNZDUamX1Kpf6rTaQMnben4JpS7OaO0zwwBHmnVBWBnQrciL9uUjKy0G1Rc-Ii3ec', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfspw6HcZ5vYwG8WHB2lVJz-sxaAb05U7A05tsQpb_ni_ec-_W6W2xOjWDXlKXZtUrKvg9K62yVrUpDpZgi6v4wIBP3i_A', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfso47WwFIl3VWc_YDFC-othyiQJe6toaODA3bAzRj8R-2XS40j3HI90wvW4mFtodnVkiGY7CgFcg8Ery0q-Jrm2SzUno0g', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfohrXzwpKGQht1jOwZEQRhHVi2kxj_hzvgj9nEzYftgVXgYal5gjmwchuHxJVr4zOxHxfPvImrZniHDDXuJuATC1h4qQlc', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfoglaRdeBfYHV_Rqhy6V0OpX2pemE-YlxdpmRgy_3C8ZEVjwp6gyK-XfDFYmtXpJsLBE48CiflFoP2yAvXGUdlr0iZh0g', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfojhnbJMryxC2HOwz_Ek2tydOLzdQTvynbTfaR_N2vXRMfDnxQBppvnBjCW-DScTQKKUkytI6xOyqRBCk1Z4Z4eXL_owCk', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfoiYwCuF_2kpo674jSO7Qx5IpVjyd-_uJorWExZavT2jyrB8GS36erI2h9kFgYLwCInekTISNM9gykIZswvQ4SxPR9hAzw', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfolX68uJtWXPwReKCDo6vOdfwaqN-UZs9FpX4SjCVgLqmiPUR4QzIvGNyLfPm-wrNwC2fpsWyjHcFcrAiXQqzgUCZzeVUk', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfokpv63ZoN0iHyfMZo1SVajHKX2otxF4ze0mmw9ssKUorC--5bMjSHBALhA8_D9UHGKj2OOYxT37CTzCZesDz5n2FzQW5U', + '活动不存在或已结束,试试其他活动吧~', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfomGcx4Npir_v8wdomXvxUIhXD-MeaCmqOkFaqPFcwbmTcV8FCVSBJg0gkVFrotgMRMOzJp-Gl10zmjugQGIIxalBb0HwA', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfopmj6UNaaQf1RH3-j34B_k37p3W_NWW_ll-iqiYn0HehoderoVHNUxSuwLceQWStwSWx2m27ix2Y8MkpHBQ5Lg0Jt3nQY', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfooaxiDKISznvTYePbE3lOzASLuXPP8XWysr1MAYZ0KVZ7_HKiPlCSOAmOC5Skxcti8s_5sFtRIORHkRAHrFjyTQNXpjAM', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUhzydZiUwrQA-YYMy56oIDc_oCnNI-N6oSpCbCu2qxRcRLqp6Kp1GEmoAWDwSpq_NZxhDsqZHsHlk0_8qL_yFlMFbrYCw', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUgZwLfqVLDdWMlTpUkB4of3IHJLvvSpytixo0m-Re4R396shpCtt8IbN3zXYy1pMMfbVZR7kPgi9BSK5ST8G_K0ZSrFZA', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUjoOIj6OgMFLBamYLJ3HW8ad1nqLoj1D6NmlFnkGuyAzY5HsOFhsraGonP2B1Tx2nuJPZuJAwapb43a0WxRkKA3HSsXA', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUiRpJ9C08JwP3F2pMpRSWrVmOFj-6wM3wvABiP3AxpYGI1tjr4XIYZkFeMeUstUeifdvNES7Sgx1XXsIVxcD8dlJ8FfqQ', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUlnpdQctIkBIPCE-KoLw6aLglNbHq1qUUBhiT_2BfEFqX0sCJOpxd2ucp_E6syRQ9mW8pSKuTNo7kInnVSO28uaC_LluE', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUkmXh_RTbFx8L_BcJVAtEU78aNcj1OdAsxsTxnDn5jpw72bkx064VI86qV0HpdCbeDo4qPptTDz1m5Ydxb7cxzmeZyWM4', + '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUnHohneTsnYM52nK570112qiiBTQKwEI-OLwFtqDgI2tM5zXpA_1AZDrYeFv4AczU53pMEPZBTWHeQMKWOqCrOrfM-AA' +] + + +//初始化 +function initial() { + merge = { + nickname: "", + enabled: true, + end: false + } + for (let i in merge) { + merge[i].success = 0; + merge[i].fail = 0; + merge[i].prizeCount = 0; + merge[i].notify = ""; + merge[i].show = true; + } +} +//通知 +function msgShow() { + let message = "京东账号:" +merge.nickname + "\n执行成功,请点击通知跳转APP查看!"; + let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/4DEZi5iUgrNLD9EWknrGZhCjNv7V/index.html%22%20%7D`} + $.msg($.name, "", message, url); +} + + +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 1587bfe36299529407611676286d136173e4ff0c Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 01:00:15 +0800 Subject: [PATCH 063/721] --- .github/workflows/jd_starStore.yml | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/jd_starStore.yml diff --git a/.github/workflows/jd_starStore.yml b/.github/workflows/jd_starStore.yml new file mode 100644 index 0000000000..fb28dd21ab --- /dev/null +++ b/.github/workflows/jd_starStore.yml @@ -0,0 +1,48 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: 京东星店长 + +on: + workflow_dispatch: + schedule: + - cron: '5 1 * * * ' + watch: + types: started + +jobs: + build: + + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + npm install request + npm install --save got + npm install tough-cookie + - name: '京东星店长' + env: + COOKIE: ${{secrets.JD_COOKIE}} + TG_BOT_TOKEN : ${{secrets.TG_BOT_TOKEN}} + TG_USER_ID : ${{secrets.TG_USER_ID}} + REMOTE_URL: https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_starStore.js + MULT_CUSTOM_REPLACE: '[[{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-YTX'')"}], + [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-SR'')"}], + [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-LJ'')"}], + [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-ZGX'')"}], + [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-WJY'')"}], + [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-LJ2'')"}], + [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-RQ'')"}], + [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-WRX'')"}], + [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-GC'')"}], + [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-WSR'')"}] + ]' + run: | + node 'scripts/remote/runRemoteScripts.js' From d914f24ce988fb9fcc425d05db028eb7dd96fcb4 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 01:12:10 +0800 Subject: [PATCH 064/721] --- .github/workflows/jd_starStore.yml | 46 +++++++++++------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/.github/workflows/jd_starStore.yml b/.github/workflows/jd_starStore.yml index fb28dd21ab..d722c15947 100644 --- a/.github/workflows/jd_starStore.yml +++ b/.github/workflows/jd_starStore.yml @@ -1,48 +1,36 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: 京东星店长 +name: 星店长 on: workflow_dispatch: schedule: - - cron: '5 1 * * * ' + - cron: '5 5 * * *' watch: types: started - jobs: build: - runs-on: ubuntu-latest if: github.event.repository.owner.id == github.event.sender.id + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 10.x + - name: Use Node.js 12.x uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 12.x - name: npm install run: | npm install - npm install request - npm install --save got - npm install tough-cookie - - name: '京东星店长' - env: - COOKIE: ${{secrets.JD_COOKIE}} - TG_BOT_TOKEN : ${{secrets.TG_BOT_TOKEN}} - TG_USER_ID : ${{secrets.TG_USER_ID}} - REMOTE_URL: https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_starStore.js - MULT_CUSTOM_REPLACE: '[[{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-YTX'')"}], - [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-SR'')"}], - [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-LJ'')"}], - [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-ZGX'')"}], - [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-WJY'')"}], - [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-LJ2'')"}], - [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-RQ'')"}], - [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-WRX'')"}], - [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-GC'')"}], - [{key : /const \$.+\(''(.+)''\);/,value : "const $ = new Env(''$1-WSR'')"}] - ]' + - name: '运行 【京东星店长】' + if: env.JD_COOKIE run: | - node 'scripts/remote/runRemoteScripts.js' + node Task/jd_starStore.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file From 2a9d2cdfcaa07d6a949c95526831031c42ea1907 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 01:16:47 +0800 Subject: [PATCH 065/721] --- .github/workflows/jd_starStore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jd_starStore.yml b/.github/workflows/jd_starStore.yml index d722c15947..76b3f16e5d 100644 --- a/.github/workflows/jd_starStore.yml +++ b/.github/workflows/jd_starStore.yml @@ -4,7 +4,7 @@ name: 星店长 on: workflow_dispatch: schedule: - - cron: '5 5 * * *' + - cron: '5 19 * * *' watch: types: started jobs: From 0addffc10cfe19f8d623a1ab7159421669dc86e1 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 16:12:15 +0800 Subject: [PATCH 066/721] --- .github/workflows/dianshijia.yml | 8 ++++++-- .github/workflows/jd_starStore.yml | 2 ++ .github/workflows/jingxi.yml | 14 +++++++++----- .github/workflows/midu_read.yml | 6 +++--- .github/workflows/txnews.yml | 6 +++--- .github/workflows/weibo.yml | 2 +- .github/workflows/youth.yml | 6 +++--- .github/workflows/youth_read.yml | 6 +++--- 8 files changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/dianshijia.yml b/.github/workflows/dianshijia.yml index e0d1117820..1693489c33 100644 --- a/.github/workflows/dianshijia.yml +++ b/.github/workflows/dianshijia.yml @@ -1,5 +1,5 @@ -name: dianshijia +name: 电视家 on: workflow_dispatch: @@ -15,17 +15,21 @@ jobs: DSJ_HEADERS: ${{ secrets.DSJ_HEADERS }} DSJ_DRAWAL: ${{ secrets.DSJ_DRAWAL }} steps: - - uses: actions/checkout@v1 + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts - name: Use Node.js 12.x uses: actions/setup-node@v1 with: node-version: 12.x - name: npm install run: | + cd ~/Scripts npm install - name: '运行 【电视家】' if: env.DSJ_HEADERS run: | + cd ~/Scripts node Task/dianshijia.js env: DSJ_NOTIFY_CONTROL: ${{ secrets.DSJ_NOTIFY_CONTROL }} diff --git a/.github/workflows/jd_starStore.yml b/.github/workflows/jd_starStore.yml index 76b3f16e5d..c6f932283c 100644 --- a/.github/workflows/jd_starStore.yml +++ b/.github/workflows/jd_starStore.yml @@ -21,10 +21,12 @@ jobs: node-version: 12.x - name: npm install run: | + cd ~/Scripts npm install - name: '运行 【京东星店长】' if: env.JD_COOKIE run: | + cd ~/Scripts node Task/jd_starStore.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} diff --git a/.github/workflows/jingxi.yml b/.github/workflows/jingxi.yml index 2c3b5b521a..8cbb06e88d 100644 --- a/.github/workflows/jingxi.yml +++ b/.github/workflows/jingxi.yml @@ -1,10 +1,10 @@ -name: jingxi +name: 京喜 on: workflow_dispatch: schedule: - - cron: '5 5 * * *' + - cron: '1 19 * * *' watch: types: started jobs: @@ -14,17 +14,21 @@ jobs: env: JD_COOKIE: ${{ secrets.JD_COOKIE }} steps: - - uses: actions/checkout@v1 - - name: Use Node.js 14.x + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 12.x - name: npm install run: | + cd ~/Scripts npm install - name: '运行 【京喜】' if: env.JD_COOKIE run: | + cd ~/Scripts node Task/jingxi.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} diff --git a/.github/workflows/midu_read.yml b/.github/workflows/midu_read.yml index 4889afdd9d..589ce204c0 100644 --- a/.github/workflows/midu_read.yml +++ b/.github/workflows/midu_read.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: midu_read +name: 米读 on: workflow_dispatch: @@ -17,10 +17,10 @@ jobs: MIDU_SIGN: ${{ secrets.MIDU_SIGN }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 14.x + - name: Use Node.js 12.x uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 12.x - name: npm install run: | npm install diff --git a/.github/workflows/txnews.yml b/.github/workflows/txnews.yml index 8705933cee..cf42dfb3d4 100644 --- a/.github/workflows/txnews.yml +++ b/.github/workflows/txnews.yml @@ -4,7 +4,7 @@ # branches: # - master -name: txnews +name: 腾讯新闻 on: workflow_dispatch: @@ -23,10 +23,10 @@ jobs: TXNEWS_VIDEO: ${{ secrets.TXNEWS_VIDEO }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 14.x + - name: Use Node.js 12.x uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 12.x - name: npm install run: | npm install diff --git a/.github/workflows/weibo.yml b/.github/workflows/weibo.yml index f9f24e7a70..a031e72a7c 100644 --- a/.github/workflows/weibo.yml +++ b/.github/workflows/weibo.yml @@ -1,5 +1,5 @@ -name: weibo +name: 微博每日签到打卡 on: workflow_dispatch: diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index afad4ea1db..53ea0e87a3 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: youth +name: 中青看点 on: workflow_dispatch: @@ -21,10 +21,10 @@ jobs: YOUTH_TIME: ${{ secrets.YOUTH_TIME }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 14.x + - name: Use Node.js 12.x uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 12.x - name: npm install if: env.YOUTH_HEADER run: | diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index c6ddde2278..00d2678d9c 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: youth_read +name: 中青自动阅读 on: workflow_dispatch: @@ -20,10 +20,10 @@ jobs: YOUTH_READ4: ${{ secrets.YOUTH_READ4 }} steps: - uses: actions/checkout@v1 - - name: Use Node.js 14.x + - name: Use Node.js 12.x uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 12.x - name: npm install run: | npm install From 7b890d538b8d9c7c7ee2083fd5799abf2abc5261 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 16:28:20 +0800 Subject: [PATCH 067/721] --- .github/workflows/jd_starStore.yml | 4 +++- .github/workflows/midu_read.yml | 6 +++++- .github/workflows/txnews.yml | 6 +++++- .github/workflows/weibo.yml | 10 +++++++--- .github/workflows/youth.yml | 6 +++++- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/jd_starStore.yml b/.github/workflows/jd_starStore.yml index c6f932283c..3d6f899011 100644 --- a/.github/workflows/jd_starStore.yml +++ b/.github/workflows/jd_starStore.yml @@ -14,7 +14,9 @@ jobs: env: JD_COOKIE: ${{ secrets.JD_COOKIE }} steps: - - uses: actions/checkout@v1 + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts - name: Use Node.js 12.x uses: actions/setup-node@v1 with: diff --git a/.github/workflows/midu_read.yml b/.github/workflows/midu_read.yml index 589ce204c0..0443355d7b 100644 --- a/.github/workflows/midu_read.yml +++ b/.github/workflows/midu_read.yml @@ -16,17 +16,21 @@ jobs: MIDU_TIME: ${{ secrets.MIDU_TIME }} MIDU_SIGN: ${{ secrets.MIDU_SIGN }} steps: - - uses: actions/checkout@v1 + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts - name: Use Node.js 12.x uses: actions/setup-node@v1 with: node-version: 12.x - name: npm install run: | + cd ~/Scripts npm install - name: '运行 【米读自动阅读】' if: env.MIDU_TOKEN run: | + cd ~/Scripts node Task/midu_Read.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} diff --git a/.github/workflows/txnews.yml b/.github/workflows/txnews.yml index cf42dfb3d4..c331ed5a9c 100644 --- a/.github/workflows/txnews.yml +++ b/.github/workflows/txnews.yml @@ -22,17 +22,21 @@ jobs: TXNEWS_COOKIE: ${{ secrets.TXNEWS_COOKIE }} TXNEWS_VIDEO: ${{ secrets.TXNEWS_VIDEO }} steps: - - uses: actions/checkout@v1 + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts - name: Use Node.js 12.x uses: actions/setup-node@v1 with: node-version: 12.x - name: npm install run: | + cd ~/Scripts npm install - name: '运行 【腾讯新闻】' if: env.TXNEWS_COOKIE run: | + cd ~/Scripts node Task/txnews.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} diff --git a/.github/workflows/weibo.yml b/.github/workflows/weibo.yml index a031e72a7c..b43e809d0c 100644 --- a/.github/workflows/weibo.yml +++ b/.github/workflows/weibo.yml @@ -15,18 +15,22 @@ jobs: WB_TOKEN: ${{ secrets.WB_TOKEN }} WB_PAY: ${{ secrets.WB_PAY }} steps: - - uses: actions/checkout@v1 - - name: Use Node.js 14.x + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Script + - name: Use Node.js 12.x uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 12.x - name: npm install if: env.WB_TOKEN run: | + cd ~/Scripts npm install - name: '运行 【新浪微博】' if: env.WB_TOKEN run: | + cd ~/Scripts node Task/weibo.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index 53ea0e87a3..02508da39a 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -20,7 +20,9 @@ jobs: YOUTH_REDBODY: ${{ secrets.YOUTH_REDBODY }} YOUTH_TIME: ${{ secrets.YOUTH_TIME }} steps: - - uses: actions/checkout@v1 + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts - name: Use Node.js 12.x uses: actions/setup-node@v1 with: @@ -28,10 +30,12 @@ jobs: - name: npm install if: env.YOUTH_HEADER run: | + cd ~/Scripts npm install - name: '运行 【中青看点】' if: env.YOUTH_HEADER run: | + cd ~/Scripts node Task/youth.js env: YOUTH_NOTIFY_CONTROL: ${{ secrets.YOUTH_NOTIFY_CONTROL }} From ece65f466f23657d414f36aae717495b0a9b6338 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 16:53:52 +0800 Subject: [PATCH 068/721] --- Task/jingxi.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Task/jingxi.js b/Task/jingxi.js index fae87ebc4d..3458ff1d1e 100644 --- a/Task/jingxi.js +++ b/Task/jingxi.js @@ -75,6 +75,10 @@ function getsign() { } } else if (signres.retCode == '30003') { $.msg($.name, '【提示】京东cookie已失效,请重新登录获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + if($.isNode()){ + await notify.sendNotify($.name + " 账号" + $.index+ `\n【提示】京东cookie已失效,请重新登录获取`) + } + return } resolve() }) From 8891d18e2a302c6e5dcd6871fbf417f4f89e7ab0 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 16:55:38 +0800 Subject: [PATCH 069/721] --- Task/jingxi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jingxi.js b/Task/jingxi.js index 3458ff1d1e..85485f3b1d 100644 --- a/Task/jingxi.js +++ b/Task/jingxi.js @@ -60,7 +60,7 @@ function getsign() { Referer: "https://wqsh.jd.com/pingou/taskcenter/index.html" }, } - $.get(signurl, (err, resp, data) => { + $.get(signurl, async(err, resp, data) => { signres = JSON.parse(data) if (signres.retCode == '0') { nickname = signres.data.nickname From a4d8b773b51be192ddf0307749ecac4918fe57a7 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 17:01:32 +0800 Subject: [PATCH 070/721] --- Task/jingxi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jingxi.js b/Task/jingxi.js index 85485f3b1d..3b5efa85e1 100644 --- a/Task/jingxi.js +++ b/Task/jingxi.js @@ -76,7 +76,7 @@ function getsign() { } else if (signres.retCode == '30003') { $.msg($.name, '【提示】京东cookie已失效,请重新登录获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); if($.isNode()){ - await notify.sendNotify($.name + " 账号" + $.index+ `\n【提示】京东cookie已失效,请重新登录获取`) + await notify.sendNotify($.name + " 账号" + $.index, `【提示】京东cookie已失效,请重新登录获取`) } return } From 56418383394487219dc484930ba451dcfc43ccf2 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 17:21:50 +0800 Subject: [PATCH 071/721] --- Task/sendNotify.js | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Task/sendNotify.js b/Task/sendNotify.js index c6b8e9d8ed..fa5f091c2b 100644 --- a/Task/sendNotify.js +++ b/Task/sendNotify.js @@ -96,13 +96,13 @@ function serverNotify(text, desp) { $.post(options, (err, resp, data) => { try { if (err) { - console.log('\n发送通知调用API失败!!\n') + console.log('\n发送通知调用API失败!!') } else { data = JSON.parse(data); if (data.errno === 0) { - console.log('\nserver酱发送通知消息成功\n') + console.log('\nserver酱发送通知消息成功') } else if (data.errno === 1024) { - console.log('\nPUSH_KEY 错误\n') + console.log('\nPUSH_KEY 错误') } } } catch (e) { @@ -112,7 +112,7 @@ function serverNotify(text, desp) { } }) } else { - console.log('\n您未提供server酱的SCKEY,取消微信推送消息通知\n'); + console.log('\n您未提供server酱的SCKEY,取消微信推送消息通知'); resolve() } }) @@ -127,13 +127,13 @@ function BarkNotify(text, desp) { $.get(options, (err, resp, data) => { try { if (err) { - console.log('\nBark APP发送通知调用API失败!!\n') + console.log('\nBark APP发送通知调用API失败!!') } else { data = JSON.parse(data); if (data.code === 200) { - console.log('\nBark APP发送通知消息成功\n') + console.log('\nBark APP发送通知消息成功') } else { - console.log(`\n${data.message}\n`); + console.log(`\n${data.message}`); } } } catch (e) { @@ -143,7 +143,7 @@ function BarkNotify(text, desp) { } }) } else { - console.log('\n您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知\n'); + console.log('\n您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知'); resolve() } }) @@ -162,15 +162,15 @@ function tgBotNotify(text, desp) { $.post(options, (err, resp, data) => { try { if (err) { - console.log('\ntelegram发送通知消息失败!!\n') + console.log('\ntelegram发送通知消息失败!!') } else { data = JSON.parse(data); if (data.ok) { - console.log('\nTelegram发送通知消息完成。\n') + console.log('\nTelegram发送通知消息完成。') } else if (data.error_code === 400) { - console.log('\n请主动给bot发送一条消息并检查接收用户ID是否正确。\n') + console.log('\n请主动给bot发送一条消息并检查接收用户ID是否正确。') } else if (data.error_code === 401){ - console.log('\nTelegram bot token 填写错误。\n') + console.log('\nTelegram bot token 填写错误。') } } } catch (e) { @@ -180,7 +180,7 @@ function tgBotNotify(text, desp) { } }) } else { - console.log('\n您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知\n'); + console.log('\n您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知'); resolve() } }) @@ -209,14 +209,14 @@ function ddBotNotify(text, desp) { $.post(options, (err, resp, data) => { try { if (err) { - console.log('\n钉钉发送通知消息失败!!\n') + console.log('\n钉钉发送通知消息失败!!') console.log(err); } else { data = JSON.parse(data); if (data.errcode === 0) { - console.log('\n钉钉发送通知消息完成。\n') + console.log('\n钉钉发送通知消息完成。') } else { - console.log(`\n${data.errmsg}\n`) + console.log(`\n${data.errmsg}`) } } } catch (e) { @@ -229,14 +229,14 @@ function ddBotNotify(text, desp) { $.post(options, (err, resp, data) => { try { if (err) { - console.log('\n钉钉发送通知消息失败!!\n') + console.log('\n钉钉发送通知消息失败!!') console.log(err); } else { data = JSON.parse(data); if (data.errcode === 0) { - console.log('\n钉钉发送通知消息完成。\n') + console.log('\n钉钉发送通知消息完成。') } else { - console.log(`\n${data.errmsg}\n`) + console.log(`\n${data.errmsg}`) } } } catch (e) { @@ -246,7 +246,7 @@ function ddBotNotify(text, desp) { } }) } else { - console.log('\n您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n'); + console.log('\n您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知'); resolve() } }) From 88225934c111d43c3d0fcc6508382ab55b17a175 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 21:08:49 +0800 Subject: [PATCH 072/721] --- Task/dianshijia.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 10d906f10f..f3717b4ddd 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -47,7 +47,7 @@ const notify = $.isNode() ? require('./sendNotify') : ''; let sleeping = "",detail=``,subTitle=``; let RewardId = $.getdata('REWARD')||'55'; //额外签到奖励,默认55为兑换0.2元额度,44为兑换1天VIP,42为兑换1888金币 const dianshijia_API = 'http://api.gaoqingdianshi.com/api' -let tokenArr = [], DsjurlArr = [], DrawalArr = [],drawalVal,CountMax,CompCount; +let tokenArr = [], DsjurlArr = [], DrawalArr = [],CountMax,CompCount; if ($.isNode()) { if (process.env.DSJ_HEADERS && process.env.DSJ_HEADERS.indexOf('#') > -1) { Dsjheaders = process.env.DSJ_HEADERS.split('#'); @@ -106,7 +106,7 @@ if (isGetCookie = typeof $request !== 'undefined') { await signinfo(); // 签到信息 await Addsign(); // 额外奖励,默认额度 if (drawalVal != undefined){ - await Withdrawal() + await Withdrawal() } else { detail += `【金额提现】❌ 请获取提现地址 \n` };// 金额提现 @@ -305,15 +305,15 @@ function dotask(code) { CompCount = taskres.data.dayCompCount CountMax = taskres.data.dayDoCountMax console.log('任务代码:'+code+',获得金币:'+taskres.data.getCoin) - if (code== 'playTask'&&taskres.data.doneStatus == 3) { + if ( code == 'playTask'&&taskres.data.doneStatus == 3) { detail += `【播放任务】🔕 完成/共计 `+CompCount+`/`+CountMax+` 次\n` } } else if (taskcode == '4000'){ //console.log('任务代码:'+code+','+taskres.msg) } - resolve() }) + resolve() }) } @@ -486,8 +486,8 @@ function getGametime() { } $.get(url, (error, response, data) => { if(logs)$.log(`游戏时长: ${data}\n`) - resolve() }) + resolve() }) } function Addsign() { @@ -498,8 +498,8 @@ function Addsign() { } $.get(url, (error, response, data) => { if(logs)$.log(`额外签到: ${data}\n`) - resolve() }) + resolve() }) } From b6577cc47c6a4c63387fe0b0d7b94313fea37d4a Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 21:23:20 +0800 Subject: [PATCH 073/721] --- Task/dianshijia.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index f3717b4ddd..c3bd575a41 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -1,6 +1,6 @@ /* -更新时间: 2020-11-03 20:40 +更新时间: 2020-11-04 21:20 赞赏:电视家邀请码`893988`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于电视家签到,支持Actions多账号运行,请用'#'或者换行隔开‼️ 获取Cookie方法: @@ -250,8 +250,10 @@ function cash() { { if(logs)$.log(`现金: ${data}\n`) let cashresult = JSON.parse(data) - subTitle += '现金:'+ cashresult.data.amount/100+'元 额度:'+cashresult.data.withdrawalQuota/100+'元' - cashtotal = cashresult.data.totalWithdrawn/100 + if(cashresult.errCode=="0"){ + subTitle += '现金:'+ cashresult.data.amount/100+'元 额度:'+cashresult.data.withdrawalQuota/100+'元' + cashtotal = cashresult.data.totalWithdrawn/100 + } resolve() }) }) @@ -274,7 +276,7 @@ function cashlist() { if(cashres&&cashtotal){ detail += `【提现结果】`+cashres+`共计提现:`+cashtotal+`元\n` } - else if(cashtotal){ + else if(!cashres&&cashtotal){ detail += `【提现结果】今日未提现 共计提现:`+cashtotal+`元\n` } } @@ -282,8 +284,7 @@ function cashlist() { } catch (e){ console.log(`提现列表失败,可忽略: ${data}`) - resolve() - } + } }) }) } @@ -462,15 +463,15 @@ function getCUpcoin() { return new Promise((resolve, reject) => { $.get({ url: `${dianshijia_API}/taskext/getCoin?code=carveUp&coin=0&ext=1`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { if(logs) $.log(`瓜分百万金币: ${data}`) - resolve() }) + resolve() }) } function Withdrawal() { return new Promise((resolve, reject) => { $.get({url: drawalVal, headers: JSON.parse(signheaderVal)}, (error, response, data) => { if(logs)$.log(`金币随机兑换 : ${data}\n`) - const result = JSON.parse(data) + let result = JSON.parse(data) if (result.errCode == 0) { detail += `【金额提现】✅ 到账`+result.data.price/100+`元 🌷\n` } From e7c84a594a040bac1f170667160b8b3ceed38a6c Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 21:27:14 +0800 Subject: [PATCH 074/721] --- Task/dianshijia.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index c3bd575a41..2582a53c5c 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -273,7 +273,8 @@ function cashlist() { cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` } } - if(cashres&&cashtotal){ + console.log(cashtotal+cashres) + if(cashres && cashtotal){ detail += `【提现结果】`+cashres+`共计提现:`+cashtotal+`元\n` } else if(!cashres&&cashtotal){ From b2de4ba868f3a373552bfe39139bf9f5b60cdb69 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 21:30:32 +0800 Subject: [PATCH 075/721] --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 2582a53c5c..39b76d9ba7 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -272,8 +272,8 @@ function cashlist() { (result.data[i].type==2&&result.data[i].ctime>=time){ cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` } + console.log(cashres) } - console.log(cashtotal+cashres) if(cashres && cashtotal){ detail += `【提现结果】`+cashres+`共计提现:`+cashtotal+`元\n` } From 4eb3f447985f7b210481ab3e9f69ed1eae1d6f21 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 21:32:41 +0800 Subject: [PATCH 076/721] --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 39b76d9ba7..ac4d35b833 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -270,9 +270,9 @@ function cashlist() { for (i=0;i=time){ + console.log(result.data[i].amount) cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` } - console.log(cashres) } if(cashres && cashtotal){ detail += `【提现结果】`+cashres+`共计提现:`+cashtotal+`元\n` From 023f02b3dc81efee13000ad7f1de39f7d47255c3 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 21:35:04 +0800 Subject: [PATCH 077/721] --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index ac4d35b833..9e9fe3b56f 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -268,9 +268,9 @@ function cashlist() { try{ if (result.errCode == 0) { for (i=0;i=time){ - console.log(result.data[i].amount) cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` } } From 5af0e384c7c46dca955fc13c4552d76552a08c74 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 21:39:47 +0800 Subject: [PATCH 078/721] --- Task/dianshijia.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 9e9fe3b56f..5bea9b0f7a 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -268,9 +268,9 @@ function cashlist() { try{ if (result.errCode == 0) { for (i=0;i=time){ +(result.data[i].type == 2 && result.data[i].ctime >= time){ cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` } } From d7628a2c0cf2a730085a25b15603678c51627462 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 21:42:47 +0800 Subject: [PATCH 079/721] --- Task/dianshijia.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 5bea9b0f7a..b8ae6e98c9 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -263,14 +263,15 @@ function cashlist() { $.get({ url: `${dianshijia_API}/cash/detail`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { let result = JSON.parse(data) - let totalcash = Number(),cashres = "" - var time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 + let totalcash = Number(),cashres = ""; + var time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 try{ if (result.errCode == 0) { for (i=0;i= time){ +(result.data[i].type == '2' && result.data[i].ctime >= time ){ + console.log(result.data[i].amount) cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` } } From 17bd8d58758bb55cd5672e0224281029ed4f3de2 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 21:46:00 +0800 Subject: [PATCH 080/721] --- Task/dianshijia.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index b8ae6e98c9..d24dfebdb0 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -268,7 +268,9 @@ function cashlist() { try{ if (result.errCode == 0) { for (i=0;i= time && result.data[i].type == '2'){ + console.log(result.data[i].ctime) + } if (result.data[i].type == '2' && result.data[i].ctime >= time ){ console.log(result.data[i].amount) From 13d02b4fc211bebf442ec590b014ffeb59b79180 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 21:46:37 +0800 Subject: [PATCH 081/721] --- Task/dianshijia.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index d24dfebdb0..05fd9afc3d 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -270,13 +270,13 @@ function cashlist() { for (i=0;i= time && result.data[i].type == '2'){ console.log(result.data[i].ctime) - } + }; if (result.data[i].type == '2' && result.data[i].ctime >= time ){ console.log(result.data[i].amount) cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` - } - } + }, + }; if(cashres && cashtotal){ detail += `【提现结果】`+cashres+`共计提现:`+cashtotal+`元\n` } From 108c63a80f1c2dfcc3627970ba1e6e918cb17fc4 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 21:48:23 +0800 Subject: [PATCH 082/721] --- Task/dianshijia.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 05fd9afc3d..43af87a92b 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -273,9 +273,9 @@ function cashlist() { }; if (result.data[i].type == '2' && result.data[i].ctime >= time ){ - console.log(result.data[i].amount) + console.log(result.data[i].amount); cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` - }, + } }; if(cashres && cashtotal){ detail += `【提现结果】`+cashres+`共计提现:`+cashtotal+`元\n` From 2ddb6f03d118f40378704b4e2496c36194744423 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 22:03:59 +0800 Subject: [PATCH 083/721] --- Task/dianshijia.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 43af87a92b..67251fbe30 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -96,6 +96,11 @@ if (isGetCookie = typeof $request !== 'undefined') { return; } console.log(`------------- 共${tokenArr.length}个账号`) + if($.isNode()){ + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-28800 + } else { + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 + } for (let i = 0; i < tokenArr.length; i++) { if (tokenArr[i]) { signheaderVal = tokenArr[i]; @@ -264,17 +269,12 @@ function cashlist() { headers: JSON.parse(signheaderVal)}, (error, response, data) => { let result = JSON.parse(data) let totalcash = Number(),cashres = ""; - var time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 try{ if (result.errCode == 0) { for (i=0;i= time && result.data[i].type == '2'){ - console.log(result.data[i].ctime) - }; if (result.data[i].type == '2' && result.data[i].ctime >= time ){ - console.log(result.data[i].amount); - cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` + cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` } }; if(cashres && cashtotal){ @@ -386,7 +386,6 @@ function coinlist() { let result = JSON.parse(data) let onlamount = 0, vdamount = 0, gamestime = 0, todaysign = 0; - var time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 try { for (i=0;i= time;i++){ if (result.data[i].from=="领取走路金币"){ From 203e5950d2419a3efbf5a3f8992f66ed68375d43 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 22:22:29 +0800 Subject: [PATCH 084/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=B5=E8=A7=86?= =?UTF-8?q?=E5=AE=B6=E6=97=B6=E5=8C=BA=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/dianshijia.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 67251fbe30..ba622f024f 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -1,6 +1,6 @@ /* -更新时间: 2020-11-04 21:20 +更新时间: 2020-11-04 22:20 赞赏:电视家邀请码`893988`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于电视家签到,支持Actions多账号运行,请用'#'或者换行隔开‼️ 获取Cookie方法: @@ -96,8 +96,8 @@ if (isGetCookie = typeof $request !== 'undefined') { return; } console.log(`------------- 共${tokenArr.length}个账号`) - if($.isNode()){ - time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-28800 + if(new Date().getTimezoneOffset()/60 != `-8`){ + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-(0-new Date().getTimezoneOffset()*60) } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } From 5e21a499d7d18eeb2d80e6e41041df5d2d249c15 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 22:31:38 +0800 Subject: [PATCH 085/721] --- Task/dianshijia.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index ba622f024f..b32fd7079a 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -98,6 +98,8 @@ if (isGetCookie = typeof $request !== 'undefined') { console.log(`------------- 共${tokenArr.length}个账号`) if(new Date().getTimezoneOffset()/60 != `-8`){ time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-(0-new Date().getTimezoneOffset()*60) + + console.log(time) } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } From dc8b545f1b6873ee76db54414eb866830408e022 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 22:32:24 +0800 Subject: [PATCH 086/721] --- Task/dianshijia.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index b32fd7079a..3e890da024 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -96,8 +96,8 @@ if (isGetCookie = typeof $request !== 'undefined') { return; } console.log(`------------- 共${tokenArr.length}个账号`) - if(new Date().getTimezoneOffset()/60 != `-8`){ - time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-(0-new Date().getTimezoneOffset()*60) + if(new Date().getTimezoneOffset()/60 != '-8'){ + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 + new Date().getTimezoneOffset()*60 console.log(time) } else { From 991520d17eb66812b40151a1e0ab095a5c650615 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 22:38:24 +0800 Subject: [PATCH 087/721] --- Task/dianshijia.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 3e890da024..fb5518664c 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -97,8 +97,7 @@ if (isGetCookie = typeof $request !== 'undefined') { } console.log(`------------- 共${tokenArr.length}个账号`) if(new Date().getTimezoneOffset()/60 != '-8'){ - time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 + new Date().getTimezoneOffset()*60 - + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 + Number(new Date().getTimezoneOffset()*60) console.log(time) } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 From ec24a5b245ec3f9f0ca04809afd2427a051614fe Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 23:06:56 +0800 Subject: [PATCH 088/721] --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index fb5518664c..b44fefe7ed 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -97,7 +97,7 @@ if (isGetCookie = typeof $request !== 'undefined') { } console.log(`------------- 共${tokenArr.length}个账号`) if(new Date().getTimezoneOffset()/60 != '-8'){ - time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 + Number(new Date().getTimezoneOffset()*60) + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 console.log(time) } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 From baddeb85cec7971780ebb52e2822548cb27d0de8 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 23:28:27 +0800 Subject: [PATCH 089/721] --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index b44fefe7ed..0b442e98e7 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -98,7 +98,7 @@ if (isGetCookie = typeof $request !== 'undefined') { console.log(`------------- 共${tokenArr.length}个账号`) if(new Date().getTimezoneOffset()/60 != '-8'){ time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 - console.log(time) + console.log(new Date().getTimezoneOffset()*60) } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } From de1b6cff90ccb56a8873b3c888a8853a86b00f7e Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 4 Nov 2020 23:39:41 +0800 Subject: [PATCH 090/721] --- Task/dianshijia.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 0b442e98e7..4571e1d251 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -97,8 +97,7 @@ if (isGetCookie = typeof $request !== 'undefined') { } console.log(`------------- 共${tokenArr.length}个账号`) if(new Date().getTimezoneOffset()/60 != '-8'){ - time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 - console.log(new Date().getTimezoneOffset()*60) + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-8*60*60 } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } From c5bedf08db4074b469f813bda4724273cb272535 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 5 Nov 2020 10:20:11 +0800 Subject: [PATCH 091/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BE=AE=E5=8D=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/weibo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/weibo.yml b/.github/workflows/weibo.yml index b43e809d0c..8212569a5f 100644 --- a/.github/workflows/weibo.yml +++ b/.github/workflows/weibo.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout run: | - git clone https://github.com/Sunert/Scripts.git ~/Script + git clone https://github.com/Sunert/Scripts.git ~/Scripts - name: Use Node.js 12.x uses: actions/setup-node@v1 with: From 5d28a86c600da8c4017d808f059d44313bff7a6c Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 5 Nov 2020 19:28:47 +0800 Subject: [PATCH 092/721] --- .github/workflows/jd_ timeMachine.yml | 40 +++ .github/workflows/jd_lotteryMachine.yml | 40 +++ .github/workflows/jd_rankingList.yml | 40 +++ .github/workflows/jd_starStore.yml | 2 +- Task/jd_lotteryMachine.js | 281 +++++++++++++++++++ Task/jd_rankingList.js | 228 +++++++++++++++ Task/jd_starStore.js | 25 +- Task/jd_timeMachine.js | 356 ++++++++++++++++++++++++ 8 files changed, 999 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/jd_ timeMachine.yml create mode 100644 .github/workflows/jd_lotteryMachine.yml create mode 100644 .github/workflows/jd_rankingList.yml create mode 100644 Task/jd_lotteryMachine.js create mode 100644 Task/jd_rankingList.js create mode 100644 Task/jd_timeMachine.js diff --git a/.github/workflows/jd_ timeMachine.yml b/.github/workflows/jd_ timeMachine.yml new file mode 100644 index 0000000000..332d52373f --- /dev/null +++ b/.github/workflows/jd_ timeMachine.yml @@ -0,0 +1,40 @@ + +name: 京东时光机 + +on: + workflow_dispatch: + schedule: + - cron: '15 */4 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【京东时光机】' + if: env.JD_COOKIE + run: | + cd ~/Scripts + node Task/jd_timeMachine.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/.github/workflows/jd_lotteryMachine.yml b/.github/workflows/jd_lotteryMachine.yml new file mode 100644 index 0000000000..03d250ff0f --- /dev/null +++ b/.github/workflows/jd_lotteryMachine.yml @@ -0,0 +1,40 @@ + +name: 京东抽奖机 + +on: + workflow_dispatch: + schedule: + - cron: '8 16 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【京东抽奖机】' + if: env.JD_COOKIE + run: | + cd ~/Scripts + node Task/jd_lotteryMachine.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/.github/workflows/jd_rankingList.yml b/.github/workflows/jd_rankingList.yml new file mode 100644 index 0000000000..a8c5967275 --- /dev/null +++ b/.github/workflows/jd_rankingList.yml @@ -0,0 +1,40 @@ + +name: 京东排行榜 + +on: + workflow_dispatch: + schedule: + - cron: '10 16 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【京东排行榜】' + if: env.JD_COOKIE + run: | + cd ~/Scripts + node Task/jd_rankingList.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/.github/workflows/jd_starStore.yml b/.github/workflows/jd_starStore.yml index 3d6f899011..575a5210d4 100644 --- a/.github/workflows/jd_starStore.yml +++ b/.github/workflows/jd_starStore.yml @@ -4,7 +4,7 @@ name: 星店长 on: workflow_dispatch: schedule: - - cron: '5 19 * * *' + - cron: '5 16 * * *' watch: types: started jobs: diff --git a/Task/jd_lotteryMachine.js b/Task/jd_lotteryMachine.js new file mode 100644 index 0000000000..31cb666e9f --- /dev/null +++ b/Task/jd_lotteryMachine.js @@ -0,0 +1,281 @@ +/* +京东抽奖机 +更新时间:2020-11-05 16:06 +脚本说明: +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +// quantumultx +[task_local] +#京东抽奖机 +11 1 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_lotteryMachine.js, tag=京东抽奖机, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jd.png, enabled=true +// Loon +[Script] +cron "11 1 * * *" script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_lotteryMachine.js,tag=京东抽奖机 +// Surge +京东抽奖机 = type=cron,cronexp=11 1 * * *,wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_lotteryMachine.js + */ +const $ = new Env('京东抽奖机'); +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +const STRSPLIT = "|"; +const needSum = false; //是否需要显示汇总 +$.isMuteLog = true //是否显示出参详情 +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) +} else { + cookiesArr.push($.getdata('CookieJD')); + cookiesArr.push($.getdata('CookieJD2')); +} + +const JD_API_HOST = `https://api.m.jd.com/client.action`; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + cookie = cookiesArr[i]; + if (cookie) { + if (i) console.log(`\n***************开始京东账号${i + 1}***************`) + initial(); + await QueryJDUserInfo(); + if (!merge.enabled) //cookie不可用 + { + $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 + $.msg($.name, `【提示】京东账号${i + 1} cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + continue; + } + await interact_template_getHomeData(); + await interact_template_getLotteryResult(); + await msgShow(); + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + + +//获取昵称 +function QueryJDUserInfo(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + headers : { + 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, + 'Cookie' : cookie + } + } + $.get(url, (err, resp, data) => { + try { + data = JSON.parse(data); + if (data.retcode === 13) { + merge.enabled = false + return + } + merge.nickname = data.base.nickname; + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +function interact_template_getHomeData(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}`, + headers : { + 'Origin' : `https://h5.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html`, + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=interact_template_getHomeData&body={"appId":"1EFRQxQ","taskToken":""}&client=wh5&clientVersion=1.0.0` + } + $.post(url, async (err, resp, data) => { + try { + if (!$.isMuteLog) console.log(data); + data = JSON.parse(data); + + for (let i = 0;i < data.data.result.taskVos.length;i ++) { + console.log("\n" + data.data.result.taskVos[i].taskType + '-' + data.data.result.taskVos[i].taskName + '-' + (data.data.result.taskVos[i].status === 1 ? `已完成${data.data.result.taskVos[i].times}-未完成${data.data.result.taskVos[i].maxTimes}` : "全部已完成")) + //签到 + if (data.data.result.taskVos[i].taskType === 13) { + if (data.data.result.taskVos[i].status === 1) { + await harmony_collectScore(data.data.result.taskVos[i].simpleRecordInfoVo.taskToken,data.data.result.taskVos[i].taskId); + } + continue + } + if (data.data.result.taskVos[i].taskType === 14) {//'data.data.result.taskVos[i].assistTaskDetailVo.taskToken' + await harmony_collectScore('P04z54XCjVXmYaW5m9cZ2f433tIlGBj3JnLHD0',data.data.result.taskVos[i].taskId); + continue + } + let list = data.data.result.taskVos[i].productInfoVos || data.data.result.taskVos[i].followShopVo || data.data.result.taskVos[i].shoppingActivityVos || data.data.result.taskVos[i].browseShopVo + for (let k = data.data.result.taskVos[i].times; k < data.data.result.taskVos[i].maxTimes; k++) { + for (let j in list) { + if (list[j].status === 1) { + //console.log(list[j].simpleRecordInfoVo||list[j].assistTaskDetailVo) + console.log("\n" + (list[j].title || list[j].shopName||list[j].skuName)) + await harmony_collectScore(list[j].taskToken,data.data.result.taskVos[i].taskId); + list[j].status = 2; + break; + } else { + continue; + } + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +function harmony_collectScore(taskToken,taskId,timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}`, + headers : { + 'Origin' : `https://h5.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html?inviteId=P04z54XCjVXmYaW5m9cZ2f433tIlGBj3JnLHD0`,//?inviteId=P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=harmony_collectScore&body={"appId":"1EFRQxQ","taskToken":"${taskToken}","taskId":${taskId},"actionType":0}&client=wh5&clientVersion=1.0.0` + } + $.post(url, async (err, resp, data) => { + try { + if (!$.isMuteLog) console.log(data); + data = JSON.parse(data); + console.log(data.data.bizMsg) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} +// +function interact_template_getLotteryResult(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}`, + headers : { + 'Origin' : `https://h5.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html?inviteId=P04z54XCjVXmYaW5m9cZ2f433tIlGBj3JnLHD0`,//?inviteId=P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=interact_template_getLotteryResult&body={"appId":"1EFRQxQ"}&client=wh5&clientVersion=1.0.0` + } + $.post(url, async (err, resp, data) => { + try { + if (!$.isMuteLog) console.log(data); + if (!timeout) console.log('\n开始抽奖') + data = JSON.parse(data); + if (data.data.bizCode === 0) { + merge.jdBeans.success++; + if (data.data.result.userAwardsCacheDto.jBeanAwardVo&&data.data.result.userAwardsCacheDto.jBeanAwardVo.prizeName === "京豆") { + console.log(data.data.result.userAwardsCacheDto.jBeanAwardVo.prizeName + ':' + data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity) + merge.jdBeans.prizeCount += parseInt(data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity) + } + if (parseInt(data.data.result.userScore) >= 400 ) { + await interact_template_getLotteryResult(1000) + } + } else{ + merge.jdBeans.fail++; + console.log(data.data.bizMsg) + if (data.data.bizCode === 111 ) data.data.bizMsg = "无机会" + merge.jdBeans.notify = `${data.data.bizMsg}`; + } + + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//初始化 +function initial() { + merge = { + nickname: "", + enabled: true, + //blueCoin: {prizeDesc : "收取|蓝币|个",number : true}, //定义 动作|奖励名称|奖励单位 是否是数字 + jdBeans: {prizeDesc : "抽得|京豆|个",number : true,fixed : 0} + } + for (let i in merge) { + merge[i].success = 0; + merge[i].fail = 0; + merge[i].prizeCount = 0; + merge[i].notify = ""; + merge[i].show = true; + } + //merge.jdBeans.show =Boolean(coinToBeans); +} +//通知 +function msgShow() { + let message = ""; + let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html%22%20%7D`} + let title = `京东账号:${merge.nickname}`; + for (let i in merge) { + if (typeof (merge[i]) !== "object" || !merge[i].show) continue; + if (merge[i].notify.split("").reverse()[0] === "\n") merge[i].notify = merge[i].notify.substr(0,merge[i].notify.length - 1); + message += `${merge[i].prizeDesc.split(STRSPLIT)[0]}${merge[i].prizeDesc.split(STRSPLIT)[1]}:` + (merge[i].success ? `${merge[i].prizeCount.toFixed(merge[i].fixed)}${merge[i].prizeDesc.split(STRSPLIT)[2]}\n` : `失败:${merge[i].notify}\n`) + } +//合计 + if (needSum) + { + $.sum = {}; + for (let i in merge) { + if (typeof (merge[i]) !== "object" || !merge[i].show) continue; + if (typeof ($.sum[merge[i].prizeDesc.split(STRSPLIT)[1]]) === "undefined") $.sum[merge[i].prizeDesc.split(STRSPLIT)[1]] = {count : 0}; + $.sum[merge[i].prizeDesc.split(STRSPLIT)[1]].count += merge[i].prizeCount; + } + message += `合计:` + for (let i in $.sum) + { + message += `${$.sum[i].count.toFixed($.sum[i].fixed)}${i},` + } + } + message += `请点击通知跳转至APP查看` + //message = message.substr(0,message.length - 1); + $.msg($.name, title, message, url); +} + + + +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 diff --git a/Task/jd_rankingList.js b/Task/jd_rankingList.js new file mode 100644 index 0000000000..9578098cad --- /dev/null +++ b/Task/jd_rankingList.js @@ -0,0 +1,228 @@ +/* +京东排行榜 +更新时间:2020-11-05 16:07 +脚本说明:京东排行榜签到得京豆 +活动入口:找不着了,点击脚本通知进入吧 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +// quantumultx +[task_local] +#京东排行榜 +11 9 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_rankingList.js, tag=京东排行榜, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jd.png, enabled=true +// Loon +[Script] +cron "11 9 * * *" script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_rankingList.js,tag=京东排行榜 +// Surge +京东排行榜 = type=cron,cronexp=11 9 * * *,wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_rankingList.js + */ +const $ = new Env('京东排行榜'); +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +const needSum = false; //是否需要显示汇总 +const STRSPLIT = "|"; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) +} else { + cookiesArr.push($.getdata('CookieJD')); + cookiesArr.push($.getdata('CookieJD2')); +} + +const JD_API_HOST = `https://api.m.jd.com/client.action?functionId=`; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + cookie = cookiesArr[i]; + if (cookie) { + if (i) console.log(`\n***************开始京东账号${i + 1}***************`) + initial(); + await QueryJDUserInfo(); + if (!merge.enabled) //cookie不可用 + { + $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 + $.msg($.name, `【提示】京东账号${i + 1} cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + continue; + } + await queryTrumpTask(); + await msgShow(); + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + + +//获取昵称 +function QueryJDUserInfo(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + headers : { + 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, + 'Cookie' : cookie + } + } + $.get(url, (err, resp, data) => { + try { + data = JSON.parse(data); + if (data.retcode === 13) { + merge.enabled = false + return + } + merge.nickname = data.base.nickname; + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//查询任务 +function queryTrumpTask(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}queryTrumpTask&body=%7B%22sign%22%3A2%7D&appid=content_ecology&clientVersion=9.2.0&client=wh5`, + headers : { + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3wtN2MjeQgjmxYTLB3YFcHjKiUJj/index.html`, + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + } + } + $.post(url, async (err, resp, data) => { + try { + //console.log(data) + data = JSON.parse(data) + let now = $.time('yyyy-MM-dd') + for (let i in data.result.signTask.taskItemInfo.signList){ + //console.log(data.result.signTask.taskItemInfo.signList[i]) + if (data.result.signTask.taskItemInfo.signList[i].match(now)) { + merge.jdBeans.fail++; + merge.jdBeans.notify = `${now}已签过`; + console.log(now + '已签过') + return + } + } + for (let i in data.result.taskList) { + console.log(data.result.taskList[i].taskName) + if (data.result.taskList[i].taskItemInfo.status === 0) { + await doTrumpTask(data.result.taskList[i].taskId,data.result.taskList[i].taskItemInfo.itemId,1000) + } else { + console.log('已完成') + } + } + console.log('开始签到') + await doTrumpTask(4,"1",1000) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +//做任务 +function doTrumpTask(taskId,itemId,timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}doTrumpTask&body=%7B%22taskId%22%3A${taskId}%2C%22itemId%22%3A%22${itemId}%22%2C%22sign%22%3A2%7D&appid=content_ecology&clientVersion=9.2.0&client=wh5`, + headers : { + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3wtN2MjeQgjmxYTLB3YFcHjKiUJj/index.html`, + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + } + } + $.post(url, async (err, resp, data) => { + try { + // + data = JSON.parse(data); + console.log(data.msg) + if (data.code !== "0") { + merge.jdBeans.fail++; + merge.jdBeans.notify = `${data.msg}`; + return + } else { + merge.jdBeans.success++; + merge.jdBeans.prizeCount += parseInt(data.result.lotteryScore) + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + + +//初始化 +function initial() { + merge = { + nickname: "", + enabled: true, + //blueCoin: {prizeDesc : "收取|蓝币|个",number : true}, //定义 动作|奖励名称|奖励单位 是否是数字 + jdBeans: {prizeDesc : "获得|京豆|个",number : true,fixed : 0} + } + for (let i in merge) { + merge[i].success = 0; + merge[i].fail = 0; + merge[i].prizeCount = 0; + merge[i].notify = ""; + merge[i].show = true; + } +} +//通知 +function msgShow() { + let message = ""; + let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/3wtN2MjeQgjmxYTLB3YFcHjKiUJj/index.html%22%20%7D`} + let title = `京东账号:${merge.nickname}`; + for (let i in merge) { + if (typeof (merge[i]) !== "object" || !merge[i].show) continue; + if (merge[i].notify.split("").reverse()[0] === "\n") merge[i].notify = merge[i].notify.substr(0,merge[i].notify.length - 1); + message += `${merge[i].prizeDesc.split(STRSPLIT)[0]}${merge[i].prizeDesc.split(STRSPLIT)[1]}:` + (merge[i].success ? `${merge[i].prizeCount.toFixed(merge[i].fixed)}${merge[i].prizeDesc.split(STRSPLIT)[2]}\n` : `失败:${merge[i].notify}\n`) + } +//合计 +if (needSum) + { + $.sum = {}; + for (let i in merge) { + if (typeof (merge[i]) !== "object" || !merge[i].show) continue; + if (typeof ($.sum[merge[i].prizeDesc.split(STRSPLIT)[1]]) === "undefined") $.sum[merge[i].prizeDesc.split(STRSPLIT)[1]] = {count : 0}; + $.sum[merge[i].prizeDesc.split(STRSPLIT)[1]].count += merge[i].prizeCount; + } + message += `合计:` + for (let i in $.sum) + { + message += `${$.sum[i].count.toFixed($.sum[i].fixed)}${i},` + } + } + message += `请点击通知跳转至APP查看` + //message = message.substr(0,message.length - 1); + $.msg($.name, title, message, url); +} + + +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 diff --git a/Task/jd_starStore.js b/Task/jd_starStore.js index 7ddc023a96..f03e68f6eb 100644 --- a/Task/jd_starStore.js +++ b/Task/jd_starStore.js @@ -1,6 +1,6 @@ /* 京东星店长 -更新时间:2020-11-03 16:51 +更新时间:2020-11-04 08:27 脚本说明: 第一次执行会循环 8--86号店铺,时间比较长,后面会判断,做完86的不再全部做,每天运行一次即可 使用前请先看下活动介绍,可能会关注店铺,入会是假入会,入会任务可能不会完成 @@ -46,14 +46,14 @@ const JD_API_HOST = `https://api.m.jd.com/client.action?functionId=`; } let shopId = 0; let now = new Date(); - await mcxhd_starmall_taskList(86); //做最后一个,看是否做完 - if (!merge.end) { - for (shopId = 8; shopId <86 ; shopId ++ ) { - console.log('\n开始店铺:' + shopId) - await mcxhd_starmall_taskList(shopId); - } + //await mcxhd_starmall_taskList(86); //做最后一个,看是否做完 + //if (!merge.end) { + for (shopId = 8; shopId <87 ; shopId ++ ) { + console.log('\n开始店铺:' + shopId) + await mcxhd_starmall_taskList(shopId); } - merge.end = false; + //} + //merge.end = false; if (now.getDate() === 3) shopId = 2; if (now.getDate() === 4) shopId = 2; if (now.getDate() === 5) shopId = 3; @@ -140,11 +140,12 @@ function mcxhd_starmall_taskList(shopId,timeout = 0){ await mcxhd_starmall_doTask(shopId,data.result.tasks[i].taskType,data.result.tasks[i].subItem[j].itemId) } } else { - if (shopId === 86) { - console.log('最后一个店铺已做完,不再执行所有店铺') - merge.end = true; - } + //console.log(data.result.tasks[i].taskType) console.log('已完成') + if (data.result.tasks[i].taskType === "1") { + console.log('签到已完成,本店任务跳过') + break + } } } } catch (e) { diff --git a/Task/jd_timeMachine.js b/Task/jd_timeMachine.js new file mode 100644 index 0000000000..78f3374da3 --- /dev/null +++ b/Task/jd_timeMachine.js @@ -0,0 +1,356 @@ +/* +京东时光机 +更新时间:2020-10-31 03:14 +脚本说明: +京东时光机 +20 0-20/4 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_timeMachine.js, tag=京东时光机, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jd.png, enabled=true +*/ +const $ = new Env('京东时光机'); +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) +} else { + cookiesArr.push($.getdata('CookieJD')); + cookiesArr.push($.getdata('CookieJD2')); +} + +const JD_API_HOST = `https://api.m.jd.com/client.action`; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + console.log('提示:任务状态显示0是成功的意思,不要问为什么是0,执行完去app看!') + console.log('4小时执行一次是为了领能量球,不需要的设置为每天执行一次即可!') + for (let i = 0; i < cookiesArr.length; i++) { + cookie = cookiesArr[i]; + if (cookie) { + initial(); + console.log('*******************分割线*********************') + await QueryJDUserInfo(); + if (!merge.enabled) //cookie不可用 + { + $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 + $.msg($.name, `【提示】京东账号${i + 1} cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + continue; + } + await bc_getHome() + await bc_collectEnergyBall() + await bc_taskList() + console.log('\n开始兑换碎片') + await bc_fragmentCharge() + await msgShow() + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + + +//获取昵称(直接用,勿删) +function QueryJDUserInfo(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + headers : { + 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, + 'Cookie' : cookie + } + } + $.get(url, (err, resp, data) => { + try { + data = JSON.parse(data); + if (data.retcode === 13) { + merge.enabled = false + return + } + merge.nickname = data.base.nickname; + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +function qryCompositeMaterials(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}`, + headers : { + 'Origin' : `https://h5.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'Content-Type' : `application/x-www-form-urlencoded` + }, + body : `functionId=qryCompositeMaterials&appid=publicUseApi&body={"activityId":"3DDunaJMLDamrmGwu73QbqtGtbX1","qryParam":"[{\\"type\\":\\"advertGroup\\",\\"id\\":\\"04891674\\",\\"mapTo\\":\\"assist\\",\\"promotion\\":1},{\\"type\\":\\"advertGroup\\",\\"id\\":\\"04892350\\",\\"mapTo\\":\\"game\\",\\"promotion\\":1},{\\"type\\":\\"advertGroup\\",\\"id\\":\\"04891674\\",\\"mapTo\\":\\"normal\\",\\"promotion\\":1}]","applyKey":"big_promotion"}&client=wh5&clientVersion=1.0.0&sid=` + } + $.post(url, async (err, resp, data) => { + try { + console.log(data) + data = JSON.parse(data); + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//查询任务 +function bc_taskList(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url: `${JD_API_HOST}`, + headers: { + 'Origin': `https://h5.m.jd.com`, + 'Cookie': cookie, + 'Connection': `keep-alive`, + 'Accept': `application/json, text/plain, */*`, + 'Referer': `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, + 'Host': `api.m.jd.com`, + 'Accept-Encoding': `gzip, deflate, br`, + 'Accept-Language': `zh-cn`, + 'Content-Type': `application/x-www-form-urlencoded`, + 'User-Agent': `jdapp;iPhone;9.2.0;14.1;` + }, + body : `functionId=bc_taskList&appid=publicUseApi&body={"lat":"36","lng":"117"}&client=wh5&clientVersion=1.0.0&sid=` + } + $.post(url, async (err, resp, data) => { + try { + //console.log(data) + data = JSON.parse(data); + if (data.data.result.signInfo.todayIsSigned === 0) { + console.log('\n开始签到:') + await bc_doTask(0) + } else { + console.log('\n当天已签到') + } + await bc_doTask(8,"","6acTpqhUjIOlhxlTq3RiZg") + for (let i in data.data.result.taskList) { + if (data.data.result.taskList[i].taskType === 8) continue; + console.log('\n开始做任务:' + data.data.result.taskList[i].taskType + '-' + data.data.result.taskList[i].mainTitle) + if (data.data.result.taskList[i].isCompleted === 1) { + console.log('已做完') + continue + } + for (let j = data.data.result.taskList[i].doTimes; j < data.data.result.taskList[i].timesLimit; j++) { + if (data.data.result.taskList[i].taskType === 1) { + for (let k in $.plusAdvertList) { + if ($.plusAdvertList[k].isCompleted === 0) { + console.log('\n' + $.plusAdvertList[k].desc) + await bc_doTask(data.data.result.taskList[i].taskType,$.plusAdvertList[k].comments0) + $.plusAdvertList[k].isCompleted = 1 + } + } + } else if (data.data.result.taskList[i].taskType === 2) { + for (let k in $.t1AdvertList) { + if ($.t1AdvertList[k].isCompleted === 0) { + console.log('\n' + $.t1AdvertList[k].desc) + await bc_doTask(data.data.result.taskList[i].taskType,$.t1AdvertList[k].comments0) + $.t1AdvertList[k].isCompleted = 1 + } + } + } else { + await bc_doTask(data.data.result.taskList[i].taskType) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} +//做任务 +function bc_doTask(taskType,shopId = "",invitePin = "",timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + shopId = shopId&&`"shopId":"${shopId}",` + invitePin = invitePin&&`"invitePin":"${invitePin}",` + let url = { + url : `${JD_API_HOST}`, + headers : { + 'Origin' : `https://h5.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'Content-Type' : `application/x-www-form-urlencoded` + }, + body : `functionId=bc_doTask&appid=publicUseApi&body={${shopId}${invitePin}"taskType":${taskType}}&client=wh5&clientVersion=1.0.0&sid=` + } + $.post(url, async (err, resp, data) => { + try { + //console.log(data) + data = JSON.parse(data); + console.log('做任务结果:'+ data.data.bizCode) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} +// 换碎片 +function bc_fragmentCharge(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}`, + headers : { + 'Origin' : `https://h5.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'Content-Type' : `application/x-www-form-urlencoded` + }, + body : `functionId=bc_fragmentCharge&appid=publicUseApi&body={}&client=wh5&clientVersion=1.0.0&sid=` + } + $.post(url, async (err, resp, data) => { + try { + //console.log(data) + data = JSON.parse(data); + if (data.data.bizCode === 0) { + console.log('寻找碎片结果:剩余'+ data.data.result.energy) + if (data.data.result.energy >= data.data.result.fragmentEnergy) { + await bc_fragmentCharge() + } + } else { + console.log(data.data.bizMsg) + } + + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +// 主页 +function bc_getHome(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}`, + headers : { + 'Origin' : `https://h5.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'Content-Type' : `application/x-www-form-urlencoded` + }, + body : `functionId=bc_getHome&appid=publicUseApi&body={"lat":"","lng":""}&client=wh5&clientVersion=1.0.0&sid=` + } + $.post(url, async (err, resp, data) => { + try { + // + //console.log(data) + data = JSON.parse(data); + console.log("您的助力码为:" + data.data.result.ePin) + $.plusAdvertList = data.data.result.homeAdvertVO.plusAdvertList; + $.t1AdvertList = data.data.result.homeAdvertVO.t1AdvertList; + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//收集能量球 +function bc_collectEnergyBall(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}`, + headers : { + 'Origin' : `https://h5.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, + 'Host' : `api.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'Content-Type' : `application/x-www-form-urlencoded` + }, + body : `functionId=bc_collectEnergyBall&appid=publicUseApi&body={}&client=wh5&clientVersion=1.0.0` + } + console.log("\n收取能量球") + $.post(url, async (err, resp, data) => { + try { + //console.log(data) + data = JSON.parse(data); + console.log(data.data.bizMsg) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} +//初始化 +function initial() { + merge = { + nickname: "", + enabled: true + } + for (let i in merge) { + merge[i].success = 0; + merge[i].fail = 0; + merge[i].prizeCount = 0; + merge[i].notify = ""; + merge[i].show = true; + } +} +//通知 +function msgShow() { + let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html%22%20%7D`} + $.msg($.Name,"","京东账号:" + merge.nickname +"\n任务已做完!逛同城好店请手动做",url) +} + + +function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),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}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{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=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"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 e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o)),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} From 574df041203bd0579cabd920abc943fbda2a145c Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 6 Nov 2020 02:44:48 +0800 Subject: [PATCH 093/721] --- .github/workflows/dianshijia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dianshijia.yml b/.github/workflows/dianshijia.yml index 1693489c33..073f452f9b 100644 --- a/.github/workflows/dianshijia.yml +++ b/.github/workflows/dianshijia.yml @@ -4,7 +4,7 @@ name: 电视家 on: workflow_dispatch: schedule: - - cron: '*/29 4,12,23 * * *' + - cron: '*/15 4,12,19,23 * * *' watch: types: started jobs: From cf2706b26cf02e5faa09338d5510d29b48ee70af Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 6 Nov 2020 14:39:00 +0800 Subject: [PATCH 094/721] --- Task/dianshijia.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 4571e1d251..851536cfb7 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -41,7 +41,7 @@ http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal url script-request- */ const walkstep = '20000';//每日步数设置,可设置0-20000 const gametimes = "1999"; //游戏时长 -const logs = 0 //响应日志开关,默认关闭 +const logs = 1 //响应日志开关,默认关闭 const $ = new Env('电视家') const notify = $.isNode() ? require('./sendNotify') : ''; let sleeping = "",detail=``,subTitle=``; @@ -317,8 +317,8 @@ function dotask(code) { else if (taskcode == '4000'){ //console.log('任务代码:'+code+','+taskres.msg) } + resolve() }) - resolve() }) } From 57422b8c8e388579bde8945bd0d7bfdb43d83a0b Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 6 Nov 2020 14:42:03 +0800 Subject: [PATCH 095/721] --- Task/dianshijia.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 851536cfb7..5b2ba9913b 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -283,11 +283,12 @@ function cashlist() { else if(!cashres&&cashtotal){ detail += `【提现结果】今日未提现 共计提现:`+cashtotal+`元\n` } + resolve() } - resolve() } catch (e){ console.log(`提现列表失败,可忽略: ${data}`) + resolve() } }) }) From 3fc0a573c0db3bbe7cfaca88ccee5ca8c86113ab Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 6 Nov 2020 14:45:46 +0800 Subject: [PATCH 096/721] --- Task/dianshijia.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 5b2ba9913b..822b23d2e1 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -283,13 +283,12 @@ function cashlist() { else if(!cashres&&cashtotal){ detail += `【提现结果】今日未提现 共计提现:`+cashtotal+`元\n` } - resolve() } } catch (e){ console.log(`提现列表失败,可忽略: ${data}`) - resolve() - } + } + resolve() }) }) } From a0e7eb75b177ac432935a38968f343b065033f82 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 6 Nov 2020 14:49:36 +0800 Subject: [PATCH 097/721] --- Task/dianshijia.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 822b23d2e1..cc62a5b9c6 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -41,7 +41,7 @@ http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal url script-request- */ const walkstep = '20000';//每日步数设置,可设置0-20000 const gametimes = "1999"; //游戏时长 -const logs = 1 //响应日志开关,默认关闭 +const logs = 0 //响应日志开关,默认关闭 const $ = new Env('电视家') const notify = $.isNode() ? require('./sendNotify') : ''; let sleeping = "",detail=``,subTitle=``; @@ -269,6 +269,7 @@ function cashlist() { headers: JSON.parse(signheaderVal)}, (error, response, data) => { let result = JSON.parse(data) let totalcash = Number(),cashres = ""; + console.log(`提现列表: ${data}`) try{ if (result.errCode == 0) { for (i=0;i { - //console.log(`金币列表: ${data}`) + console.log(`金币列表: ${data}`) let result = JSON.parse(data) let onlamount = 0, vdamount = 0, gamestime = 0, todaysign = 0; + try { for (i=0;i= time;i++){ if (result.data[i].from=="领取走路金币"){ From a7611607be3d97cfff0ef6ccc5bb88ef06bd7fca Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 6 Nov 2020 14:58:56 +0800 Subject: [PATCH 098/721] --- Task/dianshijia.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index cc62a5b9c6..1595b48dff 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -269,24 +269,21 @@ function cashlist() { headers: JSON.parse(signheaderVal)}, (error, response, data) => { let result = JSON.parse(data) let totalcash = Number(),cashres = ""; - console.log(`提现列表: ${data}`) - try{ - if (result.errCode == 0) { - for (i=0;i= time ){ cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` } - }; + } if(cashres && cashtotal){ detail += `【提现结果】`+cashres+`共计提现:`+cashtotal+`元\n` } else if(!cashres&&cashtotal){ detail += `【提现结果】今日未提现 共计提现:`+cashtotal+`元\n` } - } - } - catch (e){ + } else { console.log(`提现列表失败,可忽略: ${data}`) } resolve() @@ -383,11 +380,10 @@ function coinlist() { let url = { url: `${dianshijia_API}/coin/detail`, headers: JSON.parse(signheaderVal)} $.get(url, (error, response, data) => { - console.log(`金币列表: ${data}`) + //console.log(`金币列表: ${data}`) let result = JSON.parse(data) let onlamount = 0, vdamount = 0, gamestime = 0, todaysign = 0; - try { for (i=0;i= time;i++){ if (result.data[i].from=="领取走路金币"){ From 13f6d52af0a315011ad9203b4905f7e1eb5f96e1 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 6 Nov 2020 15:32:33 +0800 Subject: [PATCH 099/721] --- Task/dianshijia.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 1595b48dff..d70f04c03e 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -47,7 +47,7 @@ const notify = $.isNode() ? require('./sendNotify') : ''; let sleeping = "",detail=``,subTitle=``; let RewardId = $.getdata('REWARD')||'55'; //额外签到奖励,默认55为兑换0.2元额度,44为兑换1天VIP,42为兑换1888金币 const dianshijia_API = 'http://api.gaoqingdianshi.com/api' -let tokenArr = [], DsjurlArr = [], DrawalArr = [],CountMax,CompCount; +let tokenArr = [], DsjurlArr = [], DrawalArr = [],todrawal=""; if ($.isNode()) { if (process.env.DSJ_HEADERS && process.env.DSJ_HEADERS.indexOf('#') > -1) { Dsjheaders = process.env.DSJ_HEADERS.split('#'); @@ -122,8 +122,8 @@ if (isGetCookie = typeof $request !== 'undefined') { await cash(); // 现金 await cashlist(); // 现金列表 await coinlist(); // 金币列表 - if ($.isNode() && code == 'playTask' && CountMax == CompCount && taskcode == 0 ) { - await notify.sendNotify($.name, subTitle+'\n'+ detail) + if ($.isNode() && todrawal == '0') { + await notify.sendNotify($.name+"提现成功", subTitle+'\n'+ detail) } } } @@ -146,7 +146,7 @@ function GetCookie() { } } async function run() { - if ($.isNode()) { + if ($.isNode()&&new Date().getTimezoneOffset() == '0') { if ($.time('HH')>11){ await sleep(); await CarveUp(); @@ -302,8 +302,8 @@ function tasks(tkcode) { function dotask(code) { return new Promise((resolve, reject) => { $.get({ url: `${dianshijia_API}/v4/task/complete?code=${code}`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { - let taskres = JSON.parse(data) - taskcode = taskres.errCode + let taskres = JSON.parse(data), + taskcode = taskres.errCode; if (taskcode == 0){ CompCount = taskres.data.dayCompCount CountMax = taskres.data.dayDoCountMax @@ -368,8 +368,8 @@ function wakeup() { headers: JSON.parse(signheaderVal)} $.get(url, (error, response, data) => { if(logs)$.log(`睡觉打卡: ${data}\n`) - resolve() }) + resolve() }) } @@ -471,9 +471,10 @@ function getCUpcoin() { function Withdrawal() { return new Promise((resolve, reject) => { $.get({url: drawalVal, headers: JSON.parse(signheaderVal)}, (error, response, data) => { - if(logs)$.log(`金币随机兑换 : ${data}\n`) - let result = JSON.parse(data) - if (result.errCode == 0) { + $.log(`金币随机兑换 : ${data}\n`) + let result = JSON.parse(data), + todrawal = result.errCode; + if (todrawal == 0) { detail += `【金额提现】✅ 到账`+result.data.price/100+`元 🌷\n` } resolve() @@ -505,4 +506,4 @@ function Addsign() { }) } -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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 2108765c70d809804c65b7341f2691c8ad2c7ea3 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 6 Nov 2020 15:42:05 +0800 Subject: [PATCH 100/721] --- Task/jd_lotteryMachine.js | 46 ++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/Task/jd_lotteryMachine.js b/Task/jd_lotteryMachine.js index 31cb666e9f..88b05dba42 100644 --- a/Task/jd_lotteryMachine.js +++ b/Task/jd_lotteryMachine.js @@ -1,7 +1,7 @@ /* 京东抽奖机 -更新时间:2020-11-05 16:06 -脚本说明: +更新时间:2020-11-06 13:12 +脚本说明:四个抽奖活动,【东东抽奖机】【新店福利】【东东福利屋】【东东生活】,点通知只能跳转一个,入口在京东APP玩一玩里面可以看到 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js // quantumultx [task_local] @@ -18,7 +18,10 @@ const $ = new Env('京东抽奖机'); const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; const STRSPLIT = "|"; const needSum = false; //是否需要显示汇总 -$.isMuteLog = true //是否显示出参详情 +const printDetail = false; //是否显示出参详情 +const appIdArr = ['1EFRQxQ','1EFRQxA','1EFRQxw','1EFRQyw'] +const shareCodeArr = ['P04z54XCjVXmYaW5m9cZ2f433tIlGBj3JnLHD0','P04z54XCjVXmIaW5m9cZ2f433tIlGWEga-IO2o','P04z54XCjVXm4aW5m9cZ2f433tIlINrBDzgMdY','P04z54XCjVXl4aW5m9cZ2f433tIlHQIDDSzFzg'] +//const funPrefixArr = ['interact_template','interact_template','wfh'] //IOS等用户直接用NobyDa的jd cookie let cookiesArr = [], cookie = ''; if ($.isNode()) { @@ -48,8 +51,14 @@ const JD_API_HOST = `https://api.m.jd.com/client.action`; $.msg($.name, `【提示】京东账号${i + 1} cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); continue; } - await interact_template_getHomeData(); - await interact_template_getLotteryResult(); + for (let j in appIdArr) { + appId = appIdArr[j] + shareCode = shareCodeArr[j] + //funPrefix = funPrefixArr[j] + if (parseInt(j)) console.log(`\n开始第${parseInt(j) + 1}个抽奖活动`) + await interact_template_getHomeData(); + await interact_template_getLotteryResult(); + } await msgShow(); } } @@ -103,13 +112,14 @@ function interact_template_getHomeData(timeout = 0) { 'Accept-Encoding' : `gzip, deflate, br`, 'Accept-Language' : `zh-cn` }, - body : `functionId=interact_template_getHomeData&body={"appId":"1EFRQxQ","taskToken":""}&client=wh5&clientVersion=1.0.0` + body : `functionId=${appId === '1EFRQxw' ? 'wfh' :'interact_template'}_getHomeData&body={"appId":"${appId}","taskToken":""}&client=wh5&clientVersion=1.0.0` } $.post(url, async (err, resp, data) => { try { - if (!$.isMuteLog) console.log(data); + if (printDetail) console.log(data); data = JSON.parse(data); - + scorePerLottery = data.data.result.userInfo.scorePerLottery||data.data.result.userInfo.lotteryMinusScore + //console.log(scorePerLottery) for (let i = 0;i < data.data.result.taskVos.length;i ++) { console.log("\n" + data.data.result.taskVos[i].taskType + '-' + data.data.result.taskVos[i].taskName + '-' + (data.data.result.taskVos[i].status === 1 ? `已完成${data.data.result.taskVos[i].times}-未完成${data.data.result.taskVos[i].maxTimes}` : "全部已完成")) //签到 @@ -120,7 +130,8 @@ function interact_template_getHomeData(timeout = 0) { continue } if (data.data.result.taskVos[i].taskType === 14) {//'data.data.result.taskVos[i].assistTaskDetailVo.taskToken' - await harmony_collectScore('P04z54XCjVXmYaW5m9cZ2f433tIlGBj3JnLHD0',data.data.result.taskVos[i].taskId); + console.log('您的助力码:'+data.data.result.taskVos[i].assistTaskDetailVo.taskToken) + await harmony_collectScore(shareCode,data.data.result.taskVos[i].taskId); continue } let list = data.data.result.taskVos[i].productInfoVos || data.data.result.taskVos[i].followShopVo || data.data.result.taskVos[i].shoppingActivityVos || data.data.result.taskVos[i].browseShopVo @@ -159,16 +170,17 @@ function harmony_collectScore(taskToken,taskId,timeout = 0) { 'Cookie' : cookie, 'Connection' : `keep-alive`, 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html?inviteId=P04z54XCjVXmYaW5m9cZ2f433tIlGBj3JnLHD0`,//?inviteId=P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ + 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html`,//?inviteId=P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ?inviteId=${shareCode} 'Host' : `api.m.jd.com`, 'Accept-Encoding' : `gzip, deflate, br`, 'Accept-Language' : `zh-cn` }, - body : `functionId=harmony_collectScore&body={"appId":"1EFRQxQ","taskToken":"${taskToken}","taskId":${taskId},"actionType":0}&client=wh5&clientVersion=1.0.0` + body : `functionId=${appId === '1EFRQxw' ? 'wfh' :'harmony'}_collectScore&body={"appId":"${appId}","taskToken":"${taskToken}","taskId":${taskId},"actionType":0}&client=wh5&clientVersion=1.0.0` } + //console.log(url) $.post(url, async (err, resp, data) => { try { - if (!$.isMuteLog) console.log(data); + if (printDetail) console.log(data); data = JSON.parse(data); console.log(data.data.bizMsg) } catch (e) { @@ -196,20 +208,20 @@ function interact_template_getLotteryResult(timeout = 0) { 'Accept-Encoding' : `gzip, deflate, br`, 'Accept-Language' : `zh-cn` }, - body : `functionId=interact_template_getLotteryResult&body={"appId":"1EFRQxQ"}&client=wh5&clientVersion=1.0.0` + body : `functionId=${appId === '1EFRQxw' ? 'wfh' :'interact_template'}_getLotteryResult&body={"appId":"${appId}"}&client=wh5&clientVersion=1.0.0` } $.post(url, async (err, resp, data) => { try { - if (!$.isMuteLog) console.log(data); + if (printDetail) console.log(data); if (!timeout) console.log('\n开始抽奖') data = JSON.parse(data); if (data.data.bizCode === 0) { merge.jdBeans.success++; - if (data.data.result.userAwardsCacheDto.jBeanAwardVo&&data.data.result.userAwardsCacheDto.jBeanAwardVo.prizeName === "京豆") { - console.log(data.data.result.userAwardsCacheDto.jBeanAwardVo.prizeName + ':' + data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity) + if (data.data.result.userAwardsCacheDto.jBeanAwardVo&&data.data.result.userAwardsCacheDto.jBeanAwardVo.prizeName.match(/京豆/)) { + console.log('京豆:' + data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity) merge.jdBeans.prizeCount += parseInt(data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity) } - if (parseInt(data.data.result.userScore) >= 400 ) { + if (parseInt(data.data.result.userScore) >= scorePerLottery ) { await interact_template_getLotteryResult(1000) } } else{ From 7021c229bea4242bb8fa0672972c016ea01b8fa4 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 6 Nov 2020 18:39:27 +0800 Subject: [PATCH 101/721] --- Task/midu_Read.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/midu_Read.js b/Task/midu_Read.js index feb24d3776..96c05ead38 100644 --- a/Task/midu_Read.js +++ b/Task/midu_Read.js @@ -212,7 +212,7 @@ function addDraw() { url = { url: 'https://apiwz.midukanshu.com/wz/task/weekReward', headers: {}, - body: drawVal + body: drawVal+"&draw_num=28&sign=36646430333630313c3c353c6661326136333266326036353663333232363d3d" } url.headers['Host'] = 'apiwz.midukanshu.com' url.headers['Content-Type'] = 'application/x-www-form-urlencoded' @@ -222,12 +222,12 @@ function addDraw() { // $.log(`🐍🐢 ${cookieName} addDraw - response: ${JSON.stringify(data)}\n`) add_Draw = JSON.parse(data) if(add_Draw.code==0){ - console.log("额外奖励:"+add_Draw.data.msg) + console.log("转盘额外奖励:"+add_Draw.data.msg) } resolve() } catch (e) { // $.msg(cookieName, `额外奖励: 失败`, `说明: ${e}`) - $.log(`❌ ${cookieName} addDraw - 额外奖励失败: ${e}`) + $.log(`❌ ${cookieName} addDraw - 转盘额外奖励失败: ${e}`) $.log(`❌ ${cookieName} addDraw - response: ${JSON.stringify(data)}\n`) resolve() } From 3eee1acdc5b078fdd1ecf99ea84f4ddb972ec1f7 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 7 Nov 2020 10:13:47 +0800 Subject: [PATCH 102/721] --- README.md | 2 +- Task/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f038fbca02..eab9a7267a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ > ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此免责声明,请仔细阅读*** #### 开发者不易,请赏杯茶水费 -
+
### 特别感谢: diff --git a/Task/README.md b/Task/README.md index d6aee70625..105a37bf35 100644 --- a/Task/README.md +++ b/Task/README.md @@ -21,7 +21,7 @@ ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此免责声明,请仔细阅读*** ####开发者不易,请赏杯茶水费 -
+
### 特别感谢: From a2c53c5e66bb12c60b2e3ab3f820425c4e40ece0 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 7 Nov 2020 12:20:09 +0800 Subject: [PATCH 103/721] --- Task/dianshijia.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index d70f04c03e..a39f7e55f0 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -41,7 +41,7 @@ http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal url script-request- */ const walkstep = '20000';//每日步数设置,可设置0-20000 const gametimes = "1999"; //游戏时长 -const logs = 0 //响应日志开关,默认关闭 +const logs = 1 //响应日志开关,默认关闭 const $ = new Env('电视家') const notify = $.isNode() ? require('./sendNotify') : ''; let sleeping = "",detail=``,subTitle=``; @@ -122,6 +122,7 @@ if (isGetCookie = typeof $request !== 'undefined') { await cash(); // 现金 await cashlist(); // 现金列表 await coinlist(); // 金币列表 + console.log(todrawal) if ($.isNode() && todrawal == '0') { await notify.sendNotify($.name+"提现成功", subTitle+'\n'+ detail) } From d4ce262aa7db215fc7a2562bdb7246e0c2983b8d Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 7 Nov 2020 12:26:30 +0800 Subject: [PATCH 104/721] --- Task/dianshijia.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index a39f7e55f0..efdd52323c 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -41,7 +41,7 @@ http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal url script-request- */ const walkstep = '20000';//每日步数设置,可设置0-20000 const gametimes = "1999"; //游戏时长 -const logs = 1 //响应日志开关,默认关闭 +const logs = 0 //响应日志开关,默认关闭 const $ = new Env('电视家') const notify = $.isNode() ? require('./sendNotify') : ''; let sleeping = "",detail=``,subTitle=``; @@ -270,7 +270,7 @@ function cashlist() { headers: JSON.parse(signheaderVal)}, (error, response, data) => { let result = JSON.parse(data) let totalcash = Number(),cashres = ""; - //console.log(`提现列表: ${data}`) + console.log(`提现列表: ${data}`) if (result.errCode == 0) { for (i=0;i { - //console.log(`金币列表: ${data}`) + console.log(`金币列表: ${data}`) let result = JSON.parse(data) let onlamount = 0, vdamount = 0, gamestime = 0, todaysign = 0; @@ -434,14 +434,13 @@ function coinlist() { detail += `【任务统计】共完成${i+1}次任务🌷` } $.msg($.name+` `+sleeping, subTitle, detail) - resolve() } catch(e) { console.log(`获取任务金币列表失败,错误代码${e}+ \n响应数据:${data}`) $.msg($.name+` `+sleeping, subTitle, detail) - resolve() } }) - },1000) + },2000) + resolve() }) } From e67099c1aa76a72009c34a3f51c24e507a2e3ac5 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 7 Nov 2020 12:34:33 +0800 Subject: [PATCH 105/721] --- Task/dianshijia.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index efdd52323c..974823ced7 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -374,7 +374,6 @@ function wakeup() { }) } - function coinlist() { return new Promise((resolve, reject) => { setTimeout(() => { @@ -439,8 +438,8 @@ function coinlist() { $.msg($.name+` `+sleeping, subTitle, detail) } }) + resolve() },2000) - resolve() }) } From 3c52583fb2a9f99b253274c8cf4eb0a06de1cf27 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 7 Nov 2020 12:37:32 +0800 Subject: [PATCH 106/721] --- Task/dianshijia.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 974823ced7..d45e14ea35 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -435,10 +435,10 @@ function coinlist() { $.msg($.name+` `+sleeping, subTitle, detail) } catch(e) { console.log(`获取任务金币列表失败,错误代码${e}+ \n响应数据:${data}`) - $.msg($.name+` `+sleeping, subTitle, detail) + $.msg($.name+` 获取任务金币详情失败 `, subTitle, detail) } + resolve() }) - resolve() },2000) }) } From 655390b660b26cc3aa277a003e666f705ad3b646 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 7 Nov 2020 12:43:30 +0800 Subject: [PATCH 107/721] --- Task/dianshijia.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index d45e14ea35..3c94469765 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -122,8 +122,8 @@ if (isGetCookie = typeof $request !== 'undefined') { await cash(); // 现金 await cashlist(); // 现金列表 await coinlist(); // 金币列表 - console.log(todrawal) - if ($.isNode() && todrawal == '0') { + console.log(todrawal); + if ($.isNode() && todrawal != '0') { await notify.sendNotify($.name+"提现成功", subTitle+'\n'+ detail) } } @@ -435,7 +435,7 @@ function coinlist() { $.msg($.name+` `+sleeping, subTitle, detail) } catch(e) { console.log(`获取任务金币列表失败,错误代码${e}+ \n响应数据:${data}`) - $.msg($.name+` 获取任务金币详情失败 `, subTitle, detail) + $.msg($.name+` 获取金币详情失败 `, subTitle, detail) } resolve() }) @@ -473,10 +473,10 @@ function Withdrawal() { $.log(`金币随机兑换 : ${data}\n`) let result = JSON.parse(data), todrawal = result.errCode; - if (todrawal == 0) { - detail += `【金额提现】✅ 到账`+result.data.price/100+`元 🌷\n` - } - resolve() + if (todrawal == 0) { + detail += `【金额提现】✅ 到账`+result.data.price/100+`元 🌷\n` + } + resolve() }) }) } From 4d32ed5a9ec0b12b62dd343787886b5a9a561e86 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 7 Nov 2020 13:12:11 +0800 Subject: [PATCH 108/721] --- Task/dianshijia.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 3c94469765..07e95efe11 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -47,7 +47,7 @@ const notify = $.isNode() ? require('./sendNotify') : ''; let sleeping = "",detail=``,subTitle=``; let RewardId = $.getdata('REWARD')||'55'; //额外签到奖励,默认55为兑换0.2元额度,44为兑换1天VIP,42为兑换1888金币 const dianshijia_API = 'http://api.gaoqingdianshi.com/api' -let tokenArr = [], DsjurlArr = [], DrawalArr = [],todrawal=""; +let tokenArr = [], DsjurlArr = [], DrawalArr = [],drawalCode=""; if ($.isNode()) { if (process.env.DSJ_HEADERS && process.env.DSJ_HEADERS.indexOf('#') > -1) { Dsjheaders = process.env.DSJ_HEADERS.split('#'); @@ -113,8 +113,7 @@ if (isGetCookie = typeof $request !== 'undefined') { if (drawalVal != undefined){ await Withdrawal() } else { - detail += `【金额提现】❌ 请获取提现地址 \n` - };// 金额提现 + detail += `【金额提现】❌ 请获取提现地址 \n`}; // 金额提现 await run(); await tasks(); // 任务状态 await getGametime();// 游戏时长 @@ -122,8 +121,7 @@ if (isGetCookie = typeof $request !== 'undefined') { await cash(); // 现金 await cashlist(); // 现金列表 await coinlist(); // 金币列表 - console.log(todrawal); - if ($.isNode() && todrawal != '0') { + if ($.isNode() && drawalCode == '0') { await notify.sendNotify($.name+"提现成功", subTitle+'\n'+ detail) } } @@ -270,7 +268,7 @@ function cashlist() { headers: JSON.parse(signheaderVal)}, (error, response, data) => { let result = JSON.parse(data) let totalcash = Number(),cashres = ""; - console.log(`提现列表: ${data}`) + //console.log(`提现列表: ${data}`) if (result.errCode == 0) { for (i=0;i { - console.log(`金币列表: ${data}`) + //console.log(`金币列表: ${data}`) let result = JSON.parse(data) let onlamount = 0, vdamount = 0, gamestime = 0, todaysign = 0; @@ -439,7 +437,7 @@ function coinlist() { } resolve() }) - },2000) + },1000) }) } @@ -470,13 +468,13 @@ function getCUpcoin() { function Withdrawal() { return new Promise((resolve, reject) => { $.get({url: drawalVal, headers: JSON.parse(signheaderVal)}, (error, response, data) => { - $.log(`金币随机兑换 : ${data}\n`) - let result = JSON.parse(data), - todrawal = result.errCode; - if (todrawal == 0) { - detail += `【金额提现】✅ 到账`+result.data.price/100+`元 🌷\n` + if(logs)$.log(`金币随机兑换 : ${data}\n`) + let todrawal = JSON.parse(data); + if (todrawal.errCode == 0) { + detail += `【金额提现】✅ 到账`+todrawal.data.price/100+`元 🌷\n` + drawalCode = todrawal.errCode } - resolve() + resolve() }) }) } From 259be77e276bd503e636605e73cfc365a975f452 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 8 Nov 2020 08:57:40 +0800 Subject: [PATCH 109/721] --- Task/dianshijia.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 07e95efe11..a185c3269d 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -98,6 +98,7 @@ if (isGetCookie = typeof $request !== 'undefined') { console.log(`------------- 共${tokenArr.length}个账号`) if(new Date().getTimezoneOffset()/60 != '-8'){ time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-8*60*60 + console.log(time) } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } From b82de9b86870456fa089acd18eefc99674173bc4 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 8 Nov 2020 09:07:35 +0800 Subject: [PATCH 110/721] --- Task/dianshijia.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index a185c3269d..1057af2f10 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -113,8 +113,7 @@ if (isGetCookie = typeof $request !== 'undefined') { await Addsign(); // 额外奖励,默认额度 if (drawalVal != undefined){ await Withdrawal() - } else { - detail += `【金额提现】❌ 请获取提现地址 \n`}; // 金额提现 + } else { detail += `【金额提现】❌ 请获取提现地址 \n`}; await run(); await tasks(); // 任务状态 await getGametime();// 游戏时长 @@ -244,8 +243,9 @@ function total() { } resolve() } catch(e){ - console.log(e) } - resolve() + console.log(e) + resolve() + } }) }) } From 910aa47264fefc47ec38be98ffa88a681db13f7e Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 8 Nov 2020 09:15:42 +0800 Subject: [PATCH 111/721] --- .github/workflows/dianshijia.yml | 1 + Task/dianshijia.js | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/dianshijia.yml b/.github/workflows/dianshijia.yml index 073f452f9b..8622189e88 100644 --- a/.github/workflows/dianshijia.yml +++ b/.github/workflows/dianshijia.yml @@ -14,6 +14,7 @@ jobs: env: DSJ_HEADERS: ${{ secrets.DSJ_HEADERS }} DSJ_DRAWAL: ${{ secrets.DSJ_DRAWAL }} + TZ: Asia/shanghai steps: - name: Checkout run: | diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 1057af2f10..dde0d302f0 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -99,6 +99,7 @@ if (isGetCookie = typeof $request !== 'undefined') { if(new Date().getTimezoneOffset()/60 != '-8'){ time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-8*60*60 console.log(time) + console.log(TZ) } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } From b7cab49fa5d223d38460865a6b263729138df564 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 8 Nov 2020 09:17:52 +0800 Subject: [PATCH 112/721] --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index dde0d302f0..368c861d35 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -99,7 +99,7 @@ if (isGetCookie = typeof $request !== 'undefined') { if(new Date().getTimezoneOffset()/60 != '-8'){ time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-8*60*60 console.log(time) - console.log(TZ) + console.log(env.TZ) } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } From 1e6da175dd4284d91da6d1bb4fa8e98d03c31377 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 8 Nov 2020 09:18:33 +0800 Subject: [PATCH 113/721] --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 368c861d35..113df765cc 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -99,7 +99,7 @@ if (isGetCookie = typeof $request !== 'undefined') { if(new Date().getTimezoneOffset()/60 != '-8'){ time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-8*60*60 console.log(time) - console.log(env.TZ) + console.log(process.env.TZ) } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } From baaad50672cc195c615271d38bd613c493a67bae Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 9 Nov 2020 13:29:18 +0800 Subject: [PATCH 114/721] --- .github/workflows/jd_baiTiao.yml | 40 ++ .github/workflows/jd_bigWinner.yml | 40 ++ Task/jd_baiTiao.js | 220 +++++++ Task/jd_bigWinner.js | 934 +++++++++++++++++++++++++++++ Task/jd_lotteryMachine.js | 12 +- 5 files changed, 1240 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/jd_baiTiao.yml create mode 100644 .github/workflows/jd_bigWinner.yml create mode 100644 Task/jd_baiTiao.js create mode 100644 Task/jd_bigWinner.js diff --git a/.github/workflows/jd_baiTiao.yml b/.github/workflows/jd_baiTiao.yml new file mode 100644 index 0000000000..86e99567dd --- /dev/null +++ b/.github/workflows/jd_baiTiao.yml @@ -0,0 +1,40 @@ + +name: 京东白条 + +on: + workflow_dispatch: + #schedule: + # - cron: '15 */4 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【京东白条】' + if: env.JD_COOKIE + run: | + cd ~/Scripts + node Task/jd_baiTiao.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/.github/workflows/jd_bigWinner.yml b/.github/workflows/jd_bigWinner.yml new file mode 100644 index 0000000000..3ba820eaca --- /dev/null +++ b/.github/workflows/jd_bigWinner.yml @@ -0,0 +1,40 @@ + +name: 京东大赢家 + +on: + workflow_dispatch: + schedule: + - cron: '3 */2 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【京东大赢家】' + if: env.JD_COOKIE + run: | + cd ~/Scripts + node Task/jd_bigWinner.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/Task/jd_baiTiao.js b/Task/jd_baiTiao.js new file mode 100644 index 0000000000..301f81e438 --- /dev/null +++ b/Task/jd_baiTiao.js @@ -0,0 +1,220 @@ +/* +京东金融领白条券 +更新时间:2020-10-26 16:02 +[task_local] +# 京东金融领白条券 9点执行(非天天领券要9点开始领) +0 9 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_baiTiao.js, tag=京东白条, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/baitiao.png, enabled=true +*/ +const $ = new Env('天天领白条券'); +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +//直接用NobyDa的jd cookie +let cookiesArr = [], cookie = ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) +} else { + cookiesArr.push($.getdata('CookieJD')); + cookiesArr.push($.getdata('CookieJD2')); +} +const JR_API_HOST = 'https://jrmkt.jd.com/activity/newPageTake/takePrize'; +let prize = + //每日领随机白条券 + [ + {name : `prizeDaily`, desc : `天天领`, id : `Q72m9P5k3K94223q5k5O1w228U2S8B040D2B9qt`}, + //周一领 + {name : `prizeMonday`, desc : `周一领`, id : `Q1295372232228280029Aw`}, + //周二领 + {name : `prizeTuesday`, desc : `周二领`, id : `Q9293947555491r1b3U870x0D2V95X`}, + //周三领 + {name : `prizeWednesday`, desc : `周三领`, id : `Q8299679592g5N1Y1r3j8X0004269Ll`}, + //周四领 + {name : `prizeThursday`, desc : `周四领`, id : `X9D2l0f0P8S31154947512923QU`}, + //每周五领55-5券 + {name : `prizeFriday`, desc : `周五领`, id : `Q529284818011r8O2Y8L07082T9kE`}, + //周六领 + {name : `prizeSaturday`, desc : `周六领`, id : `i9200831161952186922QB`}, + //周六领2 + {name : `prizeSaturday2`, desc : `周六领`, id : `Q4295706b5Q9t2D6F181k3x8Q0v0W2e9JK`} + ] + +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '提示:请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + + for (let i = 0; i < prize.length; i++) { + prize[i].body =`activityId=${prize[i].id}&eid=${randomWord(false,90).toUpperCase()}&fp=${randomWord(false,32).toLowerCase()}` + } + + for (let i = 0; i < cookiesArr.length; i++) { + cookie = cookiesArr[i]; + if (cookie) { + $.prize = {addMsg : ``}; + let date = new Date(); + await takePrize(prize[0]); + if ($.prize["prizeDaily"].respCode === "00001" ) { + $.msg($.name, '提示:请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + continue; + } + if (date.getDay() !== 0) { + await takePrize(prize[date.getDay()],820);//延迟执行,防止提示活动火爆 + if (date.getDay() === 6) await takePrize(prize[7],820);//第二个周六券 + } + if (date.getDay() === 0) { + $.prize.addMsg = `提 醒:请于今天使用周日专享白条券\n` + } + await queryMissionWantedDetail(); + await msgShow(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + + +function takePrize(prize,timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url: JR_API_HOST, + body : prize.body, + headers: { + 'Cookie' : cookie, + 'X-Requested-With' : `XMLHttpRequest`, + 'Accept' : `application/json, text/javascript, */*; q=0.01`, + 'Origin' : `https://jrmkt.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Content-Type' : `application/x-www-form-urlencoded;charset=UTF-8`, + 'Host' : `jrmkt.jd.com`, + 'Connection' : `keep-alive`, + 'Referer' : `https://jrmkt.jd.com/ptp/wl/vouchers.html?activityId=${prize.id}`, + 'Accept-Language' : `zh-cn` + } + } + $.post(url, (err, resp, data) => { + try { + data = JSON.parse(data); + $.prize[prize.name] = data; + $.prize[prize.name].desc = prize.desc; + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +function queryMissionWantedDetail(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url: `https://ms.jr.jd.com/gw/generic/mission/h5/m/queryMissionWantedDetail?reqData=%7B%22playId%22:%2281%22,%22channelCode%22:%22MISSIONCENTER%22,%22timeStamp%22:%2${$.time(`yyyy-MM-ddTHH:mm:ss.SZ`)}%22%7D`, + headers: { + 'Cookie' : cookie, + 'Origin' : `https://m.jr.jd.com`, + 'Connection' : `keep-alive`, + 'Accept' : `application/json`, + 'Referer' : `https://m.jr.jd.com/member/task/RewardDetail/?playId=81&platformCode=MISSIONCENTER&channel=baitiao&jrcontainer=h5&jrcloseweb=false`, + 'Host' : `ms.jr.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + } + } + $.post(url, async (err, resp, data) => { + try { + data = JSON.parse(data); + switch (data.resultData.data.mission.status ) { + case -1 : + $.prize.addMsg += `周任务:${data.resultData.data.mission.name}`; + await receivePlay(data.resultData.data.mission.missionId); + break; + case 0 : // 2已完成 -1未领取 0已领取 + $.prize.addMsg += `周任务:完成进度${data.resultData.data.mission.scheduleNowValue || 0}/${data.resultData.data.mission.scheduleTargetValue},剩余数量:${data.resultData.data.residueAwardNum || `未知`}\n` + break; + case 1 : // + $.prize.addMsg += `周任务:完成进度${data.resultData.data.mission.scheduleNowValue || 0}/${data.resultData.data.mission.scheduleTargetValue},剩余数量:${data.resultData.data.residueAwardNum || `未知`}\n` + break; + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +function receivePlay(missionId,timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url: `https://ms.jr.jd.com/gw/generic/mission/h5/m/receivePlay?reqData=%7B%22playId%22:%2281%22,%22channelCode%22:%22MISSIONCENTER%22,%22playType%22:1,%22missionId%22:${missionId},%22timeStamp%22:%22${$.time(`yyyy-MM-ddTHH:mm:ss.SZ`)}%22%7D`, + headers: { + 'Cookie' : cookie, + 'Origin' : `https://m.jr.jd.com`, + 'Connection' : `keep-alive`, + 'Accept' : `application/json`, + 'Referer' : `https://m.jr.jd.com/member/task/RewardDetail/?playId=81&platformCode=MISSIONCENTER&channel=baitiao&jrcontainer=h5&jrcloseweb=false`, + 'Host' : `ms.jr.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + } + } + $.post(url, (err, resp, data) => { + try { + data = JSON.parse(data); + $.prize.addMsg += `-${data.resultData.msg.replace(`该任务`,``)}\n`; + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +function randomWord(randomFlag, min, max){ + let str = "", + range = min, + arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; + // 随机产生 + if(randomFlag){ + range = Math.round(Math.random() * (max-min)) + min; + } + for(let i=0; i{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{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=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"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 e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o)),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} diff --git a/Task/jd_bigWinner.js b/Task/jd_bigWinner.js new file mode 100644 index 0000000000..554e26ac86 --- /dev/null +++ b/Task/jd_bigWinner.js @@ -0,0 +1,934 @@ +/* +京东大赢家 双11活动 +更新时间:2020-11-09 13:10 +修复火爆问题,第一次还有可能个别的火爆,再次运行即可 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +// quantumultx +[task_local] +#京东大赢家 +5 0-22/2 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_bigWinner.js, tag=京东大赢家, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jd.png, enabled=true +// Loon +[Script] +cron "5 0-22/2 * * *" script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_bigWinner.js,tag=京东大赢家 +// Surge +京东大赢家 = type=cron,cronexp=5 0-22/2 * * *,wake-system=1,timeout=500,script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_bigWinner.js +*/ +const $ = new Env('京东大赢家'); +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '',secretp = ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) +} else { + cookiesArr.push($.getdata('CookieJD')); + cookiesArr.push($.getdata('CookieJD2')); +} + +const JD_API_HOST = `https://api.m.jd.com/client.action?functionId=`; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + //console.log('提示-1002的账号是因为京东对入参进行了强校验,并不是黑号,目前无法使用脚本,请手动去APP做吧,不提示-1002的可以继续使用') + //console.log('目前京东已全面判断入参校验,所有账号都不能用,手动做吧') + //console.log('请删除或禁用脚本!') + //return + + + for (let i = 0; i < cookiesArr.length; i++) { + cookie = cookiesArr[i]; + if (cookie) { + if (Date.now() > Date.parse('2020-11-12')) { + $.msg($.Name,"","活动已结束,请删除或禁用脚本!") + return + } + initial(); + await QueryJDUserInfo(); + if (!merge.enabled) //cookie不可用 + { + $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 + $.msg($.name, `【提示】京东账号${i ? i + 1 : "" } cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + continue; + } + console.log('\n\n京东账号:'+merge.nickname + ' 任务开始') + await stall_pk_getHomeData(); + await stall_getHomeData(); + //if (merge.black) continue ; + //await stall_pk_assistGroup() + await stall_myShop() + await qryCompositeMaterials() + await msgShow(); + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + +//获取昵称(直接用,勿删) +function QueryJDUserInfo(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + headers : { + 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, + 'Cookie' : cookie + } + } + $.get(url, (err, resp, data) => { + try { + data = JSON.parse(data); + if (data.retcode === 13) { + merge.enabled = false + return + } + merge.nickname = data.base.nickname; + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//查询任务 "appSign":"2","channel":1, +function stall_getTaskDetail(shopSign = "",appSign = "",timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + appSign = appSign&&'"appSign":"2","channel":1,' + let url = { + url : `${JD_API_HOST}stall_getTaskDetail`, + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=stall_getTaskDetail&body={${appSign}"shopSign":"${shopSign}"}&client=wh5&clientVersion=1.0.0` + } + + $.post(url, async (err, resp, data) => { + try { + //console.log('stall_getTaskDetail:' + data) + data = JSON.parse(data); + if (shopSign === "") { + shopSign = '""' + //if (appSign === "") console.log(`您的个人助力码:${data.data.result.inviteId}`) + } + for (let i = 0;i < data.data.result.taskVos.length;i ++) { + //if (merge.black) return ; + console.log( "\n" + data.data.result.taskVos[i].taskType + '-' + data.data.result.taskVos[i].taskName + (appSign&&"(微信小程序)") + '-' + (data.data.result.taskVos[i].status === 1 ? `已完成${data.data.result.taskVos[i].times}-未完成${data.data.result.taskVos[i].maxTimes}` : "全部已完成") ) + let rnd = Math.round(Math.random()*1e6) + let nonstr = randomWord(false,10) + let time = Date.now() + let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) + let msg = `inviteId=-1&rnd=${rnd}&stealId=-1&taskId=${data.data.result.taskVos[i].taskId}&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` + let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() + if ([1,3,7,9].includes(data.data.result.taskVos[i].taskType) && data.data.result.taskVos[i].status === 1 ) { + let list = data.data.result.taskVos[i].brandMemberVos||data.data.result.taskVos[i].followShopVo||data.data.result.taskVos[i].shoppingActivityVos||data.data.result.taskVos[i].browseShopVo + //console.log(list) + //if (data.data.result.taskVos[i].taskType === 9) continue + for (let k = data.data.result.taskVos[i].times; k < data.data.result.taskVos[i].maxTimes; k++) { + //body : `functionId=stall_collectProduceScore&body={"ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"fpb\\":\\"xAX3mMUyCgH120XCrQXIZUw==\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"collectProducedCoin\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` + for (let j in list) { + if (list[j].status === 1) { + let taskBody = `functionId=stall_collectScore&body={"taskId":${data.data.result.taskVos[i].taskId},"itemId":"${list[j].itemId}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"${data.data.result.taskVos[i].taskId}\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}","actionType":"1","shopSign":${shopSign}}&client=wh5&clientVersion=1.0.0` + console.log("\n"+(list[j].title||list[j].shopName)) + await stall_collectScore(taskBody,2000) + //} + list[j].status = 2; + break; + } else { + continue; + } + } + } + } + + if ([12,13].includes(data.data.result.taskVos[i].taskType) && data.data.result.taskVos[i].status === 1) { + //let taskBody = `functionId=stall_collectScore&body={"taskId":${data.data.result.taskVos[i].taskId},"itemId":"1","ss":"{\\"extraData\\":{},\\"businessData\\":{},\\"secretp\\":\\"${secretp}\\"}","shopSign":${shopSign}}&client=wh5&clientVersion=1.0.0` + let taskBody = `functionId=stall_collectScore&body={"taskId":${data.data.result.taskVos[i].taskId},"itemId":"1","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"${data.data.result.taskVos[i].taskId}\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}","actionType":"1","shopSign":${shopSign}}&client=wh5&clientVersion=1.0.0` + for (let k = data.data.result.taskVos[i].times; k < data.data.result.taskVos[i].maxTimes; k++) { + if (merge.black) return ; + //if (typeof data.data.result.taskVos[i].simpleRecordInfoVo !== "undefined"){ + // taskBody = encodeURIComponent(`{"dataSource":"newshortAward","method":"getTaskAward","reqParams":"{\\"taskToken\\":\\"${data.data.result.taskVos[i].simpleRecordInfoVo.taskToken}\\"}","sdkVersion":"1.0.0","clientLanguage":"zh"}`) + // await qryViewkitCallbackResult(taskBody,1000) + //} else { + await stall_collectScore(taskBody,3000) + //} + } + } + + if ([2].includes(data.data.result.taskVos[i].taskType) && data.data.result.taskVos[i].status === 1) { + for (let k = data.data.result.taskVos[i].times; k < data.data.result.taskVos[i].maxTimes; k++) { + await stall_getFeedDetail(data.data.result.taskVos[i].taskId) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//获取我的城市 +function stall_myShop(timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}stall_myShop`, + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=stall_myShop&body={"ss":"{\\"extraData\\":{},\\"businessData\\":{},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` + } + $.post(url, async (err, resp, data) => { + try { + //console.log('stall_myShop:' + data) + data = JSON.parse(data); + for (let i in data.data.result.shopList) { + // (data.data.result.shopList[i].status === 1) { + //console.log(data.data.result.shopList[i]) + console.log('\n开始城市任务:'+ data.data.result.shopList[i].name)// + '-' + data.data.result.shopList[i].shopId + await stall_getTaskDetail(data.data.result.shopList[i].shopId) + //} + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//逛商城 +function stall_shopSignInWrite(shopSign,timeout = 0){ + return new Promise((resolve) => { + + let rnd = Math.round(Math.random()*1e6) + let nonstr = randomWord(false,10) + let time = Date.now() + let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) + let msg = `inviteId=-1&rnd=${rnd}&stealId=-1&taskId=${shopSign}&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` + let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() + + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}stall_shopSignInWrite`, + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=stall_shopSignInWrite&body={"shopSign":"${shopSign}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"${shopSign}\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` + } + $.post(url, async (err, resp, data) => { + try { + //console.log(data) + data = JSON.parse(data); + if (data.data.bizCode !== 0) { + console.log(data.data.bizMsg) + merge.end = true + } else { + console.log('获得金币' + data.data.result.score) + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//逛商城 +function stall_shopSignInRead(shopSign,timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}stall_shopSignInRead`, + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=stall_shopSignInRead&client=wh5&clientVersion=1.0.0&body={"shopSign":"${shopSign}"}` + } + $.post(url, async (err, resp, data) => { + try { + data = JSON.parse(data); + //console.log(shopSign) + if (data.data.result.signInTag === 0) { + secretp = secretp||data.data.result.secretp + await stall_shopSignInWrite(shopSign) + } else { + console.log('已逛过') + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//收金币 +function stall_collectProduceScore(timeout = 0){ + return new Promise((resolve) => { + let rnd = Math.round(Math.random()*1e6) + let nonstr = randomWord(false,10) + let time = Date.now() + let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) + let msg = `inviteId=-1&rnd=${rnd}&stealId=-1&taskId=collectProducedCoin&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` + let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}stall_collectProduceScore`, + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=stall_collectProduceScore&body={"ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"fpb\\":\\"xAX3mMUyCgH120XCrQXIZUw==\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"collectProducedCoin\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` + } + //console.log(url.body) + $.post(url, async (err, resp, data) => { + try { + //console.log(data) + data = JSON.parse(data); + if (data.data.bizCode === -1002) { + //console.log('此账号暂不可使用脚本,脚本终止!') + //merge.black = true; + return ; + } + console.log(`\n收取金币:${data.data.result.produceScore}`) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//获取可偷 +function stall_pk_getStealForms(taskBody,timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}stall_pk_getStealForms`, + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : taskBody + } + $.post(url, async (err, resp, data) => { + try { + console.log(data) + data = JSON.parse(data); + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} +//做任务 +function stall_collectScore(taskBody,timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}stall_collectScore`, + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : taskBody + } + //console.log(url.body) + $.post(url, async (err, resp, data) => { + try { + //console.log(data) + data = JSON.parse(data); + console.log('任务执行结果:' + data.data.bizMsg) + if (data.data.bizCode === -1002) { + await $.wait(1000) + //console.log('此账号暂不可使用脚本,脚本终止!') + //merge.black = true; + return ; + } + if (data.data.bizCode === 0 && typeof data.data.result.taskToken !== "undefined") { + //console.log('需要再次执行,如提示活动异常请多次重试,个别任务多次执行也不行就去APP做吧!') + let taskBody = encodeURIComponent(`{"dataSource":"newshortAward","method":"getTaskAward","reqParams":"{\\"taskToken\\":\\"${data.data.result.taskToken}\\"}","sdkVersion":"1.0.0","clientLanguage":"zh"}`) + //console.log(taskBody) + await qryViewkitCallbackResult(taskBody,8000) + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//查询甄选任务 +function stall_getFeedDetail(taskId,timeout = 0){ + return new Promise((resolve) => { + + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}stall_getFeedDetail`, + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=stall_getFeedDetail&body={"taskId":"${taskId}"}&client=wh5&clientVersion=1.0.0` + } + //console.log(url) + $.post(url, async (err, resp, data) => { + try { + //console.log(data) + data = JSON.parse(data); + let list = data.data.result.viewProductVos||data.data.result.addProductVos + for (let i in list) { + if (list[i].status === 1) { + for (let j in list[i].productInfoVos) { + if (j >= 5) break; + + let rnd = Math.round(Math.random()*1e6) + let nonstr = randomWord(false,10) + let time = Date.now() + let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) + let msg = `inviteId=-1&rnd=${rnd}&stealId=-1&taskId=${taskId}&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` + let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() + let taskBody = `functionId=stall_collectScore&body={"taskId":${list[i].taskId},"itemId":"${list[i].productInfoVos[j].skuId}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"${taskId}\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}","shopSign":""}&client=wh5&clientVersion=1.0.0` + console.log(list[i].productInfoVos[j].skuName) + await stall_collectScore(taskBody,1000) + } + list[i].status = 2 + } + } + + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//做任务2 +function qryViewkitCallbackResult(taskBody,timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `https://api.m.jd.com/?functionId=qryViewkitCallbackResult&client=wh5&clientVersion=1.0.0&body=${taskBody}&_timestamp=`+Date.now(), + headers : { + 'Origin' : `https://bunearth.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `*/*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'Content-Type' : 'application/x-www-form-urlencoded', + 'Referer' : 'https://bunearth.m.jd.com/babelDiy/Zeus/4SJUHwGdUQYgg94PFzjZZbGZRjDd/index.html?jmddToSmartEntry=login' + } + } + + $.get(url, async (err, resp, data) => { + try { + //console.log(url.url) + //console.log(data) + data = JSON.parse(data); + console.log(data.toast.subTitle) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//群组助力 +function stall_pk_assistGroup(inviteId = "XUkkFpUhDG0OdMYzp22uY_lyEaiFin-OxTLmhqosoNJHNIHp84xOJxNmUElr71Un",timeout = 0) { + return new Promise((resolve) => { + let rnd = Math.round(Math.random()*1e6) + let nonstr = randomWord(false,10) + let time = Date.now() + let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) + let msg = `inviteId=${inviteId}&rnd=${rnd}&stealId=-1&taskId=2&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` + let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() + //let taskBody = `functionId=stall_collectScore&body={"taskId":2,"itemId":"${data.data.result.homeMainInfo.guestInfo.itemId}","inviteId": "${body}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"2\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"${body}\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` + + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}stall_pk_assistGroup` , + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'Refer' : `https://bunearth.m.jd.com/babelDiy/Zeus/4SJUHwGdUQYgg94PFzjZZbGZRjDd/index.html?jmddToSmartEntry=login` + }, + body : `functionId=stall_pk_assistGroup&client=wh5&clientVersion=1.0.0&body={"confirmFlag":1,"inviteId": "${inviteId}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"2\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"${inviteId}\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}` + } + //console.log(url.body) + $.post(url, async (err, resp, data) => { + try { + //console.log('商圈助力:' + data) + data = JSON.parse(data); + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +//获取首页信息 +function stall_getHomeData(body= "",timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}stall_getHomeData` , + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=stall_getHomeData&body={${body ? "\"inviteId\":\"" + body +'\"': ""}}&client=wh5&clientVersion=1.0.0` + } + $.post(url, async (err, resp, data) => { + try { + //console.log(url.body) + //if (merge.black) return ; + data = JSON.parse(data); + if (data.code === 0) { + if (body !== "") { + //console.log('stall_getHomeData2:' + JSON.stringify(data)) + if (data.data.result.homeMainInfo.guestInfo.status === 0) { + + let rnd = Math.round(Math.random()*1e6) + let nonstr = randomWord(false,10) + let time = Date.now() + let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) + let msg = `inviteId=${body}&rnd=${rnd}&stealId=-1&taskId=2&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` + let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() + let taskBody = `functionId=stall_collectScore&body={"taskId":2,"itemId":"${data.data.result.homeMainInfo.guestInfo.itemId}","inviteId": "${body}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"2\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"${body}\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` + //console.log(taskBody) + //let taskBody = `functionId=stall_collectScore&body={"taskId":2,"itemId":"${data.data.result.homeMainInfo.guestInfo.itemId}","inviteId": "${body}","ss":"{\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` + //console.log(taskBody) + //console.log('开始助力:') + await stall_collectScore(taskBody, 1000) + } + return + } + //console.log('stall_getHomeData:' + JSON.stringify(data)) + secretp = data.data.result.homeMainInfo.secretp + await stall_collectProduceScore(); + await stall_pk_assistGroup() + if (data.data.result.homeMainInfo.raiseInfo.buttonStatus === 2 ) await stall_raise(1000) + await stall_getHomeData('Vl4ISNZnRyNVJf028W76ZuyTXfbtGlbVhbQEF3XxyFux9uadYgA0uao'); + await stall_getTaskDetail("","app") + await stall_getTaskDetail() + } else { + return + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +//助力 +function collectFriendRecordColor(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}collectFriendRecordColor` , + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=collectFriendRecordColor&body={"mpin":"RnFgwWRbPDGKy9RP--twXV_3bZt2p2ZADl2v","businessCode":"20118","assistType":"1"}&client=wh5&clientVersion=1.0.0` + } + $.post(url, async (err, resp, data) => { + try { + console.log(data) + //data = JSON.parse(data); + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +function getEncryptedPinColor(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}getEncryptedPinColor` , + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=getEncryptedPinColor&body={}&client=wh5&clientVersion=1.0.0` + } + $.post(url, async (err, resp, data) => { + try { + data = JSON.parse(data); + console.log('助力码:'+ data.result) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +function stall_raise(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}stall_raise` , + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=stall_raise&body={}&client=wh5&clientVersion=1.0.0` + } + $.post(url, async (err, resp, data) => { + try { + //console.log(data) + data = JSON.parse(data); + console.log('解锁结果:'+ data.data.bizMsg) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +function qryCompositeMaterials(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}qryCompositeMaterials` , + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=qryCompositeMaterials&client=wh5&clientVersion=1.0.0&body={"qryParam":"[{\\"type\\":\\"advertGroup\\",\\"mapTo\\":\\"homeFeedBanner\\",\\"id\\":\\"04891279\\"},{\\"type\\":\\"advertGroup\\",\\"mapTo\\":\\"homeBottomBanner\\",\\"id\\":\\"04888981\\"}]","activityId":"4SJUHwGdUQYgg94PFzjZZbGZRjDd","pageId":"","reqSrc":"","applyKey":"raiders_venue_lite"}` + } + $.post(url, async (err, resp, data) => { + try { + //console.log(data) + data = JSON.parse(data); + for (let i in data.data.homeBottomBanner.list) { + if (merge.end) break; + console.log('\n开始逛'+data.data.homeBottomBanner.list[i].name) + await stall_shopSignInRead(data.data.homeBottomBanner.list[i].link) + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +function stall_pk_getHomeData(body = "",timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}stall_pk_getHomeData` , + headers : { + 'Origin' : `https://wbbny.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json, text/plain, */*`, + 'Host' : `api.m.jd.com`, + 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `functionId=stall_pk_getHomeData&body={}&client=wh5&clientVersion=1.0.0` + } + $.post(url, async (err, resp, data) => { + try { + if (body !== "") { + await stall_pk_assistGroup(); + } else { + data = JSON.parse(data); + if (data.data.result.groupInfo.groupAssistInviteId.match(/XUkkFpUhDG0OdMYzp22uY_lyEaiFin/)){ + console.log('您的商圈助力码:' + data.data.result.groupInfo.groupAssistInviteId) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +function randomWord(randomFlag, min, max){ + let str = "", + range = min, + arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; + // 随机产生 + if(randomFlag){ + range = Math.round(Math.random() * (max-min)) + min; + } + for(let i=0; i>> 5] >>> 24 - e % 32 & 255); + return n +} + +function bytesToHex(t) { + for (var n = [], e = 0; e < t.length; e++) + n.push((t[e] >>> 4).toString(16)), + n.push((15 & t[e]).toString(16)); + return n.join("") +} + +function stringToBytes(t) { + t = unescape(encodeURIComponent(t)) + for (var n = [], e = 0; e < t.length; e++) + n.push(255 & t.charCodeAt(e)); + return n +} + +function bytesToWords(t) { + for (var n = [], e = 0, r = 0; e < t.length; e++, + r += 8) + n[r >>> 5] |= t[e] << 24 - r % 32; + return n +} +function getSign (t) { + t = stringToBytes(t) + var e = bytesToWords(t) + , i = 8 * t.length + , a = [] + , s = 1732584193 + , u = -271733879 + , c = -1732584194 + , f = 271733878 + , h = -1009589776; + e[i >> 5] |= 128 << 24 - i % 32, + e[15 + (i + 64 >>> 9 << 4)] = i; + for (var l = 0; l < e.length; l += 16) { + for (var p = s, g = u, v = c, d = f, y = h, m = 0; m < 80; m++) { + if (m < 16) + a[m] = e[l + m]; + else { + var w = a[m - 3] ^ a[m - 8] ^ a[m - 14] ^ a[m - 16]; + a[m] = w << 1 | w >>> 31 + } + var _ = (s << 5 | s >>> 27) + h + (a[m] >>> 0) + (m < 20 ? 1518500249 + (u & c | ~u & f) : m < 40 ? 1859775393 + (u ^ c ^ f) : m < 60 ? (u & c | u & f | c & f) - 1894007588 : (u ^ c ^ f) - 899497514); + h = f, + f = c, + c = u << 30 | u >>> 2, + u = s, + s = _ + } + s += p, + u += g, + c += v, + f += d, + h += y + } + return [s, u, c, f, h] +} +//初始化 +function initial() { + merge = { + nickname: "", + enabled: true, + end: false, + black: false + } + for (let i in merge) { + merge[i].success = 0; + merge[i].fail = 0; + merge[i].prizeCount = 0; + merge[i].notify = ""; + merge[i].show = true; + } +} +//通知 +function msgShow() { + console.log("\n\n京东账号:"+merge.nickname + ' 任务已做完!\n如有未完成的任务,请多执行几次') + //$.msg($.Name,"","京东账号:"+merge.nickname + ' 任务已做完!\n如有未完成的任务,请多执行几次') +} + +function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),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}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{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=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"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 e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o)),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} diff --git a/Task/jd_lotteryMachine.js b/Task/jd_lotteryMachine.js index 88b05dba42..283966fbf1 100644 --- a/Task/jd_lotteryMachine.js +++ b/Task/jd_lotteryMachine.js @@ -1,7 +1,7 @@ /* 京东抽奖机 -更新时间:2020-11-06 13:12 -脚本说明:四个抽奖活动,【东东抽奖机】【新店福利】【东东福利屋】【东东生活】,点通知只能跳转一个,入口在京东APP玩一玩里面可以看到 +更新时间:2020-11-07 21:42 +脚本说明:五个抽奖活动,【东东抽奖机】【新店福利】【东东福利屋】【东东生活】【闪购盲盒】,点通知只能跳转一个,入口在京东APP玩一玩里面可以看到 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js // quantumultx [task_local] @@ -19,8 +19,8 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; const STRSPLIT = "|"; const needSum = false; //是否需要显示汇总 const printDetail = false; //是否显示出参详情 -const appIdArr = ['1EFRQxQ','1EFRQxA','1EFRQxw','1EFRQyw'] -const shareCodeArr = ['P04z54XCjVXmYaW5m9cZ2f433tIlGBj3JnLHD0','P04z54XCjVXmIaW5m9cZ2f433tIlGWEga-IO2o','P04z54XCjVXm4aW5m9cZ2f433tIlINrBDzgMdY','P04z54XCjVXl4aW5m9cZ2f433tIlHQIDDSzFzg'] +const appIdArr = ['1EFRQxQ','1EFRQxA','1EFRQxw','1EFRQyw','1EFRRxA'] +const shareCodeArr = ['P04z54XCjVXmYaW5m9cZ2f433tIlGBj3JnLHD0','P04z54XCjVXmIaW5m9cZ2f433tIlGWEga-IO2o','P04z54XCjVXm4aW5m9cZ2f433tIlINrBDzgMdY','P04z54XCjVXl4aW5m9cZ2f433tIlHQIDDSzFzg','P04z54XCjVWmIaW5m9cZ2f433tIlJz4FjX2kfk'] //const funPrefixArr = ['interact_template','interact_template','wfh'] //IOS等用户直接用NobyDa的jd cookie let cookiesArr = [], cookie = ''; @@ -123,7 +123,7 @@ function interact_template_getHomeData(timeout = 0) { for (let i = 0;i < data.data.result.taskVos.length;i ++) { console.log("\n" + data.data.result.taskVos[i].taskType + '-' + data.data.result.taskVos[i].taskName + '-' + (data.data.result.taskVos[i].status === 1 ? `已完成${data.data.result.taskVos[i].times}-未完成${data.data.result.taskVos[i].maxTimes}` : "全部已完成")) //签到 - if (data.data.result.taskVos[i].taskType === 13) { + if ([0,13].includes(data.data.result.taskVos[i].taskType)) { if (data.data.result.taskVos[i].status === 1) { await harmony_collectScore(data.data.result.taskVos[i].simpleRecordInfoVo.taskToken,data.data.result.taskVos[i].taskId); } @@ -290,4 +290,4 @@ function msgShow() { -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 96c3f6bbf74cf304a908ae07f54beff69ed3fc68 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 11 Nov 2020 22:37:20 +0800 Subject: [PATCH 115/721] Delete LICENSE --- LICENSE | 72 --------------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index b8e7853f41..0000000000 --- a/LICENSE +++ /dev/null @@ -1,72 +0,0 @@ -Copyright (c) [Year] [name of copyright holder] - [Software Name] is licensed under Mulan PSL v2. - You can use this software according to the terms and conditions of the Mulan PSL v2. - You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - See the Mulan PSL v2 for more details. - - - Mulan Permissive Software License,Version 2 - - Mulan Permissive Software License,Version 2 (Mulan PSL v2) - January 2020 http://license.coscl.org.cn/MulanPSL2 - - Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions: - - 0. Definition - - Software means the program and related documents which are licensed under this License and comprise all Contribution(s). - - Contribution means the copyrightable work licensed by a particular Contributor under this License. - - Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License. - - Legal Entity means the entity making a Contribution and all its Affiliates. - - Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity. - - 1. Grant of Copyright License - - Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not. - - 2. Grant of Patent License - - Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken. - - 3. No Trademark License - - No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4. - - 4. Distribution Restriction - - You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software. - - 5. Disclaimer of Warranty and Limitation of Liability - - THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - 6. Language - - THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL. - - END OF THE TERMS AND CONDITIONS - - How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software - - To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps: - - i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner; - - ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package; - - iii Attach the statement to the appropriate annotated syntax at the beginning of each source file. - - - Copyright (c) [Year] [name of copyright holder] - [Software Name] is licensed under Mulan PSL v2. - You can use this software according to the terms and conditions of the Mulan PSL v2. - You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - See the Mulan PSL v2 for more details. From 1726ae7ab7b63550859ba31dcaa1a789de44e231 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 11 Nov 2020 22:37:48 +0800 Subject: [PATCH 116/721] Create LICENSE --- LICENSE | 1 + 1 file changed, 1 insertion(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/LICENSE @@ -0,0 +1 @@ + From 452f42335374d3389d56a86c468e91fcc43f0f0c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 11 Nov 2020 22:50:24 +0800 Subject: [PATCH 117/721] Delete LICENSE --- LICENSE | 1 - 1 file changed, 1 deletion(-) delete mode 100644 LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 8b13789179..0000000000 --- a/LICENSE +++ /dev/null @@ -1 +0,0 @@ - From 2c5768b6b605e4b7a04ce016f94bd3dd3baa4153 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 11 Nov 2020 23:26:48 +0800 Subject: [PATCH 118/721] Delete test.yml --- .workflow/test.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .workflow/test.yml diff --git a/.workflow/test.yml b/.workflow/test.yml deleted file mode 100644 index 8fbd35db80..0000000000 --- a/.workflow/test.yml +++ /dev/null @@ -1,23 +0,0 @@ -# ======================================================== -# npm 构建参考流水线样例 -# 功能:输出当前 npm 构建环境的环境信息 -# ======================================================== -name: gitee-go-npm-example # 定义一个唯一 ID 标识为 gitee-go-npm-example,名称为 “npm-流水线示例” 的流水线 -displayName: 'npm-流水线示例' -triggers: # 流水线触发器配置 - push: # 设置 master 分支 在产生代码 push 时精确触发(PRECISE)构建 - - matchType: PRECISE - branch: master -commitMessage: '' # 通过匹配当前提交的 CommitMessage 决定是否执行流水线 -stages: # 构建阶段配置 - - stage: # 定义一个 ID 标识为 npm-build-stage ,名为 “npm Stage” 的阶段 - name: npm-build-stage - displayName: 'npm Stage' - failFast: false # 允许快速失败,即当 Stage 中有任务失败时,直接结束整个 Stage - steps: # 构建步骤配置 - - step: npmbuild@1 # 采用 npm 编译环境 - name: npm-build # 定义一个 ID 标识为 npm-build ,名为 “npm Step” 的阶段 - displayName: 'npm Step' - inputs: # 构建输入参数设定 - nodeVersion: 10.1 # 指定 node 环境版本为 10.1 - goals: "node -v && npm -v" # 输出 构建环境 Node 和 npm 信息 \ No newline at end of file From c42dd0de22782deb51ed7b4543969bbbcda930c4 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 12 Nov 2020 00:54:40 +0800 Subject: [PATCH 119/721] Create LICENSE --- LICENSE | 661 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 661 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..dbbe355815 --- /dev/null +++ b/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. From 6293d2bc69701a7ba40485dac9f8898a25dcf60c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 12 Nov 2020 01:06:13 +0800 Subject: [PATCH 120/721] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eab9a7267a..1fb95d98d7 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,12 @@ ### 特别感谢: -* [@NobyDa](https://github.com/NobyDa) * [@chavyleung](https://github.com/chavyleung) +* [@NobyDa](https://github.com/NobyDa) + +* [@lxk0301](https://github.com/lxk0301) + +* [@id77_Github](https://github.com/id77) + From 4e8b41669d2517f95485ad2dccaad92e60bdba48 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 12 Nov 2020 09:46:35 +0800 Subject: [PATCH 121/721] Delete jd_starStore.js --- Task/jd_starStore.js | 309 ------------------------------------------- 1 file changed, 309 deletions(-) delete mode 100644 Task/jd_starStore.js diff --git a/Task/jd_starStore.js b/Task/jd_starStore.js deleted file mode 100644 index f03e68f6eb..0000000000 --- a/Task/jd_starStore.js +++ /dev/null @@ -1,309 +0,0 @@ -/* -京东星店长 -更新时间:2020-11-04 08:27 -脚本说明: -第一次执行会循环 8--86号店铺,时间比较长,后面会判断,做完86的不再全部做,每天运行一次即可 -使用前请先看下活动介绍,可能会关注店铺,入会是假入会,入会任务可能不会完成 -此脚本仅做任务,需要拉人头才能参与瓜分,请按需使用 -活动进入方式:京东app搜索【星店长】 -5 9 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_starStore.js, tag=京东星店长, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jd.png, enabled=true - -*/ -const $ = new Env('京东星店长'); -//Node.js用户请在jdCookie.js处填写京东ck; -const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; -//IOS等用户直接用NobyDa的jd cookie -let cookiesArr = [], cookie = ''; -if ($.isNode()) { - Object.keys(jdCookieNode).forEach((item) => { - cookiesArr.push(jdCookieNode[item]) - }) -} else { - cookiesArr.push($.getdata('CookieJD')); - cookiesArr.push($.getdata('CookieJD2')); -} -const JD_API_HOST = `https://api.m.jd.com/client.action?functionId=`; -!(async () => { - if (!cookiesArr[0]) { - $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - return; - } - for (let i = 0; i < cookiesArr.length; i++) { - cookie = cookiesArr[i]; - if (cookie) { - console.log('**********************分割线**********************') - initial(); - await QueryJDUserInfo(); - if (!merge.enabled) //cookie不可用 - { - $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 - $.msg($.name, `【提示】京东账号${i + 1} cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - continue; - } - if (Date.now() > Date.parse('2020-11-12')){ - $.msg($.Name,"","活动已结束,请删除或禁用脚本!"); - return - } - let shopId = 0; - let now = new Date(); - //await mcxhd_starmall_taskList(86); //做最后一个,看是否做完 - //if (!merge.end) { - for (shopId = 8; shopId <87 ; shopId ++ ) { - console.log('\n开始店铺:' + shopId) - await mcxhd_starmall_taskList(shopId); - } - //} - //merge.end = false; - if (now.getDate() === 3) shopId = 2; - if (now.getDate() === 4) shopId = 2; - if (now.getDate() === 5) shopId = 3; - if (now.getDate() === 6) shopId = 3; - if (now.getDate() === 7) shopId = 4; - if (now.getDate() === 8) shopId = 4; - if (now.getDate() === 9) shopId = 5; - if (now.getDate() === 10) shopId = 6; - if (now.getDate() === 11) shopId = 7; - await mcxhd_starmall_taskList(shopId); - await msgShow(); - } - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - - -//获取昵称(直接用,勿删) -function QueryJDUserInfo(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, - headers : { - 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, - 'Cookie' : cookie - } - } - $.get(url, (err, resp, data) => { - try { - data = JSON.parse(data); - if (data.retcode === 13) { - merge.enabled = false - return - } - merge.nickname = data.base.nickname; - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//查询 -function mcxhd_starmall_taskList(shopId,timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}mcxhd_starmall_taskList&appid=jd_mp_h5&body=%7B%22shopId%22:%22${shopId}%22,%22token%22:%22jd6df03bd53f0f292f%22%7D&loginType=2`, - headers : { - 'Origin' : `https://h5.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/4DEZi5iUgrNLD9EWknrGZhCjNv7V/index.html`, - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - } - } - $.get(url, async (err, resp, data) => { - try { - data = JSON.parse(data); - if (data.retCode !== "200") { - console.log(data.retMessage) - return - } - console.log('\n星店长:'+data.result.starName) - for (let i in data.result.tasks) { - if (merge.end) return ; - //if (data.result.tasks[i].taskType !== "7"){ - // continue - //} else { - // console.log(data.result.tasks[i].subItem[0].itemId) - // return - //} - if (data.result.tasks[i].taskType !== "7") console.log('\n开始做任务:' + data.result.tasks[i].taskName) - if (data.result.tasks[i].status === 0 ) { - for (let j in data.result.tasks[i].subItem) { - await mcxhd_starmall_doTask(shopId,data.result.tasks[i].taskType,data.result.tasks[i].subItem[j].itemId) - } - } else { - //console.log(data.result.tasks[i].taskType) - console.log('已完成') - if (data.result.tasks[i].taskType === "1") { - console.log('签到已完成,本店任务跳过') - break - } - } - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//做任务 -function mcxhd_starmall_doTask(shopId,taskType,itemId,timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - if (taskType === "7") itemId = shareCode[shopId];// '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8zYv7WVIxFMVj1lV2pKDjARLLbNU_JV-gpnPfE9HW-02KqFUKGtvxAhB0qpzIrZwdSu-yZTRWQMbBwd4k2XPmFHDqa'; - let url = { - url : `${JD_API_HOST}mcxhd_starmall_doTask&appid=jd_mp_h5&body=%7B%22itemId%22:%22${itemId}%22,%22taskType%22:%22${taskType}%22,%22shopId%22:%22${shopId}%22,%22token%22:%22jd6df03bd53f0f292f%22%7D&loginType=2`, - headers : { - 'Origin' : `https://h5.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `*/*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/4DEZi5iUgrNLD9EWknrGZhCjNv7V/index.html?shopId=${shopId}&inviteId=${shareCode[shopId]}&babelChannel=ttt1`, - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - } - } - $.get(url, async (err, resp, data) => { - try { - //console.log(url.url) - //console.log(data) - data = JSON.parse(data); - if (taskType !== "7") console.log(data.retMessage) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -var shareCode = [ - '', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwzfupaUAaCzThSWkJH-rWzkE1CiSqcKjixdbItXLI36wd2PRn53FF3Qd83QaH-eksFJaOtrv6OeY7ZPZxBlToRqbNRrw', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8zYv7WVIxFMVj1lV2pKDjARLLbNU_JV-gpnPfE9HW-02KqFUKGtvxAhB0qpzIrZwdSu-yZTRWQMbBwd4k2XPmFHDqa', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4zzIuAP9ftTzuEao3sXWuGLLpFCZ5icB_-WvBMpD6Go5-HLIIV5iGRwTgj8stXlkisI8N_5JhwQsD7GQ4LGsgvJ_Wruw', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkzagijopM6HP9i8jM8Hvo2CfFhtPmUIBcG2gmTDdvOg_bCvQS9LROdHNxp2CaqYwdqkm5goAePm-yVeRUMoYj_dRnugg', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgzSEllgoZFO2Qm8oFmt0Q4mow9dCzWpinng8olsX7EMifKAGeDMVk7_oaIVQPCbC9-VtlD_hzdK811DMzScm33McGt', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfszf6XfbSkVmvZ41eDovmsK1hM-13auIalW_2Mj5eLGaScrZA_euWAVL3G95wbuAV8viZaEFCcUPGUmCwe5VZd-mTzilw', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfoza8K0IpL9mvWLveI1os5oJp2dTVcxqcNGK_we7REPVSOQHIRX47scO74cIkYQOB6T_S6RhuILYyMUbS4BPjRvYbO06g', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUzFOD-4F8YdcGyLhJdtLVbkV1zpvhNUdZVO_auO4PKrbCS3XQffPgTvdVQpelJiK3roby2J2TZV9EBDwmkaotEL7jQSQ', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfQzcjir8SeH7RnnwOFgXTwfTeoyrdK7ZaR-SBmLf3RsY--v7DpVA7H5rjSgRFZCgbfm-Z0M6nvxkVmWAzsU3B97Gcw7iA', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwhwhxjv9goOzjcVIHpVqBrcgAu1QDzjWRmis99vVsRXHAfdITKHZWgSKYP4rTiNmILf3hhGBKRt3nwWYelfcfx3tByzQ', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwg1GkpMYts8kEYMM2UgyMYF8s7hGmA3s9SGNYAns7xhs_og6O6QR7O-JtMWGMcG1iEPf-H9L85wein_wFn1mVM-sCA0V8', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwj5lnjD6wrhVGo0oN2nUU-aYNeqA-PDItHq9HQhFppDm8vvcs622gpz-0BVf5ftyaVigNkqZLf2veMaRgeGcEUXv7h8N0', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwiej9xjZP0LbnLloPCge1bsVtIH7k2tYk4mUw-ntWz2Cn46Iy1E4tOhSOL-Dyx-tfnhAPyy2adQ8Jln8-NlLp6iToiNTw', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwlOWoIwiLSKbuDSbp6V-f6tZd5dZ7pHcl1Rmw5UYW8ugOuFtG1obW1eMGitMUo87QRUbPSKilOxYXXGTKDYSU-PU4KTg', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwkEyo_2Xqhtn8UM5huWU49Yu2ogT4bguZxlaguPeK5l2Qj88DZeTmPUVVHY0zW4ov2geKLvKHqO4wHoOFL7Oa1ruI59TQ', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwniukeK0jGMdPRHf7_w5TEv4yKLIq5ifuYOHX9Nv2wVUkOp2OnXrhrMdIuFpPuqY_wUgIgXbV7J1mOnQpHr2dd4SYldQ', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwmXvcUbGY9LbbkDifMWqHOdmpi9ks5VS1KiGauQZjnyuGH8S-1_GTd5IKrecfzbAE24D0QtfSGw8XVQDZv8alrDZ1iFA', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwpBn9H4cZ55ZHQXbHyK64A6XkWjfzxsJNIl7_cgBfmqDGnnQRs2FNDxi-gJ1m-LoBHAYDuaW47H_ON8aBYJDEZohEiLGY', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfwoDFjEn_bARCtQnOAU-aQtTTdvLHbUeMcdncaUPqMVCCzAJekDdSDcoFvRdYfLvbGKvnqNfRT1Ra1EjKoNqVzxurhcCw', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8hYAlTUnHWn0lIqm0wmbkyMT_ZiCBePGEwwqUOUokFoSk1PMMwmYHmkd_cq_0uWHy0tEwLkCwBSBRrqTaDDSp80h2aEKo', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8g-ERlkoyFzDfwGNc4ujzFPPpVPDav6KLvNJToaZyngBY1gX8i3LpYkFYTG7UsC0HsdBeHmy_xvECm84qlXHwIoGBV2rk', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8jg4H-3mtslFtHHj5odslZizbzquoy0KJPp_ZcaPJfmEWGakJGkXr0xuLh-5pzESdP7DZDDPuyx7TOk-Vr-GdD9d4MzQ', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8iaLgHXA9kP1Gab0-LjixH1XbYRSyvDh8U_Bz0U2Tjc5JpjuM3Zrub4EcS-nFbaObQiOKOCHIKZuBn1Q91hLblDfQtYx0', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8luvOmnSUBSuwwQV_84Z8bcEt3CRzSTz2RQS016aI8wuaCzgjpnxUxCOtD8lGIGSQfkERRzxW1T2t2qSaOjb4aPEJ-Jx0', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8kbKT3QJERdmecdKDkHSoMoXSniWOQsn-QIAxV6DdMFtaCVtSkaN8ZAbAYsq4ASWNiBuNGGR8kD2cmoSvmIdKnuhztNw', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8nNTbJHovvbC-2gPbI5KOgt2zghQehOj9cRCiG4vCC7JoRTNqmIkjSLhRbbI-UhQQ4qV6VoZuc2opMo3DqGmVV5buJycQ', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8mQGt4VfZKRvRhI5ILdBLkxXar2g51KytOYsbHkHdExbreOWA54eVdlkiPEoaJJMG8LUBZ7iZ8-E5INsHrdA1ZG7deRh4', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8pLXJYHI-a8nHXvxfeGZ4Wx9xbU7BcN19iGczuIIrUqFOS38wC2KeBH1oChm-JIH0EhtlEmUnqzhVLRE-K4mMLWQh72w', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf8okmHdcCdskP7LmeBLQiN9reOaSydRb1rl1SrM8gMHJTci93Pjvcls9dqlWalYLm8sBFzieqAVD6nCyBB2G2sPu-PiUmg', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4hOcHPA4zCjLnErqe9LD5c8E8gRs4rBf4KkPYCbKVvgF68nefvxa0BS5SFumwHJsT8wW6RdTd867QCewf4Udlp7-ygiA', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4gv7ktxxXawJyq73ZXSDDO3K3W4XdaPCHnm9Fhi2bH9kAj7wOd_FPpHhoLc9oEHW6JHBVkC15igau8ppEDn6b9PADFmgo', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4jSN_mDWvfNa5RrLTavB-U9YOF-6G0HyZa5RXdQ-QrNmVT9Oo0_SjPOtDWAeBC2hYdlAx-QmhHAXS4yB-3YEGDRJiwf54', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4i59rZPbyugO3dSl_y3r71j5kre0TVzA8Mn_ejcxaF9nszVzBmMcWNFJCv4qR9j9C6y-m4EOA27TJE6lIse8pIqPtiGzM', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4le55QaxXu2zOLDO53A0S5tDUVyoQjqihzMn43fMRajKaMeobc3_lYTJNWRbuufGpzZjbSJqODeeJSIOTkSm-NhFMnsL4', - '活动不存在或已结束,试试其他活动吧~', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4nVvBWxlihhrqqtJhrVGMzep75ykmRsh0RYafgHWA1DJhDcZn12n6L-82KG5NFY3gD7UI5IxliqAoKSj6vhJy7FAtSwA', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4mLJGS2hwyI05jqfoxqpX_fLOBWLhLJedkAZCNWZe_N7n5xIm5_K17KyNSTK2B5Xd-xVXC-vktUvxHJt8QbYDVcRL4OIY', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4pljzS2kzg32QlbdWIhIm4DcTeqsZ46Xehmm3-X5Nk5ZkAwXgLXY98IGZYKVqBmnqetu8iXtOcWKeA3BUeuyjwk2_TiKc', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWf4oEBZPcxERcmVGNMEUXy8y6E-cqbbfnR63aUrz5H7Yo6vc8L1E0SyHbI3d6N4b2CrQ_cLS8Voux-npXu8WbABWYfrUmQ', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkhDsSrdkcVGK3VTommsDKAvYw0l6HweWIWVOjHViJGyWGC38WVh963S5Ud1PAt4EQlV1MmI7jNTdQ5sk1iG8ZomoiZazQ', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkgy97snot-BF6Y0n9yUo6v0AN7ylo5Jbe0cB5T8A0783IPCGqMCm3yn-rOL395ebEQaM-nw6Da5Ap3Ias-VLHpIxeB8NE', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkjXCW2KTTC26wxgkilM-7gp6oP-EceBlbS7SH5xeHFkR4RmW3VotHe-F9kJFDZRbdGIPd5ATI38KQ6QHShR1zFb0Q3CQU', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkiBmW2WsEkjXxdxhQfNXDc8wfa-p9jwesxxnCOZZ0jBWF1gW5VespnUODpkyKDhz3g2LeKhup9EEdyp0kHoNe-Tm3bDyk', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfklnO45rRYZjmyo0tMWIEQIt2PjL0cEZWiUop4NmuzSvoMvQwamflWB2nR0HUzAq7JBA_lCgRGgpO7f-OSSu4y_bkZXZA', - '活动不存在或已结束,试试其他活动吧~', - '活动不存在或已结束,试试其他活动吧~', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfkmCjT4RXQOEO1JuKHUbhTy4jTDchNxUn5-n5HNHX6Mqptvx2i8lOe_cfYziWW_KbwN5iZfGd0mEiOM2qrPkWFayz-VMaw', - '活动不存在或已结束,试试其他活动吧~', - '活动不存在或已结束,试试其他活动吧~', - '活动不存在或已结束,试试其他活动吧~', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfggMxZjZNCAb9v9v2mWjs7bl2RxHBJWrCEV4xjJ9NBSese836v2mfKFfc2tv9SrjmhycjvhTqXR3CBmCrWEVbw_fljmrQ', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgj6GYEtRUHqfbhnsvLlCTSV-jTYvQR_t8SCOOABo2vxzkDDCaRXDDv2MUrOps5NumniB5MDKkoU5BVCxEikisRgsnPYd0', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgitlDQvhA0gqfgXU0UfYkrTuOXJnst9JYdbW5yHLe41n6RtD_pMMp2zc1SBIloFjmNFaeaUP1clWcOGqtV4wbLTeGLAKY', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgl0vbXXC9JdSAWkC-vVrO9vmU82R3qkl1oBmb9pNdjxgiDaklmSNZzhKSfieRcJ-Mn8y0o01XmiLQ6lWg7Tj-RdDyrig', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgkvQ0bu6XWOuaKd5H28f-yXxgdhMmK5RyAW9TzjtIskHb4QHYhqNATons0UdM3YjqizMaOKb5o373TDItVq5gvTG8fat0', - '活动不存在或已结束,试试其他活动吧~', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgmVp8WCv8r_aeQECSQZLMnp4ZxgGpbkZazZQETws2UMPvcMJeYaXH6SBG3ax6bwcmDW73vzOd9Qqcea625puk_oTdAln8', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgpHAaEY1G-5u_B-Hh6N0ua6psMP8lmBLSikCLnYmc5RONZxeHqyruE7TPlV44cwrCYYlS2lakReHT9HZqJ9EZyRhBBN_w', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfgozwf1YShpYwumLKrL2ds-Ag81fYt_1cAv52t7qDr42NdQFFaopeqjh6VRtU_aiNImgvJJ32UbedSst8YDL5JSEQ8Jl0Q', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfshzgVN_NDaq8FF1xcXks1Of81nzViBaivBA1KiwyeHh_cXdtE9jJbEpTStq8KmaT9B-LjEJNlR-7sBpUDHhZww7B6iCXM', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfsgP4D0AfC15vH5HIIregOPLqDnr78boGgwDTgIynX7z-CPYc0V5w4G8zRgtIABHbj872nCBjsjr-wsWv1uUZCRMrBs-zk', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfsj0X_ymCa6ASuH9tD9XzpcnvT70DQJ2uYV9vnfYD0eGFFvspksrWau9vCgvsqtg6MUpdoylM6iP27zWfi1Viout7gBv1Y', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfsi-uUhG9sLfW9OhsLAFSwzLYKUWYRV6EzyrqbaOQqgc4gavlWUThHlBPJXBXYgV6Cq318pd01uwwnTdHCmuyePmFGp7w', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfslOA7UpZCFo6gy9F9tsvVD5GIjYRFPS4p9DUzpnlipH-R6Ov_GrQ7t1aUcr7aguuCVti_gXDboLJBrZkCDp_Ck1-zL04w', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfskmMFFOF1YzpVZ-2NGA0v5nDJ5DFdEf24JLCi9vi2RLagqxaIeOEf_cQdqCNyZI3EwfsStEvLuC8wd-bZWpWYDy6Fscr0', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfsnd9UbKcTL-Uh4IvNj847UoVCCAysL3HRqrIqbgYVVuS0A1K9x3IZOfvtLSnjtzpGOMzzcu5XjTB4NT7BQGQx2hjOj9GQ', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfsmTZ3cgqFDSKt8YjYAgC13jJqcd-rNZDUamX1Kpf6rTaQMnben4JpS7OaO0zwwBHmnVBWBnQrciL9uUjKy0G1Rc-Ii3ec', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfspw6HcZ5vYwG8WHB2lVJz-sxaAb05U7A05tsQpb_ni_ec-_W6W2xOjWDXlKXZtUrKvg9K62yVrUpDpZgi6v4wIBP3i_A', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfso47WwFIl3VWc_YDFC-othyiQJe6toaODA3bAzRj8R-2XS40j3HI90wvW4mFtodnVkiGY7CgFcg8Ery0q-Jrm2SzUno0g', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfohrXzwpKGQht1jOwZEQRhHVi2kxj_hzvgj9nEzYftgVXgYal5gjmwchuHxJVr4zOxHxfPvImrZniHDDXuJuATC1h4qQlc', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfoglaRdeBfYHV_Rqhy6V0OpX2pemE-YlxdpmRgy_3C8ZEVjwp6gyK-XfDFYmtXpJsLBE48CiflFoP2yAvXGUdlr0iZh0g', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfojhnbJMryxC2HOwz_Ek2tydOLzdQTvynbTfaR_N2vXRMfDnxQBppvnBjCW-DScTQKKUkytI6xOyqRBCk1Z4Z4eXL_owCk', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfoiYwCuF_2kpo674jSO7Qx5IpVjyd-_uJorWExZavT2jyrB8GS36erI2h9kFgYLwCInekTISNM9gykIZswvQ4SxPR9hAzw', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfolX68uJtWXPwReKCDo6vOdfwaqN-UZs9FpX4SjCVgLqmiPUR4QzIvGNyLfPm-wrNwC2fpsWyjHcFcrAiXQqzgUCZzeVUk', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfokpv63ZoN0iHyfMZo1SVajHKX2otxF4ze0mmw9ssKUorC--5bMjSHBALhA8_D9UHGKj2OOYxT37CTzCZesDz5n2FzQW5U', - '活动不存在或已结束,试试其他活动吧~', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfomGcx4Npir_v8wdomXvxUIhXD-MeaCmqOkFaqPFcwbmTcV8FCVSBJg0gkVFrotgMRMOzJp-Gl10zmjugQGIIxalBb0HwA', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfopmj6UNaaQf1RH3-j34B_k37p3W_NWW_ll-iqiYn0HehoderoVHNUxSuwLceQWStwSWx2m27ix2Y8MkpHBQ5Lg0Jt3nQY', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfooaxiDKISznvTYePbE3lOzASLuXPP8XWysr1MAYZ0KVZ7_HKiPlCSOAmOC5Skxcti8s_5sFtRIORHkRAHrFjyTQNXpjAM', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUhzydZiUwrQA-YYMy56oIDc_oCnNI-N6oSpCbCu2qxRcRLqp6Kp1GEmoAWDwSpq_NZxhDsqZHsHlk0_8qL_yFlMFbrYCw', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUgZwLfqVLDdWMlTpUkB4of3IHJLvvSpytixo0m-Re4R396shpCtt8IbN3zXYy1pMMfbVZR7kPgi9BSK5ST8G_K0ZSrFZA', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUjoOIj6OgMFLBamYLJ3HW8ad1nqLoj1D6NmlFnkGuyAzY5HsOFhsraGonP2B1Tx2nuJPZuJAwapb43a0WxRkKA3HSsXA', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUiRpJ9C08JwP3F2pMpRSWrVmOFj-6wM3wvABiP3AxpYGI1tjr4XIYZkFeMeUstUeifdvNES7Sgx1XXsIVxcD8dlJ8FfqQ', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUlnpdQctIkBIPCE-KoLw6aLglNbHq1qUUBhiT_2BfEFqX0sCJOpxd2ucp_E6syRQ9mW8pSKuTNo7kInnVSO28uaC_LluE', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUkmXh_RTbFx8L_BcJVAtEU78aNcj1OdAsxsTxnDn5jpw72bkx064VI86qV0HpdCbeDo4qPptTDz1m5Ydxb7cxzmeZyWM4', - '9HId9Z2m6CsyDV00EzbubGvFewAM3GwBiqLEr9J70c7yglxRrYXbB76sxU8dWfUnHohneTsnYM52nK570112qiiBTQKwEI-OLwFtqDgI2tM5zXpA_1AZDrYeFv4AczU53pMEPZBTWHeQMKWOqCrOrfM-AA' -] - - -//初始化 -function initial() { - merge = { - nickname: "", - enabled: true, - end: false - } - for (let i in merge) { - merge[i].success = 0; - merge[i].fail = 0; - merge[i].prizeCount = 0; - merge[i].notify = ""; - merge[i].show = true; - } -} -//通知 -function msgShow() { - let message = "京东账号:" +merge.nickname + "\n执行成功,请点击通知跳转APP查看!"; - let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/4DEZi5iUgrNLD9EWknrGZhCjNv7V/index.html%22%20%7D`} - $.msg($.name, "", message, url); -} - - -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 5adadd5a51cfc69312378cf688a0499bc08f6836 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 12 Nov 2020 09:46:58 +0800 Subject: [PATCH 122/721] Delete jd_starStore.yml --- .github/workflows/jd_starStore.yml | 40 ------------------------------ 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/jd_starStore.yml diff --git a/.github/workflows/jd_starStore.yml b/.github/workflows/jd_starStore.yml deleted file mode 100644 index 575a5210d4..0000000000 --- a/.github/workflows/jd_starStore.yml +++ /dev/null @@ -1,40 +0,0 @@ - -name: 星店长 - -on: - workflow_dispatch: - schedule: - - cron: '5 16 * * *' - watch: - types: started -jobs: - build: - runs-on: ubuntu-latest - if: github.event.repository.owner.id == github.event.sender.id - env: - JD_COOKIE: ${{ secrets.JD_COOKIE }} - steps: - - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: npm install - run: | - cd ~/Scripts - npm install - - name: '运行 【京东星店长】' - if: env.JD_COOKIE - run: | - cd ~/Scripts - node Task/jd_starStore.js - env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file From 075b494fd0f99e94ff36f6aad2f95ce700d7ac35 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 12 Nov 2020 10:21:39 +0800 Subject: [PATCH 123/721] Delete jd_bigWinner.yml --- .github/workflows/jd_bigWinner.yml | 40 ------------------------------ 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/jd_bigWinner.yml diff --git a/.github/workflows/jd_bigWinner.yml b/.github/workflows/jd_bigWinner.yml deleted file mode 100644 index 3ba820eaca..0000000000 --- a/.github/workflows/jd_bigWinner.yml +++ /dev/null @@ -1,40 +0,0 @@ - -name: 京东大赢家 - -on: - workflow_dispatch: - schedule: - - cron: '3 */2 * * *' - watch: - types: started -jobs: - build: - runs-on: ubuntu-latest - if: github.event.repository.owner.id == github.event.sender.id - env: - JD_COOKIE: ${{ secrets.JD_COOKIE }} - steps: - - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: npm install - run: | - cd ~/Scripts - npm install - - name: '运行 【京东大赢家】' - if: env.JD_COOKIE - run: | - cd ~/Scripts - node Task/jd_bigWinner.js - env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file From 2ee7916639d132252d50f59df3f0162e54a82ba4 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 12 Nov 2020 10:22:26 +0800 Subject: [PATCH 124/721] Delete jd_ timeMachine.yml --- .github/workflows/jd_ timeMachine.yml | 40 --------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/jd_ timeMachine.yml diff --git a/.github/workflows/jd_ timeMachine.yml b/.github/workflows/jd_ timeMachine.yml deleted file mode 100644 index 332d52373f..0000000000 --- a/.github/workflows/jd_ timeMachine.yml +++ /dev/null @@ -1,40 +0,0 @@ - -name: 京东时光机 - -on: - workflow_dispatch: - schedule: - - cron: '15 */4 * * *' - watch: - types: started -jobs: - build: - runs-on: ubuntu-latest - if: github.event.repository.owner.id == github.event.sender.id - env: - JD_COOKIE: ${{ secrets.JD_COOKIE }} - steps: - - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: npm install - run: | - cd ~/Scripts - npm install - - name: '运行 【京东时光机】' - if: env.JD_COOKIE - run: | - cd ~/Scripts - node Task/jd_timeMachine.js - env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file From 0398349cf9e621761eed26e75076a922df29c49f Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 16 Nov 2020 09:41:15 +0800 Subject: [PATCH 125/721] Update dianshijia.js --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 113df765cc..82074fd75d 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -97,7 +97,7 @@ if (isGetCookie = typeof $request !== 'undefined') { } console.log(`------------- 共${tokenArr.length}个账号`) if(new Date().getTimezoneOffset()/60 != '-8'){ - time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-8*60*60 + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000+16*60*60 console.log(time) console.log(process.env.TZ) } else { From 853b454a93d2e47d98ea03d5093b80adb0749999 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 16 Nov 2020 09:45:39 +0800 Subject: [PATCH 126/721] Update dianshijia.js --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 82074fd75d..66a8dbdb9c 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -1,6 +1,6 @@ /* -更新时间: 2020-11-04 22:20 +更新时间: 2020-11-16 09:40 赞赏:电视家邀请码`893988`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于电视家签到,支持Actions多账号运行,请用'#'或者换行隔开‼️ 获取Cookie方法: From d3c0fd378dcd51706a594e3fb25c1006079d7106 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 16 Nov 2020 10:09:05 +0800 Subject: [PATCH 127/721] Update dianshijia.js --- Task/dianshijia.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 66a8dbdb9c..5bdd3b418c 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -96,13 +96,14 @@ if (isGetCookie = typeof $request !== 'undefined') { return; } console.log(`------------- 共${tokenArr.length}个账号`) - if(new Date().getTimezoneOffset()/60 != '-8'){ - time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000+16*60*60 - console.log(time) - console.log(process.env.TZ) + if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')<'16'){ + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 + } if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')>'16'){ + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000+8*60*60 } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } + console.log(time) for (let i = 0; i < tokenArr.length; i++) { if (tokenArr[i]) { signheaderVal = tokenArr[i]; From 502c2811989c1347e97fee02ec78a8840552b086 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 16 Nov 2020 10:23:47 +0800 Subject: [PATCH 128/721] Update dianshijia.js --- Task/dianshijia.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 5bdd3b418c..a1743b0cb2 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -98,8 +98,8 @@ if (isGetCookie = typeof $request !== 'undefined') { console.log(`------------- 共${tokenArr.length}个账号`) if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')<'16'){ time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 - } if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')>'16'){ - time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000+8*60*60 + } else if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')>'16'){ + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000+24*60*60 } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } From 95022ca1532bd02f0f8e6789b8f37bb7a9b810ba Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 16 Nov 2020 11:09:44 +0800 Subject: [PATCH 129/721] Update dianshijia.js --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index a1743b0cb2..bff0382098 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -98,12 +98,12 @@ if (isGetCookie = typeof $request !== 'undefined') { console.log(`------------- 共${tokenArr.length}个账号`) if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')<'16'){ time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 + console.log(time) } else if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')>'16'){ time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000+24*60*60 } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } - console.log(time) for (let i = 0; i < tokenArr.length; i++) { if (tokenArr[i]) { signheaderVal = tokenArr[i]; From 7206fb52807618c36e3f66d332b888d141ed61f0 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 16 Nov 2020 13:12:39 +0800 Subject: [PATCH 130/721] Update dianshijia.js --- Task/dianshijia.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index bff0382098..e124305909 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -97,10 +97,10 @@ if (isGetCookie = typeof $request !== 'undefined') { } console.log(`------------- 共${tokenArr.length}个账号`) if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')<'16'){ - time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-28800 console.log(time) } else if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')>'16'){ - time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000+24*60*60 + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000+16*60*60 } else { time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 } From 163edecae1078d57e477399028d5833b1d5af77c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 26 Nov 2020 10:00:45 +0800 Subject: [PATCH 131/721] =?UTF-8?q?Update=20=E4=B8=AD=E9=9D=92=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=A5=BD=E5=8F=8B=E7=AD=BE=E5=88=B0=E7=BA=A2=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index b6d5983c79..087e0658ce 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2020-09-25 18:15 +更新时间: 2020-11-26 10:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 @@ -156,7 +156,7 @@ if (isGetCookie = typeof $request !== 'undefined') { } await sign(); await signInfo(); - await Invitant(); + await friendsign(); if($.time('HH')>12){ await punchCard() }; @@ -433,7 +433,7 @@ function boxshare() { }) } -function Invitant() { +function Invitant2() { return new Promise((resolve, reject) => { $.post({ url: `${YOUTH_HOST}User/fillCode`,headers: JSON.parse(signheaderVal),body: `{"code": "46746961"}` }, (error, response, data) => @@ -443,6 +443,45 @@ function Invitant() { resolve() }) } +function friendsign(uid) { + return new Promise((resolve, reject) => { + const url = { + url: `https://kd.youth.cn/WebApi/ShareSignNew/getFriendActiveList`, + headers: JSON.parse(signheaderVal) + } + $.get(url, async(error, response, data) => { + let addsign = JSON.parse(data) + if (addsign.error_code == "0"&& addsign.data.active_list.length>0) { + friendsitem = addsign.data.active_list + for(friends of friendsitem){ + if(friends.button==1){ + await friendSign(friends.uid) + } + } + } + resolve() + }) + }) +} + + +function friendSign(uid) { + return new Promise((resolve, reject) => { + const url = { + url: `https://kd.youth.cn/WebApi/ShareSignNew/sendScoreV2?friend_uid=${uid}`, + headers: JSON.parse(signheaderVal) + } + $.get(url, (error, response, data) => { + friendres = JSON.parse(data) + if (friendres.error_code == "0") { + //detail += `【好友红包】+${friendres.score}个青豆\n` + console.log("好友签到,我得红包+"+friendres.score+"个青豆") + } + resolve() + }) + }) +} + //看视频奖励 function getAdVideo() { From 45d255a06e47877283d38234d0db45fe33a7a543 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 26 Nov 2020 10:12:13 +0800 Subject: [PATCH 132/721] Update youth.js --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 087e0658ce..76e691f250 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -475,7 +475,7 @@ function friendSign(uid) { friendres = JSON.parse(data) if (friendres.error_code == "0") { //detail += `【好友红包】+${friendres.score}个青豆\n` - console.log("好友签到,我得红包+"+friendres.score+"个青豆") + console.log(`好友签到,我得红包 +${friendres.score}个青豆`) } resolve() }) From 162629c550afea28cca789e89215c95b00e7df77 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 27 Nov 2020 19:16:53 +0800 Subject: [PATCH 133/721] Create repo_sync.yml --- .github/workflows/repo_sync.yml | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/repo_sync.yml diff --git a/.github/workflows/repo_sync.yml b/.github/workflows/repo_sync.yml new file mode 100644 index 0000000000..cbd757bd5d --- /dev/null +++ b/.github/workflows/repo_sync.yml @@ -0,0 +1,40 @@ +# File: .github/workflows/repo-sync.yml +name: sync-Sunert-scripts +on: + schedule: + - cron: '1 0,15 * * *' + workflow_dispatch: + watch: + types: started + repository_dispatch: + types: sync-Sunert-scripts +jobs: + repo-sync: + env: + PAT: ${{ secrets.PAT }} #此处PAT需要申请,教程详见:https://www.jianshu.com/p/bb82b3ad1d11 + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} # 我自己同步到gitee使用,其他人可忽略 + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: sync Sunert-scripts + uses: repo-sync/github-sync@v2 + if: env.PAT + with: + source_repo: "https://github.com/Sunert/Scripts.git" + source_branch: "master" + destination_branch: "master" + github_token: ${{ secrets.PAT }} + # 我自己同步到gitee使用,其他人可忽略 + - name: sync github -> gitee + uses: Yikun/hub-mirror-action@master + if: env.dst_key + with: + src: github/Sunert + dst: gitee/Sunert + static_list: "Scripts" + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} + dst_token: ${{ secrets.GITEE_TOKEN }} From d446a0635c9e40819a4bdef8e1e61343fc768b50 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 27 Nov 2020 19:40:16 +0800 Subject: [PATCH 134/721] Update repo_sync.yml --- .github/workflows/repo_sync.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/repo_sync.yml b/.github/workflows/repo_sync.yml index cbd757bd5d..68be811884 100644 --- a/.github/workflows/repo_sync.yml +++ b/.github/workflows/repo_sync.yml @@ -33,8 +33,15 @@ jobs: uses: Yikun/hub-mirror-action@master if: env.dst_key with: + # 必选,需要同步的Github用户(源) src: github/Sunert + # 必选,需要同步到的Gitee的用户(目的) dst: gitee/Sunert + # 必选,更新指定库名字 static_list: "Scripts" + + # 必选,Gitee公钥对应的私钥,https://gitee.com/profile/sshkeys dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} + + # 必选,Gitee对应的用于创建仓库的token,https://gitee.com/profile/personal_access_tokens dst_token: ${{ secrets.GITEE_TOKEN }} From 55c5c3d27ccbe9a7a5ae08f82bfe5a4da3b6fa9c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 6 Dec 2020 15:18:38 +0800 Subject: [PATCH 135/721] Create Auto_Kuaishou.js --- Task/Auto_Kuaishou.js | 75 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Task/Auto_Kuaishou.js diff --git a/Task/Auto_Kuaishou.js b/Task/Auto_Kuaishou.js new file mode 100644 index 0000000000..9bc948e5b9 --- /dev/null +++ b/Task/Auto_Kuaishou.js @@ -0,0 +1,75 @@ +/* +更新时间: 2020-12-06 13:46 +Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 + +请自行抓包,刷视频即,可获得更多包数据,抓包地址为"http://ali2.a.yximgs.com/ksc1/xxxxxx.kpg",在Github Actions中的Secrets新建name为'KUAISHOUMV'的一个值,拷贝抓包的请求体到下面Value的文本框中,本脚本不包含任何推送通知 + +多个请求时用'#'号或者换行隔开" ‼️ + +*/ + +const $ = new Env("快手视频") + +let ksUrl = [], ksArr = []; + + if (process.env.KUAISHOUMV && process.env.KUAISHOUMV.indexOf('#') > -1) { + ksUrl = process.env.KUAISHOUMV.split('#'); + console.log(`您选择的是用"#"隔开\n`) + } + else if (process.env.KUAISHOUMV && process.env.KUAISHOUMV.indexOf('\n') > -1) { + ksUrl = process.env.KUAISHOUMV.split('\n'); + console.log(`您选择的是用换行隔开\n`) + } else { + ksUrl = process.env.KUAISHOUMV.split() + } + Object.keys(ksUrl).forEach((item) => { + if (ksUrl[item]) { + ksArr.push(ksUrl[item]) + } + }) + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + +!(async () => { + if (!ksArr[0]) { + console.log($.name, '【提示】请把抓包地址填入Github 的 Secrets 中,请以#或者换行隔开') + return; + } + for (let i = 0; i < ksArr.length; i++) { + if (ksArr[i]) { + playUrl = ksArr[i]; + $.index = i + 1; + console.log(`-------------------------\n\n开始快手极速版共${$.index}个视频`) + } + for (let j = 0; j < 20; j++) { + await AutoRead(); + await $.wait(5000); + console.log(`\n "请等待5s后继续视频${$.index}第${j+1}次任务`) + } + }; + console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*50)次,视频金币详情见App,任务全部结束`) +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + +function AutoRead(){ + return new Promise((resolve) => { + const myRequest = { + url: playUrl, + headers: { + 'Accept-Encoding' : `gzip, deflate`, + 'Connection' : `close`, + 'Accept' : `application/json`, + 'Host' : `ali2.a.yximgs.com`, + 'User-Agent' : `kwai-ios`, + 'Accept-Language' : `zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8`}, +}; + $.get(myRequest, (error, response, data) => { + //console.log(response.statusCode + "\n\n" + data); + //$.done(); + }) + resolve() + }) +} + +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 317556ce90845addb1ddf25d241e0871aff0f53c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 6 Dec 2020 15:23:51 +0800 Subject: [PATCH 136/721] Create AUTO_KS.yml --- .github/workflows/AUTO_KS.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/AUTO_KS.yml diff --git a/.github/workflows/AUTO_KS.yml b/.github/workflows/AUTO_KS.yml new file mode 100644 index 0000000000..3906aa178c --- /dev/null +++ b/.github/workflows/AUTO_KS.yml @@ -0,0 +1,42 @@ +# 快手视频刷金币测试,抓包获取secrets + +name: 快手视频 + +on: + workflow_dispatch: + schedule: + - cron: '*/5 1-15 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + KUAISHOUMV: ${{ secrets.KUAISHOUMV }} + TZ: Asia/shanghai + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【快手视频】' + if: env.KUAISHOUMV + run: | + cd ~/Scripts + node Task/Auto_Kuaishou.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} From 2b1881b1bec50b88ab07b51199c5a3d9188c72d9 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 6 Dec 2020 15:28:00 +0800 Subject: [PATCH 137/721] Update AUTO_KS.yml --- .github/workflows/AUTO_KS.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/AUTO_KS.yml b/.github/workflows/AUTO_KS.yml index 3906aa178c..663590409a 100644 --- a/.github/workflows/AUTO_KS.yml +++ b/.github/workflows/AUTO_KS.yml @@ -5,7 +5,7 @@ name: 快手视频 on: workflow_dispatch: schedule: - - cron: '*/5 1-15 * * *' + - cron: '*/20 1-15 * * *' watch: types: started jobs: From 07854374b107cc1f10bc0458c263113f9bddbed3 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 6 Dec 2020 15:33:31 +0800 Subject: [PATCH 138/721] =?UTF-8?q?Create=20=E5=BF=AB=E6=89=8B=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=88=B7=E9=87=91=E5=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Auto_Kuaishou.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/Auto_Kuaishou.js b/Task/Auto_Kuaishou.js index 9bc948e5b9..10fe9ba231 100644 --- a/Task/Auto_Kuaishou.js +++ b/Task/Auto_Kuaishou.js @@ -1,5 +1,6 @@ /* 更新时间: 2020-12-06 13:46 +赞赏:快手邀请码`774010415`,农妇山泉 -> 有点咸,万分感谢 Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 请自行抓包,刷视频即,可获得更多包数据,抓包地址为"http://ali2.a.yximgs.com/ksc1/xxxxxx.kpg",在Github Actions中的Secrets新建name为'KUAISHOUMV'的一个值,拷贝抓包的请求体到下面Value的文本框中,本脚本不包含任何推送通知 From 810a4bd9b03bbcdcb76debc3e1c6f8f0e36efdb9 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 6 Dec 2020 15:34:07 +0800 Subject: [PATCH 139/721] fix --- Task/Auto_Kuaishou.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/Auto_Kuaishou.js b/Task/Auto_Kuaishou.js index 10fe9ba231..6b3b94a6f4 100644 --- a/Task/Auto_Kuaishou.js +++ b/Task/Auto_Kuaishou.js @@ -48,7 +48,7 @@ let ksUrl = [], ksArr = []; console.log(`\n "请等待5s后继续视频${$.index}第${j+1}次任务`) } }; - console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*50)次,视频金币详情见App,任务全部结束`) + console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*20)次,视频金币详情见App,任务全部结束`) })() .catch((e) => $.logErr(e)) .finally(() => $.done()) From c2fd74f05b9c1662879d932c66e406b2fc1c5271 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 6 Dec 2020 15:52:15 +0800 Subject: [PATCH 140/721] --- Task/kuaishou.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index a1e42b5e12..c43a1544d7 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -140,5 +140,17 @@ function info() { }) }) } +function invite() { + return new Promise((resolve, reject) => { + let invurl = { + url: 'https://nbictssmx.kwairr9aw56vso581r.com/f/YPCw7XfI_AO', + headers: {Cookie: cookieVal}} + $.get(invurl, (error, response, data) => { + if(logs) $.log(`${$.name}, data: ${data}`) + let result = JSON.parse(data) + }) + resolve() + }) + } 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 d46a61b2ecf77ff91e77d1bea573ac62d709327b Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 6 Dec 2020 15:54:02 +0800 Subject: [PATCH 141/721] --- Task/kuaishou.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index c43a1544d7..25c7923435 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -58,7 +58,8 @@ if (isGetCookie) { !(async() => { await sign(); await signifo(); - await info() + await info(); + await invite() })() .catch((e) => $.logErr(e)) .finally(() => $.done()) From 8e746c204fbdef6a9b667e2ad17afaa8045d1188 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 6 Dec 2020 16:23:38 +0800 Subject: [PATCH 142/721] --- .github/workflows/AUTO_KS.yml | 2 +- Task/Auto_Kuaishou.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/AUTO_KS.yml b/.github/workflows/AUTO_KS.yml index 663590409a..db03d68013 100644 --- a/.github/workflows/AUTO_KS.yml +++ b/.github/workflows/AUTO_KS.yml @@ -5,7 +5,7 @@ name: 快手视频 on: workflow_dispatch: schedule: - - cron: '*/20 1-15 * * *' + - cron: '*/15 * * * *' watch: types: started jobs: diff --git a/Task/Auto_Kuaishou.js b/Task/Auto_Kuaishou.js index 6b3b94a6f4..b45f6254e2 100644 --- a/Task/Auto_Kuaishou.js +++ b/Task/Auto_Kuaishou.js @@ -1,5 +1,5 @@ /* -更新时间: 2020-12-06 13:46 +更新时间: 2020-12-06 15:46 赞赏:快手邀请码`774010415`,农妇山泉 -> 有点咸,万分感谢 Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 @@ -42,13 +42,13 @@ let ksUrl = [], ksArr = []; $.index = i + 1; console.log(`-------------------------\n\n开始快手极速版共${$.index}个视频`) } - for (let j = 0; j < 20; j++) { + for (let j = 0; j < 50; j++) { await AutoRead(); - await $.wait(5000); - console.log(`\n "请等待5s后继续视频${$.index}第${j+1}次任务`) + await $.wait(2000); + console.log(`\n "请等待2s后继续视频${$.index}第${j+1}次任务`) } }; - console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*20)次,视频金币详情见App,任务全部结束`) + console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*50)次,视频金币详情见App,任务全部结束`) })() .catch((e) => $.logErr(e)) .finally(() => $.done()) From 6e88eae92cf57368a7594ebe22d5143399e72969 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 6 Dec 2020 16:47:37 +0800 Subject: [PATCH 143/721] --- Task/txnews.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Task/txnews.js b/Task/txnews.js index 2bcfcb9232..9449fc1f4e 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -125,11 +125,11 @@ if (isGetCookie) { await Pending(); }; await StepsTotal(); - if(getreadred > 0){ + if(getreadred != 0){ redbody = `redpack_type=article&activity_id=${actid}` await Redpack() }; - if(getvideored>0){ + if(getvideored != 0){ redbody = `redpack_type=video&activity_id=${actid}` await Redpack() }; @@ -334,7 +334,9 @@ function Redpack() { } $.post(cashUrl, (error, response, data) => { let rcash = JSON.parse(data) + console.log(data) try{ + if(rcash.data.award.length == 1){ redpacks = rcash.data.award.num/100 if (rcash.ret == 0&&redpacks>0&&getreadred > 0){ redpackres = `【阅读红包】到账`+redpacks+`元 🌷\n` @@ -344,6 +346,9 @@ function Redpack() { redpackres = `【视频红包】到账`+redpacks+`元 🌷\n` $.log("视频红包到账"+redpacks+"元\n") } + } else { + $.log(rcash.data.award.length+"个红包到账\n") + } } catch(error){ console.log("打开红包失败,响应数据: "+ data) From eb679ad4fdb67f1bbb9a4748236e7334488a96ac Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 6 Dec 2020 18:08:58 +0800 Subject: [PATCH 144/721] --- Task/Auto_Kuaishou.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/Auto_Kuaishou.js b/Task/Auto_Kuaishou.js index b45f6254e2..e0c73f6b6b 100644 --- a/Task/Auto_Kuaishou.js +++ b/Task/Auto_Kuaishou.js @@ -40,12 +40,12 @@ let ksUrl = [], ksArr = []; if (ksArr[i]) { playUrl = ksArr[i]; $.index = i + 1; - console.log(`-------------------------\n\n开始快手极速版共${$.index}个视频`) + console.log(`-------------------------\n\n开始快手极速版第${$.index}个视频`) } for (let j = 0; j < 50; j++) { await AutoRead(); await $.wait(2000); - console.log(`\n "请等待2s后继续视频${$.index}第${j+1}次任务`) + console.log(`\n 请等待2s后继续视频${$.index}第${j+1}次任务`) } }; console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*50)次,视频金币详情见App,任务全部结束`) From 44f9283e14812def5f09a00e5da79a522515ad24 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 6 Dec 2020 19:22:43 +0800 Subject: [PATCH 145/721] --- Task/kuaishou.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 25c7923435..f15a77a9b6 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -144,9 +144,12 @@ function info() { function invite() { return new Promise((resolve, reject) => { let invurl = { - url: 'https://nbictssmx.kwairr9aw56vso581r.com/f/YPCw7XfI_AO', - headers: {Cookie: cookieVal}} - $.get(invurl, (error, response, data) => { + url: 'https://nbictssmx.kwairr9aw56vso581r.com/rest/n/nebula/invitation/external/click', + headers: {Cookie: cookieVal, + Host: 'nbictssmx.kwairr9aw56vso581r.com'}, + body: '{"code":"774010415","stage":"launch_app_try_launch","dph":736,"dpw":414,"reader":3,"platform":"copylink"}' + } + $.post(invurl, (error, response, data) => { if(logs) $.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) }) From be3996d629ec7e1b68ae98cd5082a7787a1b4e34 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 6 Dec 2020 22:19:41 +0800 Subject: [PATCH 146/721] update --- .github/workflows/jd_woHome.yml | 40 ++ Task/jd_baiTiao.js | 100 +++- Task/jd_bigWinner.js | 934 -------------------------------- Task/jd_lotteryMachine.js | 83 ++- Task/jd_rankingList.js | 5 +- Task/jd_woHome.js | 511 +++++++++++++++++ Task/kuaishou.js | 37 +- 7 files changed, 719 insertions(+), 991 deletions(-) create mode 100644 .github/workflows/jd_woHome.yml delete mode 100644 Task/jd_bigWinner.js create mode 100644 Task/jd_woHome.js diff --git a/.github/workflows/jd_woHome.yml b/.github/workflows/jd_woHome.yml new file mode 100644 index 0000000000..e1ab1cfb70 --- /dev/null +++ b/.github/workflows/jd_woHome.yml @@ -0,0 +1,40 @@ + +name: 京东小窝 + +on: + workflow_dispatch: + schedule: + - cron: '2 16 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【京东小窝】' + if: env.JD_COOKIE + run: | + cd ~/Scripts + node Task/jd_woHome.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/Task/jd_baiTiao.js b/Task/jd_baiTiao.js index 301f81e438..17322197d3 100644 --- a/Task/jd_baiTiao.js +++ b/Task/jd_baiTiao.js @@ -1,12 +1,14 @@ /* 京东金融领白条券 -更新时间:2020-10-26 16:02 +更新时间:2020-12-01 13:42 [task_local] -# 京东金融领白条券 9点执行(非天天领券要9点开始领) -0 9 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_baiTiao.js, tag=京东白条, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/baitiao.png, enabled=true +# 京东金融领白条券 0点,9点执行(非天天领券要9点开始领,扫码券0点领) +0 0,9 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_baiTiao.js, tag=京东白条, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/baitiao.png, enabled=true */ const $ = new Env('天天领白条券'); const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +const printDetail = false; //是否显示出参详情 +let cookieExpire = false; //直接用NobyDa的jd cookie let cookiesArr = [], cookie = ''; if ($.isNode()) { @@ -53,19 +55,22 @@ let prize = if (cookie) { $.prize = {addMsg : ``}; let date = new Date(); - await takePrize(prize[0]); - if ($.prize["prizeDaily"].respCode === "00001" ) { + cookieExpire = false; + await queryCouponsNotGroup() + if (cookieExpire) { $.msg($.name, '提示:请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); continue; } - if (date.getDay() !== 0) { + if (date.getHours() > 0) await takePrize(prize[0]); + if (date.getDay() !== 0 && date.getHours() >= 9) { await takePrize(prize[date.getDay()],820);//延迟执行,防止提示活动火爆 if (date.getDay() === 6) await takePrize(prize[7],820);//第二个周六券 } + if (date.getDay() === 0) { $.prize.addMsg = `提 醒:请于今天使用周日专享白条券\n` } - await queryMissionWantedDetail(); + if (date.getHours() >= 9) await queryMissionWantedDetail(); await msgShow(); } } @@ -99,6 +104,7 @@ function takePrize(prize,timeout = 0) { } $.post(url, (err, resp, data) => { try { + if (printDetail) console.log(data); data = JSON.parse(data); $.prize[prize.name] = data; $.prize[prize.name].desc = prize.desc; @@ -130,6 +136,7 @@ function queryMissionWantedDetail(timeout = 0) { } $.post(url, async (err, resp, data) => { try { + if (printDetail) console.log(data); data = JSON.parse(data); switch (data.resultData.data.mission.status ) { case -1 : @@ -171,6 +178,7 @@ function receivePlay(missionId,timeout = 0) { } $.post(url, (err, resp, data) => { try { + if (printDetail) console.log(data); data = JSON.parse(data); $.prize.addMsg += `-${data.resultData.msg.replace(`该任务`,``)}\n`; } catch (e) { @@ -183,6 +191,79 @@ function receivePlay(missionId,timeout = 0) { }) } +function queryCouponsNotGroup(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url: `https://ms.jr.jd.com/gw/generic/bt/h5/m/queryCouponsNotGroup?reqData=%7B%22businessLine%22:%22LQ_QYZX_SCQ%22%7D`, + headers: { + 'Cookie' : cookie, + 'Origin' : `https://m.jr.jd.com`, + 'Connection' : `keep-alive`, + 'Accept' : `application/json`, + 'Referer' : `https://m.jr.jd.com/`, + 'Host' : `ms.jr.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + } + } + $.get(url, async(err, resp, data) => { + try { + if (printDetail) console.log(data); + data = JSON.parse(data); + if (data.resultData.result.code !== "0000") { + cookieExpire = true + return + } + for (let i = data.resultData.floorInfo.length - 1;i > 0 ;i--){ + if (data.resultData.floorInfo[i].couponStatus === "2") { + await comReceiveCoupon(data.resultData.floorInfo[i].couponKey,100) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +function comReceiveCoupon(couponKey,timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url: `https://ms.jr.jd.com/gw/generic/bt/h5/m/comReceiveCoupon?reqData=%7B%22businessLine%22:%22LQ_QYZX_SCQ%22,%22couponKey%22:%22${couponKey}%22%7D`, + headers: { + 'Cookie' : cookie, + 'Origin' : `https://m.jr.jd.com`, + 'Connection' : `keep-alive`, + 'Accept' : `application/json`, + 'Referer' : `https://m.jr.jd.com/`, + 'Host' : `ms.jr.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + } + } + $.get(url, (err, resp, data) => { + try { + if (printDetail) console.log(data); + data = JSON.parse(data); + $.prize["dailyCoupon"] = $.prize["dailyCoupon"]||"立减券" + $.prize["dailyCoupon"] += data.resultData.couponsVo.prizeAmount + '元;' + console.log($.prize["dailyCoupon"]) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + function randomWord(randomFlag, min, max){ let str = "", @@ -212,9 +293,12 @@ function msgShow() { $.message += `${$.prize[i].desc}:${typeof($.prize[i].failDesc) == "undefined" ? $.prize[i].respDesc : $.prize[i].failDesc}\n`; } } + if (typeof $.prize["dailyCoupon"] !== "undefined") { + $.message += "扫码券:" + $.prize["dailyCoupon"].substr(0,$.prize["dailyCoupon"].length - 1) + '\n' + } $.message += $.prize.addMsg ? $.prize.addMsg : ""; $.msg($.name, '', `${$.message.substr(0,$.message.length - 1)}`, url); } -function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),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}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{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=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"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 e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o)),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} +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,g=-8){ let f=new Date().getTimezoneOffset();let d=new Date().getTime()+ f * 60 * 1000 - (g * 60 * 60 * 1000); let n = new Date(d);let e={"M+":n.getMonth()+1,"d+":n.getDate(),"H+":n.getHours(),"m+":n.getMinutes(),"s+":n.getSeconds(),"q+":Math.floor((n.getMonth()+3)/3),S:n.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(n.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)} diff --git a/Task/jd_bigWinner.js b/Task/jd_bigWinner.js deleted file mode 100644 index 554e26ac86..0000000000 --- a/Task/jd_bigWinner.js +++ /dev/null @@ -1,934 +0,0 @@ -/* -京东大赢家 双11活动 -更新时间:2020-11-09 13:10 -修复火爆问题,第一次还有可能个别的火爆,再次运行即可 -脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js -// quantumultx -[task_local] -#京东大赢家 -5 0-22/2 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_bigWinner.js, tag=京东大赢家, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jd.png, enabled=true -// Loon -[Script] -cron "5 0-22/2 * * *" script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_bigWinner.js,tag=京东大赢家 -// Surge -京东大赢家 = type=cron,cronexp=5 0-22/2 * * *,wake-system=1,timeout=500,script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_bigWinner.js -*/ -const $ = new Env('京东大赢家'); -//Node.js用户请在jdCookie.js处填写京东ck; -const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; -//IOS等用户直接用NobyDa的jd cookie -let cookiesArr = [], cookie = '',secretp = ''; -if ($.isNode()) { - Object.keys(jdCookieNode).forEach((item) => { - cookiesArr.push(jdCookieNode[item]) - }) -} else { - cookiesArr.push($.getdata('CookieJD')); - cookiesArr.push($.getdata('CookieJD2')); -} - -const JD_API_HOST = `https://api.m.jd.com/client.action?functionId=`; -!(async () => { - if (!cookiesArr[0]) { - $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - return; - } - //console.log('提示-1002的账号是因为京东对入参进行了强校验,并不是黑号,目前无法使用脚本,请手动去APP做吧,不提示-1002的可以继续使用') - //console.log('目前京东已全面判断入参校验,所有账号都不能用,手动做吧') - //console.log('请删除或禁用脚本!') - //return - - - for (let i = 0; i < cookiesArr.length; i++) { - cookie = cookiesArr[i]; - if (cookie) { - if (Date.now() > Date.parse('2020-11-12')) { - $.msg($.Name,"","活动已结束,请删除或禁用脚本!") - return - } - initial(); - await QueryJDUserInfo(); - if (!merge.enabled) //cookie不可用 - { - $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 - $.msg($.name, `【提示】京东账号${i ? i + 1 : "" } cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - continue; - } - console.log('\n\n京东账号:'+merge.nickname + ' 任务开始') - await stall_pk_getHomeData(); - await stall_getHomeData(); - //if (merge.black) continue ; - //await stall_pk_assistGroup() - await stall_myShop() - await qryCompositeMaterials() - await msgShow(); - } - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - -//获取昵称(直接用,勿删) -function QueryJDUserInfo(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, - headers : { - 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, - 'Cookie' : cookie - } - } - $.get(url, (err, resp, data) => { - try { - data = JSON.parse(data); - if (data.retcode === 13) { - merge.enabled = false - return - } - merge.nickname = data.base.nickname; - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//查询任务 "appSign":"2","channel":1, -function stall_getTaskDetail(shopSign = "",appSign = "",timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - appSign = appSign&&'"appSign":"2","channel":1,' - let url = { - url : `${JD_API_HOST}stall_getTaskDetail`, - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=stall_getTaskDetail&body={${appSign}"shopSign":"${shopSign}"}&client=wh5&clientVersion=1.0.0` - } - - $.post(url, async (err, resp, data) => { - try { - //console.log('stall_getTaskDetail:' + data) - data = JSON.parse(data); - if (shopSign === "") { - shopSign = '""' - //if (appSign === "") console.log(`您的个人助力码:${data.data.result.inviteId}`) - } - for (let i = 0;i < data.data.result.taskVos.length;i ++) { - //if (merge.black) return ; - console.log( "\n" + data.data.result.taskVos[i].taskType + '-' + data.data.result.taskVos[i].taskName + (appSign&&"(微信小程序)") + '-' + (data.data.result.taskVos[i].status === 1 ? `已完成${data.data.result.taskVos[i].times}-未完成${data.data.result.taskVos[i].maxTimes}` : "全部已完成") ) - let rnd = Math.round(Math.random()*1e6) - let nonstr = randomWord(false,10) - let time = Date.now() - let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) - let msg = `inviteId=-1&rnd=${rnd}&stealId=-1&taskId=${data.data.result.taskVos[i].taskId}&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` - let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() - if ([1,3,7,9].includes(data.data.result.taskVos[i].taskType) && data.data.result.taskVos[i].status === 1 ) { - let list = data.data.result.taskVos[i].brandMemberVos||data.data.result.taskVos[i].followShopVo||data.data.result.taskVos[i].shoppingActivityVos||data.data.result.taskVos[i].browseShopVo - //console.log(list) - //if (data.data.result.taskVos[i].taskType === 9) continue - for (let k = data.data.result.taskVos[i].times; k < data.data.result.taskVos[i].maxTimes; k++) { - //body : `functionId=stall_collectProduceScore&body={"ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"fpb\\":\\"xAX3mMUyCgH120XCrQXIZUw==\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"collectProducedCoin\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` - for (let j in list) { - if (list[j].status === 1) { - let taskBody = `functionId=stall_collectScore&body={"taskId":${data.data.result.taskVos[i].taskId},"itemId":"${list[j].itemId}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"${data.data.result.taskVos[i].taskId}\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}","actionType":"1","shopSign":${shopSign}}&client=wh5&clientVersion=1.0.0` - console.log("\n"+(list[j].title||list[j].shopName)) - await stall_collectScore(taskBody,2000) - //} - list[j].status = 2; - break; - } else { - continue; - } - } - } - } - - if ([12,13].includes(data.data.result.taskVos[i].taskType) && data.data.result.taskVos[i].status === 1) { - //let taskBody = `functionId=stall_collectScore&body={"taskId":${data.data.result.taskVos[i].taskId},"itemId":"1","ss":"{\\"extraData\\":{},\\"businessData\\":{},\\"secretp\\":\\"${secretp}\\"}","shopSign":${shopSign}}&client=wh5&clientVersion=1.0.0` - let taskBody = `functionId=stall_collectScore&body={"taskId":${data.data.result.taskVos[i].taskId},"itemId":"1","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"${data.data.result.taskVos[i].taskId}\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}","actionType":"1","shopSign":${shopSign}}&client=wh5&clientVersion=1.0.0` - for (let k = data.data.result.taskVos[i].times; k < data.data.result.taskVos[i].maxTimes; k++) { - if (merge.black) return ; - //if (typeof data.data.result.taskVos[i].simpleRecordInfoVo !== "undefined"){ - // taskBody = encodeURIComponent(`{"dataSource":"newshortAward","method":"getTaskAward","reqParams":"{\\"taskToken\\":\\"${data.data.result.taskVos[i].simpleRecordInfoVo.taskToken}\\"}","sdkVersion":"1.0.0","clientLanguage":"zh"}`) - // await qryViewkitCallbackResult(taskBody,1000) - //} else { - await stall_collectScore(taskBody,3000) - //} - } - } - - if ([2].includes(data.data.result.taskVos[i].taskType) && data.data.result.taskVos[i].status === 1) { - for (let k = data.data.result.taskVos[i].times; k < data.data.result.taskVos[i].maxTimes; k++) { - await stall_getFeedDetail(data.data.result.taskVos[i].taskId) - } - } - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//获取我的城市 -function stall_myShop(timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}stall_myShop`, - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=stall_myShop&body={"ss":"{\\"extraData\\":{},\\"businessData\\":{},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` - } - $.post(url, async (err, resp, data) => { - try { - //console.log('stall_myShop:' + data) - data = JSON.parse(data); - for (let i in data.data.result.shopList) { - // (data.data.result.shopList[i].status === 1) { - //console.log(data.data.result.shopList[i]) - console.log('\n开始城市任务:'+ data.data.result.shopList[i].name)// + '-' + data.data.result.shopList[i].shopId - await stall_getTaskDetail(data.data.result.shopList[i].shopId) - //} - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//逛商城 -function stall_shopSignInWrite(shopSign,timeout = 0){ - return new Promise((resolve) => { - - let rnd = Math.round(Math.random()*1e6) - let nonstr = randomWord(false,10) - let time = Date.now() - let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) - let msg = `inviteId=-1&rnd=${rnd}&stealId=-1&taskId=${shopSign}&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` - let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() - - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}stall_shopSignInWrite`, - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=stall_shopSignInWrite&body={"shopSign":"${shopSign}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"${shopSign}\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` - } - $.post(url, async (err, resp, data) => { - try { - //console.log(data) - data = JSON.parse(data); - if (data.data.bizCode !== 0) { - console.log(data.data.bizMsg) - merge.end = true - } else { - console.log('获得金币' + data.data.result.score) - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//逛商城 -function stall_shopSignInRead(shopSign,timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}stall_shopSignInRead`, - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=stall_shopSignInRead&client=wh5&clientVersion=1.0.0&body={"shopSign":"${shopSign}"}` - } - $.post(url, async (err, resp, data) => { - try { - data = JSON.parse(data); - //console.log(shopSign) - if (data.data.result.signInTag === 0) { - secretp = secretp||data.data.result.secretp - await stall_shopSignInWrite(shopSign) - } else { - console.log('已逛过') - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//收金币 -function stall_collectProduceScore(timeout = 0){ - return new Promise((resolve) => { - let rnd = Math.round(Math.random()*1e6) - let nonstr = randomWord(false,10) - let time = Date.now() - let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) - let msg = `inviteId=-1&rnd=${rnd}&stealId=-1&taskId=collectProducedCoin&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` - let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}stall_collectProduceScore`, - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=stall_collectProduceScore&body={"ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"fpb\\":\\"xAX3mMUyCgH120XCrQXIZUw==\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"collectProducedCoin\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` - } - //console.log(url.body) - $.post(url, async (err, resp, data) => { - try { - //console.log(data) - data = JSON.parse(data); - if (data.data.bizCode === -1002) { - //console.log('此账号暂不可使用脚本,脚本终止!') - //merge.black = true; - return ; - } - console.log(`\n收取金币:${data.data.result.produceScore}`) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//获取可偷 -function stall_pk_getStealForms(taskBody,timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}stall_pk_getStealForms`, - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : taskBody - } - $.post(url, async (err, resp, data) => { - try { - console.log(data) - data = JSON.parse(data); - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} -//做任务 -function stall_collectScore(taskBody,timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}stall_collectScore`, - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : taskBody - } - //console.log(url.body) - $.post(url, async (err, resp, data) => { - try { - //console.log(data) - data = JSON.parse(data); - console.log('任务执行结果:' + data.data.bizMsg) - if (data.data.bizCode === -1002) { - await $.wait(1000) - //console.log('此账号暂不可使用脚本,脚本终止!') - //merge.black = true; - return ; - } - if (data.data.bizCode === 0 && typeof data.data.result.taskToken !== "undefined") { - //console.log('需要再次执行,如提示活动异常请多次重试,个别任务多次执行也不行就去APP做吧!') - let taskBody = encodeURIComponent(`{"dataSource":"newshortAward","method":"getTaskAward","reqParams":"{\\"taskToken\\":\\"${data.data.result.taskToken}\\"}","sdkVersion":"1.0.0","clientLanguage":"zh"}`) - //console.log(taskBody) - await qryViewkitCallbackResult(taskBody,8000) - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//查询甄选任务 -function stall_getFeedDetail(taskId,timeout = 0){ - return new Promise((resolve) => { - - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}stall_getFeedDetail`, - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=stall_getFeedDetail&body={"taskId":"${taskId}"}&client=wh5&clientVersion=1.0.0` - } - //console.log(url) - $.post(url, async (err, resp, data) => { - try { - //console.log(data) - data = JSON.parse(data); - let list = data.data.result.viewProductVos||data.data.result.addProductVos - for (let i in list) { - if (list[i].status === 1) { - for (let j in list[i].productInfoVos) { - if (j >= 5) break; - - let rnd = Math.round(Math.random()*1e6) - let nonstr = randomWord(false,10) - let time = Date.now() - let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) - let msg = `inviteId=-1&rnd=${rnd}&stealId=-1&taskId=${taskId}&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` - let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() - let taskBody = `functionId=stall_collectScore&body={"taskId":${list[i].taskId},"itemId":"${list[i].productInfoVos[j].skuId}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"${taskId}\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"-1\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}","shopSign":""}&client=wh5&clientVersion=1.0.0` - console.log(list[i].productInfoVos[j].skuName) - await stall_collectScore(taskBody,1000) - } - list[i].status = 2 - } - } - - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//做任务2 -function qryViewkitCallbackResult(taskBody,timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `https://api.m.jd.com/?functionId=qryViewkitCallbackResult&client=wh5&clientVersion=1.0.0&body=${taskBody}&_timestamp=`+Date.now(), - headers : { - 'Origin' : `https://bunearth.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `*/*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'Content-Type' : 'application/x-www-form-urlencoded', - 'Referer' : 'https://bunearth.m.jd.com/babelDiy/Zeus/4SJUHwGdUQYgg94PFzjZZbGZRjDd/index.html?jmddToSmartEntry=login' - } - } - - $.get(url, async (err, resp, data) => { - try { - //console.log(url.url) - //console.log(data) - data = JSON.parse(data); - console.log(data.toast.subTitle) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//群组助力 -function stall_pk_assistGroup(inviteId = "XUkkFpUhDG0OdMYzp22uY_lyEaiFin-OxTLmhqosoNJHNIHp84xOJxNmUElr71Un",timeout = 0) { - return new Promise((resolve) => { - let rnd = Math.round(Math.random()*1e6) - let nonstr = randomWord(false,10) - let time = Date.now() - let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) - let msg = `inviteId=${inviteId}&rnd=${rnd}&stealId=-1&taskId=2&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` - let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() - //let taskBody = `functionId=stall_collectScore&body={"taskId":2,"itemId":"${data.data.result.homeMainInfo.guestInfo.itemId}","inviteId": "${body}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"2\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"${body}\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` - - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}stall_pk_assistGroup` , - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'Refer' : `https://bunearth.m.jd.com/babelDiy/Zeus/4SJUHwGdUQYgg94PFzjZZbGZRjDd/index.html?jmddToSmartEntry=login` - }, - body : `functionId=stall_pk_assistGroup&client=wh5&clientVersion=1.0.0&body={"confirmFlag":1,"inviteId": "${inviteId}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"2\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"${inviteId}\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}` - } - //console.log(url.body) - $.post(url, async (err, resp, data) => { - try { - //console.log('商圈助力:' + data) - data = JSON.parse(data); - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -//获取首页信息 -function stall_getHomeData(body= "",timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}stall_getHomeData` , - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=stall_getHomeData&body={${body ? "\"inviteId\":\"" + body +'\"': ""}}&client=wh5&clientVersion=1.0.0` - } - $.post(url, async (err, resp, data) => { - try { - //console.log(url.body) - //if (merge.black) return ; - data = JSON.parse(data); - if (data.code === 0) { - if (body !== "") { - //console.log('stall_getHomeData2:' + JSON.stringify(data)) - if (data.data.result.homeMainInfo.guestInfo.status === 0) { - - let rnd = Math.round(Math.random()*1e6) - let nonstr = randomWord(false,10) - let time = Date.now() - let key = minusByByte(nonstr.slice(0,5),String(time).slice(-5)) - let msg = `inviteId=${body}&rnd=${rnd}&stealId=-1&taskId=2&token=dzbn7uttoxf3v6kowburzrashgxz9jpq&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` - let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase() - let taskBody = `functionId=stall_collectScore&body={"taskId":2,"itemId":"${data.data.result.homeMainInfo.guestInfo.itemId}","inviteId": "${body}","ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"token\\":\\"dzbn7uttoxf3v6kowburzrashgxz9jpq\\",\\"cf_v\\":\\"1.0.1\\",\\"client_version\\":\\"2.1.3\\",\\"sceneid\\":\\"homePageh5\\",\\"appid\\":\\"50073\\"},\\"businessData\\":{\\"taskId\\":\\"2\\",\\"rnd\\":\\"${rnd}\\",\\"inviteId\\":\\"${body}\\",\\"stealId\\":\\"-1\\"},\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` - //console.log(taskBody) - //let taskBody = `functionId=stall_collectScore&body={"taskId":2,"itemId":"${data.data.result.homeMainInfo.guestInfo.itemId}","inviteId": "${body}","ss":"{\\"secretp\\":\\"${secretp}\\"}"}&client=wh5&clientVersion=1.0.0` - //console.log(taskBody) - //console.log('开始助力:') - await stall_collectScore(taskBody, 1000) - } - return - } - //console.log('stall_getHomeData:' + JSON.stringify(data)) - secretp = data.data.result.homeMainInfo.secretp - await stall_collectProduceScore(); - await stall_pk_assistGroup() - if (data.data.result.homeMainInfo.raiseInfo.buttonStatus === 2 ) await stall_raise(1000) - await stall_getHomeData('Vl4ISNZnRyNVJf028W76ZuyTXfbtGlbVhbQEF3XxyFux9uadYgA0uao'); - await stall_getTaskDetail("","app") - await stall_getTaskDetail() - } else { - return - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -//助力 -function collectFriendRecordColor(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}collectFriendRecordColor` , - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=collectFriendRecordColor&body={"mpin":"RnFgwWRbPDGKy9RP--twXV_3bZt2p2ZADl2v","businessCode":"20118","assistType":"1"}&client=wh5&clientVersion=1.0.0` - } - $.post(url, async (err, resp, data) => { - try { - console.log(data) - //data = JSON.parse(data); - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -function getEncryptedPinColor(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}getEncryptedPinColor` , - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=getEncryptedPinColor&body={}&client=wh5&clientVersion=1.0.0` - } - $.post(url, async (err, resp, data) => { - try { - data = JSON.parse(data); - console.log('助力码:'+ data.result) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -function stall_raise(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}stall_raise` , - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=stall_raise&body={}&client=wh5&clientVersion=1.0.0` - } - $.post(url, async (err, resp, data) => { - try { - //console.log(data) - data = JSON.parse(data); - console.log('解锁结果:'+ data.data.bizMsg) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -function qryCompositeMaterials(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}qryCompositeMaterials` , - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=qryCompositeMaterials&client=wh5&clientVersion=1.0.0&body={"qryParam":"[{\\"type\\":\\"advertGroup\\",\\"mapTo\\":\\"homeFeedBanner\\",\\"id\\":\\"04891279\\"},{\\"type\\":\\"advertGroup\\",\\"mapTo\\":\\"homeBottomBanner\\",\\"id\\":\\"04888981\\"}]","activityId":"4SJUHwGdUQYgg94PFzjZZbGZRjDd","pageId":"","reqSrc":"","applyKey":"raiders_venue_lite"}` - } - $.post(url, async (err, resp, data) => { - try { - //console.log(data) - data = JSON.parse(data); - for (let i in data.data.homeBottomBanner.list) { - if (merge.end) break; - console.log('\n开始逛'+data.data.homeBottomBanner.list[i].name) - await stall_shopSignInRead(data.data.homeBottomBanner.list[i].link) - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -function stall_pk_getHomeData(body = "",timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}stall_pk_getHomeData` , - headers : { - 'Origin' : `https://wbbny.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Host' : `api.m.jd.com`, - 'User-Agent' : `jdapp;iPhone;9.2.0;14.1;`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=stall_pk_getHomeData&body={}&client=wh5&clientVersion=1.0.0` - } - $.post(url, async (err, resp, data) => { - try { - if (body !== "") { - await stall_pk_assistGroup(); - } else { - data = JSON.parse(data); - if (data.data.result.groupInfo.groupAssistInviteId.match(/XUkkFpUhDG0OdMYzp22uY_lyEaiFin/)){ - console.log('您的商圈助力码:' + data.data.result.groupInfo.groupAssistInviteId) - } - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -function randomWord(randomFlag, min, max){ - let str = "", - range = min, - arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; - // 随机产生 - if(randomFlag){ - range = Math.round(Math.random() * (max-min)) + min; - } - for(let i=0; i>> 5] >>> 24 - e % 32 & 255); - return n -} - -function bytesToHex(t) { - for (var n = [], e = 0; e < t.length; e++) - n.push((t[e] >>> 4).toString(16)), - n.push((15 & t[e]).toString(16)); - return n.join("") -} - -function stringToBytes(t) { - t = unescape(encodeURIComponent(t)) - for (var n = [], e = 0; e < t.length; e++) - n.push(255 & t.charCodeAt(e)); - return n -} - -function bytesToWords(t) { - for (var n = [], e = 0, r = 0; e < t.length; e++, - r += 8) - n[r >>> 5] |= t[e] << 24 - r % 32; - return n -} -function getSign (t) { - t = stringToBytes(t) - var e = bytesToWords(t) - , i = 8 * t.length - , a = [] - , s = 1732584193 - , u = -271733879 - , c = -1732584194 - , f = 271733878 - , h = -1009589776; - e[i >> 5] |= 128 << 24 - i % 32, - e[15 + (i + 64 >>> 9 << 4)] = i; - for (var l = 0; l < e.length; l += 16) { - for (var p = s, g = u, v = c, d = f, y = h, m = 0; m < 80; m++) { - if (m < 16) - a[m] = e[l + m]; - else { - var w = a[m - 3] ^ a[m - 8] ^ a[m - 14] ^ a[m - 16]; - a[m] = w << 1 | w >>> 31 - } - var _ = (s << 5 | s >>> 27) + h + (a[m] >>> 0) + (m < 20 ? 1518500249 + (u & c | ~u & f) : m < 40 ? 1859775393 + (u ^ c ^ f) : m < 60 ? (u & c | u & f | c & f) - 1894007588 : (u ^ c ^ f) - 899497514); - h = f, - f = c, - c = u << 30 | u >>> 2, - u = s, - s = _ - } - s += p, - u += g, - c += v, - f += d, - h += y - } - return [s, u, c, f, h] -} -//初始化 -function initial() { - merge = { - nickname: "", - enabled: true, - end: false, - black: false - } - for (let i in merge) { - merge[i].success = 0; - merge[i].fail = 0; - merge[i].prizeCount = 0; - merge[i].notify = ""; - merge[i].show = true; - } -} -//通知 -function msgShow() { - console.log("\n\n京东账号:"+merge.nickname + ' 任务已做完!\n如有未完成的任务,请多执行几次') - //$.msg($.Name,"","京东账号:"+merge.nickname + ' 任务已做完!\n如有未完成的任务,请多执行几次') -} - -function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),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}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{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=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"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 e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o)),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} diff --git a/Task/jd_lotteryMachine.js b/Task/jd_lotteryMachine.js index 283966fbf1..b8db5711c1 100644 --- a/Task/jd_lotteryMachine.js +++ b/Task/jd_lotteryMachine.js @@ -1,12 +1,12 @@ /* 京东抽奖机 -更新时间:2020-11-07 21:42 -脚本说明:五个抽奖活动,【东东抽奖机】【新店福利】【东东福利屋】【东东生活】【闪购盲盒】,点通知只能跳转一个,入口在京东APP玩一玩里面可以看到 +更新时间:2020-12-01 17:37 +脚本说明:四个抽奖活动,【新店福利】【闪购盲盒】【疯狂砸金蛋】【东东福利屋】,点通知只能跳转一个,入口在京东APP玩一玩里面可以看到 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js // quantumultx [task_local] #京东抽奖机 -11 1 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_lotteryMachine.js, tag=京东抽奖机, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jd.png, enabled=true +11 1 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_lotteryMachine.js, tag=京东抽奖机, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jdlottery.png, enabled=true // Loon [Script] cron "11 1 * * *" script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_lotteryMachine.js,tag=京东抽奖机 @@ -19,9 +19,10 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; const STRSPLIT = "|"; const needSum = false; //是否需要显示汇总 const printDetail = false; //是否显示出参详情 -const appIdArr = ['1EFRQxQ','1EFRQxA','1EFRQxw','1EFRQyw','1EFRRxA'] -const shareCodeArr = ['P04z54XCjVXmYaW5m9cZ2f433tIlGBj3JnLHD0','P04z54XCjVXmIaW5m9cZ2f433tIlGWEga-IO2o','P04z54XCjVXm4aW5m9cZ2f433tIlINrBDzgMdY','P04z54XCjVXl4aW5m9cZ2f433tIlHQIDDSzFzg','P04z54XCjVWmIaW5m9cZ2f433tIlJz4FjX2kfk'] -//const funPrefixArr = ['interact_template','interact_template','wfh'] +const appIdArr = ['1EFRQxA','1EFRRxA','1EFRQwA','1EFRQyg'] +const shareCodeArr = ['P04z54XCjVXmIaW5m9cZ2f433tIlGWEga-IO2o','P04z54XCjVWmIaW5m9cZ2f433tIlJz4FjX2kfk','P04z54XCjVXnIaW5m9cZ2f433tIlLKXiUijZw4','P04z54XCjVXloaW5m9cZ2f433tIlH_LzLLVOp8'] +const funPrefixArr = ['','','','wfh','splitHongbao'] +let merge = {} //IOS等用户直接用NobyDa的jd cookie let cookiesArr = [], cookie = ''; if ($.isNode()) { @@ -54,10 +55,9 @@ const JD_API_HOST = `https://api.m.jd.com/client.action`; for (let j in appIdArr) { appId = appIdArr[j] shareCode = shareCodeArr[j] - //funPrefix = funPrefixArr[j] + funPrefix = funPrefixArr[j]||'interact_template' if (parseInt(j)) console.log(`\n开始第${parseInt(j) + 1}个抽奖活动`) await interact_template_getHomeData(); - await interact_template_getLotteryResult(); } await msgShow(); } @@ -112,12 +112,18 @@ function interact_template_getHomeData(timeout = 0) { 'Accept-Encoding' : `gzip, deflate, br`, 'Accept-Language' : `zh-cn` }, - body : `functionId=${appId === '1EFRQxw' ? 'wfh' :'interact_template'}_getHomeData&body={"appId":"${appId}","taskToken":""}&client=wh5&clientVersion=1.0.0` + body : `functionId=${funPrefix}_getHomeData&body={"appId":"${appId}","taskToken":""}&client=wh5&clientVersion=1.0.0` } $.post(url, async (err, resp, data) => { try { if (printDetail) console.log(data); data = JSON.parse(data); + if (data.data.bizCode !== 0) { + console.log(data.data.bizMsg); + merge.jdBeans.fail++; + merge.jdBeans.notify = `${data.data.bizMsg}`; + return + } scorePerLottery = data.data.result.userInfo.scorePerLottery||data.data.result.userInfo.lotteryMinusScore //console.log(scorePerLottery) for (let i = 0;i < data.data.result.taskVos.length;i ++) { @@ -130,7 +136,6 @@ function interact_template_getHomeData(timeout = 0) { continue } if (data.data.result.taskVos[i].taskType === 14) {//'data.data.result.taskVos[i].assistTaskDetailVo.taskToken' - console.log('您的助力码:'+data.data.result.taskVos[i].assistTaskDetailVo.taskToken) await harmony_collectScore(shareCode,data.data.result.taskVos[i].taskId); continue } @@ -140,7 +145,14 @@ function interact_template_getHomeData(timeout = 0) { if (list[j].status === 1) { //console.log(list[j].simpleRecordInfoVo||list[j].assistTaskDetailVo) console.log("\n" + (list[j].title || list[j].shopName||list[j].skuName)) - await harmony_collectScore(list[j].taskToken,data.data.result.taskVos[i].taskId); + //console.log(list[j].itemId) + if (list[j].itemId) { + await harmony_collectScore(list[j].taskToken,data.data.result.taskVos[i].taskId,list[j].itemId,1); + await harmony_collectScore(list[j].taskToken,data.data.result.taskVos[i].taskId,list[j].itemId,0,6000); + if (k === data.data.result.taskVos[i].maxTimes - 1) await interact_template_getLotteryResult(data.data.result.taskVos[i].taskId); + } else { + await harmony_collectScore(list[j].taskToken,data.data.result.taskVos[i].taskId) + } list[j].status = 2; break; } else { @@ -148,7 +160,12 @@ function interact_template_getHomeData(timeout = 0) { } } } + if (data.data.result.taskVos[i].status === 3) { + console.log('开始抽奖') + await interact_template_getLotteryResult(data.data.result.taskVos[i].taskId); + } } + if (scorePerLottery) await interact_template_getLotteryResult(); } catch (e) { $.logErr(e, resp); } finally { @@ -160,7 +177,7 @@ function interact_template_getHomeData(timeout = 0) { } -function harmony_collectScore(taskToken,taskId,timeout = 0) { +function harmony_collectScore(taskToken,taskId,itemId = "",actionType = 0,timeout = 0) { return new Promise((resolve) => { setTimeout( ()=>{ let url = { @@ -175,9 +192,9 @@ function harmony_collectScore(taskToken,taskId,timeout = 0) { 'Accept-Encoding' : `gzip, deflate, br`, 'Accept-Language' : `zh-cn` }, - body : `functionId=${appId === '1EFRQxw' ? 'wfh' :'harmony'}_collectScore&body={"appId":"${appId}","taskToken":"${taskToken}","taskId":${taskId},"actionType":0}&client=wh5&clientVersion=1.0.0` + body : `functionId=${funPrefix === 'wfh' ? funPrefix : 'harmony'}_collectScore&body={"appId":"${appId}","taskToken":"${taskToken}","taskId":${taskId}${itemId ? ',"itemId":"'+itemId+'"' : ''},"actionType":${actionType}&client=wh5&clientVersion=1.0.0` } - //console.log(url) + //console.log(url.body) $.post(url, async (err, resp, data) => { try { if (printDetail) console.log(data); @@ -193,7 +210,7 @@ function harmony_collectScore(taskToken,taskId,timeout = 0) { }) } // -function interact_template_getLotteryResult(timeout = 0) { +function interact_template_getLotteryResult(taskId,timeout = 0) { return new Promise((resolve) => { setTimeout( ()=>{ let url = { @@ -208,20 +225,27 @@ function interact_template_getLotteryResult(timeout = 0) { 'Accept-Encoding' : `gzip, deflate, br`, 'Accept-Language' : `zh-cn` }, - body : `functionId=${appId === '1EFRQxw' ? 'wfh' :'interact_template'}_getLotteryResult&body={"appId":"${appId}"}&client=wh5&clientVersion=1.0.0` + body : `functionId=${funPrefix}_getLotteryResult&body={"appId":"${appId}"${taskId ? ',"taskId":"'+taskId+'"' : ''}}&client=wh5&clientVersion=1.0.0` } + //console.log(url.body) $.post(url, async (err, resp, data) => { try { if (printDetail) console.log(data); if (!timeout) console.log('\n开始抽奖') data = JSON.parse(data); if (data.data.bizCode === 0) { - merge.jdBeans.success++; - if (data.data.result.userAwardsCacheDto.jBeanAwardVo&&data.data.result.userAwardsCacheDto.jBeanAwardVo.prizeName.match(/京豆/)) { + if (data.data.result.userAwardsCacheDto.jBeanAwardVo) { + merge.jdBeans.success++; console.log('京豆:' + data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity) merge.jdBeans.prizeCount += parseInt(data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity) } - if (parseInt(data.data.result.userScore) >= scorePerLottery ) { + if (data.data.result.userAwardsCacheDto.redPacketVO) { + merge.redPacket.show = true; + merge.redPacket.success++; + console.log('红包:' + data.data.result.userAwardsCacheDto.redPacketVO.value) + merge.redPacket.prizeCount += parseFloat(data.data.result.userAwardsCacheDto.redPacketVO.value) + } + if (parseInt(data.data.result.userScore) >= scorePerLottery && scorePerLottery) { await interact_template_getLotteryResult(1000) } } else{ @@ -230,7 +254,6 @@ function interact_template_getLotteryResult(timeout = 0) { if (data.data.bizCode === 111 ) data.data.bizMsg = "无机会" merge.jdBeans.notify = `${data.data.bizMsg}`; } - } catch (e) { $.logErr(e, resp); } finally { @@ -242,12 +265,13 @@ function interact_template_getLotteryResult(timeout = 0) { } //初始化 + function initial() { - merge = { - nickname: "", - enabled: true, - //blueCoin: {prizeDesc : "收取|蓝币|个",number : true}, //定义 动作|奖励名称|奖励单位 是否是数字 - jdBeans: {prizeDesc : "抽得|京豆|个",number : true,fixed : 0} + merge = { + nickname: "", + enabled: true, + redPacket: {prizeDesc : "抽得|红包|元",number : true,fixed : 2}, //定义 动作|奖励名称|奖励单位 是否是数字 + jdBeans: {prizeDesc : "抽得|京豆|个",number : true,fixed : 0} } for (let i in merge) { merge[i].success = 0; @@ -256,12 +280,12 @@ function initial() { merge[i].notify = ""; merge[i].show = true; } - //merge.jdBeans.show =Boolean(coinToBeans); + merge.redPacket.show = false; } //通知 function msgShow() { - let message = ""; - let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html%22%20%7D`} + let message = "";//https://h5.m.jd.com/babelDiy/Zeus/YgnrqBaEmVHWppzCgW8zjZj3VjV/index.html + let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/YgnrqBaEmVHWppzCgW8zjZj3VjV/index.html%22%20%7D`} let title = `京东账号:${merge.nickname}`; for (let i in merge) { if (typeof (merge[i]) !== "object" || !merge[i].show) continue; @@ -269,8 +293,7 @@ function msgShow() { message += `${merge[i].prizeDesc.split(STRSPLIT)[0]}${merge[i].prizeDesc.split(STRSPLIT)[1]}:` + (merge[i].success ? `${merge[i].prizeCount.toFixed(merge[i].fixed)}${merge[i].prizeDesc.split(STRSPLIT)[2]}\n` : `失败:${merge[i].notify}\n`) } //合计 - if (needSum) - { + if (needSum) { $.sum = {}; for (let i in merge) { if (typeof (merge[i]) !== "object" || !merge[i].show) continue; diff --git a/Task/jd_rankingList.js b/Task/jd_rankingList.js index 9578098cad..4341eda3db 100644 --- a/Task/jd_rankingList.js +++ b/Task/jd_rankingList.js @@ -1,6 +1,6 @@ /* 京东排行榜 -更新时间:2020-11-05 16:07 +更新时间:2020-11-20 13:55 脚本说明:京东排行榜签到得京豆 活动入口:找不着了,点击脚本通知进入吧 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js @@ -19,6 +19,7 @@ const $ = new Env('京东排行榜'); const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; const needSum = false; //是否需要显示汇总 const STRSPLIT = "|"; +let merge = {} //IOS等用户直接用NobyDa的jd cookie let cookiesArr = [], cookie = ''; if ($.isNode()) { @@ -225,4 +226,4 @@ if (needSum) } -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,g=-8){ let f=new Date().getTimezoneOffset();let d=new Date().getTime()+ f * 60 * 1000 - (g * 60 * 60 * 1000); let n = new Date(d);let e={"M+":n.getMonth()+1,"d+":n.getDate(),"H+":n.getHours(),"m+":n.getMinutes(),"s+":n.getSeconds(),"q+":Math.floor((n.getMonth()+3)/3),S:n.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(n.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)} diff --git a/Task/jd_woHome.js b/Task/jd_woHome.js new file mode 100644 index 0000000000..3a914847fe --- /dev/null +++ b/Task/jd_woHome.js @@ -0,0 +1,511 @@ +/* +东东小窝 +更新时间:2020-12-06 06:07 +脚本说明:加购任务不需要请去BoxJs中关闭! +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +// quantumultx +[task_local] +#东东小窝 +11 0 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_woHome.js, tag=东东小窝, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/woHome.png, enabled=true +// Loon +[Script] +cron "11 0 * * *" script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_woHome.js,tag=东东小窝 +// Surge +东东小窝 = type=cron,cronexp=11 0 * * *,wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_woHome.js + */ +const $ = new Env('东东小窝'); +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +const printDetail = $.getdata("CFG_WOHOME_LOG") ? $.getdata("CFG_WOHOME_LOG") === "true" : false//是否显示出参详情 +const doAddChatTask = $.getdata("CFG_WOHOME_ADDCARTTASK") ? $.getdata("CFG_WOHOME_ADDCARTTASK") === "true" : true //加购任务 +const doPaidDraw = $.getdata("CFG_WOHOME_PAIDDRAW") ? $.getdata("CFG_WOHOME_PAIDDRAW") === "true" : false //窝币抽奖 +const funArr = ['','createAssistUser','clock','game','followShops','browseShops','followChannel','browseChannels','','purchaseCommodities','browseCommodities','browseMeetings'] +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) +} else { + cookiesArr.push($.getdata('CookieJD')); + cookiesArr.push($.getdata('CookieJD2')); +} + +const JD_API_HOST = `https://lkyl.dianpusoft.cn/api/`; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + cookie = cookiesArr[i]; + if (cookie) { + if (i) console.log(`\n***************开始京东账号${i + 1}***************`) + initial(); + await QueryJDUserInfo(); + if (!merge.enabled) //cookie不可用 + { + $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 + $.msg($.name, `【提示】京东账号${i + 1} cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + continue; + } + await encrypt(); + await msgShow(); + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + + +//获取昵称 +function QueryJDUserInfo(timeout = 0) { + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + headers : { + 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, + 'Cookie' : cookie + } + } + $.get(url, (err, resp, data) => { + try { + //if (printDetail) console.log(data) + data = JSON.parse(data); + if (data.retcode === 13) { + merge.enabled = false + return + } + merge.nickname = data.base.nickname; + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} +//登录 +function login(timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}user-info/login`, + headers : { + 'Origin' : `https://lkyl.dianpusoft.cn`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Content-Type' : `application/json`, + 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, + 'Host' : `lkyl.dianpusoft.cn`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + }, + body : `{"body": {"client": 2,"userName": "${userName}"}}` + } + $.post(url, async (err, resp, data) => { + try { + if (printDetail) console.log(data) + data = JSON.parse(data); + if (data.head.code === 200) { + token = data.head.token + await queryByUserId() + if (merge.newUser) return; + await queryDraw() + await queryAllTaskInfo() + await queryByUserId() + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +function queryByUserId(timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}ssjj-wo-home-info/queryByUserId/2?body=%7B%7D`, + headers : { + 'Origin' : `https://lkyl.dianpusoft.cn`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Content-Type' : `application/json`, + 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, + 'Host' : `lkyl.dianpusoft.cn`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'token' : token + } + } + $.get(url, async (err, resp, data) => { + try { + if (printDetail) console.log(data) + data = JSON.parse(data); + if (!data.body.id) { + merge.newUser = true; + } + if (typeof (merge.start) === "undefined") { + merge.start = data.body.woB + } else { + merge.end = data.body.woB + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +function queryAllTaskInfo(type = "",timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}ssjj-task-info/queryAllTaskInfo/2?body=%7B%7D`, + headers : { + 'Origin' : `https://lkyl.dianpusoft.cn`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Content-Type' : `application/json`, + 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, + 'Host' : `lkyl.dianpusoft.cn`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'token' : token + } + } + $.get(url, async (err, resp, data) => { + try { + if (printDetail) console.log(data) + data = JSON.parse(data); + if (data.head.code === 200) { + for (let i in data.body) { + if (type !== "" && data.body[i].ssjjTaskInfo.type !== type) continue; + console.log(`${data.body[i].ssjjTaskInfo.type}-${data.body[i].ssjjTaskInfo.name}`) + if (data.body[i].doneNum < (data.body[i].ssjjTaskInfo.awardOfDayNum||1)){ + if (data.body[i].browseId) { + await task_record(funArr[data.body[i].ssjjTaskInfo.type],`${data.body[i].ssjjTaskInfo.id}/${data.body[i].browseId}`) + await queryAllTaskInfo(data.body[i].ssjjTaskInfo.type); + continue + } + if ([2,4,9].includes(data.body[i].ssjjTaskInfo.type)) { + if (!doAddChatTask && data.body[i].ssjjTaskInfo.type === 9) { + console.log("您选择了不做加购任务,跳过") + continue; //不做加购任务则跳过 + } + await task_record(funArr[data.body[i].ssjjTaskInfo.type],data.body[i].ssjjTaskInfo.id) + continue + } + if (data.body[i].ssjjTaskInfo.type === 3) { + for (let j = data.body[i].doneNum; j < (data.body[i].ssjjTaskInfo.awardOfDayNum||1);j++) { + await task_record(funArr[data.body[i].ssjjTaskInfo.type],`${j+1}/${data.body[i].ssjjTaskInfo.id}`) + } + continue + } + if (data.body[i].ssjjTaskInfo.type === 1) { + await $.getScript("https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/memo/jd_woHomeShareCode.txt").then((text) => (shareCode = text.replace('\n',''))) + await task_record(funArr[data.body[i].ssjjTaskInfo.type],`${shareCode}/${data.body[i].ssjjTaskInfo.id}`) + continue + } + await queryDoneTaskRecord(data.body[i].ssjjTaskInfo.type,data.body[i].ssjjTaskInfo.id) + } else { + console.log('已完成') + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +function queryDoneTaskRecord(type,id,timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}ssjj-task-record/queryDoneTaskRecord/${type}/${id}?body=%7B%7D`, + headers : { + 'Origin' : `https://lkyl.dianpusoft.cn`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Content-Type' : `application/json`, + 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, + 'Host' : `lkyl.dianpusoft.cn`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'token' : token + } + } + $.get(url, async (err, resp, data) => { + try { + if (printDetail) console.log(data) + data = JSON.parse(data); + if (type === 9) { + //await queryCommoditiesListByTaskId(id,data.body||[],type) + } + await queryChannelsList(id,data.body||[],type) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +function queryChannelsList(id,list,type,timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}ssjj-task-channels/queryChannelsList/${id}?body=%7B%7D`, + headers : { + 'Origin' : `https://lkyl.dianpusoft.cn`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Content-Type' : `application/json`, + 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, + 'Host' : `lkyl.dianpusoft.cn`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'token' : token + } + } + $.get(url, async (err, resp, data) => { + try { + if (printDetail) console.log(data) + data = JSON.parse(data); + //console.log(data.head.msg) + for (let i in data.body) { + if (list.includes(data.body[i].id)) continue; + if (type === 6) await task_record(funArr[type],`${data.body[i].id}/${id}`) + if (type === 7) await task_record(funArr[type],`${id}/${data.body[i].id}`) + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + + +//做任务 +function task_record(functionid,id,timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}ssjj-task-record/${functionid}/${id}/?body=%7B%7D`, + headers : { + 'Origin' : `https://lkyl.dianpusoft.cn`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Content-Type' : `application/json`, + 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, + 'Host' : `lkyl.dianpusoft.cn`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'token' : token + } + } + //console.log(url.url) + $.get(url, async (err, resp, data) => { + try { + if (printDetail) console.log(data) + data = JSON.parse(data); + console.log(data.head.msg) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//查询抽奖 +function queryDraw(timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}ssjj-draw-center/queryDraw?body=%7B%7D`, + headers : { + 'Origin' : `https://lkyl.dianpusoft.cn`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Content-Type' : `application/json`, + 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, + 'Host' : `lkyl.dianpusoft.cn`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'token' : token + } + } + $.get(url, async (err, resp, data) => { + try { + if (printDetail) console.log(data) + data = JSON.parse(data); + if (data.head.code !== 200) { + console.log(typeof data.body !== 'undefined' ? data.body.name : data.head.msg) + merge.draw.notify += (typeof data.body !== 'undefined' ? data.body.name : data.head.msg) + ";"; + return + } + if (data.body.freeDrawCount > 0) { + console.log('开始免费抽奖') + await draw(data.body.center.id) + } else { + merge.draw.notify = '免费次数已用完;'; + console.log('免费次数已用完') + } + if (doPaidDraw) { + console.log('您选择了窝币抽奖') + while (!merge.stopDraw) { + await draw(data.body.center.id) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} +//抽奖 +function draw(id,timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `${JD_API_HOST}ssjj-draw-record/draw/${id}?body=%7B%7D`, + headers : { + 'Origin' : `https://lkyl.dianpusoft.cn`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Content-Type' : `application/json`, + 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, + 'Host' : `lkyl.dianpusoft.cn`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn`, + 'token' : token + } + } + $.get(url, async (err, resp, data) => { + try { + if (printDetail) console.log(data) + data = JSON.parse(data); + if (data.head.code !== 200) merge.stopDraw = true + console.log(typeof data.body !== 'undefined' ? data.body.name : data.head.msg) + merge.draw.notify += (typeof data.body !== 'undefined' ? data.body.name : data.head.msg) + ";"; + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//获取userName +function encrypt(timeout = 0){ + return new Promise((resolve) => { + setTimeout( ()=>{ + let url = { + url : `https://jdhome.m.jd.com/saas/framework/encrypt/pin?appId=6d28460967bda11b78e077b66751d2b0`, + headers : { + 'Origin' : `https://jdhome.m.jd.com`, + 'Cookie' : cookie, + 'Connection' : `keep-alive`, + 'Accept' : `application/json`, + 'Referer' : `https://jdhome.m.jd.com/dist/taro/index.html/`, + 'Host' : `jdhome.m.jd.com`, + 'Accept-Encoding' : `gzip, deflate, br`, + 'Accept-Language' : `zh-cn` + } + } + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(err.error) + merge.fail = `请求jdhome.m.jd.com失败:${err.error}\n请更换网络环境重试!` + return + } + if (printDetail) console.log(data) + data = JSON.parse(data); + if (data.success) { + userName = data.data; + await login() + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + },timeout) + }) +} + +//初始化 +function initial() { + merge = { + nickname: "", + enabled: true, + newUser: false, + stopDraw: false, + jdBeans: {prizeDesc : "兑换|京豆|个",isNumber : true,fixed : 0}, + draw : {prizeDesc : "抽奖结果",isNumber : false} + } + for (let i in merge) { + merge[i].success = 0; + merge[i].fail = 0; + merge[i].prizeCount = 0; + merge[i].notify = ""; + merge[i].show = true; + } +} +//通知 +function msgShow() { + let message = ""; + let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22${encodeURIComponent('https://lkyl.dianpusoft.cn/client/?lkEPin='+userName+'&token='+token)}%22%20%7D`} + let title = `京东账号:${merge.nickname}`; + if (merge.draw.notify.split(";").length >3) { + merge.draw.notify = merge.draw.notify.replace("今日没有抽奖次数;",""); + } + merge.draw.notify = merge.draw.notify.substr(0,merge.draw.notify.length -1) + if (merge.end) { + message += `当前窝币:${merge.end}\n` + message += merge.end === merge.start ? `` : `本次新增:${merge.end - merge.start}\n` + message += merge.draw.prizeDesc +':'+merge.draw.notify +'\n' + message += `请点击通知跳转至APP查看` + } else { + if (typeof merge.fail === "undefined") + message += `您的账户尚未开通东东小窝,请先点击通知进入开通` + else + message += merge.fail + } + $.msg($.name, title, message, url); +} + + +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,g=-8){ let f=new Date().getTimezoneOffset();let d=new Date().getTime()+ f * 60 * 1000 - (g * 60 * 60 * 1000); let n = new Date(d);let e={"M+":n.getMonth()+1,"d+":n.getDate(),"H+":n.getHours(),"m+":n.getMinutes(),"s+":n.getSeconds(),"q+":Math.floor((n.getMonth()+3)/3),S:n.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(n.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)} diff --git a/Task/kuaishou.js b/Task/kuaishou.js index f15a77a9b6..637272c1ef 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -99,14 +99,19 @@ function sign() { url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/sign', headers: {Cookie: cookieVal}} $.get(signurl, (error, response, data) => { - if(logs) $.log(`${$.name}, data: ${data}`) + $.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) if(result.result == 10007){ - subTitle = `签到结果: ${result.error_msg}` - $.msg($.name,subTitle,'')} - if(logs) $.log(`错误代码: ${result.result}, 返回信息: ${result.error_msg}`) - }) - resolve() + _sign = `签到结果: ${result.error_msg}`; + $.msg($.name,subTitle,''); + if(logs) $.log(`错误信息: ${result.error_msg}`) + } else if(result.result == 10901){ + _sign = `签到结果: ${result.error_msg}` + } else { + _sign = `签到结果: ${result.error_msg}` + } + resolve() + }) }) } function signifo() { @@ -115,12 +120,10 @@ function signifo() { url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/query', headers: {Cookie: cookieVal}} $.get(earnurl, (error, response, data) => { - if(logs)$.log(`${$.name}, data: ${data}`) + if(logs)$.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) - if (result.data.nebulaSignInPopup.button == '立即签到'){ - detail = `签到成功: ${result.data.nebulaSignInPopup.subTitle}, ${result.data.nebulaSignInPopup.title}` - } else if (result.data.nebulaSignInPopup.button == '好的'){ - detail = `重复签到: ${result.data.nebulaSignInPopup.subTitle}, ${result.data.nebulaSignInPopup.title}` + if (result.result == '1'){ + detail = `${result.data.nebulaSignInPopup.subTitle}, ${result.data.nebulaSignInPopup.title}\n` } resolve() }) @@ -136,10 +139,10 @@ function info() { if (result.result == 1) { subTitle = `现金收益: 💵${result.data.allCash}元 金币收益: 💰${result.data.totalCoin}` } - $.msg($.name,subTitle,detail) + $.msg($.name,subTitle,detail+_sign) resolve() - }) - }) + }) + }) } function invite() { return new Promise((resolve, reject) => { @@ -150,11 +153,11 @@ function invite() { body: '{"code":"774010415","stage":"launch_app_try_launch","dph":736,"dpw":414,"reader":3,"platform":"copylink"}' } $.post(invurl, (error, response, data) => { - if(logs) $.log(`${$.name}, data: ${data}`) - let result = JSON.parse(data) + if(logs)$.log(`${$.name}, data: ${data}`) + //let result = JSON.parse(data) }) resolve() }) } -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 d2dae2ab37df93b7c1eb1c948af5341f8f374b93 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 7 Dec 2020 09:41:57 +0800 Subject: [PATCH 147/721] --- Task/Auto_Kuaishou.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/Auto_Kuaishou.js b/Task/Auto_Kuaishou.js index e0c73f6b6b..0749f46e26 100644 --- a/Task/Auto_Kuaishou.js +++ b/Task/Auto_Kuaishou.js @@ -66,7 +66,7 @@ function AutoRead(){ 'Accept-Language' : `zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8`}, }; $.get(myRequest, (error, response, data) => { - //console.log(response.statusCode + "\n\n" + data); + console.log(response.statusCode + "\n\n" + data); //$.done(); }) resolve() From 7b8fb7b9df2bc3860cb540c74b958cb1830d6f29 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 7 Dec 2020 09:46:28 +0800 Subject: [PATCH 148/721] --- Task/Auto_Kuaishou.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/Auto_Kuaishou.js b/Task/Auto_Kuaishou.js index 0749f46e26..e0c73f6b6b 100644 --- a/Task/Auto_Kuaishou.js +++ b/Task/Auto_Kuaishou.js @@ -66,7 +66,7 @@ function AutoRead(){ 'Accept-Language' : `zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8`}, }; $.get(myRequest, (error, response, data) => { - console.log(response.statusCode + "\n\n" + data); + //console.log(response.statusCode + "\n\n" + data); //$.done(); }) resolve() From 6de8f165ac469ff2a8b9781e501d62466f1f0f6d Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 7 Dec 2020 17:39:38 +0800 Subject: [PATCH 149/721] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BF=AB=E6=89=8B?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/AUTO_KS.yml | 2 +- Task/Auto_Kuaishou.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/AUTO_KS.yml b/.github/workflows/AUTO_KS.yml index db03d68013..43a5d4da99 100644 --- a/.github/workflows/AUTO_KS.yml +++ b/.github/workflows/AUTO_KS.yml @@ -5,7 +5,7 @@ name: 快手视频 on: workflow_dispatch: schedule: - - cron: '*/15 * * * *' + - cron: '*/8 * * * *' watch: types: started jobs: diff --git a/Task/Auto_Kuaishou.js b/Task/Auto_Kuaishou.js index e0c73f6b6b..d6e36b6447 100644 --- a/Task/Auto_Kuaishou.js +++ b/Task/Auto_Kuaishou.js @@ -42,13 +42,13 @@ let ksUrl = [], ksArr = []; $.index = i + 1; console.log(`-------------------------\n\n开始快手极速版第${$.index}个视频`) } - for (let j = 0; j < 50; j++) { + for (let j = 0; j < 20; j++) { await AutoRead(); - await $.wait(2000); - console.log(`\n 请等待2s后继续视频${$.index}第${j+1}次任务`) + await $.wait(5000); + console.log(`\n 请等待5s后继续视频${$.index}第${j+1}次任务`) } }; - console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*50)次,视频金币详情见App,任务全部结束`) + console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*20)次,视频金币详情见App,任务全部结束`) })() .catch((e) => $.logErr(e)) .finally(() => $.done()) From 35fcbf3cf4fd34833da49b16bd5bc112acd03dc7 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 7 Dec 2020 22:19:21 +0800 Subject: [PATCH 150/721] --- .gitignore | 1 + package.json | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/package.json b/package.json index 64ae633998..e764e0f9d5 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,10 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/Sunert/Scripts.git" + "url": "https://github.com/Sunert/Scripts.git" }, - "keywords": [], - "author": "", + "keywords": ["中青看点,腾讯新闻等等"], + "author": "Sunert", "license": "ISC", "bugs": { "url": "https://github.com/Sunert/Scripts/issues" @@ -21,6 +21,7 @@ "crypto-js": "^4.0.0", "got": "^11.7.0", "http-server": "^0.12.3", - "tough-cookie": "^4.0.0" + "tough-cookie": "^4.0.0", + "download": "^8.0.0" } } From 044c37e89fab8f534cf40bde0329b56cc4165b8d Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 8 Dec 2020 11:44:58 +0800 Subject: [PATCH 151/721] --- Task/txnews.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/txnews.js b/Task/txnews.js index 9449fc1f4e..93e3116dca 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -329,9 +329,10 @@ function Redpack() { setTimeout(()=>{ const cashUrl = { url: `${TX_HOST}activity/redpack/get?isJailbreak=0&${ID}`, - headers: {Cookie: cookieVal}, + headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded","User-Agent": "QQNews/6.3.40 (iPhone; iOS 14.2; Scale/3.00)"}, body: redbody } + $.post(cashUrl, (error, response, data) => { let rcash = JSON.parse(data) console.log(data) From b87ee250a8186e905aa6b1d95f8adbf5d7c67c24 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 8 Dec 2020 12:02:34 +0800 Subject: [PATCH 152/721] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E7=B1=BB=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/AUTO_KS.yml | 2 +- .github/workflows/jd_baiTiao.yml | 40 -- .github/workflows/jd_lotteryMachine.yml | 40 -- .github/workflows/jd_rankingList.yml | 40 -- .github/workflows/jd_woHome.yml | 40 -- Task/Auto_Kuaishou.js | 11 +- Task/jd_baiTiao.js | 304 -------------- Task/jd_lotteryMachine.js | 316 --------------- Task/jd_rankingList.js | 229 ----------- Task/jd_timeMachine.js | 356 ----------------- Task/jd_woHome.js | 511 ------------------------ 11 files changed, 8 insertions(+), 1881 deletions(-) delete mode 100644 .github/workflows/jd_baiTiao.yml delete mode 100644 .github/workflows/jd_lotteryMachine.yml delete mode 100644 .github/workflows/jd_rankingList.yml delete mode 100644 .github/workflows/jd_woHome.yml delete mode 100644 Task/jd_baiTiao.js delete mode 100644 Task/jd_lotteryMachine.js delete mode 100644 Task/jd_rankingList.js delete mode 100644 Task/jd_timeMachine.js delete mode 100644 Task/jd_woHome.js diff --git a/.github/workflows/AUTO_KS.yml b/.github/workflows/AUTO_KS.yml index 43a5d4da99..d96855d6ed 100644 --- a/.github/workflows/AUTO_KS.yml +++ b/.github/workflows/AUTO_KS.yml @@ -5,7 +5,7 @@ name: 快手视频 on: workflow_dispatch: schedule: - - cron: '*/8 * * * *' + - cron: '*/30 * * * *' watch: types: started jobs: diff --git a/.github/workflows/jd_baiTiao.yml b/.github/workflows/jd_baiTiao.yml deleted file mode 100644 index 86e99567dd..0000000000 --- a/.github/workflows/jd_baiTiao.yml +++ /dev/null @@ -1,40 +0,0 @@ - -name: 京东白条 - -on: - workflow_dispatch: - #schedule: - # - cron: '15 */4 * * *' - watch: - types: started -jobs: - build: - runs-on: ubuntu-latest - if: github.event.repository.owner.id == github.event.sender.id - env: - JD_COOKIE: ${{ secrets.JD_COOKIE }} - steps: - - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: npm install - run: | - cd ~/Scripts - npm install - - name: '运行 【京东白条】' - if: env.JD_COOKIE - run: | - cd ~/Scripts - node Task/jd_baiTiao.js - env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/.github/workflows/jd_lotteryMachine.yml b/.github/workflows/jd_lotteryMachine.yml deleted file mode 100644 index 03d250ff0f..0000000000 --- a/.github/workflows/jd_lotteryMachine.yml +++ /dev/null @@ -1,40 +0,0 @@ - -name: 京东抽奖机 - -on: - workflow_dispatch: - schedule: - - cron: '8 16 * * *' - watch: - types: started -jobs: - build: - runs-on: ubuntu-latest - if: github.event.repository.owner.id == github.event.sender.id - env: - JD_COOKIE: ${{ secrets.JD_COOKIE }} - steps: - - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: npm install - run: | - cd ~/Scripts - npm install - - name: '运行 【京东抽奖机】' - if: env.JD_COOKIE - run: | - cd ~/Scripts - node Task/jd_lotteryMachine.js - env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/.github/workflows/jd_rankingList.yml b/.github/workflows/jd_rankingList.yml deleted file mode 100644 index a8c5967275..0000000000 --- a/.github/workflows/jd_rankingList.yml +++ /dev/null @@ -1,40 +0,0 @@ - -name: 京东排行榜 - -on: - workflow_dispatch: - schedule: - - cron: '10 16 * * *' - watch: - types: started -jobs: - build: - runs-on: ubuntu-latest - if: github.event.repository.owner.id == github.event.sender.id - env: - JD_COOKIE: ${{ secrets.JD_COOKIE }} - steps: - - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: npm install - run: | - cd ~/Scripts - npm install - - name: '运行 【京东排行榜】' - if: env.JD_COOKIE - run: | - cd ~/Scripts - node Task/jd_rankingList.js - env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/.github/workflows/jd_woHome.yml b/.github/workflows/jd_woHome.yml deleted file mode 100644 index e1ab1cfb70..0000000000 --- a/.github/workflows/jd_woHome.yml +++ /dev/null @@ -1,40 +0,0 @@ - -name: 京东小窝 - -on: - workflow_dispatch: - schedule: - - cron: '2 16 * * *' - watch: - types: started -jobs: - build: - runs-on: ubuntu-latest - if: github.event.repository.owner.id == github.event.sender.id - env: - JD_COOKIE: ${{ secrets.JD_COOKIE }} - steps: - - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: npm install - run: | - cd ~/Scripts - npm install - - name: '运行 【京东小窝】' - if: env.JD_COOKIE - run: | - cd ~/Scripts - node Task/jd_woHome.js - env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/Task/Auto_Kuaishou.js b/Task/Auto_Kuaishou.js index d6e36b6447..30cbb3a696 100644 --- a/Task/Auto_Kuaishou.js +++ b/Task/Auto_Kuaishou.js @@ -42,13 +42,13 @@ let ksUrl = [], ksArr = []; $.index = i + 1; console.log(`-------------------------\n\n开始快手极速版第${$.index}个视频`) } - for (let j = 0; j < 20; j++) { + for (let j = 0; j < 5; j++) { await AutoRead(); - await $.wait(5000); - console.log(`\n 请等待5s后继续视频${$.index}第${j+1}次任务`) + await $.wait(10000); + console.log(`\n 请等待10s后继续视频${$.index}第${j+1}次任务`) } }; - console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*20)次,视频金币详情见App,任务全部结束`) + console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*5)次,视频金币详情见App,任务全部结束`) })() .catch((e) => $.logErr(e)) .finally(() => $.done()) @@ -66,6 +66,9 @@ function AutoRead(){ 'Accept-Language' : `zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8`}, }; $.get(myRequest, (error, response, data) => { + if(error){ + console.log("响应数据失败:"+response.statusCode + "\n\n" + data); + } //console.log(response.statusCode + "\n\n" + data); //$.done(); }) diff --git a/Task/jd_baiTiao.js b/Task/jd_baiTiao.js deleted file mode 100644 index 17322197d3..0000000000 --- a/Task/jd_baiTiao.js +++ /dev/null @@ -1,304 +0,0 @@ -/* -京东金融领白条券 -更新时间:2020-12-01 13:42 -[task_local] -# 京东金融领白条券 0点,9点执行(非天天领券要9点开始领,扫码券0点领) -0 0,9 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_baiTiao.js, tag=京东白条, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/baitiao.png, enabled=true -*/ -const $ = new Env('天天领白条券'); -const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; -const printDetail = false; //是否显示出参详情 -let cookieExpire = false; -//直接用NobyDa的jd cookie -let cookiesArr = [], cookie = ''; -if ($.isNode()) { - Object.keys(jdCookieNode).forEach((item) => { - cookiesArr.push(jdCookieNode[item]) - }) -} else { - cookiesArr.push($.getdata('CookieJD')); - cookiesArr.push($.getdata('CookieJD2')); -} -const JR_API_HOST = 'https://jrmkt.jd.com/activity/newPageTake/takePrize'; -let prize = - //每日领随机白条券 - [ - {name : `prizeDaily`, desc : `天天领`, id : `Q72m9P5k3K94223q5k5O1w228U2S8B040D2B9qt`}, - //周一领 - {name : `prizeMonday`, desc : `周一领`, id : `Q1295372232228280029Aw`}, - //周二领 - {name : `prizeTuesday`, desc : `周二领`, id : `Q9293947555491r1b3U870x0D2V95X`}, - //周三领 - {name : `prizeWednesday`, desc : `周三领`, id : `Q8299679592g5N1Y1r3j8X0004269Ll`}, - //周四领 - {name : `prizeThursday`, desc : `周四领`, id : `X9D2l0f0P8S31154947512923QU`}, - //每周五领55-5券 - {name : `prizeFriday`, desc : `周五领`, id : `Q529284818011r8O2Y8L07082T9kE`}, - //周六领 - {name : `prizeSaturday`, desc : `周六领`, id : `i9200831161952186922QB`}, - //周六领2 - {name : `prizeSaturday2`, desc : `周六领`, id : `Q4295706b5Q9t2D6F181k3x8Q0v0W2e9JK`} - ] - -!(async () => { - if (!cookiesArr[0]) { - $.msg($.name, '提示:请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - return; - } - - for (let i = 0; i < prize.length; i++) { - prize[i].body =`activityId=${prize[i].id}&eid=${randomWord(false,90).toUpperCase()}&fp=${randomWord(false,32).toLowerCase()}` - } - - for (let i = 0; i < cookiesArr.length; i++) { - cookie = cookiesArr[i]; - if (cookie) { - $.prize = {addMsg : ``}; - let date = new Date(); - cookieExpire = false; - await queryCouponsNotGroup() - if (cookieExpire) { - $.msg($.name, '提示:请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - continue; - } - if (date.getHours() > 0) await takePrize(prize[0]); - if (date.getDay() !== 0 && date.getHours() >= 9) { - await takePrize(prize[date.getDay()],820);//延迟执行,防止提示活动火爆 - if (date.getDay() === 6) await takePrize(prize[7],820);//第二个周六券 - } - - if (date.getDay() === 0) { - $.prize.addMsg = `提 醒:请于今天使用周日专享白条券\n` - } - if (date.getHours() >= 9) await queryMissionWantedDetail(); - await msgShow(); - } - } -})() - .catch((e) => { - $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') - }) - .finally(() => { - $.done(); - }) - - -function takePrize(prize,timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url: JR_API_HOST, - body : prize.body, - headers: { - 'Cookie' : cookie, - 'X-Requested-With' : `XMLHttpRequest`, - 'Accept' : `application/json, text/javascript, */*; q=0.01`, - 'Origin' : `https://jrmkt.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Content-Type' : `application/x-www-form-urlencoded;charset=UTF-8`, - 'Host' : `jrmkt.jd.com`, - 'Connection' : `keep-alive`, - 'Referer' : `https://jrmkt.jd.com/ptp/wl/vouchers.html?activityId=${prize.id}`, - 'Accept-Language' : `zh-cn` - } - } - $.post(url, (err, resp, data) => { - try { - if (printDetail) console.log(data); - data = JSON.parse(data); - $.prize[prize.name] = data; - $.prize[prize.name].desc = prize.desc; - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -function queryMissionWantedDetail(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url: `https://ms.jr.jd.com/gw/generic/mission/h5/m/queryMissionWantedDetail?reqData=%7B%22playId%22:%2281%22,%22channelCode%22:%22MISSIONCENTER%22,%22timeStamp%22:%2${$.time(`yyyy-MM-ddTHH:mm:ss.SZ`)}%22%7D`, - headers: { - 'Cookie' : cookie, - 'Origin' : `https://m.jr.jd.com`, - 'Connection' : `keep-alive`, - 'Accept' : `application/json`, - 'Referer' : `https://m.jr.jd.com/member/task/RewardDetail/?playId=81&platformCode=MISSIONCENTER&channel=baitiao&jrcontainer=h5&jrcloseweb=false`, - 'Host' : `ms.jr.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - } - } - $.post(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data); - data = JSON.parse(data); - switch (data.resultData.data.mission.status ) { - case -1 : - $.prize.addMsg += `周任务:${data.resultData.data.mission.name}`; - await receivePlay(data.resultData.data.mission.missionId); - break; - case 0 : // 2已完成 -1未领取 0已领取 - $.prize.addMsg += `周任务:完成进度${data.resultData.data.mission.scheduleNowValue || 0}/${data.resultData.data.mission.scheduleTargetValue},剩余数量:${data.resultData.data.residueAwardNum || `未知`}\n` - break; - case 1 : // - $.prize.addMsg += `周任务:完成进度${data.resultData.data.mission.scheduleNowValue || 0}/${data.resultData.data.mission.scheduleTargetValue},剩余数量:${data.resultData.data.residueAwardNum || `未知`}\n` - break; - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -function receivePlay(missionId,timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url: `https://ms.jr.jd.com/gw/generic/mission/h5/m/receivePlay?reqData=%7B%22playId%22:%2281%22,%22channelCode%22:%22MISSIONCENTER%22,%22playType%22:1,%22missionId%22:${missionId},%22timeStamp%22:%22${$.time(`yyyy-MM-ddTHH:mm:ss.SZ`)}%22%7D`, - headers: { - 'Cookie' : cookie, - 'Origin' : `https://m.jr.jd.com`, - 'Connection' : `keep-alive`, - 'Accept' : `application/json`, - 'Referer' : `https://m.jr.jd.com/member/task/RewardDetail/?playId=81&platformCode=MISSIONCENTER&channel=baitiao&jrcontainer=h5&jrcloseweb=false`, - 'Host' : `ms.jr.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - } - } - $.post(url, (err, resp, data) => { - try { - if (printDetail) console.log(data); - data = JSON.parse(data); - $.prize.addMsg += `-${data.resultData.msg.replace(`该任务`,``)}\n`; - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -function queryCouponsNotGroup(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url: `https://ms.jr.jd.com/gw/generic/bt/h5/m/queryCouponsNotGroup?reqData=%7B%22businessLine%22:%22LQ_QYZX_SCQ%22%7D`, - headers: { - 'Cookie' : cookie, - 'Origin' : `https://m.jr.jd.com`, - 'Connection' : `keep-alive`, - 'Accept' : `application/json`, - 'Referer' : `https://m.jr.jd.com/`, - 'Host' : `ms.jr.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - } - } - $.get(url, async(err, resp, data) => { - try { - if (printDetail) console.log(data); - data = JSON.parse(data); - if (data.resultData.result.code !== "0000") { - cookieExpire = true - return - } - for (let i = data.resultData.floorInfo.length - 1;i > 0 ;i--){ - if (data.resultData.floorInfo[i].couponStatus === "2") { - await comReceiveCoupon(data.resultData.floorInfo[i].couponKey,100) - } - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -function comReceiveCoupon(couponKey,timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url: `https://ms.jr.jd.com/gw/generic/bt/h5/m/comReceiveCoupon?reqData=%7B%22businessLine%22:%22LQ_QYZX_SCQ%22,%22couponKey%22:%22${couponKey}%22%7D`, - headers: { - 'Cookie' : cookie, - 'Origin' : `https://m.jr.jd.com`, - 'Connection' : `keep-alive`, - 'Accept' : `application/json`, - 'Referer' : `https://m.jr.jd.com/`, - 'Host' : `ms.jr.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - } - } - $.get(url, (err, resp, data) => { - try { - if (printDetail) console.log(data); - data = JSON.parse(data); - $.prize["dailyCoupon"] = $.prize["dailyCoupon"]||"立减券" - $.prize["dailyCoupon"] += data.resultData.couponsVo.prizeAmount + '元;' - console.log($.prize["dailyCoupon"]) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -function randomWord(randomFlag, min, max){ - let str = "", - range = min, - arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; - // 随机产生 - if(randomFlag){ - range = Math.round(Math.random() * (max-min)) + min; - } - for(let i=0; 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,g=-8){ let f=new Date().getTimezoneOffset();let d=new Date().getTime()+ f * 60 * 1000 - (g * 60 * 60 * 1000); let n = new Date(d);let e={"M+":n.getMonth()+1,"d+":n.getDate(),"H+":n.getHours(),"m+":n.getMinutes(),"s+":n.getSeconds(),"q+":Math.floor((n.getMonth()+3)/3),S:n.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(n.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)} diff --git a/Task/jd_lotteryMachine.js b/Task/jd_lotteryMachine.js deleted file mode 100644 index b8db5711c1..0000000000 --- a/Task/jd_lotteryMachine.js +++ /dev/null @@ -1,316 +0,0 @@ -/* -京东抽奖机 -更新时间:2020-12-01 17:37 -脚本说明:四个抽奖活动,【新店福利】【闪购盲盒】【疯狂砸金蛋】【东东福利屋】,点通知只能跳转一个,入口在京东APP玩一玩里面可以看到 -脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js -// quantumultx -[task_local] -#京东抽奖机 -11 1 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_lotteryMachine.js, tag=京东抽奖机, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jdlottery.png, enabled=true -// Loon -[Script] -cron "11 1 * * *" script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_lotteryMachine.js,tag=京东抽奖机 -// Surge -京东抽奖机 = type=cron,cronexp=11 1 * * *,wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_lotteryMachine.js - */ -const $ = new Env('京东抽奖机'); -//Node.js用户请在jdCookie.js处填写京东ck; -const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; -const STRSPLIT = "|"; -const needSum = false; //是否需要显示汇总 -const printDetail = false; //是否显示出参详情 -const appIdArr = ['1EFRQxA','1EFRRxA','1EFRQwA','1EFRQyg'] -const shareCodeArr = ['P04z54XCjVXmIaW5m9cZ2f433tIlGWEga-IO2o','P04z54XCjVWmIaW5m9cZ2f433tIlJz4FjX2kfk','P04z54XCjVXnIaW5m9cZ2f433tIlLKXiUijZw4','P04z54XCjVXloaW5m9cZ2f433tIlH_LzLLVOp8'] -const funPrefixArr = ['','','','wfh','splitHongbao'] -let merge = {} -//IOS等用户直接用NobyDa的jd cookie -let cookiesArr = [], cookie = ''; -if ($.isNode()) { - Object.keys(jdCookieNode).forEach((item) => { - cookiesArr.push(jdCookieNode[item]) - }) -} else { - cookiesArr.push($.getdata('CookieJD')); - cookiesArr.push($.getdata('CookieJD2')); -} - -const JD_API_HOST = `https://api.m.jd.com/client.action`; -!(async () => { - if (!cookiesArr[0]) { - $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - return; - } - for (let i = 0; i < cookiesArr.length; i++) { - cookie = cookiesArr[i]; - if (cookie) { - if (i) console.log(`\n***************开始京东账号${i + 1}***************`) - initial(); - await QueryJDUserInfo(); - if (!merge.enabled) //cookie不可用 - { - $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 - $.msg($.name, `【提示】京东账号${i + 1} cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - continue; - } - for (let j in appIdArr) { - appId = appIdArr[j] - shareCode = shareCodeArr[j] - funPrefix = funPrefixArr[j]||'interact_template' - if (parseInt(j)) console.log(`\n开始第${parseInt(j) + 1}个抽奖活动`) - await interact_template_getHomeData(); - } - await msgShow(); - } - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - - -//获取昵称 -function QueryJDUserInfo(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, - headers : { - 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, - 'Cookie' : cookie - } - } - $.get(url, (err, resp, data) => { - try { - data = JSON.parse(data); - if (data.retcode === 13) { - merge.enabled = false - return - } - merge.nickname = data.base.nickname; - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -function interact_template_getHomeData(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}`, - headers : { - 'Origin' : `https://h5.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html`, - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=${funPrefix}_getHomeData&body={"appId":"${appId}","taskToken":""}&client=wh5&clientVersion=1.0.0` - } - $.post(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data); - data = JSON.parse(data); - if (data.data.bizCode !== 0) { - console.log(data.data.bizMsg); - merge.jdBeans.fail++; - merge.jdBeans.notify = `${data.data.bizMsg}`; - return - } - scorePerLottery = data.data.result.userInfo.scorePerLottery||data.data.result.userInfo.lotteryMinusScore - //console.log(scorePerLottery) - for (let i = 0;i < data.data.result.taskVos.length;i ++) { - console.log("\n" + data.data.result.taskVos[i].taskType + '-' + data.data.result.taskVos[i].taskName + '-' + (data.data.result.taskVos[i].status === 1 ? `已完成${data.data.result.taskVos[i].times}-未完成${data.data.result.taskVos[i].maxTimes}` : "全部已完成")) - //签到 - if ([0,13].includes(data.data.result.taskVos[i].taskType)) { - if (data.data.result.taskVos[i].status === 1) { - await harmony_collectScore(data.data.result.taskVos[i].simpleRecordInfoVo.taskToken,data.data.result.taskVos[i].taskId); - } - continue - } - if (data.data.result.taskVos[i].taskType === 14) {//'data.data.result.taskVos[i].assistTaskDetailVo.taskToken' - await harmony_collectScore(shareCode,data.data.result.taskVos[i].taskId); - continue - } - let list = data.data.result.taskVos[i].productInfoVos || data.data.result.taskVos[i].followShopVo || data.data.result.taskVos[i].shoppingActivityVos || data.data.result.taskVos[i].browseShopVo - for (let k = data.data.result.taskVos[i].times; k < data.data.result.taskVos[i].maxTimes; k++) { - for (let j in list) { - if (list[j].status === 1) { - //console.log(list[j].simpleRecordInfoVo||list[j].assistTaskDetailVo) - console.log("\n" + (list[j].title || list[j].shopName||list[j].skuName)) - //console.log(list[j].itemId) - if (list[j].itemId) { - await harmony_collectScore(list[j].taskToken,data.data.result.taskVos[i].taskId,list[j].itemId,1); - await harmony_collectScore(list[j].taskToken,data.data.result.taskVos[i].taskId,list[j].itemId,0,6000); - if (k === data.data.result.taskVos[i].maxTimes - 1) await interact_template_getLotteryResult(data.data.result.taskVos[i].taskId); - } else { - await harmony_collectScore(list[j].taskToken,data.data.result.taskVos[i].taskId) - } - list[j].status = 2; - break; - } else { - continue; - } - } - } - if (data.data.result.taskVos[i].status === 3) { - console.log('开始抽奖') - await interact_template_getLotteryResult(data.data.result.taskVos[i].taskId); - } - } - if (scorePerLottery) await interact_template_getLotteryResult(); - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -function harmony_collectScore(taskToken,taskId,itemId = "",actionType = 0,timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}`, - headers : { - 'Origin' : `https://h5.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html`,//?inviteId=P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ?inviteId=${shareCode} - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=${funPrefix === 'wfh' ? funPrefix : 'harmony'}_collectScore&body={"appId":"${appId}","taskToken":"${taskToken}","taskId":${taskId}${itemId ? ',"itemId":"'+itemId+'"' : ''},"actionType":${actionType}&client=wh5&clientVersion=1.0.0` - } - //console.log(url.body) - $.post(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data); - data = JSON.parse(data); - console.log(data.data.bizMsg) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} -// -function interact_template_getLotteryResult(taskId,timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}`, - headers : { - 'Origin' : `https://h5.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html?inviteId=P04z54XCjVXmYaW5m9cZ2f433tIlGBj3JnLHD0`,//?inviteId=P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `functionId=${funPrefix}_getLotteryResult&body={"appId":"${appId}"${taskId ? ',"taskId":"'+taskId+'"' : ''}}&client=wh5&clientVersion=1.0.0` - } - //console.log(url.body) - $.post(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data); - if (!timeout) console.log('\n开始抽奖') - data = JSON.parse(data); - if (data.data.bizCode === 0) { - if (data.data.result.userAwardsCacheDto.jBeanAwardVo) { - merge.jdBeans.success++; - console.log('京豆:' + data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity) - merge.jdBeans.prizeCount += parseInt(data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity) - } - if (data.data.result.userAwardsCacheDto.redPacketVO) { - merge.redPacket.show = true; - merge.redPacket.success++; - console.log('红包:' + data.data.result.userAwardsCacheDto.redPacketVO.value) - merge.redPacket.prizeCount += parseFloat(data.data.result.userAwardsCacheDto.redPacketVO.value) - } - if (parseInt(data.data.result.userScore) >= scorePerLottery && scorePerLottery) { - await interact_template_getLotteryResult(1000) - } - } else{ - merge.jdBeans.fail++; - console.log(data.data.bizMsg) - if (data.data.bizCode === 111 ) data.data.bizMsg = "无机会" - merge.jdBeans.notify = `${data.data.bizMsg}`; - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//初始化 - -function initial() { - merge = { - nickname: "", - enabled: true, - redPacket: {prizeDesc : "抽得|红包|元",number : true,fixed : 2}, //定义 动作|奖励名称|奖励单位 是否是数字 - jdBeans: {prizeDesc : "抽得|京豆|个",number : true,fixed : 0} - } - for (let i in merge) { - merge[i].success = 0; - merge[i].fail = 0; - merge[i].prizeCount = 0; - merge[i].notify = ""; - merge[i].show = true; - } - merge.redPacket.show = false; -} -//通知 -function msgShow() { - let message = "";//https://h5.m.jd.com/babelDiy/Zeus/YgnrqBaEmVHWppzCgW8zjZj3VjV/index.html - let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/YgnrqBaEmVHWppzCgW8zjZj3VjV/index.html%22%20%7D`} - let title = `京东账号:${merge.nickname}`; - for (let i in merge) { - if (typeof (merge[i]) !== "object" || !merge[i].show) continue; - if (merge[i].notify.split("").reverse()[0] === "\n") merge[i].notify = merge[i].notify.substr(0,merge[i].notify.length - 1); - message += `${merge[i].prizeDesc.split(STRSPLIT)[0]}${merge[i].prizeDesc.split(STRSPLIT)[1]}:` + (merge[i].success ? `${merge[i].prizeCount.toFixed(merge[i].fixed)}${merge[i].prizeDesc.split(STRSPLIT)[2]}\n` : `失败:${merge[i].notify}\n`) - } -//合计 - if (needSum) { - $.sum = {}; - for (let i in merge) { - if (typeof (merge[i]) !== "object" || !merge[i].show) continue; - if (typeof ($.sum[merge[i].prizeDesc.split(STRSPLIT)[1]]) === "undefined") $.sum[merge[i].prizeDesc.split(STRSPLIT)[1]] = {count : 0}; - $.sum[merge[i].prizeDesc.split(STRSPLIT)[1]].count += merge[i].prizeCount; - } - message += `合计:` - for (let i in $.sum) - { - message += `${$.sum[i].count.toFixed($.sum[i].fixed)}${i},` - } - } - message += `请点击通知跳转至APP查看` - //message = message.substr(0,message.length - 1); - $.msg($.name, title, message, url); -} - - - -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)} diff --git a/Task/jd_rankingList.js b/Task/jd_rankingList.js deleted file mode 100644 index 4341eda3db..0000000000 --- a/Task/jd_rankingList.js +++ /dev/null @@ -1,229 +0,0 @@ -/* -京东排行榜 -更新时间:2020-11-20 13:55 -脚本说明:京东排行榜签到得京豆 -活动入口:找不着了,点击脚本通知进入吧 -脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js -// quantumultx -[task_local] -#京东排行榜 -11 9 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_rankingList.js, tag=京东排行榜, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jd.png, enabled=true -// Loon -[Script] -cron "11 9 * * *" script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_rankingList.js,tag=京东排行榜 -// Surge -京东排行榜 = type=cron,cronexp=11 9 * * *,wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_rankingList.js - */ -const $ = new Env('京东排行榜'); -//Node.js用户请在jdCookie.js处填写京东ck; -const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; -const needSum = false; //是否需要显示汇总 -const STRSPLIT = "|"; -let merge = {} -//IOS等用户直接用NobyDa的jd cookie -let cookiesArr = [], cookie = ''; -if ($.isNode()) { - Object.keys(jdCookieNode).forEach((item) => { - cookiesArr.push(jdCookieNode[item]) - }) -} else { - cookiesArr.push($.getdata('CookieJD')); - cookiesArr.push($.getdata('CookieJD2')); -} - -const JD_API_HOST = `https://api.m.jd.com/client.action?functionId=`; -!(async () => { - if (!cookiesArr[0]) { - $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - return; - } - for (let i = 0; i < cookiesArr.length; i++) { - cookie = cookiesArr[i]; - if (cookie) { - if (i) console.log(`\n***************开始京东账号${i + 1}***************`) - initial(); - await QueryJDUserInfo(); - if (!merge.enabled) //cookie不可用 - { - $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 - $.msg($.name, `【提示】京东账号${i + 1} cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - continue; - } - await queryTrumpTask(); - await msgShow(); - } - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - - -//获取昵称 -function QueryJDUserInfo(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, - headers : { - 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, - 'Cookie' : cookie - } - } - $.get(url, (err, resp, data) => { - try { - data = JSON.parse(data); - if (data.retcode === 13) { - merge.enabled = false - return - } - merge.nickname = data.base.nickname; - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//查询任务 -function queryTrumpTask(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}queryTrumpTask&body=%7B%22sign%22%3A2%7D&appid=content_ecology&clientVersion=9.2.0&client=wh5`, - headers : { - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3wtN2MjeQgjmxYTLB3YFcHjKiUJj/index.html`, - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - } - } - $.post(url, async (err, resp, data) => { - try { - //console.log(data) - data = JSON.parse(data) - let now = $.time('yyyy-MM-dd') - for (let i in data.result.signTask.taskItemInfo.signList){ - //console.log(data.result.signTask.taskItemInfo.signList[i]) - if (data.result.signTask.taskItemInfo.signList[i].match(now)) { - merge.jdBeans.fail++; - merge.jdBeans.notify = `${now}已签过`; - console.log(now + '已签过') - return - } - } - for (let i in data.result.taskList) { - console.log(data.result.taskList[i].taskName) - if (data.result.taskList[i].taskItemInfo.status === 0) { - await doTrumpTask(data.result.taskList[i].taskId,data.result.taskList[i].taskItemInfo.itemId,1000) - } else { - console.log('已完成') - } - } - console.log('开始签到') - await doTrumpTask(4,"1",1000) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -//做任务 -function doTrumpTask(taskId,itemId,timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}doTrumpTask&body=%7B%22taskId%22%3A${taskId}%2C%22itemId%22%3A%22${itemId}%22%2C%22sign%22%3A2%7D&appid=content_ecology&clientVersion=9.2.0&client=wh5`, - headers : { - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3wtN2MjeQgjmxYTLB3YFcHjKiUJj/index.html`, - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - } - } - $.post(url, async (err, resp, data) => { - try { - // - data = JSON.parse(data); - console.log(data.msg) - if (data.code !== "0") { - merge.jdBeans.fail++; - merge.jdBeans.notify = `${data.msg}`; - return - } else { - merge.jdBeans.success++; - merge.jdBeans.prizeCount += parseInt(data.result.lotteryScore) - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - - -//初始化 -function initial() { - merge = { - nickname: "", - enabled: true, - //blueCoin: {prizeDesc : "收取|蓝币|个",number : true}, //定义 动作|奖励名称|奖励单位 是否是数字 - jdBeans: {prizeDesc : "获得|京豆|个",number : true,fixed : 0} - } - for (let i in merge) { - merge[i].success = 0; - merge[i].fail = 0; - merge[i].prizeCount = 0; - merge[i].notify = ""; - merge[i].show = true; - } -} -//通知 -function msgShow() { - let message = ""; - let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/3wtN2MjeQgjmxYTLB3YFcHjKiUJj/index.html%22%20%7D`} - let title = `京东账号:${merge.nickname}`; - for (let i in merge) { - if (typeof (merge[i]) !== "object" || !merge[i].show) continue; - if (merge[i].notify.split("").reverse()[0] === "\n") merge[i].notify = merge[i].notify.substr(0,merge[i].notify.length - 1); - message += `${merge[i].prizeDesc.split(STRSPLIT)[0]}${merge[i].prizeDesc.split(STRSPLIT)[1]}:` + (merge[i].success ? `${merge[i].prizeCount.toFixed(merge[i].fixed)}${merge[i].prizeDesc.split(STRSPLIT)[2]}\n` : `失败:${merge[i].notify}\n`) - } -//合计 -if (needSum) - { - $.sum = {}; - for (let i in merge) { - if (typeof (merge[i]) !== "object" || !merge[i].show) continue; - if (typeof ($.sum[merge[i].prizeDesc.split(STRSPLIT)[1]]) === "undefined") $.sum[merge[i].prizeDesc.split(STRSPLIT)[1]] = {count : 0}; - $.sum[merge[i].prizeDesc.split(STRSPLIT)[1]].count += merge[i].prizeCount; - } - message += `合计:` - for (let i in $.sum) - { - message += `${$.sum[i].count.toFixed($.sum[i].fixed)}${i},` - } - } - message += `请点击通知跳转至APP查看` - //message = message.substr(0,message.length - 1); - $.msg($.name, title, message, url); -} - - -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,g=-8){ let f=new Date().getTimezoneOffset();let d=new Date().getTime()+ f * 60 * 1000 - (g * 60 * 60 * 1000); let n = new Date(d);let e={"M+":n.getMonth()+1,"d+":n.getDate(),"H+":n.getHours(),"m+":n.getMinutes(),"s+":n.getSeconds(),"q+":Math.floor((n.getMonth()+3)/3),S:n.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(n.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)} diff --git a/Task/jd_timeMachine.js b/Task/jd_timeMachine.js deleted file mode 100644 index 78f3374da3..0000000000 --- a/Task/jd_timeMachine.js +++ /dev/null @@ -1,356 +0,0 @@ -/* -京东时光机 -更新时间:2020-10-31 03:14 -脚本说明: -京东时光机 -20 0-20/4 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_timeMachine.js, tag=京东时光机, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/jd.png, enabled=true -*/ -const $ = new Env('京东时光机'); -//Node.js用户请在jdCookie.js处填写京东ck; -const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; -//IOS等用户直接用NobyDa的jd cookie -let cookiesArr = [], cookie = ''; -if ($.isNode()) { - Object.keys(jdCookieNode).forEach((item) => { - cookiesArr.push(jdCookieNode[item]) - }) -} else { - cookiesArr.push($.getdata('CookieJD')); - cookiesArr.push($.getdata('CookieJD2')); -} - -const JD_API_HOST = `https://api.m.jd.com/client.action`; -!(async () => { - if (!cookiesArr[0]) { - $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - return; - } - console.log('提示:任务状态显示0是成功的意思,不要问为什么是0,执行完去app看!') - console.log('4小时执行一次是为了领能量球,不需要的设置为每天执行一次即可!') - for (let i = 0; i < cookiesArr.length; i++) { - cookie = cookiesArr[i]; - if (cookie) { - initial(); - console.log('*******************分割线*********************') - await QueryJDUserInfo(); - if (!merge.enabled) //cookie不可用 - { - $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 - $.msg($.name, `【提示】京东账号${i + 1} cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - continue; - } - await bc_getHome() - await bc_collectEnergyBall() - await bc_taskList() - console.log('\n开始兑换碎片') - await bc_fragmentCharge() - await msgShow() - } - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - - -//获取昵称(直接用,勿删) -function QueryJDUserInfo(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, - headers : { - 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, - 'Cookie' : cookie - } - } - $.get(url, (err, resp, data) => { - try { - data = JSON.parse(data); - if (data.retcode === 13) { - merge.enabled = false - return - } - merge.nickname = data.base.nickname; - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -function qryCompositeMaterials(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}`, - headers : { - 'Origin' : `https://h5.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'Content-Type' : `application/x-www-form-urlencoded` - }, - body : `functionId=qryCompositeMaterials&appid=publicUseApi&body={"activityId":"3DDunaJMLDamrmGwu73QbqtGtbX1","qryParam":"[{\\"type\\":\\"advertGroup\\",\\"id\\":\\"04891674\\",\\"mapTo\\":\\"assist\\",\\"promotion\\":1},{\\"type\\":\\"advertGroup\\",\\"id\\":\\"04892350\\",\\"mapTo\\":\\"game\\",\\"promotion\\":1},{\\"type\\":\\"advertGroup\\",\\"id\\":\\"04891674\\",\\"mapTo\\":\\"normal\\",\\"promotion\\":1}]","applyKey":"big_promotion"}&client=wh5&clientVersion=1.0.0&sid=` - } - $.post(url, async (err, resp, data) => { - try { - console.log(data) - data = JSON.parse(data); - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//查询任务 -function bc_taskList(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url: `${JD_API_HOST}`, - headers: { - 'Origin': `https://h5.m.jd.com`, - 'Cookie': cookie, - 'Connection': `keep-alive`, - 'Accept': `application/json, text/plain, */*`, - 'Referer': `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, - 'Host': `api.m.jd.com`, - 'Accept-Encoding': `gzip, deflate, br`, - 'Accept-Language': `zh-cn`, - 'Content-Type': `application/x-www-form-urlencoded`, - 'User-Agent': `jdapp;iPhone;9.2.0;14.1;` - }, - body : `functionId=bc_taskList&appid=publicUseApi&body={"lat":"36","lng":"117"}&client=wh5&clientVersion=1.0.0&sid=` - } - $.post(url, async (err, resp, data) => { - try { - //console.log(data) - data = JSON.parse(data); - if (data.data.result.signInfo.todayIsSigned === 0) { - console.log('\n开始签到:') - await bc_doTask(0) - } else { - console.log('\n当天已签到') - } - await bc_doTask(8,"","6acTpqhUjIOlhxlTq3RiZg") - for (let i in data.data.result.taskList) { - if (data.data.result.taskList[i].taskType === 8) continue; - console.log('\n开始做任务:' + data.data.result.taskList[i].taskType + '-' + data.data.result.taskList[i].mainTitle) - if (data.data.result.taskList[i].isCompleted === 1) { - console.log('已做完') - continue - } - for (let j = data.data.result.taskList[i].doTimes; j < data.data.result.taskList[i].timesLimit; j++) { - if (data.data.result.taskList[i].taskType === 1) { - for (let k in $.plusAdvertList) { - if ($.plusAdvertList[k].isCompleted === 0) { - console.log('\n' + $.plusAdvertList[k].desc) - await bc_doTask(data.data.result.taskList[i].taskType,$.plusAdvertList[k].comments0) - $.plusAdvertList[k].isCompleted = 1 - } - } - } else if (data.data.result.taskList[i].taskType === 2) { - for (let k in $.t1AdvertList) { - if ($.t1AdvertList[k].isCompleted === 0) { - console.log('\n' + $.t1AdvertList[k].desc) - await bc_doTask(data.data.result.taskList[i].taskType,$.t1AdvertList[k].comments0) - $.t1AdvertList[k].isCompleted = 1 - } - } - } else { - await bc_doTask(data.data.result.taskList[i].taskType) - } - } - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} -//做任务 -function bc_doTask(taskType,shopId = "",invitePin = "",timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - shopId = shopId&&`"shopId":"${shopId}",` - invitePin = invitePin&&`"invitePin":"${invitePin}",` - let url = { - url : `${JD_API_HOST}`, - headers : { - 'Origin' : `https://h5.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'Content-Type' : `application/x-www-form-urlencoded` - }, - body : `functionId=bc_doTask&appid=publicUseApi&body={${shopId}${invitePin}"taskType":${taskType}}&client=wh5&clientVersion=1.0.0&sid=` - } - $.post(url, async (err, resp, data) => { - try { - //console.log(data) - data = JSON.parse(data); - console.log('做任务结果:'+ data.data.bizCode) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} -// 换碎片 -function bc_fragmentCharge(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}`, - headers : { - 'Origin' : `https://h5.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'Content-Type' : `application/x-www-form-urlencoded` - }, - body : `functionId=bc_fragmentCharge&appid=publicUseApi&body={}&client=wh5&clientVersion=1.0.0&sid=` - } - $.post(url, async (err, resp, data) => { - try { - //console.log(data) - data = JSON.parse(data); - if (data.data.bizCode === 0) { - console.log('寻找碎片结果:剩余'+ data.data.result.energy) - if (data.data.result.energy >= data.data.result.fragmentEnergy) { - await bc_fragmentCharge() - } - } else { - console.log(data.data.bizMsg) - } - - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -// 主页 -function bc_getHome(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}`, - headers : { - 'Origin' : `https://h5.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'Content-Type' : `application/x-www-form-urlencoded` - }, - body : `functionId=bc_getHome&appid=publicUseApi&body={"lat":"","lng":""}&client=wh5&clientVersion=1.0.0&sid=` - } - $.post(url, async (err, resp, data) => { - try { - // - //console.log(data) - data = JSON.parse(data); - console.log("您的助力码为:" + data.data.result.ePin) - $.plusAdvertList = data.data.result.homeAdvertVO.plusAdvertList; - $.t1AdvertList = data.data.result.homeAdvertVO.t1AdvertList; - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//收集能量球 -function bc_collectEnergyBall(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}`, - headers : { - 'Origin' : `https://h5.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json, text/plain, */*`, - 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html`, - 'Host' : `api.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'Content-Type' : `application/x-www-form-urlencoded` - }, - body : `functionId=bc_collectEnergyBall&appid=publicUseApi&body={}&client=wh5&clientVersion=1.0.0` - } - console.log("\n收取能量球") - $.post(url, async (err, resp, data) => { - try { - //console.log(data) - data = JSON.parse(data); - console.log(data.data.bizMsg) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} -//初始化 -function initial() { - merge = { - nickname: "", - enabled: true - } - for (let i in merge) { - merge[i].success = 0; - merge[i].fail = 0; - merge[i].prizeCount = 0; - merge[i].notify = ""; - merge[i].show = true; - } -} -//通知 -function msgShow() { - let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html%22%20%7D`} - $.msg($.Name,"","京东账号:" + merge.nickname +"\n任务已做完!逛同城好店请手动做",url) -} - - -function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),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}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{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=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"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 e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o)),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} diff --git a/Task/jd_woHome.js b/Task/jd_woHome.js deleted file mode 100644 index 3a914847fe..0000000000 --- a/Task/jd_woHome.js +++ /dev/null @@ -1,511 +0,0 @@ -/* -东东小窝 -更新时间:2020-12-06 06:07 -脚本说明:加购任务不需要请去BoxJs中关闭! -脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js -// quantumultx -[task_local] -#东东小窝 -11 0 * * * https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_woHome.js, tag=东东小窝, img-url=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/image/woHome.png, enabled=true -// Loon -[Script] -cron "11 0 * * *" script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_woHome.js,tag=东东小窝 -// Surge -东东小窝 = type=cron,cronexp=11 0 * * *,wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_woHome.js - */ -const $ = new Env('东东小窝'); -//Node.js用户请在jdCookie.js处填写京东ck; -const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; -const printDetail = $.getdata("CFG_WOHOME_LOG") ? $.getdata("CFG_WOHOME_LOG") === "true" : false//是否显示出参详情 -const doAddChatTask = $.getdata("CFG_WOHOME_ADDCARTTASK") ? $.getdata("CFG_WOHOME_ADDCARTTASK") === "true" : true //加购任务 -const doPaidDraw = $.getdata("CFG_WOHOME_PAIDDRAW") ? $.getdata("CFG_WOHOME_PAIDDRAW") === "true" : false //窝币抽奖 -const funArr = ['','createAssistUser','clock','game','followShops','browseShops','followChannel','browseChannels','','purchaseCommodities','browseCommodities','browseMeetings'] -//IOS等用户直接用NobyDa的jd cookie -let cookiesArr = [], cookie = ''; -if ($.isNode()) { - Object.keys(jdCookieNode).forEach((item) => { - cookiesArr.push(jdCookieNode[item]) - }) -} else { - cookiesArr.push($.getdata('CookieJD')); - cookiesArr.push($.getdata('CookieJD2')); -} - -const JD_API_HOST = `https://lkyl.dianpusoft.cn/api/`; -!(async () => { - if (!cookiesArr[0]) { - $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - return; - } - for (let i = 0; i < cookiesArr.length; i++) { - cookie = cookiesArr[i]; - if (cookie) { - if (i) console.log(`\n***************开始京东账号${i + 1}***************`) - initial(); - await QueryJDUserInfo(); - if (!merge.enabled) //cookie不可用 - { - $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 - $.msg($.name, `【提示】京东账号${i + 1} cookie已过期!请先获取cookie\n直接使用NobyDa的京东签到获取`, 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - continue; - } - await encrypt(); - await msgShow(); - } - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - - -//获取昵称 -function QueryJDUserInfo(timeout = 0) { - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, - headers : { - 'Referer' : `https://wqs.jd.com/my/iserinfo.html`, - 'Cookie' : cookie - } - } - $.get(url, (err, resp, data) => { - try { - //if (printDetail) console.log(data) - data = JSON.parse(data); - if (data.retcode === 13) { - merge.enabled = false - return - } - merge.nickname = data.base.nickname; - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} -//登录 -function login(timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}user-info/login`, - headers : { - 'Origin' : `https://lkyl.dianpusoft.cn`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Content-Type' : `application/json`, - 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, - 'Host' : `lkyl.dianpusoft.cn`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - }, - body : `{"body": {"client": 2,"userName": "${userName}"}}` - } - $.post(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data) - data = JSON.parse(data); - if (data.head.code === 200) { - token = data.head.token - await queryByUserId() - if (merge.newUser) return; - await queryDraw() - await queryAllTaskInfo() - await queryByUserId() - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -function queryByUserId(timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}ssjj-wo-home-info/queryByUserId/2?body=%7B%7D`, - headers : { - 'Origin' : `https://lkyl.dianpusoft.cn`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Content-Type' : `application/json`, - 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, - 'Host' : `lkyl.dianpusoft.cn`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'token' : token - } - } - $.get(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data) - data = JSON.parse(data); - if (!data.body.id) { - merge.newUser = true; - } - if (typeof (merge.start) === "undefined") { - merge.start = data.body.woB - } else { - merge.end = data.body.woB - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -function queryAllTaskInfo(type = "",timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}ssjj-task-info/queryAllTaskInfo/2?body=%7B%7D`, - headers : { - 'Origin' : `https://lkyl.dianpusoft.cn`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Content-Type' : `application/json`, - 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, - 'Host' : `lkyl.dianpusoft.cn`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'token' : token - } - } - $.get(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data) - data = JSON.parse(data); - if (data.head.code === 200) { - for (let i in data.body) { - if (type !== "" && data.body[i].ssjjTaskInfo.type !== type) continue; - console.log(`${data.body[i].ssjjTaskInfo.type}-${data.body[i].ssjjTaskInfo.name}`) - if (data.body[i].doneNum < (data.body[i].ssjjTaskInfo.awardOfDayNum||1)){ - if (data.body[i].browseId) { - await task_record(funArr[data.body[i].ssjjTaskInfo.type],`${data.body[i].ssjjTaskInfo.id}/${data.body[i].browseId}`) - await queryAllTaskInfo(data.body[i].ssjjTaskInfo.type); - continue - } - if ([2,4,9].includes(data.body[i].ssjjTaskInfo.type)) { - if (!doAddChatTask && data.body[i].ssjjTaskInfo.type === 9) { - console.log("您选择了不做加购任务,跳过") - continue; //不做加购任务则跳过 - } - await task_record(funArr[data.body[i].ssjjTaskInfo.type],data.body[i].ssjjTaskInfo.id) - continue - } - if (data.body[i].ssjjTaskInfo.type === 3) { - for (let j = data.body[i].doneNum; j < (data.body[i].ssjjTaskInfo.awardOfDayNum||1);j++) { - await task_record(funArr[data.body[i].ssjjTaskInfo.type],`${j+1}/${data.body[i].ssjjTaskInfo.id}`) - } - continue - } - if (data.body[i].ssjjTaskInfo.type === 1) { - await $.getScript("https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/memo/jd_woHomeShareCode.txt").then((text) => (shareCode = text.replace('\n',''))) - await task_record(funArr[data.body[i].ssjjTaskInfo.type],`${shareCode}/${data.body[i].ssjjTaskInfo.id}`) - continue - } - await queryDoneTaskRecord(data.body[i].ssjjTaskInfo.type,data.body[i].ssjjTaskInfo.id) - } else { - console.log('已完成') - } - } - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -function queryDoneTaskRecord(type,id,timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}ssjj-task-record/queryDoneTaskRecord/${type}/${id}?body=%7B%7D`, - headers : { - 'Origin' : `https://lkyl.dianpusoft.cn`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Content-Type' : `application/json`, - 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, - 'Host' : `lkyl.dianpusoft.cn`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'token' : token - } - } - $.get(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data) - data = JSON.parse(data); - if (type === 9) { - //await queryCommoditiesListByTaskId(id,data.body||[],type) - } - await queryChannelsList(id,data.body||[],type) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -function queryChannelsList(id,list,type,timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}ssjj-task-channels/queryChannelsList/${id}?body=%7B%7D`, - headers : { - 'Origin' : `https://lkyl.dianpusoft.cn`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Content-Type' : `application/json`, - 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, - 'Host' : `lkyl.dianpusoft.cn`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'token' : token - } - } - $.get(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data) - data = JSON.parse(data); - //console.log(data.head.msg) - for (let i in data.body) { - if (list.includes(data.body[i].id)) continue; - if (type === 6) await task_record(funArr[type],`${data.body[i].id}/${id}`) - if (type === 7) await task_record(funArr[type],`${id}/${data.body[i].id}`) - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - - -//做任务 -function task_record(functionid,id,timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}ssjj-task-record/${functionid}/${id}/?body=%7B%7D`, - headers : { - 'Origin' : `https://lkyl.dianpusoft.cn`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Content-Type' : `application/json`, - 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, - 'Host' : `lkyl.dianpusoft.cn`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'token' : token - } - } - //console.log(url.url) - $.get(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data) - data = JSON.parse(data); - console.log(data.head.msg) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//查询抽奖 -function queryDraw(timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}ssjj-draw-center/queryDraw?body=%7B%7D`, - headers : { - 'Origin' : `https://lkyl.dianpusoft.cn`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Content-Type' : `application/json`, - 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, - 'Host' : `lkyl.dianpusoft.cn`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'token' : token - } - } - $.get(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data) - data = JSON.parse(data); - if (data.head.code !== 200) { - console.log(typeof data.body !== 'undefined' ? data.body.name : data.head.msg) - merge.draw.notify += (typeof data.body !== 'undefined' ? data.body.name : data.head.msg) + ";"; - return - } - if (data.body.freeDrawCount > 0) { - console.log('开始免费抽奖') - await draw(data.body.center.id) - } else { - merge.draw.notify = '免费次数已用完;'; - console.log('免费次数已用完') - } - if (doPaidDraw) { - console.log('您选择了窝币抽奖') - while (!merge.stopDraw) { - await draw(data.body.center.id) - } - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} -//抽奖 -function draw(id,timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `${JD_API_HOST}ssjj-draw-record/draw/${id}?body=%7B%7D`, - headers : { - 'Origin' : `https://lkyl.dianpusoft.cn`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Content-Type' : `application/json`, - 'Referer' : `https://lkyl.dianpusoft.cn/client/?lkEPin=`, - 'Host' : `lkyl.dianpusoft.cn`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn`, - 'token' : token - } - } - $.get(url, async (err, resp, data) => { - try { - if (printDetail) console.log(data) - data = JSON.parse(data); - if (data.head.code !== 200) merge.stopDraw = true - console.log(typeof data.body !== 'undefined' ? data.body.name : data.head.msg) - merge.draw.notify += (typeof data.body !== 'undefined' ? data.body.name : data.head.msg) + ";"; - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//获取userName -function encrypt(timeout = 0){ - return new Promise((resolve) => { - setTimeout( ()=>{ - let url = { - url : `https://jdhome.m.jd.com/saas/framework/encrypt/pin?appId=6d28460967bda11b78e077b66751d2b0`, - headers : { - 'Origin' : `https://jdhome.m.jd.com`, - 'Cookie' : cookie, - 'Connection' : `keep-alive`, - 'Accept' : `application/json`, - 'Referer' : `https://jdhome.m.jd.com/dist/taro/index.html/`, - 'Host' : `jdhome.m.jd.com`, - 'Accept-Encoding' : `gzip, deflate, br`, - 'Accept-Language' : `zh-cn` - } - } - $.post(url, async (err, resp, data) => { - try { - if (err) { - console.log(err.error) - merge.fail = `请求jdhome.m.jd.com失败:${err.error}\n请更换网络环境重试!` - return - } - if (printDetail) console.log(data) - data = JSON.parse(data); - if (data.success) { - userName = data.data; - await login() - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - },timeout) - }) -} - -//初始化 -function initial() { - merge = { - nickname: "", - enabled: true, - newUser: false, - stopDraw: false, - jdBeans: {prizeDesc : "兑换|京豆|个",isNumber : true,fixed : 0}, - draw : {prizeDesc : "抽奖结果",isNumber : false} - } - for (let i in merge) { - merge[i].success = 0; - merge[i].fail = 0; - merge[i].prizeCount = 0; - merge[i].notify = ""; - merge[i].show = true; - } -} -//通知 -function msgShow() { - let message = ""; - let url ={ "open-url" : `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22${encodeURIComponent('https://lkyl.dianpusoft.cn/client/?lkEPin='+userName+'&token='+token)}%22%20%7D`} - let title = `京东账号:${merge.nickname}`; - if (merge.draw.notify.split(";").length >3) { - merge.draw.notify = merge.draw.notify.replace("今日没有抽奖次数;",""); - } - merge.draw.notify = merge.draw.notify.substr(0,merge.draw.notify.length -1) - if (merge.end) { - message += `当前窝币:${merge.end}\n` - message += merge.end === merge.start ? `` : `本次新增:${merge.end - merge.start}\n` - message += merge.draw.prizeDesc +':'+merge.draw.notify +'\n' - message += `请点击通知跳转至APP查看` - } else { - if (typeof merge.fail === "undefined") - message += `您的账户尚未开通东东小窝,请先点击通知进入开通` - else - message += merge.fail - } - $.msg($.name, title, message, url); -} - - -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,g=-8){ let f=new Date().getTimezoneOffset();let d=new Date().getTime()+ f * 60 * 1000 - (g * 60 * 60 * 1000); let n = new Date(d);let e={"M+":n.getMonth()+1,"d+":n.getDate(),"H+":n.getHours(),"m+":n.getMinutes(),"s+":n.getSeconds(),"q+":Math.floor((n.getMonth()+3)/3),S:n.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(n.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 aa8f5e1fdfaa2fa15bb1dbaf8f881d707c16b5ae Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 8 Dec 2020 14:35:00 +0800 Subject: [PATCH 153/721] =?UTF-8?q?=E6=B7=BB=E5=8A=A0NOW=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/NOWLIVE.js | 105 +++++++++++++++++++++++++++++++++++++++++ Task/sunert.boxjs.json | 9 ++++ 2 files changed, 114 insertions(+) create mode 100644 Task/NOWLIVE.js diff --git a/Task/NOWLIVE.js b/Task/NOWLIVE.js new file mode 100644 index 0000000000..733578b9e5 --- /dev/null +++ b/Task/NOWLIVE.js @@ -0,0 +1,105 @@ +/* +NOW直播每日签到 + +1.打开APP首页点击"领红包"悬浮球,通知获取签到Cookie成功 +Surge 4.0: +[Script] +NOW直播 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js,script-update-interval=0 +NOW直播 = type=http-request,pattern=https:\/\/now\.qq\.com\/cgi-bin\/task\/welfare\/getUserTasks\?bkn,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js +------------------ +Loon 2.1.0+ +[Script] +# 本地脚本 +cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js, enabled=true, tag=NOWLIVE + +http-request https:\/\/now\.qq\.com\/cgi-bin\/task\/welfare\/getUserTasks\?bkn script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js +----------------- + +#QX 1.0.7+ : +[task_local] +0 9 * * * NOWLIVE.js +[rewrite_local] +https:\/\/now\.qq\.com\/cgi-bin\/task\/welfare\/getUserTasks\?bkn url script-request-header NOWLIVE.js +~~~~~~~~~~~~~~~~~~ + +[MITM] +hostname = now.qq.com + +~~~~~~~~~~~~~~~~ + +*/ +const $ = new Env('NOW直播') +const nowid = $.getdata(`now_qq`) + +const cookieVal =$.getdata(`nowqq_cookie`) + +let isGetCookie = typeof $request !== 'undefined' +if (isGetCookie) { + GetCookie() + $.done() + } else { + !(async() => { + await getsign(); + await signinfo() + })() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) +} +function GetCookie() { +if ($request && $request.method != 'OPTIONS'){ + const signurlVal = $request.url + const nowid = $request.url.match(/bkn=([\d]+)/)[1] + const cookieVal = $request.headers['Cookie']; + $.log(`signurlVal:${signurlVal}`) + $.log(`cookieVal:${cookieVal}`) + if (nowid) $.setdata(nowid, +`now_qq`) + if (cookieVal) $.setdata(cookieVal, `nowqq_cookie`) + $.msg($.name, `获取签到: 成功`, ``) + } +} +//签到 +function getsign() { + return new Promise((resolve, reject) =>{ + let signurl = { + url: `https://now.qq.com/cgi-bin/task/welfare/submitTask?bkn=${nowid}`, + headers: {Cookie: cookieVal,"Referer": "https://now.qq.com/activity/c-annual-redpacket-v5/checkEntry.html"}, + body: `taskId=14&bkn=${nowid}` + } + $.post(signurl, (error, response, data) => { + let result = JSON.parse(data) + if (result.retcode == 0){ + signres = `签到成功🎉` + detail = `获得收益${result.result.rewardList.match(/\"name\"\:"([\u4e00-\u9fa5]+)/)[1]}: ${result.result.rewardList.match(/"num":(\d+)/)[1]}💰 ` + } + else if (result.retcode == -1100){ + signres = result.retmsg + " 本月已签到"+result.result.signCnt+"次" + detail = `` + } + else { + signres = `签到失败❌` + detail = `说明: `+ result.retmsg + } + resolve() + }) + }) +} +function signinfo() { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://now.qq.com/cgi-bin/ambient/get_all?bkn=${nowid}`, + headers: {Cookie: cookieVal,"Referer": "https://now.qq.com/activity/c-annual-redpacket-v5/checkEntry.html"} + } + $.get(infourl, (error, response, data) => { + let result = JSON.parse(data) + if (result.retcode == 0){ + detail += `现金收益: ${result.result.money/100}元 金豆收益: ${result.result.points}` + } + $.msg($.name,signres,detail) + resolve() + }) + }) +} + + +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)} diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 81294dd6f2..10eb37eb59 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -83,6 +83,15 @@ "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png"], "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/sinanews.js" }, + { + "id": "NOWLIVE", + "name": "NOW直播", + "keys": ["now_qq", "nowqq_cookie"], + "author": "@sunert", + "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", + "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], + "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/NOWLIVE.js" + }, { "id": "chinatelecomEnquiry", "name": "电信套餐查询", From eda6aaaff009f5719a3241dfb9b07432a5f2de35 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 8 Dec 2020 14:41:36 +0800 Subject: [PATCH 154/721] --- Task/sunert.boxjs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 10eb37eb59..969c803a04 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -89,7 +89,7 @@ "keys": ["now_qq", "nowqq_cookie"], "author": "@sunert", "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", - "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], + "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/NOWLIVE.js" }, { From 7b7ddc65c19e23f3bba332bcd2a7b8dbbdbaa887 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 8 Dec 2020 20:29:17 +0800 Subject: [PATCH 155/721] update --- Task/NOWLIVE.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Task/NOWLIVE.js b/Task/NOWLIVE.js index 733578b9e5..b04694395f 100644 --- a/Task/NOWLIVE.js +++ b/Task/NOWLIVE.js @@ -40,7 +40,8 @@ if (isGetCookie) { } else { !(async() => { await getsign(); - await signinfo() + await signinfo(); + await daojishiTask() })() .catch((e) => $.logErr(e)) .finally(() => $.done()) @@ -95,11 +96,28 @@ function signinfo() { if (result.retcode == 0){ detail += `现金收益: ${result.result.money/100}元 金豆收益: ${result.result.points}` } - $.msg($.name,signres,detail) + //$.msg($.name,signres,detail) resolve() }) }) } +function daojishiTask() { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://now.qq.com/cgi-bin/task/welfare/STaskClick?name_key=daojishi&auto_start=true&bkn=${nowid}`, + headers: {Cookie: cookieVal,"Referer": "https://now.qq.com/activity/hang-host/hang.html"} + } + $.get(infourl, (error, response, data) => { + let result = JSON.parse(data) + //console.log(data) + if (result.result.retcode == 0){ + //detail += `\n本次收益: ${result.result.new_info.gifts[0].num}元 ` + } + $.msg($.name,signres,detail) + resolve() + }) + }) +} 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 2ed83acad5770a29134c4b103314e65476089f2b Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 8 Dec 2020 21:15:08 +0800 Subject: [PATCH 156/721] --- Task/txnews.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Task/txnews.js b/Task/txnews.js index 93e3116dca..fc8ed63a47 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -136,7 +136,7 @@ if (isGetCookie) { await getTotal(); await showmsg(); if ($.isNode()){ - if (readnum%notifyInterval==0&&Total_Earn.data.wealth[1].title > 2){ + if (readnum%notifyInterval==0&&cashtotal > 2){ await notify.sendNotify($.name,subTile+'\n'+detail) } } @@ -372,7 +372,8 @@ function getTotal() { $.msg("获取收益信息失败‼️", "", error) } else { const Total_Earn = JSON.parse(data) - subTile = '【收益总计】'+ Total_Earn.data.wealth[0].title +'金币 '+"钱包: " + Total_Earn.data.wealth[1].title+'元' + cashtotal =Total_Earn.data.wealth[1].title + subTile = '【收益总计】'+ Total_Earn.data.wealth[0].title +'金币 '+"钱包: " + cashtotal+'元' // $.log("钱包收益共计"+obj.data.wealth[1].title+"元") } resolve() From 0521367b2efa663c3eff54b4daddeb6340fa5a3d Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 03:05:17 +0800 Subject: [PATCH 157/721] --- Task/moji.js | 147 +++++++++++++++++++++++++++++++++++++++++ Task/sunert.boxjs.json | 26 +++++++- 2 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 Task/moji.js diff --git a/Task/moji.js b/Task/moji.js new file mode 100644 index 0000000000..3fa87c1228 --- /dev/null +++ b/Task/moji.js @@ -0,0 +1,147 @@ +/* + + + +*/ +const $ = new Env('墨迹天气') +const City = encodeURIComponent($.getdata('city')||"北京") +const j = $.getdata('citynum')||"1" + +!(async() => { + await SearchCity(); + await Weather(); + await Indexs(); + await showmsg() + })() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + + +function Weather() { + return new Promise((resolve, reject) =>{ + let weatherurl = { + url: `https://co.moji.com/api/weather2/weather?lang=zh&city=${cityid}` + } + $.get(weatherurl, (error, response, data) => { + try { + $.weather = JSON.parse(data); + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + }) +} + +function Indexs() { + return new Promise((resolve, reject) =>{ + let indexsurl = { + url: `https://h5ctywhr.api.moji.com/indexDetail?cityId=${cityid}`, + headers: {}, + body: `{"cityId": ${cityid}}` + } + $.post(indexsurl, (error, response, data) => { +try { + $.index = JSON.parse(data); + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + resolve() + }) + }) +} + + + +function SearchCity() { + return new Promise((resolve) =>{ + let cityurl = { + url: `https://ssch.api.moji.com/citymanage/json/h5/searchCity?keyWord=${City}`, + headers: {}, + } + $.post(cityurl, (error, response, data) => { + let result = JSON.parse(data) + if(result.city_list.length>0){ + console.log("城市或者地区名称及ID序号") + for(i=0; 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)} diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 969c803a04..e3c8cb3deb 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -122,7 +122,7 @@ { "id": "TVlist", "name": "电视预告", - "keys": [], + "keys": ["c"], "settings": [{ "id": "c", "name": "电视台", @@ -134,6 +134,30 @@ "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/tvpreview.js" }, + { + "id": "moji", + "name": "墨迹天气", + "keys": ["city","citynum"], + "settings": [{ + "id": "city", + "name": "城市", + "val": "北京", + "type": "text", + "desc": "请填写中文地区" + }, + . { + "id": "citynum", + "name": "城市序号", + "val": "1", + "type": "number", + "placeholder": "默认1 (点击以展开说明)", + "desc": "选择地区,请填写日志内冒号前的数字序号" + }], + "author": "@sunert", + "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/moji.js", + "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], + "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/moji.js" + }, { "id": "mydigit", "name": "数码之家", From 6380214db6cf57ca66c239c4fde9618e0970e02a Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 03:10:05 +0800 Subject: [PATCH 158/721] --- Task/sunert.boxjs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index e3c8cb3deb..7bf8080d8b 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -145,7 +145,7 @@ "type": "text", "desc": "请填写中文地区" }, - . { + { "id": "citynum", "name": "城市序号", "val": "1", From ad051d7ba22b862b4db29dd977a48817e8dc9f6a Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 03:27:34 +0800 Subject: [PATCH 159/721] --- Task/moji.js | 6 +++++- Task/sunert.boxjs.json | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index 3fa87c1228..64ca30fbb4 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -6,6 +6,7 @@ const $ = new Env('墨迹天气') const City = encodeURIComponent($.getdata('city')||"北京") const j = $.getdata('citynum')||"1" +const reduction = $.getdata('cut') || true !(async() => { await SearchCity(); @@ -137,7 +138,10 @@ for ( Hourlyweather of $.weather.data.hourly){ indexLevelDesc =indexdata.indexLevelDesc indexDesc = indexdata.indexDesc console.log("\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ) - $.desc += " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n "+indexDesc+"\n" + $.desc += " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n" + if (!reduction){ + $.desc +=indexDesc+"\n" + } } } $.sub = "【今日天气】" diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 7bf8080d8b..6c3ade95d1 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -145,10 +145,17 @@ "type": "text", "desc": "请填写中文地区" }, + { + "id": "cut", + "name": "精简模式", + "val": true, + "type": "boolean", + "desc": "取消详情描述,默认打开" + }, { "id": "citynum", "name": "城市序号", - "val": "1", + "val": "", "type": "number", "placeholder": "默认1 (点击以展开说明)", "desc": "选择地区,请填写日志内冒号前的数字序号" From d3e0987f4fd2e079ba833371a8107dd18bdaa330 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 09:32:53 +0800 Subject: [PATCH 160/721] --- Task/txnews.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/txnews.js b/Task/txnews.js index fc8ed63a47..bb8ffc2cbd 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -328,7 +328,7 @@ function Redpack() { return new Promise((resolve, reject) => { setTimeout(()=>{ const cashUrl = { - url: `${TX_HOST}activity/redpack/get?isJailbreak=0&${ID}`, + url: `${TX_HOST}activity/redpack/get?isJailbreak=0&mac=${token}`, headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded","User-Agent": "QQNews/6.3.40 (iPhone; iOS 14.2; Scale/3.00)"}, body: redbody } From f9162fee24b2d5ca2c0307d6ee28016573705588 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 10:08:50 +0800 Subject: [PATCH 161/721] --- Task/moji.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index 64ca30fbb4..9ea7c9c35c 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -92,14 +92,16 @@ function showmsg() { if (weatherstate == "晴") icon = "☀️"; if (weatherstate == "多云") icon = "⛅️"; if (weatherstate == "阴") icon = "☁️"; + if (weatherstate == "雷阵雨") icon = "🌩"; if (weatherstate == "小雨") icon = "💧"; if (weatherstate == "中雨") icon = "💦"; if (weatherstate == "大雨") icon = "🌧"; if (weatherstate == "暴雨") icon = "⛈"; if (weatherstate == "小雪") icon = "🌨"; if (weatherstate == "中雪") icon = "❄️"; - if (weatherstate == "大雪") icon = "☃️"; - if (weatherstate == "暴雪") icon = "⛄️"; + if (weatherstate == "大雪") icon = "⛄️"; + if (weatherstate == "暴雪") icon = "☃️"; + if (weatherstate == "霾") icon = "💭"; //if (weatherstate == "雾") icon = "🌫"; //if (weatherstate == "浮尘") icon = "💨"; //if (weatherstate == "大风") icon = "🌪"; @@ -110,7 +112,7 @@ function showmsg() { nowhum = $.weather.data.humidity //当前湿度 aqidesc = $.weather.data.aqi_desc //空气质量 - $.desc = " "+nowweather +icon+" 温度🌡:"+nowtemp+" 风速🌪:"+ nowwindval + "\n 空气质量🌫:"+aqidesc+" 湿度☔️:"+nowhum+"\n【每周天气】\n" + $.desc = " "+nowweather +icon+" 温度🌡:"+nowtemp+" 风速🌪:"+ nowwindval + "\n 空气质量🌬:"+aqidesc+" 湿度☔️:"+nowhum+"\n【每周天气】\n" for ( Dayweather of $.weather.data.forecast_day){ date = Dayweather.predict_date+ " " +Dayweather.predict_week // 日期 @@ -122,7 +124,6 @@ for ( Dayweather of $.weather.data.forecast_day){ } //$.desc +="【小时天气】\n" for ( Hourlyweather of $.weather.data.hourly){ - hours = Hourlyweather.temperature.hour hourweather = Hourlyweather.temperature.condition hourWinds = Hourlyweather.wind.wind_desc.winddir+Hourlyweather.wind.wind_desc.value+ Hourlyweather.wind.wind_desc.unit From c09851bb5126142a31546087719ee1a7b07df85d Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 10:13:11 +0800 Subject: [PATCH 162/721] create moji.js --- Task/moji.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Task/moji.js b/Task/moji.js index 9ea7c9c35c..3a4204bb8b 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -132,16 +132,18 @@ for ( Hourlyweather of $.weather.data.hourly){ //console.log(" "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds) } if ($.index.code == 0){ + if (!reduction){ $.desc += "【生活指数】\n" + } for (indexdata of $.index.indexs){ indexType = indexdata.indexType indexLevel = indexdata.indexLevel indexLevelDesc =indexdata.indexLevelDesc indexDesc = indexdata.indexDesc - console.log("\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ) $.desc += " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n" if (!reduction){ $.desc +=indexDesc+"\n" + console.log("\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ) } } } From 77c2f646bb17bbc4c7ed92eb892934af7abe38f8 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 10:16:01 +0800 Subject: [PATCH 163/721] fix --- Task/moji.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index 3a4204bb8b..383d4dee39 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -132,9 +132,7 @@ for ( Hourlyweather of $.weather.data.hourly){ //console.log(" "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds) } if ($.index.code == 0){ - if (!reduction){ $.desc += "【生活指数】\n" - } for (indexdata of $.index.indexs){ indexType = indexdata.indexType indexLevel = indexdata.indexLevel @@ -143,7 +141,7 @@ for ( Hourlyweather of $.weather.data.hourly){ $.desc += " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n" if (!reduction){ $.desc +=indexDesc+"\n" - console.log("\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ) + console.log("【生活指数】\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ) } } } From b0e521017dc43159731bbaef2c8ac1eed4c25c1a Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 10:57:24 +0800 Subject: [PATCH 164/721] =?UTF-8?q?update=20=20=E5=A2=A8=E8=BF=B9=E5=A4=A9?= =?UTF-8?q?=E6=B0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/moji.js | 11 ++++++----- Task/sunert.boxjs.json | 17 +++++++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index 383d4dee39..63d8886094 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -1,6 +1,5 @@ /* - - +支持boxjs手动修改位置,可直接输入中文地区名 */ const $ = new Env('墨迹天气') @@ -111,8 +110,10 @@ function showmsg() { nowwindval = $.weather.data.wind_desc.winddir+$.weather.data.wind_desc.value+$.weather.data.wind_desc.unit //当前风速 nowhum = $.weather.data.humidity //当前湿度 aqidesc = $.weather.data.aqi_desc //空气质量 - - $.desc = " "+nowweather +icon+" 温度🌡:"+nowtemp+" 风速🌪:"+ nowwindval + "\n 空气质量🌬:"+aqidesc+" 湿度☔️:"+nowhum+"\n【每周天气】\n" + sunrise = $.weather.data.sunset.sunrise + sundown = $.weather.data.sunset.sundown + daytemp = $.weather.data.forecast_day[0].temp_low.value+"℃"+"-"+$.weather.data.forecast_day[0].temp_high.value+"℃" + $.desc = " 当天温度: "+daytemp+" 当前温度🌡:"+nowtemp+"\n "+nowweather +icon+" 风速🌪:"+ nowwindval + "\n 空气质量🌬:"+aqidesc+" 湿度☔️:"+nowhum+"\n 日出时间:"+sunrise+"\n 日落时间:"+sundown+"\n【每周天气】\n" for ( Dayweather of $.weather.data.forecast_day){ date = Dayweather.predict_date+ " " +Dayweather.predict_week // 日期 @@ -146,7 +147,7 @@ for ( Hourlyweather of $.weather.data.hourly){ } } $.sub = "【今日天气】" - $.msg($.weather.data.city+"天气预报",$.sub, $.desc) + $.msg($.weather.data.city+$.weather.data.forecast_day[0].predict_date +$.weather.data.forecast_day[0].predict_week+" 天气预报 ",$.sub, $.desc) } 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)} diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 6c3ade95d1..beda777aa0 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -145,13 +145,6 @@ "type": "text", "desc": "请填写中文地区" }, - { - "id": "cut", - "name": "精简模式", - "val": true, - "type": "boolean", - "desc": "取消详情描述,默认打开" - }, { "id": "citynum", "name": "城市序号", @@ -159,7 +152,15 @@ "type": "number", "placeholder": "默认1 (点击以展开说明)", "desc": "选择地区,请填写日志内冒号前的数字序号" - }], + }, + { + "id": "cut", + "name": "精简模式", + "val": true, + "type": "boolean", + "desc": "取消详情描述,默认打开" + } + ], "author": "@sunert", "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/moji.js", "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], From e9780e9ec958acc4582787cddb2b6a6e183e8fa4 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 11:01:30 +0800 Subject: [PATCH 165/721] --- Task/NOWLIVE.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/NOWLIVE.js b/Task/NOWLIVE.js index b04694395f..4d8e48284f 100644 --- a/Task/NOWLIVE.js +++ b/Task/NOWLIVE.js @@ -71,7 +71,7 @@ function getsign() { let result = JSON.parse(data) if (result.retcode == 0){ signres = `签到成功🎉` - detail = `获得收益${result.result.rewardList.match(/\"name\"\:"([\u4e00-\u9fa5]+)/)[1]}: ${result.result.rewardList.match(/"num":(\d+)/)[1]}💰 ` + detail = `获得收益${result.result.rewardList.match(/\"name\"\:"([\u4e00-\u9fa5]+)/)[1]}: ${result.result.rewardList.match(/"num":(\d+)/)[1]}💰 \n` } else if (result.retcode == -1100){ signres = result.retmsg + " 本月已签到"+result.result.signCnt+"次" @@ -79,7 +79,7 @@ function getsign() { } else { signres = `签到失败❌` - detail = `说明: `+ result.retmsg + detail = `说明: `+ result.retmsg+"\n" } resolve() }) From a6314942bfa3f477c54b270ff9b4e994f5239207 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 12:51:06 +0800 Subject: [PATCH 166/721] --- Task/moji.js | 41 ++++++++++++++++++++++------------------- Task/sunert.boxjs.json | 25 +++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index 63d8886094..8939c96a19 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -4,9 +4,12 @@ */ const $ = new Env('墨迹天气') const City = encodeURIComponent($.getdata('city')||"北京") -const j = $.getdata('citynum')||"1" -const reduction = $.getdata('cut') || true - +const j = $.getdata('citynum')||"1"; +let reduction = $.getdata('cut') || false; +let daylys = $.getdata('day_desc') || false, + hourlys = $.getdata('hour_desc') || false, + indexs = $.getdata('index_desc') || false; + !(async() => { await SearchCity(); await Weather(); @@ -104,7 +107,7 @@ function showmsg() { //if (weatherstate == "雾") icon = "🌫"; //if (weatherstate == "浮尘") icon = "💨"; //if (weatherstate == "大风") icon = "🌪"; - console.log("\n您的地区为〈"+$.weather.data.city+"〉\n") + console.log("\n您的地区为〈"+$.weather.data.city+"〉") nowweather = $.weather.data.weather_desc //当前天气 nowtemp = $.weather.data.temp.value+$.weather.data.temp.unit //当前温度 nowwindval = $.weather.data.wind_desc.winddir+$.weather.data.wind_desc.value+$.weather.data.wind_desc.unit //当前风速 @@ -113,37 +116,37 @@ function showmsg() { sunrise = $.weather.data.sunset.sunrise sundown = $.weather.data.sunset.sundown daytemp = $.weather.data.forecast_day[0].temp_low.value+"℃"+"-"+$.weather.data.forecast_day[0].temp_high.value+"℃" - $.desc = " 当天温度: "+daytemp+" 当前温度🌡:"+nowtemp+"\n "+nowweather +icon+" 风速🌪:"+ nowwindval + "\n 空气质量🌬:"+aqidesc+" 湿度☔️:"+nowhum+"\n 日出时间:"+sunrise+"\n 日落时间:"+sundown+"\n【每周天气】\n" + $.desc = " 当天温度: "+daytemp+" 当前温度🌡:"+nowtemp+"\n "+nowweather +icon+" 风速🌪:"+ nowwindval + "\n 空气质量🌬:"+aqidesc+" 湿度☔️:"+nowhum+"\n 日出时间:"+sunrise+"\n 日落时间:"+sundown+"\n" + $.desc += !daylys ? "【每周天气】\n":"" -for ( Dayweather of $.weather.data.forecast_day){ + for ( Dayweather of $.weather.data.forecast_day){ date = Dayweather.predict_date+ " " +Dayweather.predict_week // 日期 Daysweather = Dayweather.weather_desc_day //当日天气 Winds = Dayweather.wind_desc_day.winddir+Dayweather.wind_desc_day.value+ Dayweather.wind_desc_day.unit //当日风速 temps = Dayweather.temp_low.value+Dayweather.temp_low.unit+"至"+Dayweather.temp_high.value+Dayweather.temp_high.unit //当日温度 - //console.log(" "+ date+" "+Daysweather+" "+ temps+" "+Winds) - $.desc += " "+date+" "+Daysweather+" "+ temps+" "+Winds+"\n" - } - //$.desc +="【小时天气】\n" + //console.log(reduction) + !reduction ? $.log(" "+ date+" "+Daysweather+" "+ temps+" "+Winds):"" + $.desc += !daylys ? " "+date+" "+Daysweather+" "+ temps+" "+Winds+"\n":"" + }; + $.desc += hourlys ? "【小时预报】\n":"" for ( Hourlyweather of $.weather.data.hourly){ hours = Hourlyweather.temperature.hour hourweather = Hourlyweather.temperature.condition hourWinds = Hourlyweather.wind.wind_desc.winddir+Hourlyweather.wind.wind_desc.value+ Hourlyweather.wind.wind_desc.unit hourtemps = Hourlyweather.temperature.temp.value+Hourlyweather.temperature.temp.unit - //$.desc += " "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds +"\n" - //console.log(" "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds) - } + $.desc += hourlys ? " "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds +"\n":"" + !reduction ? $.log(" "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds):"" + + } if ($.index.code == 0){ - $.desc += "【生活指数】\n" + $.desc += !indexs ? "【生活指数】\n":"" for (indexdata of $.index.indexs){ indexType = indexdata.indexType indexLevel = indexdata.indexLevel indexLevelDesc =indexdata.indexLevelDesc indexDesc = indexdata.indexDesc - $.desc += " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n" - if (!reduction){ - $.desc +=indexDesc+"\n" - console.log("【生活指数】\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ) - } + $.desc += !indexs ? " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n":"" + !reduction ? console.log("\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ):""; } } $.sub = "【今日天气】" diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index beda777aa0..63ae226856 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -137,7 +137,7 @@ { "id": "moji", "name": "墨迹天气", - "keys": ["city","citynum"], + "keys": ["city","citynum","cut","day_desc","hour_desc","index_desc"], "settings": [{ "id": "city", "name": "城市", @@ -155,10 +155,31 @@ }, { "id": "cut", - "name": "精简模式", + "name": "精简日志模式", "val": true, "type": "boolean", "desc": "取消详情描述,默认打开" + }, + { + "id": "day_desc", + "name": "每周天气预报", + "val": false, + "type": "boolean", + "desc": "每周天气接口,可显示6天天气情况" + }, + { + "id": "hour_desc", + "name": "小时天气预报", + "val": false, + "type": "boolean", + "desc": "每周天气接口,可显示6天天气情况" + }, + { + "id": "index_desc", + "name": "生活指数", + "val": false, + "type": "boolean", + "desc": "可显示生活指数情况" } ], "author": "@sunert", From f061fef31eed3ba52a7030a0bf7c154f9869b1e5 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 13:18:30 +0800 Subject: [PATCH 167/721] --- Task/sunert.boxjs.json | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 63ae226856..78298edc98 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -161,26 +161,21 @@ "desc": "取消详情描述,默认打开" }, { - "id": "day_desc", - "name": "每周天气预报", - "val": false, - "type": "boolean", - "desc": "每周天气接口,可显示6天天气情况" - }, - { - "id": "hour_desc", - "name": "小时天气预报", - "val": false, - "type": "boolean", - "desc": "每周天气接口,可显示6天天气情况" - }, - { - "id": "index_desc", - "name": "生活指数", - "val": false, - "type": "boolean", - "desc": "可显示生活指数情况" - } + "id": "weatherapi", + "name": "天气接口", + "val": "", + "type": "checkboxes", + "desc": "", + "items": [{ + "key": "day_desc", + "label": "每日天气" + }, + "key": "day_desc", + "label": "小时天气" + }, + "key": "index_desc", + "label": "生活指数" + }] ], "author": "@sunert", "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/moji.js", From f5aaa073ffb79580caa6b635f0a4e55868a227bc Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 13:24:09 +0800 Subject: [PATCH 168/721] --- Task/sunert.boxjs.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 78298edc98..a7b98c6e96 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -170,13 +170,15 @@ "key": "day_desc", "label": "每日天气" }, + { "key": "day_desc", "label": "小时天气" }, + { "key": "index_desc", "label": "生活指数" }] - ], + }], "author": "@sunert", "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/moji.js", "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], From 0f99e7093e783138214b189557f8ed22de44e6d9 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 13:26:56 +0800 Subject: [PATCH 169/721] --- Task/sunert.boxjs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index a7b98c6e96..7272811a1d 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -171,7 +171,7 @@ "label": "每日天气" }, { - "key": "day_desc", + "key": "hour_desc", "label": "小时天气" }, { From d2576851d8e54a9b2ffb98322f84e17b452c9974 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 13:42:46 +0800 Subject: [PATCH 170/721] --- Task/sunert.boxjs.json | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 7272811a1d..680dda4a16 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -161,23 +161,26 @@ "desc": "取消详情描述,默认打开" }, { - "id": "weatherapi", - "name": "天气接口", - "val": "", - "type": "checkboxes", - "desc": "", - "items": [{ - "key": "day_desc", - "label": "每日天气" - }, - { - "key": "hour_desc", - "label": "小时天气" - }, - { - "key": "index_desc", - "label": "生活指数" - }] + "id": "day_desc", + "name": "每周天气", + "val": false, + "type": "boolean", + "desc": "每周天气接口,可显示6天天气情况" + }, + { + "id": "hour_desc", + "name": "小时天气", + "val": false, + "type": "boolean", + "desc": "每周天气接口,可显示6天天气情况" + }, + { + "id": "index_desc", + "name": "生活指数", + "val": false, + "type": "boolean", + "desc": "可显示生活指数情况" + } }], "author": "@sunert", "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/moji.js", From 74004e8de02e871e29e766e4104dd6136319ddb5 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 13:43:58 +0800 Subject: [PATCH 171/721] --- Task/sunert.boxjs.json | 1 - 1 file changed, 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 680dda4a16..bb646adfb4 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -180,7 +180,6 @@ "val": false, "type": "boolean", "desc": "可显示生活指数情况" - } }], "author": "@sunert", "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/moji.js", From d1f437484acb271cdca721d96174344cedb4c6e2 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 14:07:25 +0800 Subject: [PATCH 172/721] --- Task/sunert.boxjs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index bb646adfb4..78d62b081b 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -163,7 +163,7 @@ { "id": "day_desc", "name": "每周天气", - "val": false, + "val": true, "type": "boolean", "desc": "每周天气接口,可显示6天天气情况" }, @@ -172,12 +172,12 @@ "name": "小时天气", "val": false, "type": "boolean", - "desc": "每周天气接口,可显示6天天气情况" + "desc": "未来24小时天气情况" }, { "id": "index_desc", "name": "生活指数", - "val": false, + "val": true, "type": "boolean", "desc": "可显示生活指数情况" }], From a1cc08268fbd6b95626e2244694c4633e31bf191 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 14:13:05 +0800 Subject: [PATCH 173/721] --- Task/moji.js | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index 8939c96a19..ad3c30bc27 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -1,6 +1,6 @@ /* 支持boxjs手动修改位置,可直接输入中文地区名 - +更新时间 2020-12-09 14:12 */ const $ = new Env('墨迹天气') const City = encodeURIComponent($.getdata('city')||"北京") @@ -117,26 +117,35 @@ function showmsg() { sundown = $.weather.data.sunset.sundown daytemp = $.weather.data.forecast_day[0].temp_low.value+"℃"+"-"+$.weather.data.forecast_day[0].temp_high.value+"℃" $.desc = " 当天温度: "+daytemp+" 当前温度🌡:"+nowtemp+"\n "+nowweather +icon+" 风速🌪:"+ nowwindval + "\n 空气质量🌬:"+aqidesc+" 湿度☔️:"+nowhum+"\n 日出时间:"+sunrise+"\n 日落时间:"+sundown+"\n" - $.desc += !daylys ? "【每周天气】\n":"" - + if(daylys== 'true'){ + $.desc += "【每周天气】\n" + } for ( Dayweather of $.weather.data.forecast_day){ date = Dayweather.predict_date+ " " +Dayweather.predict_week // 日期 Daysweather = Dayweather.weather_desc_day //当日天气 Winds = Dayweather.wind_desc_day.winddir+Dayweather.wind_desc_day.value+ Dayweather.wind_desc_day.unit //当日风速 temps = Dayweather.temp_low.value+Dayweather.temp_low.unit+"至"+Dayweather.temp_high.value+Dayweather.temp_high.unit //当日温度 - //console.log(reduction) - !reduction ? $.log(" "+ date+" "+Daysweather+" "+ temps+" "+Winds):"" - $.desc += !daylys ? " "+date+" "+Daysweather+" "+ temps+" "+Winds+"\n":"" + if(reduction== 'true') {$.log(" "+ date+" "+Daysweather+" "+ temps+" "+Winds) + } + if(daylys== 'true'){ + $.desc += " "+date+" "+Daysweather+" "+ temps+" "+Winds+"\n" + } }; - $.desc += hourlys ? "【小时预报】\n":"" + if(hourlys == 'true'){ + $.desc += "【小时预报】\n" + } for ( Hourlyweather of $.weather.data.hourly){ hours = Hourlyweather.temperature.hour hourweather = Hourlyweather.temperature.condition hourWinds = Hourlyweather.wind.wind_desc.winddir+Hourlyweather.wind.wind_desc.value+ Hourlyweather.wind.wind_desc.unit hourtemps = Hourlyweather.temperature.temp.value+Hourlyweather.temperature.temp.unit - $.desc += hourlys ? " "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds +"\n":"" - !reduction ? $.log(" "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds):"" - + + if(hourlys == 'true'){ + $.desc += " "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds +"\n" + } + if(reduction == 'true') { + $.log(" "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds) + } } if ($.index.code == 0){ $.desc += !indexs ? "【生活指数】\n":"" @@ -146,7 +155,8 @@ for ( Hourlyweather of $.weather.data.hourly){ indexLevelDesc =indexdata.indexLevelDesc indexDesc = indexdata.indexDesc $.desc += !indexs ? " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n":"" - !reduction ? console.log("\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ):""; + if(reduction == 'true'){ console.log("\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ) + } } } $.sub = "【今日天气】" From 0d7beeabcfd7949da770f79fca5b9c648d33a4ff Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 14:25:49 +0800 Subject: [PATCH 174/721] --- Task/moji.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index ad3c30bc27..e22213ce10 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -1,14 +1,14 @@ /* 支持boxjs手动修改位置,可直接输入中文地区名 -更新时间 2020-12-09 14:12 +更新时间 2020-12-09 14:23 */ const $ = new Env('墨迹天气') const City = encodeURIComponent($.getdata('city')||"北京") const j = $.getdata('citynum')||"1"; -let reduction = $.getdata('cut') || false; -let daylys = $.getdata('day_desc') || false, - hourlys = $.getdata('hour_desc') || false, - indexs = $.getdata('index_desc') || false; +let reduction = $.getdata('cut') || false; //日志 +let daylys = $.getdata('day_desc') || true, //每日天气 + hourlys = $.getdata('hour_desc') || false, //小时预报 + indexs = $.getdata('index_desc') || false; //生活指数 !(async() => { await SearchCity(); @@ -148,13 +148,17 @@ for ( Hourlyweather of $.weather.data.hourly){ } } if ($.index.code == 0){ - $.desc += !indexs ? "【生活指数】\n":"" + if(indexs== 'true'){ + $.desc += "【生活指数】\n" + } for (indexdata of $.index.indexs){ indexType = indexdata.indexType indexLevel = indexdata.indexLevel indexLevelDesc =indexdata.indexLevelDesc indexDesc = indexdata.indexDesc - $.desc += !indexs ? " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n":"" + if(indexs== 'true'){ + $.desc += " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n" + } if(reduction == 'true'){ console.log("\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ) } } From 20a9a399872aaa372e17afc7f245fb9d2e1fbfad Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 9 Dec 2020 14:41:28 +0800 Subject: [PATCH 175/721] --- Task/moji.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index e22213ce10..14f61facaa 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -67,7 +67,7 @@ function SearchCity() { } $.post(cityurl, (error, response, data) => { let result = JSON.parse(data) - if(result.city_list.length>0){ + if(result.city_list.length>0 && j<= result.city_list.length){ console.log("城市或者地区名称及ID序号") for(i=0; i Date: Wed, 9 Dec 2020 18:31:37 +0800 Subject: [PATCH 176/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 78d62b081b..29f604564d 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -156,9 +156,9 @@ { "id": "cut", "name": "精简日志模式", - "val": true, + "val": false, "type": "boolean", - "desc": "取消详情描述,默认打开" + "desc": "显示详情描述,默认关闭日志" }, { "id": "day_desc", From c55c9196bae7379ae2f35beb59f21f73c464a885 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 10 Dec 2020 11:38:58 +0800 Subject: [PATCH 177/721] =?UTF-8?q?=E5=87=8F=E5=B0=91=E5=BF=AB=E6=89=8B?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/AUTO_KS.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/AUTO_KS.yml b/.github/workflows/AUTO_KS.yml index d96855d6ed..7ec559992b 100644 --- a/.github/workflows/AUTO_KS.yml +++ b/.github/workflows/AUTO_KS.yml @@ -5,7 +5,7 @@ name: 快手视频 on: workflow_dispatch: schedule: - - cron: '*/30 * * * *' + - cron: '*/30 2,8,16 * * *' watch: types: started jobs: From 71e6aae4bcaf6ea817bc05983dd190b526646958 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 10 Dec 2020 20:14:18 +0800 Subject: [PATCH 178/721] Update moji.js --- Task/moji.js | 122 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 85 insertions(+), 37 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index 14f61facaa..f70ca1f8fa 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -1,6 +1,6 @@ /* 支持boxjs手动修改位置,可直接输入中文地区名 -更新时间 2020-12-09 14:23 +更新时间 2020-12-18 20:13 */ const $ = new Env('墨迹天气') const City = encodeURIComponent($.getdata('city')||"北京") @@ -52,7 +52,6 @@ try { } finally { resolve() } - resolve() }) }) } @@ -78,7 +77,7 @@ function SearchCity() { cityid = result.city_list[j-1].cityId cityname = result.city_list[j-1].name province = result.city_list[j-1].pname - }else { + } else { $.msg($.name,"地区有误或者无此地区天气情况") return } @@ -86,27 +85,71 @@ function SearchCity() { }) }) } +function mapSkycon(skycon) { + const map = { + "晴": [ + "☀️ 晴朗", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/CLEAR_DAY.gif", + ], + "多云": [ + "⛅️ 多云", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/PARTLY_CLOUDY_DAY.gif", + ], + "阴": [ + "☁️ 阴天", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/CLOUDY.gif", + ], + "霾": [ + "😤 雾霾", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/HAZE.gif", + ], + "雷阵雨": [ + "⛈ 雷阵雨", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/STORM_RAIN.gif", + ], + "小雨": [ + "💧 小雨", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/LIGHT.gif", + ], + "中雨": [ + "💦 中雨", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/MODERATE_RAIN.gif", + ], + "大雨": [ + "🌧 大雨", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/STORM_RAIN.gif", + ], + "暴雨": [ + "⛈ 暴雨", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/STORM_RAIN.gif", + ], + "小雪": [ + "🌨 小雪", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/LIGHT_SNOW.gif", + ], + "中雪": [ + "❄️ 中雪", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/MODERATE_SNOW.gif", + ], + "大雪": [ + "☃️ 大雪", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/HEAVY_SNOW.gif", + ], + "暴雪": [ + "⛄️暴雪", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/HEAVY_SNOW", + ], + //FOG: ["🌫️ 雾"], + //DUST: ["💨 浮尘"], + //SAND: ["💨 沙尘"], + //WIND: ["🌪 大风"], + }; + return map[skycon]; +} function showmsg() { - let icon = "❓" - const weatherstate = $.weather.data.weather_desc - if (weatherstate == "晴") icon = "☀️"; - if (weatherstate == "多云") icon = "⛅️"; - if (weatherstate == "阴") icon = "☁️"; - if (weatherstate == "雷阵雨") icon = "🌩"; - if (weatherstate == "小雨") icon = "💧"; - if (weatherstate == "中雨") icon = "💦"; - if (weatherstate == "大雨") icon = "🌧"; - if (weatherstate == "暴雨") icon = "⛈"; - if (weatherstate == "小雪") icon = "🌨"; - if (weatherstate == "中雪") icon = "❄️"; - if (weatherstate == "大雪") icon = "⛄️"; - if (weatherstate == "暴雪") icon = "☃️"; - if (weatherstate == "霾") icon = "💭"; - //if (weatherstate == "雾") icon = "🌫"; - //if (weatherstate == "浮尘") icon = "💨"; - //if (weatherstate == "大风") icon = "🌪"; + let icon = "❓" console.log("\n您的地区为〈"+$.weather.data.city+"〉") nowweather = $.weather.data.weather_desc //当前天气 nowtemp = $.weather.data.temp.value+$.weather.data.temp.unit //当前温度 @@ -116,35 +159,39 @@ function showmsg() { sunrise = $.weather.data.sunset.sunrise sundown = $.weather.data.sunset.sundown daytemp = $.weather.data.forecast_day[0].temp_low.value+"℃"+"-"+$.weather.data.forecast_day[0].temp_high.value+"℃" - $.desc = " 当天温度: "+daytemp+" 当前温度🌡:"+nowtemp+"\n "+nowweather +icon+" 风速🌪:"+ nowwindval + "\n 空气质量🌬:"+aqidesc+" 湿度☔️:"+nowhum+"\n 日出时间:"+sunrise+"\n 日落时间:"+sundown+"\n" + $.desc = " 当天温度: "+daytemp+" 实时温度🌡:"+nowtemp+"\n " +` 天气: ${mapSkycon(nowweather)[0]}`+" 风速🌪:"+ nowwindval + "\n 空气质量🌬:"+aqidesc+" 湿度☔️:"+nowhum+"\n" if(daylys== 'true'){ $.desc += "【每周天气】\n" } for ( Dayweather of $.weather.data.forecast_day){ - date = Dayweather.predict_date+ " " +Dayweather.predict_week // 日期 + week = Dayweather.predict_week // 日期 + date = Dayweather.predict_date + Daysweather = Dayweather.weather_desc_day //当日天气 Winds = Dayweather.wind_desc_day.winddir+Dayweather.wind_desc_day.value+ Dayweather.wind_desc_day.unit //当日风速 temps = Dayweather.temp_low.value+Dayweather.temp_low.unit+"至"+Dayweather.temp_high.value+Dayweather.temp_high.unit //当日温度 if(reduction== 'true') {$.log(" "+ date+" "+Daysweather+" "+ temps+" "+Winds) } if(daylys== 'true'){ - $.desc += " "+date+" "+Daysweather+" "+ temps+" "+Winds+"\n" + $.desc += " "+week+" "+mapSkycon(Daysweather)[0]+" "+ temps+" "+Winds+"\n" } }; if(hourlys == 'true'){ - $.desc += "【小时预报】\n" + $.desc += "【未来6小时变化预报】\n" } -for ( Hourlyweather of $.weather.data.hourly){ - hours = Hourlyweather.temperature.hour - hourweather = Hourlyweather.temperature.condition - hourWinds = Hourlyweather.wind.wind_desc.winddir+Hourlyweather.wind.wind_desc.value+ Hourlyweather.wind.wind_desc.unit - hourtemps = Hourlyweather.temperature.temp.value+Hourlyweather.temperature.temp.unit - - if(hourlys == 'true'){ - $.desc += " "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds +"\n" + for ( i=0;i <6 ;i++){ + Hourlyweather = $.weather.data.hourly + hours = Hourlyweather[i].temperature.hour + hourweather = Hourlyweather[i].temperature.condition + hourWinds = Hourlyweather[i].wind.wind_desc.winddir+Hourlyweather[i].wind.wind_desc.value+ Hourlyweather[i].wind.wind_desc.unit + hourtemps = Hourlyweather[i].temperature.temp.value+Hourlyweather[i].temperature.temp.unit + if(hourlys == 'true'&& i==0 ){ + $.desc += " "+hours+":00 "+mapSkycon(Hourlyweather[i].temperature.condition)[0]+" "+ hourtemps+" "+hourWinds +"\n" + } else if(hourlys == 'true'&& (hourweather != Hourlyweather[i-1].temperature.condition || hourtemps != Hourlyweather[i-1].temperature.temp.value+"℃")){ + $.desc += " "+hours+":00 "+mapSkycon(Hourlyweather[i].temperature.condition)[0]+" "+ hourtemps+" "+hourWinds +"\n" } if(reduction == 'true') { - $.log(" "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds) + $.log(" "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds) } } if ($.index.code == 0){ @@ -157,14 +204,15 @@ for ( Hourlyweather of $.weather.data.hourly){ indexLevelDesc =indexdata.indexLevelDesc indexDesc = indexdata.indexDesc if(indexs== 'true'){ - $.desc += " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n" + $.desc += " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n" } if(reduction == 'true'){ console.log("\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ) } } } - $.sub = "【今日天气】" - $.msg($.weather.data.city+$.weather.data.forecast_day[0].predict_date +$.weather.data.forecast_day[0].predict_week+" 天气预报 ",$.sub, $.desc) + $.sub = "【今日天气】" +`${mapSkycon(nowweather)[0]}` + $.msg($.weather.data.city +"天气预报 "+date +week,$.sub, $.desc,{"media-url": `${mapSkycon(nowweather)[1]}` + }) } 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 ac8a33e46d6575fb096db266848a9242676c86b3 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 10 Dec 2020 20:15:20 +0800 Subject: [PATCH 179/721] Update moji.js --- Task/moji.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/moji.js b/Task/moji.js index f70ca1f8fa..ee52f07608 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -1,6 +1,6 @@ /* 支持boxjs手动修改位置,可直接输入中文地区名 -更新时间 2020-12-18 20:13 +更新时间 2020-12-10 20:13 */ const $ = new Env('墨迹天气') const City = encodeURIComponent($.getdata('city')||"北京") From aacea639eff3825adfcd788f57f2effd6ba1d325 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 10 Dec 2020 20:55:44 +0800 Subject: [PATCH 180/721] Update moji.js --- Task/moji.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/moji.js b/Task/moji.js index ee52f07608..c73cff6872 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -211,7 +211,7 @@ function showmsg() { } } $.sub = "【今日天气】" +`${mapSkycon(nowweather)[0]}` - $.msg($.weather.data.city +"天气预报 "+date +week,$.sub, $.desc,{"media-url": `${mapSkycon(nowweather)[1]}` + $.msg($.weather.data.city +"天气预报 "+$.weather.data.forecast_day[0].predict_date +$.weather.data.forecast_day[0].predict_week,$.sub, $.desc,{"media-url": `${mapSkycon(nowweather)[1]}` }) } From fdf7e9baa517147c500fb50073cbfde7d6ce858b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 10 Dec 2020 21:12:19 +0800 Subject: [PATCH 181/721] Update moji.js --- Task/moji.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/moji.js b/Task/moji.js index c73cff6872..6096aadb68 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -99,7 +99,7 @@ function mapSkycon(skycon) { "☁️ 阴天", "https://raw.githubusercontent.com/58xinian/icon/master/Weather/CLOUDY.gif", ], - "霾": [ + "雾": [ "😤 雾霾", "https://raw.githubusercontent.com/58xinian/icon/master/Weather/HAZE.gif", ], From f0f7e491f640e6825d29134a50b93eba5f8bbf14 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 10 Dec 2020 23:03:23 +0800 Subject: [PATCH 182/721] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=9E=E8=AE=BF?= =?UTF-8?q?=E5=A5=96=E5=8A=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 76e691f250..1e2f9130f6 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2020-11-26 10:00 +更新时间: 2020-12-10 23:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 @@ -167,6 +167,7 @@ else if ($.time('HH')>4&&$.time('HH')<8){ await endCard(); } await SevCont(); + await comApp(); await ArticleShare(); await openbox(); await getAdVideo(); @@ -433,16 +434,6 @@ function boxshare() { }) } -function Invitant2() { - return new Promise((resolve, reject) => { - $.post({ url: `${YOUTH_HOST}User/fillCode`,headers: JSON.parse(signheaderVal),body: `{"code": "46746961"}` -}, (error, response, data) => - { - // $.log(`Invitdata:${data}`) - }) - resolve() - }) -} function friendsign(uid) { return new Promise((resolve, reject) => { const url = { @@ -520,7 +511,28 @@ function gameVideo() { }) }) } - +function comApp() { + return new Promise((resolve, reject) => { + const url = { + url: `https://ios.baertt.com/v5/mission/msgRed.json`, + headers: { + 'User-Agent': 'KDApp/1.8.0 (iPhone; iOS 14.2; Scale/3.00)' + }, + body: articlebodyVal, + } + $.post(url, (error, response, data) => { + redres = JSON.parse(data) + if (redres.success == true) { + detail += `【回访奖励】+${redres.items.score}个青豆\n` + }else{ + if(redres.error_code == "100009"){ + //detail += `【回访奖励】${redres.message}\n` + } + } + resolve() + }) + }) +} //阅读奖励 function readArticle() { @@ -722,4 +734,4 @@ async function showmsg() { } } -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 c68523f5d3b299094ccd10083d6b67504c936a75 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 13 Dec 2020 01:45:57 +0800 Subject: [PATCH 183/721] Update youth.js --- Task/youth.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 1e2f9130f6..bcf4ca0547 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2020-12-10 23:00 +更新时间: 2020-12-12 23:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 @@ -175,7 +175,11 @@ else if ($.time('HH')>4&&$.time('HH')<8){ await readArticle(); await Articlered(); await readTime(); +for ( i=0;i<5;i++){ + console.log("等待5s进行下一次任务") + await $.wait(5000); await rotary(); +} await rotaryCheck(); await earningsInfo(); await showmsg(); From fd2eee617034f260d3c4d9dab0d286e86333192b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 13 Dec 2020 02:55:47 +0800 Subject: [PATCH 184/721] Update youth.js --- Task/youth.js | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index bcf4ca0547..859ee21f48 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -66,7 +66,7 @@ const $ = new Env("中青看点") let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖每50次通知一次,如需关闭全部通知请设为0 const YOUTH_HOST = "https://kd.youth.cn/WebApi/"; const notify = $.isNode() ? require('./sendNotify') : ''; -let logs = $.getdata('zqlogs')||false, signresult; +let logs = $.getdata('zqlogs')||false, rotaryscore=0,doublerotary=0,signresult; let cookiesArr = [], signheaderVal = '', readArr = [], articlebodyVal ='', timeArr = [], timebodyVal = '', @@ -175,10 +175,28 @@ else if ($.time('HH')>4&&$.time('HH')<8){ await readArticle(); await Articlered(); await readTime(); -for ( i=0;i<5;i++){ +for ( k=0;k<5;k++){ console.log("等待5s进行下一次任务") await $.wait(5000); await rotary(); +if (rotaryres.status == 0) { + rotarynum = ` 转盘${rotaryres.msg}🎉`; + break + } else if(rotaryres.status == 1){ + rotaryscore += rotaryres.data.score + } + if (rotaryres.status == 1 && rotaryres.data.doubleNum !== 0) { + await TurnDouble(); + if (Doubleres.status == 1) { + doublerotary += Doubleres.data.score + } + } +} +if (rotaryres.status == 1) { + detail += `【转盘抽奖】+${rotaryscore}个青豆 剩余${rotaryres.data.remainTurn}次\n` +} +if (rotaryres.status !== 0&&rotaryres.data.doubleNum !== 0){ + detail += `【转盘双倍】+${doublerotary}青豆 剩余${rotaryres.data.doubleNum}次\n` } await rotaryCheck(); await earningsInfo(); @@ -627,14 +645,10 @@ function rotary() { rotaryres = JSON.parse(data) if (rotaryres.status == 1) { rotarytimes = rotaryres.data.remainTurn - detail += `【转盘抽奖】+${rotaryres.data.score}个青豆 剩余${rotaryres.data.remainTurn}次\n` - if (rotaryres.data.doubleNum != 0) { - await TurnDouble(); - } - } - if (rotaryres.code == 10010) { - rotarynum = ` 转盘${rotaryres.msg}🎉` + //rotaryscore = rotaryres.data.score + //detail += `【转盘抽奖】+${rotaryres.data.score}个青豆 剩余${rotaryres.data.remainTurn}次\n` } + resolve(); }) }, s); From 3afe0b11b533a4a06ef050eb21d5b81220959984 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 13 Dec 2020 02:57:15 +0800 Subject: [PATCH 185/721] Update repo_sync.yml --- .github/workflows/repo_sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/repo_sync.yml b/.github/workflows/repo_sync.yml index 68be811884..4655bfcdae 100644 --- a/.github/workflows/repo_sync.yml +++ b/.github/workflows/repo_sync.yml @@ -2,7 +2,7 @@ name: sync-Sunert-scripts on: schedule: - - cron: '1 0,15 * * *' + - cron: '1 0,12,22 * * *' workflow_dispatch: watch: types: started From 5eb98e3bd4ee1619a7d9a90f7b8284e5375d01dc Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 13 Dec 2020 03:20:44 +0800 Subject: [PATCH 186/721] Update youth.js --- Task/youth.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 859ee21f48..b245763e59 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -184,6 +184,7 @@ if (rotaryres.status == 0) { break } else if(rotaryres.status == 1){ rotaryscore += rotaryres.data.score + rotarytimes = rotaryres.data.remainTurn } if (rotaryres.status == 1 && rotaryres.data.doubleNum !== 0) { await TurnDouble(); @@ -642,14 +643,13 @@ function rotary() { body: rotarbody } $.post(url,async (error, response, data) => { - rotaryres = JSON.parse(data) - if (rotaryres.status == 1) { - rotarytimes = rotaryres.data.remainTurn - //rotaryscore = rotaryres.data.score - //detail += `【转盘抽奖】+${rotaryres.data.score}个青豆 剩余${rotaryres.data.remainTurn}次\n` + try{ + rotaryres = JSON.parse(data) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() } - - resolve(); }) }, s); }) @@ -704,16 +704,16 @@ function TurnDouble() { let time = (new Date()).getTime() const url = { url: `${YOUTH_HOST}RotaryTable/toTurnDouble?_=${time}`,headers: JSON.parse(signheaderVal),body: rotarbody} - $.post(url, (error, response, data) => { + $.post(url, (error, response, data) => { + try{ Doubleres = JSON.parse(data) - if (Doubleres.status == 1) { - detail += `【转盘双倍】+${Doubleres.data.score1}青豆 剩余${rotaryres.data.doubleNum}次\n` - }else{ - //detail += `【转盘双倍】失败 ${Doubleres.msg}\n` - + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() } + resolve() }) - resolve() },s) }) } From 77cdd5b790216bfa8769350dc65a59be461e3d9b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 13 Dec 2020 08:43:23 +0800 Subject: [PATCH 187/721] Update moji.js --- Task/moji.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Task/moji.js b/Task/moji.js index 6096aadb68..3cdd152273 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -107,6 +107,10 @@ function mapSkycon(skycon) { "⛈ 雷阵雨", "https://raw.githubusercontent.com/58xinian/icon/master/Weather/STORM_RAIN.gif", ], + "阵雨": [ + "🌦 阵雨", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/LIGHT.gif", + ], "小雨": [ "💧 小雨", "https://raw.githubusercontent.com/58xinian/icon/master/Weather/LIGHT.gif", From 7987f07f7b58699773f5a953ba99b71902918cbc Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 13 Dec 2020 12:41:17 +0800 Subject: [PATCH 188/721] Update dianshijia.js --- Task/dianshijia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/dianshijia.js b/Task/dianshijia.js index e124305909..dfa094d529 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -124,7 +124,7 @@ if (isGetCookie = typeof $request !== 'undefined') { await cashlist(); // 现金列表 await coinlist(); // 金币列表 if ($.isNode() && drawalCode == '0') { - await notify.sendNotify($.name+"提现成功", subTitle+'\n'+ detail) + await notify.sendNotify($.name, subTitle+'\n'+ detail) } } } From 42ce8011ca9259cf3290693e323e366b0d9c5a93 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 13 Dec 2020 22:30:01 +0800 Subject: [PATCH 189/721] =?UTF-8?q?Update=20kuaishou.js=20=E5=85=BC?= =?UTF-8?q?=E5=AE=B9Nodejs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/kuaishou.js | 271 +++++++++++++++++++++++++++++++---------------- 1 file changed, 179 insertions(+), 92 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 637272c1ef..3ee2680eb7 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -1,26 +1,28 @@ /* -更新时间: 2020-09-08 11:45 - -本脚本仅适用于快手极速版签到 -获取Cookie方法: -1.将下方[rewrite_local]和[MITM]地址复制的相应的区域 -下 -2.APP登陆账号后,以下方法获取Cookie -打开设置页面:"积分兑好礼" - -3.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 -仅测试Quantumult x,Surge、Loon自行测试 -by Macsuny -感谢 +更新时间: 2020-12-13 22:30 + +本脚本仅适用于快手双版本签到,注意正式版Cookie签到有时效性,但Cookie仍然可用于签到极速版,即正式版会掉签;极速版Cookie只能用于极速版 +正式版APP获取Cookie方法: + 1.将下方[rewrite_local]地址复制的相应的区域下,无需填写hostname; + 2.打开APP稍等几秒,即可获取Cookie. +极速版获取方法, + 1.把URL的正则改为 https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\?,添加hostname = nebula.kuaishou.com; + 2.点击设置页面的"积分兑好礼"即可 + +兼容Nodejs,把获取的Cookie填入KS_TOKEN,多账号用"&"分开 + +非专业人士制作,欢迎各位大佬提出宝贵意见和指导 +by Sunert +特别感谢 @Chavy @Nobyda ~~~~~~~~~~~~~~~~ Surge 4.0 : [Script] -快手极速版 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js,script-update-interval=0 +快手 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js,script-update-interval=0 -快手极速版 = type=http-request,pattern=https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +快手 = type=http-request,pattern=http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js ~~~~~~~~~~~~~~~~ Loon 2.1.0+ @@ -28,7 +30,7 @@ Loon 2.1.0+ # 本地脚本 cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, enabled=true, tag=快手 -http-request https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +http-request http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js ----------------- @@ -38,126 +40,211 @@ QX 1.0.7+ : [rewrite_local] -https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? url script-request-header kuaishou.js - -~~~~~~~~~~~~~~~~ - -hostname = nebula.kuaishou.com +http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js ~~~~~~~~~~~~~~~~ */ -const logs = 0 //日志开关 -const $ = new Env('快手极速版') -const cookieVal = $.getdata('cookie_ks'); -let isGetCookie = typeof $request !== 'undefined' +const logs = false //日志开关 +const $ = new Env('快手视频') +let cookieArr = []; +if ($.isNode()) { + if (process.env.KS_TOKEN && process.env.KS_TOKEN.indexOf('&') > -1) { + ks_tokens = process.env.KS_TOKEN.split('&'); + } else { + ks_tokens = process.env.KS_TOKEN.split() + }; + Object.keys(ks_tokens).forEach((item) => { + if (ks_tokens[item]) { + cookieArr.push(ks_tokens[item]) + } + }) +} else { + cookieArr.push($.getdata('cookie_ks')) +} +let isGetCookie = typeof $request !== 'undefined' if (isGetCookie) { - GetCookie() + GetCookie(); + $.done() } else { - !(async() => { - await sign(); - await signifo(); - await info(); - await invite() +!(async() => { + if(!cookieArr[0]){ + $.msg($.name, '【提示】🉐登录快手pp获取cookie',"", {"open-url": "https://live.kuaishou.com/fission/offkwai/index?cc=share_copylink&kpf=IPHONE&traceId=27&fid=1570609569&code=3429390431&shareMethod=token&kpn=KUAISHOU&subBiz=INVITE_CODE&shareId=1000517297081&shareToken=X-1oTjAy1OkMhgQk_AO&platform=copylink&shareMode=app&shareObjectId=3429390431"}); + return + } + if ($.isNode()){ + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()}=============\n`) + } + for (let i = 0; i < cookieArr.length; i++) { + if (cookieArr[i]) { + cookieVal = cookieArr[i]; + $.index = i + 1; + console.log(`-------------------------\n\n开始【快手视频账号${$.index}】`) + await speedSign(); + await speedSignifo(); + await speedInfo(); + await officialSign(); + if(offici_code !== 100111){ + await officialSignifo(); + await officialtaskCenter(); + } + await showmsg() + } + } })() .catch((e) => $.logErr(e)) .finally(() => $.done()) } -function GetCookie() { - if ($request.headers) { - var CookieValue = $request.headers['Cookie']; - - if ($.getdata('cookie_ks') != (undefined || null)) { - if ($.getdata('cookie_ks') != CookieValue) { - var cookie = $.setdata(CookieValue, 'cookie_ks'); - if (!cookie) { - $.msg("更新" + $.name + "Cookie失败‼️", "", ""); - $.log(`[${$.name}] 获取Cookie: 失败`); - } else { - $.msg("更新" + $.name + "Cookie成功 🎉", "", ""); - $.log(`[${$.name}] 获取Cookie: 成功, Cookie: ${CookieValue}`) +function officialSign() { + return new Promise((resolve, reject) => { + let signurl = { + url: 'https://activity.m.kuaishou.com/rest/wd/taskCenter/task/signIn', + headers: {Cookie: cookieVal, +'Content-Type': 'application/json;charset=utf-8'}, + body: '{"bizId": 29}' + } + $.post(signurl, (error, response, data) => { + if(logs)$.log(`${$.name}, data: ${data}`) + let officialSign_res = JSON.parse(data) + offici_code = officialSign_res.result + if(offici_code == 109){ + offic_sign = `签到结果: ${officialSign_res.error_msg}`; + $.msg($.name,offic_sign,"") + logs?$.log(`错误信息: ${officialSign_res.error_msg}`):""; + resolve() + return + } else if(offici_code == 100136){ + offic_sign = `签到结果: ${officialSign_res.error_msg}` + if(logs)console.log(""+officialSign_res.error_msg) + } else if(offici_code == 1){ + offic_sign = `签到结果: ✅ +${officialSign_res.reward.rewardCount} 积分` } - } - } else { - var cookie = $.setdata(CookieValue, 'cookie_ks'); - if (!cookie) { - $.msg("首次写入" + $.name + "Cookie失败‼️", "", ""); - } else { - $.msg("首次写入" + $.name + "Cookie成功 🎉", "", ""); - } - } - } else { - $.msg("写入" + $.name + "Cookie失败‼️", "", "配置错误, 无法读取请求头, "); - } -$.done() + resolve() + }) + }) + } + +function officialSignifo() { + return new Promise((resolve, reject) => { + infourl = { + url: 'https://zt.gifshow.com/rest/zt/encourage/account/summary/withKscoinTrial?kpn=KUAISHOU&subBiz=lowActiveUserTaskEncourage', + headers: {Cookie: cookieVal, +'Content-Type': 'application/json;charset=utf-8'},} + $.get(infourl, async(error, response, data) => { + if(logs)$.log(`${$.name}, data: ${data}`) + let _info = JSON.parse(data) + if (_info.result == 1){ + offic_info = `收益: ${_info.data.accounts[0].displayBalance}积分 现金: ${_info.data.accounts[1].displayBalance}元\n` + } + resolve() + }) + }) +} +function officialtaskCenter() { + return new Promise((resolve, reject) => { + let reurl = {url:'https://activity.m.kuaishou.com/rest/wd/taskCenter/task/appStartup/reward', + headers: {Cookie: cookieVal,'Content-Type': 'application/json;charset=utf-8'}, + body: '{"bizId": 29}' + } + $.post(reurl, (error, response, data) =>{ + if(logs)$.log(`${$.name}, data: ${data}`) + let result = JSON.parse(data) + if (result.rewardSuccess == true) { + var rewards = result.reward.accounts + if (typeof result.reward.surpriseRewardCount !== undefined){ + rewards += result.reward.surpriseRewardCount + } + offic_reward = `获得收益: 💵${rewards}积分\n` + } + resolve() + }) + }) } -function sign() { +function speedSign() { return new Promise((resolve, reject) => { let signurl = { url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/sign', headers: {Cookie: cookieVal}} $.get(signurl, (error, response, data) => { - $.log(`${$.name}, data: ${data}`) - let result = JSON.parse(data) - if(result.result == 10007){ - _sign = `签到结果: ${result.error_msg}`; - $.msg($.name,subTitle,''); - if(logs) $.log(`错误信息: ${result.error_msg}`) - } else if(result.result == 10901){ - _sign = `签到结果: ${result.error_msg}` - } else { - _sign = `签到结果: ${result.error_msg}` + if(logs)$.log(`${$.name}, data: ${data}`) + let speed_res = JSON.parse(data) + speed_code = speed_res.result + if(speed_code == 10007){ + speed_sign = `签到结果: ${speed_res.error_msg}`; + $.msg($.name,subTitle,''); + if(logs) $.log(`错误信息: ${speed_res.error_msg}`) + return + } else if(speed_code == 10901){ + speed_sign = `签到结果: ${speed_res.error_msg}` + } else if(speed_code == 1){ + speed_sign = `签到结果: ${speed_res.data.toast}` } resolve() }) }) } -function signifo() { +function speedSignifo() { return new Promise((resolve, reject) => { earnurl = { url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/query', - headers: {Cookie: cookieVal}} + headers: {Cookie: cookieVal, +'Content-Type': 'application/json;charset=utf-8'}, +} $.get(earnurl, (error, response, data) => { if(logs)$.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) if (result.result == '1'){ - detail = `${result.data.nebulaSignInPopup.subTitle}, ${result.data.nebulaSignInPopup.title}\n` + speed_info = `${result.data.nebulaSignInPopup.subTitle}, ${result.data.nebulaSignInPopup.title}\n` } resolve() }) }) } -function info() { +function speedInfo() { return new Promise((resolve, reject) => { let reurl = {url:'https://nebula.kuaishou.com/rest/n/nebula/activity/earn/overview', - headers: {Cookie:cookieVal}} + headers: {Cookie: cookieVal, +'Content-Type': 'application/json;charset=utf-8'},} $.get(reurl, (error, response, data) =>{ if(logs)$.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) if (result.result == 1) { - subTitle = `现金收益: 💵${result.data.allCash}元 金币收益: 💰${result.data.totalCoin}` + speed_rewards = `现金收益: 💵${result.data.allCash}元 金币收益: 💰${result.data.totalCoin}` } - $.msg($.name,subTitle,detail+_sign) resolve() }) }) } -function invite() { - return new Promise((resolve, reject) => { - let invurl = { - url: 'https://nbictssmx.kwairr9aw56vso581r.com/rest/n/nebula/invitation/external/click', - headers: {Cookie: cookieVal, - Host: 'nbictssmx.kwairr9aw56vso581r.com'}, - body: '{"code":"774010415","stage":"launch_app_try_launch","dph":736,"dpw":414,"reader":3,"platform":"copylink"}' - } - $.post(invurl, (error, response, data) => { - if(logs)$.log(`${$.name}, data: ${data}`) - //let result = JSON.parse(data) - }) - resolve() - }) - } - -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 showmsg() { + $.sub ="", $.desc = ""; +if(offici_code==1||offici_code ==100136 ){ + $.desc += `【正式版】:\n `+offic_info+" "+offic_sign +'\n' + } + +if(speed_code==1||speed_code ==10901 ){ + $.desc += `【极速版】:\n `+speed_rewards+"\n "+speed_info+" " +speed_sign + } +$.msg($.name,$.sub,$.desc) +} + +function GetCookie() { + var UA = $request.headers['User-Agent'] + if ($request && $request.method != `OPTIONS`&& UA.indexOf('ksNebula')>-1) { + const cookieVal = $request.headers['Cookie'] + if (cookieVal) $.setdata(cookieVal,'cookie_ks') + $.log(`${$.name} 获取Cookie: 成功,cookieVal: ${cookieVal}`) + $.msg($.name, `获取极速Cookie: 成功🎉`, ``) + } else if ($request && $request.method != `OPTIONS`&& UA.indexOf("ksNebula")==-1) { + const cookie = $request.headers['Cookie'] + cookieVal = cookie.match(/token=[a-z0-9-]+/)[0] + if (cookieVal) $.setdata(cookieVal,'cookie_ks') + $.log(`${$.name} 获取Cookie: 成功,cookieVal: ${cookieVal}`) + $.msg($.name, `获取正式Cookie: 成功🎉`, ``) + } +} + +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 e7156a4a425f309bec4acf59f43a0308a9f40b3c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 13 Dec 2020 22:42:57 +0800 Subject: [PATCH 190/721] Create kuaishou.yml --- .github/workflows/kuaishou.yml | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/kuaishou.yml diff --git a/.github/workflows/kuaishou.yml b/.github/workflows/kuaishou.yml new file mode 100644 index 0000000000..cca58e3bf1 --- /dev/null +++ b/.github/workflows/kuaishou.yml @@ -0,0 +1,41 @@ + +name: 快手视频 + +on: + workflow_dispatch: + schedule: + - cron: ’15 19 * * *‘ + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + KS_TOKEN: ${{ secrets.KS_TOKEN }} + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: ’运行 【快手视频】‘ + if: env.KS_TOKEN + run: | + cd ~/Scripts + node Task/kuaishou.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY || github.event.client_payload.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH || github.event.client_payload.BARK_PUSH }} + BARK_SOUND: ${{ secrets.BARK_SOUND || github.event.client_payload.BARK_SOUND }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN || github.event.client_payload.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID || github.event.client_payload.TG_USER_ID }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN || github.event.client_payload.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET || github.event.client_payload.DD_BOT_SECRET }} + IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY || github.event.client_payload.IGOT_PUSH_KEY }} From ea00a3a24e521a70bfb1a16a896e6335c60a393b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 13 Dec 2020 23:02:42 +0800 Subject: [PATCH 191/721] Update sendNotify.js --- Task/sendNotify.js | 155 +++++++++++++++++++++++++++++++++------------ 1 file changed, 113 insertions(+), 42 deletions(-) diff --git a/Task/sendNotify.js b/Task/sendNotify.js index fa5f091c2b..660b57f555 100644 --- a/Task/sendNotify.js +++ b/Task/sendNotify.js @@ -25,6 +25,8 @@ let DD_BOT_TOKEN = ''; //密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 let DD_BOT_SECRET = ''; //以下为脚本运行通知开关,true为不推送,false为推送通知 +let IGOT_PUSH_KEY = ''; + let txnewsNotifyControl = false;//(默认腾讯新闻脚本推送通知) let youthNotifyControl = false;//(默认中青脚本推送通知) @@ -63,6 +65,11 @@ if (process.env.DD_BOT_TOKEN) { DD_BOT_SECRET = process.env.DD_BOT_SECRET; } } + +if (process.env.IGOT_PUSH_KEY) { + IGOT_PUSH_KEY = process.env.IGOT_PUSH_KEY +} + if (process.env.YOUTH_NOTIFY_CONTROL && process.env.YOUTH_NOTIFY_CONTROL==false) { youthNotifyControl = process.env.YOUTH_NOTIFY_CONTROL; } @@ -81,7 +88,7 @@ async function sendNotify(text, desp) { await ddBotNotify(text, desp) } -function serverNotify(text, desp) { +function serverNotify(text, desp, timeout = 2100) { return new Promise(resolve => { if (SCKEY) { //微信server酱推送通知一个\n不会换行,需要两个\n才能换行,故做此替换 @@ -93,47 +100,57 @@ function serverNotify(text, desp) { 'Content-Type': 'application/x-www-form-urlencoded' } } - $.post(options, (err, resp, data) => { - try { - if (err) { - console.log('\n发送通知调用API失败!!') - } else { - data = JSON.parse(data); - if (data.errno === 0) { - console.log('\nserver酱发送通知消息成功') - } else if (data.errno === 1024) { - console.log('\nPUSH_KEY 错误') + setTimeout(() => { + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('\n发送通知调用API失败!!\n') + console.log(err); + } else { + data = JSON.parse(data); + if (data.errno === 0) { + console.log('\nserver酱发送通知消息成功\n') + } else if (data.errno === 1024) { + console.log('\nPUSH_KEY 错误\n') + } else { + console.log(`server酱发送通知消息异常\n${JSON.stringify(data)}`) + } } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve(data); - } - }) + }) + }, timeout) } else { - console.log('\n您未提供server酱的SCKEY,取消微信推送消息通知'); + console.log('\n您未提供server酱的SCKEY,取消微信推送消息通知\n'); resolve() } }) } -function BarkNotify(text, desp) { + +function BarkNotify(text, desp, params={}) { return new Promise(resolve => { if (BARK_PUSH) { const options = { - url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}`, + url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}&${querystring.stringify(params)}`, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } } $.get(options, (err, resp, data) => { try { if (err) { - console.log('\nBark APP发送通知调用API失败!!') + console.log('\nBark APP发送通知调用API失败!!\n') + console.log(err); } else { data = JSON.parse(data); if (data.code === 200) { - console.log('\nBark APP发送通知消息成功') + console.log('\nBark APP发送通知消息成功\n') } else { - console.log(`\n${data.message}`); + console.log(`\n${data.message}\n`); } } } catch (e) { @@ -143,7 +160,7 @@ function BarkNotify(text, desp) { } }) } else { - console.log('\n您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知'); + console.log('\n您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知\n'); resolve() } }) @@ -154,23 +171,36 @@ function tgBotNotify(text, desp) { if (TG_BOT_TOKEN && TG_USER_ID) { const options = { url: `https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage`, - body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}`, + body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}&disable_web_page_preview=true`, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } } + if (process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) { + const tunnel = require("tunnel"); + const agent = { + https: tunnel.httpsOverHttp({ + proxy: { + host: process.env.TG_PROXY_HOST, + port: process.env.TG_PROXY_PORT * 1 + } + }) + } + Object.assign(options, { agent }) + } $.post(options, (err, resp, data) => { try { if (err) { - console.log('\ntelegram发送通知消息失败!!') + console.log('\ntelegram发送通知消息失败!!\n') + console.log(err); } else { data = JSON.parse(data); if (data.ok) { - console.log('\nTelegram发送通知消息完成。') + console.log('\nTelegram发送通知消息完成。\n') } else if (data.error_code === 400) { - console.log('\n请主动给bot发送一条消息并检查接收用户ID是否正确。') + console.log('\n请主动给bot发送一条消息并检查接收用户ID是否正确。\n') } else if (data.error_code === 401){ - console.log('\nTelegram bot token 填写错误。') + console.log('\nTelegram bot token 填写错误。\n') } } } catch (e) { @@ -180,11 +210,12 @@ function tgBotNotify(text, desp) { } }) } else { - console.log('\n您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知'); + console.log('\n您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知\n'); resolve() } }) } + function ddBotNotify(text, desp) { return new Promise(resolve => { const options = { @@ -209,14 +240,14 @@ function ddBotNotify(text, desp) { $.post(options, (err, resp, data) => { try { if (err) { - console.log('\n钉钉发送通知消息失败!!') + console.log('\n钉钉发送通知消息失败!!\n') console.log(err); } else { data = JSON.parse(data); if (data.errcode === 0) { - console.log('\n钉钉发送通知消息完成。') + console.log('\n钉钉发送通知消息完成。\n') } else { - console.log(`\n${data.errmsg}`) + console.log(`\n${data.errmsg}\n`) } } } catch (e) { @@ -229,14 +260,57 @@ function ddBotNotify(text, desp) { $.post(options, (err, resp, data) => { try { if (err) { - console.log('\n钉钉发送通知消息失败!!') + console.log('\n钉钉发送通知消息失败!!\n') console.log(err); } else { data = JSON.parse(data); if (data.errcode === 0) { - console.log('\n钉钉发送通知消息完成。') + console.log('\n钉钉发送通知消息完成。\n') + } else { + console.log(`\n${data.errmsg}\n`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + } else { + console.log('\n您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n'); + resolve() + } + }) +} + +function iGotNotify(text, desp, params={}){ + return new Promise(resolve => { + if (IGOT_PUSH_KEY) { + // 校验传入的IGOT_PUSH_KEY是否有效 + const IGOT_PUSH_KEY_REGX = new RegExp("^[a-zA-Z0-9]{24}$") + if(!IGOT_PUSH_KEY_REGX.test(IGOT_PUSH_KEY)) { + console.log('\n您所提供的IGOT_PUSH_KEY无效\n') + resolve() + return + } + const options = { + url: `https://push.hellyw.com/${IGOT_PUSH_KEY.toLowerCase()}`, + body: `title=${text}&content=${desp}&${querystring.stringify(params)}`, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('\n发送通知调用API失败!!\n') + console.log(err); + } else { + if(typeof data === 'string') data = JSON.parse(data); + if (data.ret === 0) { + console.log('\niGot发送通知消息成功\n') } else { - console.log(`\n${data.errmsg}`) + console.log(`\niGot发送通知消息失败:${data.errMsg}\n`) } } } catch (e) { @@ -246,22 +320,19 @@ function ddBotNotify(text, desp) { } }) } else { - console.log('\n您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知'); + console.log('\n您未提供iGot的推送IGOT_PUSH_KEY,取消iGot推送消息通知\n'); resolve() } }) } module.exports = { sendNotify, - BarkNotify, SCKEY, BARK_PUSH, TG_BOT_TOKEN, TG_USER_ID, DD_BOT_TOKEN, - dsjNotifyControl, - txnewsNotifyControl, - + IGOT_PUSH_KEY } // prettier-ignore -function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),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}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{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=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"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 e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;$.isMute||(this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o))),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} \ No newline at end of file +function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),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}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{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=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"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 e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;$.isMute||(this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o))),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} From 5d5cb2c842baa2bf0256d73bd430f643a8a709a5 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 14 Dec 2020 00:12:43 +0800 Subject: [PATCH 192/721] Update kuaishou.yml --- .github/workflows/kuaishou.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/kuaishou.yml b/.github/workflows/kuaishou.yml index cca58e3bf1..349b921ca1 100644 --- a/.github/workflows/kuaishou.yml +++ b/.github/workflows/kuaishou.yml @@ -31,11 +31,11 @@ jobs: cd ~/Scripts node Task/kuaishou.js env: - PUSH_KEY: ${{ secrets.PUSH_KEY || github.event.client_payload.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH || github.event.client_payload.BARK_PUSH }} - BARK_SOUND: ${{ secrets.BARK_SOUND || github.event.client_payload.BARK_SOUND }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN || github.event.client_payload.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID || github.event.client_payload.TG_USER_ID }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN || github.event.client_payload.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET || github.event.client_payload.DD_BOT_SECRET }} - IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY || github.event.client_payload.IGOT_PUSH_KEY }} + PUSH_KEY: ${{ secrets.PUSH_KEY || github.event.client_payload.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH || github.event.client_payload.BARK_PUSH }} + BARK_SOUND: ${{ secrets.BARK_SOUND || github.event.client_payload.BARK_SOUND }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN || github.event.client_payload.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID || github.event.client_payload.TG_USER_ID }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN || github.event.client_payload.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET || github.event.client_payload.DD_BOT_SECRET }} + IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY || github.event.client_payload.IGOT_PUSH_KEY }} From 36379e10561c9c6f8b6d01ee8d7b7fd6422c38cc Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 14 Dec 2020 00:13:42 +0800 Subject: [PATCH 193/721] Update AUTO_KS.yml --- .github/workflows/AUTO_KS.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/AUTO_KS.yml b/.github/workflows/AUTO_KS.yml index 7ec559992b..352b4c0930 100644 --- a/.github/workflows/AUTO_KS.yml +++ b/.github/workflows/AUTO_KS.yml @@ -1,6 +1,6 @@ # 快手视频刷金币测试,抓包获取secrets -name: 快手视频 +name: 快手视频浏览 on: workflow_dispatch: From 99cfc7121f358fb27fbfe2c3c6a9abb3f3c3eaad Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 14 Dec 2020 00:16:09 +0800 Subject: [PATCH 194/721] Update kuaishou.yml --- .github/workflows/kuaishou.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kuaishou.yml b/.github/workflows/kuaishou.yml index 349b921ca1..398ab2c4b0 100644 --- a/.github/workflows/kuaishou.yml +++ b/.github/workflows/kuaishou.yml @@ -1,5 +1,5 @@ -name: 快手视频 +name: 快手视频签到 on: workflow_dispatch: @@ -25,7 +25,7 @@ jobs: run: | cd ~/Scripts npm install - - name: ’运行 【快手视频】‘ + - name: ’运行 【快手视频签到】‘ if: env.KS_TOKEN run: | cd ~/Scripts From 0249d641cf5721084d1b1d1f111be6387d2b63f2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 14 Dec 2020 00:17:05 +0800 Subject: [PATCH 195/721] Update kuaishou.yml --- .github/workflows/kuaishou.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kuaishou.yml b/.github/workflows/kuaishou.yml index 398ab2c4b0..09ec2a5b70 100644 --- a/.github/workflows/kuaishou.yml +++ b/.github/workflows/kuaishou.yml @@ -4,7 +4,7 @@ name: 快手视频签到 on: workflow_dispatch: schedule: - - cron: ’15 19 * * *‘ + - cron: '15 19 * * *' watch: types: started jobs: From 21636afd110a4f4554f61b3665794e6a20cefab2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 14 Dec 2020 00:46:01 +0800 Subject: [PATCH 196/721] Update kuaishou.js --- Task/kuaishou.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 3ee2680eb7..5b60bd053a 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -1,5 +1,5 @@ /* -更新时间: 2020-12-13 22:30 +更新时间: 2020-12-14 00:30 本脚本仅适用于快手双版本签到,注意正式版Cookie签到有时效性,但Cookie仍然可用于签到极速版,即正式版会掉签;极速版Cookie只能用于极速版 正式版APP获取Cookie方法: @@ -169,14 +169,14 @@ function speedSign() { url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/sign', headers: {Cookie: cookieVal}} $.get(signurl, (error, response, data) => { - if(logs)$.log(`${$.name}, data: ${data}`) + $.log(`${$.name}, data: ${data}`) let speed_res = JSON.parse(data) speed_code = speed_res.result if(speed_code == 10007){ speed_sign = `签到结果: ${speed_res.error_msg}`; - $.msg($.name,subTitle,''); + $.msg($.name,speed_sign,''); if(logs) $.log(`错误信息: ${speed_res.error_msg}`) - return + $.done() } else if(speed_code == 10901){ speed_sign = `签到结果: ${speed_res.error_msg}` } else if(speed_code == 1){ @@ -247,4 +247,4 @@ function GetCookie() { } } -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 7886602b5ae13e53ccc21440b2d063b0d807b46a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 14 Dec 2020 00:48:44 +0800 Subject: [PATCH 197/721] Update kuaishou.yml --- .github/workflows/kuaishou.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kuaishou.yml b/.github/workflows/kuaishou.yml index 09ec2a5b70..d86ec4a7e2 100644 --- a/.github/workflows/kuaishou.yml +++ b/.github/workflows/kuaishou.yml @@ -25,7 +25,7 @@ jobs: run: | cd ~/Scripts npm install - - name: ’运行 【快手视频签到】‘ + - name: 运行 【快手视频签到】 if: env.KS_TOKEN run: | cd ~/Scripts From d6e4713792f43148825788124fdd3b3ad8d8d6cf Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 14 Dec 2020 09:57:09 +0800 Subject: [PATCH 198/721] Update kuaishou.js --- Task/kuaishou.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 5b60bd053a..ed98864b76 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -169,7 +169,7 @@ function speedSign() { url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/sign', headers: {Cookie: cookieVal}} $.get(signurl, (error, response, data) => { - $.log(`${$.name}, data: ${data}`) + if(logs)$.log(`${$.name}, data: ${data}`) let speed_res = JSON.parse(data) speed_code = speed_res.result if(speed_code == 10007){ From e70f0fc65ba8c1b7d8ad08e0b11566993afe9577 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 14 Dec 2020 18:11:05 +0800 Subject: [PATCH 199/721] Update moji.js --- Task/moji.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Task/moji.js b/Task/moji.js index 3cdd152273..49ed65977c 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -141,7 +141,11 @@ function mapSkycon(skycon) { ], "暴雪": [ "⛄️暴雪", - "https://raw.githubusercontent.com/58xinian/icon/master/Weather/HEAVY_SNOW", + "https://raw.githubusercontent.com/58xinian/icon/master/Weather/HEAVY_SNOW.gif", + ], + "雨夹雪": [ + "🌨雨夹雪", + "https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/ICON/RAIN_SNOW.png", ], //FOG: ["🌫️ 雾"], //DUST: ["💨 浮尘"], From d4a46fce6a45d6efac0a7e9e759d0ffdb2abc98b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 14 Dec 2020 21:32:58 +0800 Subject: [PATCH 200/721] Update moji.js --- Task/moji.js | 130 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 81 insertions(+), 49 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index 49ed65977c..74ceb72420 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -1,6 +1,6 @@ /* 支持boxjs手动修改位置,可直接输入中文地区名 -更新时间 2020-12-10 20:13 +更新时间 2020-12-14 21:13 */ const $ = new Env('墨迹天气') const City = encodeURIComponent($.getdata('city')||"北京") @@ -13,13 +13,12 @@ let daylys = $.getdata('day_desc') || true, //每日天气 !(async() => { await SearchCity(); await Weather(); - await Indexs(); + await TodayReport(); await showmsg() })() .catch((e) => $.logErr(e)) .finally(() => $.done()) - function Weather() { return new Promise((resolve, reject) =>{ let weatherurl = { @@ -56,8 +55,6 @@ try { }) } - - function SearchCity() { return new Promise((resolve) =>{ let cityurl = { @@ -85,6 +82,7 @@ function SearchCity() { }) }) } + function mapSkycon(skycon) { const map = { "晴": [ @@ -155,58 +153,62 @@ function mapSkycon(skycon) { return map[skycon]; } +function windSpeed(speed) { + const map = { + 0: "无风", + 1: "软风", + 2: "轻风", + 3: "微风", + 4: "和风", + 5: "劲风", + 6: "强风", + 7: "疾风", + 8: "大风", + 9: "烈风", + 10: "狂风", + 11: "暴风", + 12: "飓风" + } + const wind_desc = $.weather.data.wind_desc.value + return `${map[wind_desc[0]]}` +} -function showmsg() { - let icon = "❓" - console.log("\n您的地区为〈"+$.weather.data.city+"〉") - nowweather = $.weather.data.weather_desc //当前天气 - nowtemp = $.weather.data.temp.value+$.weather.data.temp.unit //当前温度 - nowwindval = $.weather.data.wind_desc.winddir+$.weather.data.wind_desc.value+$.weather.data.wind_desc.unit //当前风速 - nowhum = $.weather.data.humidity //当前湿度 - aqidesc = $.weather.data.aqi_desc //空气质量 - sunrise = $.weather.data.sunset.sunrise - sundown = $.weather.data.sunset.sundown - daytemp = $.weather.data.forecast_day[0].temp_low.value+"℃"+"-"+$.weather.data.forecast_day[0].temp_high.value+"℃" - $.desc = " 当天温度: "+daytemp+" 实时温度🌡:"+nowtemp+"\n " +` 天气: ${mapSkycon(nowweather)[0]}`+" 风速🌪:"+ nowwindval + "\n 空气质量🌬:"+aqidesc+" 湿度☔️:"+nowhum+"\n" - if(daylys== 'true'){ - $.desc += "【每周天气】\n" - } - for ( Dayweather of $.weather.data.forecast_day){ - week = Dayweather.predict_week // 日期 - date = Dayweather.predict_date - - Daysweather = Dayweather.weather_desc_day //当日天气 - Winds = Dayweather.wind_desc_day.winddir+Dayweather.wind_desc_day.value+ Dayweather.wind_desc_day.unit //当日风速 - temps = Dayweather.temp_low.value+Dayweather.temp_low.unit+"至"+Dayweather.temp_high.value+Dayweather.temp_high.unit //当日温度 - if(reduction== 'true') {$.log(" "+ date+" "+Daysweather+" "+ temps+" "+Winds) - } - if(daylys== 'true'){ - $.desc += " "+week+" "+mapSkycon(Daysweather)[0]+" "+ temps+" "+Winds+"\n" - } - }; - if(hourlys == 'true'){ - $.desc += "【未来6小时变化预报】\n" - } - for ( i=0;i <6 ;i++){ - Hourlyweather = $.weather.data.hourly +function HourlyReport() { + const Hourlyweather = $.weather.data.hourly + for ( i=0;i < 6 ;i++){ hours = Hourlyweather[i].temperature.hour hourweather = Hourlyweather[i].temperature.condition - hourWinds = Hourlyweather[i].wind.wind_desc.winddir+Hourlyweather[i].wind.wind_desc.value+ Hourlyweather[i].wind.wind_desc.unit + hourly_Skycon = mapSkycon(hourweather) ? mapSkycon(hourweather)[0]:" "+hourweather + hourWinds = Hourlyweather[i].wind.wind_desc.winddir+Hourlyweather[i].wind.wind_desc.value+Hourlyweather[i].wind.wind_desc.unit hourtemps = Hourlyweather[i].temperature.temp.value+Hourlyweather[i].temperature.temp.unit if(hourlys == 'true'&& i==0 ){ - $.desc += " "+hours+":00 "+mapSkycon(Hourlyweather[i].temperature.condition)[0]+" "+ hourtemps+" "+hourWinds +"\n" + $.desc += " "+hours+":00 "+hourly_Skycon+" "+ hourtemps+" "+hourWinds +"\n" } else if(hourlys == 'true'&& (hourweather != Hourlyweather[i-1].temperature.condition || hourtemps != Hourlyweather[i-1].temperature.temp.value+"℃")){ - $.desc += " "+hours+":00 "+mapSkycon(Hourlyweather[i].temperature.condition)[0]+" "+ hourtemps+" "+hourWinds +"\n" + $.desc += " "+hours+":00 "+hourly_Skycon+" "+ hourtemps+" "+hourWinds +"\n" } if(reduction == 'true') { $.log(" "+hours+":00 "+hourweather+" "+ hourtemps+" "+hourWinds) } + } +} + +function WeekReport() { + for (Dayweather of $.weather.data.forecast_day){ + week = Dayweather.predict_week // 日期 + date = Dayweather.predict_date + + Daysweather = Dayweather.weather_desc_day //当日天气 + Days_Skycon = mapSkycon(Daysweather) ? mapSkycon(Daysweather)[0]:" "+Daysweather + Winds = Dayweather.wind_desc_day.winddir+Dayweather.wind_desc_day.value+ Dayweather.wind_desc_day.unit //当日风速 + temps = Dayweather.temp_low.value+Dayweather.temp_low.unit+"至"+Dayweather.temp_high.value+Dayweather.temp_high.unit //当日温度 + if(reduction== 'true') {$.log(" "+ date+" "+Daysweather+" "+ temps+" "+Winds) + } + $.desc += " "+week+" "+Days_Skycon+" "+ temps+" "+Winds+"\n" } - if ($.index.code == 0){ - if(indexs== 'true'){ - $.desc += "【生活指数】\n" - } - for (indexdata of $.index.indexs){ +} + +function IndexReport() { + for (indexdata of $.index.indexs){ indexType = indexdata.indexType indexLevel = indexdata.indexLevel indexLevelDesc =indexdata.indexLevelDesc @@ -216,11 +218,41 @@ function showmsg() { } if(reduction == 'true'){ console.log("\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc ) } - } - } + } + } + +function TodayReport() { + console.log("您的地区为〈"+$.weather.data.city+"〉") + nowweather = $.weather.data.weather_desc //当前天气 + today_Skycon = mapSkycon(nowweather)? mapSkycon(nowweather)[0]:" "+nowweather + nowtemp = $.weather.data.temp.value+$.weather.data.temp.unit //当前温度 + windDirection = $.weather.data.wind_desc.winddir + nowwindval = $.weather.data.wind_desc.value //当前风速 + nowhum = $.weather.data.humidity //当前湿度 + aqidesc = $.weather.data.aqi_desc //空气质量 + sunrise = $.weather.data.sunset.sunrise + sundown = $.weather.data.sunset.sundown + daytemp = $.weather.data.forecast_day[0].temp_low.value+"℃"+"-"+$.weather.data.forecast_day[0].temp_high.value+"℃" + $.desc = " 当天温度: "+daytemp+" 实时温度🌡:"+nowtemp+"\n " +` 实时天气: ${today_Skycon}`+" 风速🌪: "+ windDirection + nowwindval +"级" + windSpeed(nowwindval)+ "\n 空气质量🌬: "+aqidesc+" 湿度☔️: "+nowhum+"\n" +} + +async function showmsg() { + if(daylys== 'true'){ + $.desc += "【每周天气】\n" + await WeekReport() + } + if(hourlys == 'true'){ + $.desc += "【未来6小时变化预报】\n" + await HourlyReport() + } + if (indexs== 'true'){ + $.desc += "【生活指数】\n" + await Indexs(); + await IndexReport() + } $.sub = "【今日天气】" +`${mapSkycon(nowweather)[0]}` $.msg($.weather.data.city +"天气预报 "+$.weather.data.forecast_day[0].predict_date +$.weather.data.forecast_day[0].predict_week,$.sub, $.desc,{"media-url": `${mapSkycon(nowweather)[1]}` - }) + }) } 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 20680460ba1ce9ccd19df144c2c470f44570768c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 01:01:27 +0800 Subject: [PATCH 201/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 29f604564d..ac1f146428 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -39,6 +39,15 @@ "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/youth.js" }, + { + "id": "youthGain", + "name": "中青看看赚", + "keys": ["youth_start", "youth_end"], + "author": "@sunert", + "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/youth_gain.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], + "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/youth_gain.js" + }, { "id": "dianshijia", "name": "电视家", From 4aaac7d3fb8e157db7f26b3ac5744814c6b8a6b2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 01:43:05 +0800 Subject: [PATCH 202/721] Create youth_gain.js --- Task/youth_gain.js | 162 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 Task/youth_gain.js diff --git a/Task/youth_gain.js b/Task/youth_gain.js new file mode 100644 index 0000000000..4c4945cdaf --- /dev/null +++ b/Task/youth_gain.js @@ -0,0 +1,162 @@ +/* +更新时间: 2020-12-15 01:46 +Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 + +中青看点看看赚任务,手动完成任务,获取请求体,支持boxjs及Github Actions,多请求用"&"分开,支持自动获取请求 + +https:\/\/ios\.baertt\.com\/v5\/task\/browse_(start|end)\.json url script-request-body youth_gain.js + + +多个请求体时用'&'号或者换行隔开" ‼️ + +*/ + + +const $ = new Env("中青看看赚") +const notify = $.isNode() ? require('./sendNotify') : ''; +let StartBody = [], EndBody = [],gainscore = 0; +let startArr = [],endArr = []; +if (isGetCookie = typeof $request !==`undefined`) { + GetCookie(); + $.done() +} + +if ($.isNode()) { + if (process.env.YOUTH_START && process.env.YOUTH_START.indexOf('&') > -1) { + StartBody = process.env.YOUTH_START.split('&'); + }else { + StartBody = process.env.YOUTH_START.split() + }; + if (process.env.YOUTH_END && process.env.YOUTH_END.indexOf('&') > -1) { + EndBody = process.env.YOUTH_END.split('&'); + } else { + EndBody = process.env.YOUTH_END.split() + } +} else { + StartBody = $.getdata('youth_start').split('&'); + EndBody = $.getdata('youth_end').split('&'); +} + Object.keys(StartBody).forEach((item) => { + if (StartBody[item]) { + startArr.push(StartBody[item]) + } + }) + + Object.keys(EndBody).forEach((item) => { + if (EndBody[item]) { + endArr.push(EndBody[item]) + } + }) +if ($.isNode()) { + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) +} + !(async () => { + if (!startArr[0]) { + console.log($.name, '【提示】请把抓包的请求体填入Github 的 Secrets 中,请以&隔开') + return; + } + + console.log(`您共提供${startArr.length}次看看赚任务`) + for (let i = 0; i < startArr.length; i++) { + if (startArr[i]) { + gainStartbody = startArr[i]; + gainEndbody = endArr[i] + $.index = i + 1; + console.log(`-------------------------\n\n开始中青看点看看赚第${$.index}次任务`) + } + await GainStart(); + + } + console.log(`-------------------------\n\n中青看点共完成${$.index}次任务,共计获得${gainscore}个青豆,看看赚任务全部结束`); + + $.msg($.name, `共完成${$.index}次任务`, `共计获得${gainscore}个青豆`) + +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + +function GainStart() { + return new Promise((resolve, reject) => { + let url = { + url: `https://ios.baertt.com/v5/task/browse_start.json`, + headers: { + 'User-Agent': 'KDApp/1.7.8 (iPhone; iOS 14.0; Scale/3.00)', + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: gainStartbody + }; + $.post(url, async(error, response, data) => { + let startres = JSON.parse(data); + if(startres.items.comtele_state ==0){ + $.log("任务开始,"+startres.items.banner_id+startres.message) + await $.wait(30000); + await GainEnd() + } else if(startres.items.comtele_state ==1){ + $.log("任务:"+startres.items.banner_id+"已完成,本次跳过") + await $.wait(2000); + } + resolve() + }) + }) +} + +function GainEnd() { + return new Promise((resolve, reject) => { + let url = { + url: `https://ios.baertt.com/v5/task/browse_end.json`, + headers: { + 'User-Agent': 'KDApp/1.7.8 (iPhone; iOS 14.0; Scale/3.00)', + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: gainEndbody + }; + $.post(url, async(error, response, data) => { + let endres = JSON.parse(data); + if(endres.success==true){ + $.log("任务"+endres.items.banner_id+endres.message+",恭喜获得"+endres.items.score+"个青豆") + gainscore += endres.items.score + } else ( + $.log(endres.message) + ) + resolve() + }) + }) +} + +function GetCookie() { +if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/browse_start\.json/)) { + const startbodyVal = $request.body + let startbodys = $.getdata('youth_start') + if(startbodys){ + if(startbodys.indexOf(startbodyVal)>-1){ + $.msg($.name,'阅读请求重复,本次跳过'); + } else if(startbodys.indexOf("&")>-1){ + startbodys += "&"+startbodyVal + } else if(endbodys.indexOf("&")=-1){ + startbodys = startbodyVal + } + $.setdata(startbodys,'youth_start') + $.log("看看赚开始请求: "+startbodyVal) + $.msg($.name,'获取开始请求成功'); + } +} +if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/browse_end\.json/)) { + const endbodyVal = $request.body + let endbodys = $.getdata('youth_end') + if(endbodys){ + if(endbodys.indexOf(endbodyVal)>-1){ + $.msg($.name,'获取任务开始请求重复,本次跳过'); + } else if(endbodys.indexOf("&")>-1){ + endbodys += "&"+endbodyVal + }else if(endbodys.indexOf("&")=-1){ + endbodys = endbodyVal + } + $.setdata(endbodys,'youth_end') + $.log("看看赚结束请求: "+endbodyVal) + $.msg($.name,'获取任务结束请求成功'); + } + } +} + +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 845a26abb4d297f49213e70223b693974955992d Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 13:42:33 +0800 Subject: [PATCH 203/721] Update GithubActions.md --- Task/GithubActions.md | 60 +++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Task/GithubActions.md b/Task/GithubActions.md index 81c2521d84..2090062046 100644 --- a/Task/GithubActions.md +++ b/Task/GithubActions.md @@ -2,37 +2,37 @@

- | Name | 脚本/相关YML | Value分割符 | 必须/可选 | 注意事项及样式 (其中"xxx"代表任意字符) | -| :---: | :---: | :--------------: | :---: | - | YOUTH_HEADER | **中青看点** youth.yml| # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | - | YOUTH_ARTBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | - | YOUTH_REDBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | - | YOUTH_TIME | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/user/app_stay.json",
阅读时长请求体: p=xxx | - | YOUTH_NOTIFY_CONTROL | 同上 | true/false | 可选 | 中青通知开关
默认当转盘次数为50或者100并且余额大于10元时推送通知 | +| Name | 脚本相关YML | Value分割符 | 必须可选 | 注意事项及样式(其中"xxx"代表任意字符) | +| ------- | :-------: | ------- | ------ | ------- | +| YOUTH_HEADER | **中青看点** youth.yml| # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | +| YOUTH_ARTBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | +| YOUTH_REDBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | +| YOUTH_TIME | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/user/app_stay.json",
阅读时长请求体: p=xxx | +| YOUTH_NOTIFY_CONTROL | 同上 | true/false | 可选 | 中青通知开关
默认当转盘次数为50或者100并且余额大于10元时推送通知 | +| | | | - | | +| YOUTH_READ | **中青阅读** youth_read.yml| &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | | | | | - | | - | YOUTH_READ | **中青阅读** youth_read.yml| &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | - | | | | - | | - | TXNEWS_COOKIE | **腾讯新闻** txnews.yml| & | 必须 | 请求地址: "https://api.inews.qq.com/event/v1/user/event/report?",
腾讯新闻 Cookie: openxx=xxx | - | TXNEWS_SIGN | 同上 | # | 必须 | 请求地址同上, 阅读请求地址链接 | - | TXNEWS_VIDEO | 同上 | # | 必须 | 请求地址同上, 视频请求地址链接 | - | TXNEWS_NOTIFY_CONTROL | 同上 | true/false | 可选 | 腾讯新闻通知开关
默认当余额大于2元且通知间隔为50时推送通知 | - | | | | - | | - | DSJ_HEADERS | **电视家** dianshijia.yml | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/sign/signin",
签到请求头: { xxx } | - | DSJ_DRAWAL | 同上 | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/cash/withdrawal",
即提现请求地址 | - | DSJ_NOTIFY_CONTROL | 同上 | true/false | 可选 | 电视家通知开关
默认不推送 | - | | | | - | | - | WB_TOKEN | **新浪微博** weibo.yml | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: gsid=xxx | - | WB_PAY | 同上 | #或换行 | 必须 | 请求地址: "https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do",
提现请求头 | - | | | | - | | - | JD_COOKIE | **京喜**
jingxi.yml | &或换行| 必须 | 京东cookie,多个账号的cookie使用`&`隔开或者换行。具体获取参考[浏览器获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie.md) 或者 [插件获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie2.md) | - | | | | - | | - | PUSH_KEY | 微信推送 | - | 可选 | cookie失效推送[server酱的微信通知](http://sc.ftqq.com/3.version) | - | BARK_PUSH | BARK推送 | - | 可选 | cookie失效推送BARK这个APP,填写内容是app提供的`设备码`,例如:https://api.day.app/123 ,那么此处的设备码就是`123`,再不懂看 [这个图](icon/bark.jpg) | - | BARK_SOUND | BARK推送 | - | 可选 | bark推送声音设置,例如`choo`,具体值请在`bark`-`推送铃声`-`查看所有铃声` | - | TG_BOT_TOKEN | telegram推送 | - | 可选 | tg推送,填写自己申请[@BotFather](https://t.me/BotFather)的Token,如`10xxx4:AAFcqxxxxgER5uw` , [具体教程](https://github.com/lxk0301/scripts/pull/37#issuecomment-692415594) | - | TG_USER_ID | telegram推送 | - | 可选 | tg推送,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](https://github.com/lxk0301/scripts/pull/37#issuecomment-692415594) | - | DD_BOT_TOKEN | 钉钉推送 | - | 可选 | 钉钉推送[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于符号后面的XXX, 注:如果钉钉推送只填写`DD_BOT_TOKEN`,那么安全设置需勾选`自定义关键词`,内容输入输入`账号`即可,其他安全设置不要勾选 | - | DD_BOT_SECRET | 钉钉推送 | - | 可选 | 密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 , 注:填写了`DD_BOT_TOKEN`和`DD_BOT_SECRET`,钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](icon/DD_bot.png) | +| TXNEWS_COOKIE | **腾讯新闻** txnews.yml| & | 必须 | 请求地址: "https://api.inews.qq.com/event/v1/user/event/report?",
腾讯新闻 Cookie: openxx=xxx | +| TXNEWS_SIGN | 同上 | # | 必须 | 请求地址同上, 阅读请求地址链接 | +| TXNEWS_VIDEO | 同上 | # | 必须 | 请求地址同上, 视频请求地址链接 | +| TXNEWS_NOTIFY_CONTROL | 同上 | true/false | 可选 | 腾讯新闻通知开关
默认当余额大于2元且通知间隔为50时推送通知 | +| | | | - | | +| DSJ_HEADERS | **电视家** dianshijia.yml | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/sign/signin",
签到请求头: { xxx } | +| DSJ_DRAWAL | 同上 | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/cash/withdrawal",
即提现请求地址 | +| DSJ_NOTIFY_CONTROL | 同上 | true/false | 可选 | 电视家通知开关
默认不推送 | +| | | | - | | +| WB_TOKEN | **新浪微博** weibo.yml | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: gsid=xxx | +| WB_PAY | 同上 | #或换行 | 必须 | 请求地址:"https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do",
提现请求头 | +| | | | - | | +| JD_COOKIE | **京喜**
jingxi.yml | &或换行| 必须 | 京东cookie,多个账号的cookie使用`&`隔开或者换行。具体获取参考[浏览器获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie.md) 或者 [插件获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie2.md) | +| ***推送通知选项*** | | | - | | +| PUSH_KEY | 微信推送 | - | 可选 | cookie失效推送[server酱的微信通知](http://sc.ftqq.com/3.version) | +| BARK_PUSH | BARK推送 | - | 可选 | cookie失效推送BARK这个APP,填写内容是app提供的`设备码`,例如:https://api.day.app/123 ,那么此处的设备码就是`123`,再不懂看 [这个图](icon/bark.jpg) | +| BARK_SOUND | BARK推送 | - | 可选 | bark推送声音设置,例如`choo`,具体值请在`bark`-`推送铃声`-`查看所有铃声` | +| TG_BOT_TOKEN | telegram推送 | - | 可选 | tg推送,填写自己申请[@BotFather](https://t.me/BotFather)的Token,如`10xxx4:AAFcqxxxxgER5uw` , [具体教程](https://github.com/lxk0301/scripts/pull/37#issuecomment-692415594) | +| TG_USER_ID | telegram推送 | - | 可选 | tg推送,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](https://github.com/lxk0301/scripts/pull/37#issuecomment-692415594) | +| DD_BOT_TOKEN | 钉钉推送 | - | 可选 | 钉钉推送[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于符号后面的XXX, 注:如果钉钉推送只填写`DD_BOT_TOKEN`,那么安全设置需勾选`自定义关键词`,内容输入输入`账号`即可,其他安全设置不要勾选 | +| DD_BOT_SECRET | 钉钉推送 | - | 可选 | 密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 , 注:填写了`DD_BOT_TOKEN`和`DD_BOT_SECRET`,钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](icon/DD_bot.png) | # 以上为配置方法详见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) From 9de0f04c2573f7dcba9dd621a51f2b1e4489d32b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 13:43:12 +0800 Subject: [PATCH 204/721] Update GithubActions.md --- Task/GithubActions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/GithubActions.md b/Task/GithubActions.md index 2090062046..d778b84738 100644 --- a/Task/GithubActions.md +++ b/Task/GithubActions.md @@ -3,7 +3,7 @@

| Name | 脚本相关YML | Value分割符 | 必须可选 | 注意事项及样式(其中"xxx"代表任意字符) | -| ------- | :-------: | ------- | ------ | ------- | +| :-------: | :-------: | ------- | ------ | ------- | | YOUTH_HEADER | **中青看点** youth.yml| # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | | YOUTH_ARTBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | | YOUTH_REDBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | From 4a6552b616d6346cbe51290e48f791401377252e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 13:54:50 +0800 Subject: [PATCH 205/721] Update GithubActions.md --- Task/GithubActions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/GithubActions.md b/Task/GithubActions.md index d778b84738..23df56633c 100644 --- a/Task/GithubActions.md +++ b/Task/GithubActions.md @@ -34,7 +34,7 @@ | DD_BOT_TOKEN | 钉钉推送 | - | 可选 | 钉钉推送[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于符号后面的XXX, 注:如果钉钉推送只填写`DD_BOT_TOKEN`,那么安全设置需勾选`自定义关键词`,内容输入输入`账号`即可,其他安全设置不要勾选 | | DD_BOT_SECRET | 钉钉推送 | - | 可选 | 密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 , 注:填写了`DD_BOT_TOKEN`和`DD_BOT_SECRET`,钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](icon/DD_bot.png) | - # 以上为配置方法详见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) + # 以上为配置方法详见[@lxk0301](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/githubAction.md) ## ***感谢*** * [@lxk0301](https://t.me/lxk0301) From b7811a06c78260380dc615eada775b93a2b28fc6 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 15:32:36 +0800 Subject: [PATCH 206/721] Update GithubActions.md --- Task/GithubActions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/GithubActions.md b/Task/GithubActions.md index 23df56633c..08c4007b43 100644 --- a/Task/GithubActions.md +++ b/Task/GithubActions.md @@ -37,7 +37,7 @@ # 以上为配置方法详见[@lxk0301](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/githubAction.md) ## ***感谢*** - * [@lxk0301](https://t.me/lxk0301) - * [@chavy](https://t.me/chavyleung) +* [@lxk0301](https://t.me/lxk0301) +* [@chavy](https://t.me/chavyleung) \ No newline at end of file From a1b3147973cbbbf5b524fc68db7dd885ac621be0 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 15:33:25 +0800 Subject: [PATCH 207/721] Update GithubActions.md --- Task/GithubActions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/GithubActions.md b/Task/GithubActions.md index 08c4007b43..77f33c2a92 100644 --- a/Task/GithubActions.md +++ b/Task/GithubActions.md @@ -37,7 +37,7 @@ # 以上为配置方法详见[@lxk0301](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/githubAction.md) ## ***感谢*** -* [@lxk0301](https://t.me/lxk0301) -* [@chavy](https://t.me/chavyleung) + * [@lxk0301](https://t.me/lxk0301) + * [@chavy](https://t.me/chavyleung) \ No newline at end of file From 54c7eafbf61ca9c96527cdd482ab50c5e435b74e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 15:34:45 +0800 Subject: [PATCH 208/721] Update GithubActions.md --- Task/GithubActions.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Task/GithubActions.md b/Task/GithubActions.md index 77f33c2a92..7e0a09d5b4 100644 --- a/Task/GithubActions.md +++ b/Task/GithubActions.md @@ -1,6 +1,4 @@ -# 关于本仓库 ***Actions Secrets*** 配置说明 :
- -

+## Actions Secrets 环境变量配置说明 :
| Name | 脚本相关YML | Value分割符 | 必须可选 | 注意事项及样式(其中"xxx"代表任意字符) | | :-------: | :-------: | ------- | ------ | ------- | @@ -33,9 +31,11 @@ | TG_USER_ID | telegram推送 | - | 可选 | tg推送,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](https://github.com/lxk0301/scripts/pull/37#issuecomment-692415594) | | DD_BOT_TOKEN | 钉钉推送 | - | 可选 | 钉钉推送[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于符号后面的XXX, 注:如果钉钉推送只填写`DD_BOT_TOKEN`,那么安全设置需勾选`自定义关键词`,内容输入输入`账号`即可,其他安全设置不要勾选 | | DD_BOT_SECRET | 钉钉推送 | - | 可选 | 密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 , 注:填写了`DD_BOT_TOKEN`和`DD_BOT_SECRET`,钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](icon/DD_bot.png) | - - # 以上为配置方法详见[@lxk0301](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/githubAction.md) + + + ## 以上为配置方法详见[@lxk0301](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/githubAction.md) +*** ## ***感谢*** * [@lxk0301](https://t.me/lxk0301) * [@chavy](https://t.me/chavyleung) From 43293c3776f909119918ec2f11757879c5a41fda Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 15:54:42 +0800 Subject: [PATCH 209/721] Update README.md --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1fb95d98d7..1900b94bef 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,16 @@ -![Anurag’s github stats](https://github-readme-stats.vercel.app/api?username=Sunert&show_icons=true&theme=merko) +
+

本仓库不再维护

+ + + + + +
-# 本仓库不再维护 ## 免责声明: - +*** * 本仓库发布的Script项目中涉及的任何解锁和解密分析脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断. * Sunert对任何脚本问题概不负责,包括但不限于由任何脚本错误导致的任何损失或损害. From 4804efe4c0811f09a68e273923b351078f4cf5eb Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 16:02:51 +0800 Subject: [PATCH 210/721] Update README.md From de3ebaacba95a93f53bf3ee9a31580cf29882bc3 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 16:04:33 +0800 Subject: [PATCH 211/721] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1900b94bef..6dd7fd9e5c 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,9 @@ * 任何以任何方式查看此项目的人或直接或间接使用该Script项目的任何脚本的使用者都应仔细阅读此声明。Sunert保留随时更改或补充此免责声明的权利。一旦使用并复制了任何相关脚本或Script项目的规则,则视为您已接受此免责声明. **您必须在下载后的24小时内从计算机或手机中完全删除以上内容.**
-> ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此免责声明,请仔细阅读*** - +
+ ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此免责声明,请仔细阅读*** +
#### 开发者不易,请赏杯茶水费
From 4e016b5ebbe0bf44b44d215d0e27bc9829512c0e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 16:05:40 +0800 Subject: [PATCH 212/721] Update README.md --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6dd7fd9e5c..160d7d407a 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,12 @@ +
-## 免责声明: *** + +## 免责声明: + * 本仓库发布的Script项目中涉及的任何解锁和解密分析脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断. * Sunert对任何脚本问题概不负责,包括但不限于由任何脚本错误导致的任何损失或损害. @@ -23,10 +26,11 @@ * 任何以任何方式查看此项目的人或直接或间接使用该Script项目的任何脚本的使用者都应仔细阅读此声明。Sunert保留随时更改或补充此免责声明的权利。一旦使用并复制了任何相关脚本或Script项目的规则,则视为您已接受此免责声明. - **您必须在下载后的24小时内从计算机或手机中完全删除以上内容.**
-
- ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此免责声明,请仔细阅读*** -
+ - 您必须在下载后的24小时内从计算机或手机中完全删除以上内容.
+> ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此免责声明,请仔细阅读*** + +*** + #### 开发者不易,请赏杯茶水费
From b15cbd67399571b02148e2ce7eb456b925866fa8 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 16:31:56 +0800 Subject: [PATCH 213/721] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 160d7d407a..ba34674026 100644 --- a/README.md +++ b/README.md @@ -26,14 +26,16 @@ * 任何以任何方式查看此项目的人或直接或间接使用该Script项目的任何脚本的使用者都应仔细阅读此声明。Sunert保留随时更改或补充此免责声明的权利。一旦使用并复制了任何相关脚本或Script项目的规则,则视为您已接受此免责声明. - - 您必须在下载后的24小时内从计算机或手机中完全删除以上内容.
-> ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此免责声明,请仔细阅读*** - +- 您必须在下载后的24小时内从计算机或手机中完全删除以上内容.
+
您使用或者复制了本仓库且本人制作的任何脚本,则视为 已接受 此免责声明,请仔细阅读 +
*** #### 开发者不易,请赏杯茶水费
+
+--- ### 特别感谢: From d7b5f580d67ff3656d56cb6f724c3f8fc9b0ae71 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 16:33:54 +0800 Subject: [PATCH 214/721] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba34674026..fd6be34aa8 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ - 您必须在下载后的24小时内从计算机或手机中完全删除以上内容.
您使用或者复制了本仓库且本人制作的任何脚本,则视为 已接受 此免责声明,请仔细阅读
+ *** #### 开发者不易,请赏杯茶水费 @@ -46,4 +47,3 @@ * [@lxk0301](https://github.com/lxk0301) * [@id77_Github](https://github.com/id77) - From 25e10a886aba0455da00064977fb87222f62ea3c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 15 Dec 2020 17:00:19 +0800 Subject: [PATCH 215/721] Update GithubActions.md --- Task/GithubActions.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Task/GithubActions.md b/Task/GithubActions.md index 7e0a09d5b4..e65fe8f714 100644 --- a/Task/GithubActions.md +++ b/Task/GithubActions.md @@ -1,28 +1,28 @@ ## Actions Secrets 环境变量配置说明 :
-| Name | 脚本相关YML | Value分割符 | 必须可选 | 注意事项及样式(其中"xxx"代表任意字符) | -| :-------: | :-------: | ------- | ------ | ------- | -| YOUTH_HEADER | **中青看点** youth.yml| # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | +| Name | 脚本相关YML | Value分割符 | 必须/可选 | 注意事项及样式(其中"xxx"代表任意字符) | +| :-------: | :------: | ------- | ------ | ------- | +| YOUTH_HEADER |
中青看点 youth.yml
| # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | | YOUTH_ARTBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | | YOUTH_REDBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | | YOUTH_TIME | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/user/app_stay.json",
阅读时长请求体: p=xxx | | YOUTH_NOTIFY_CONTROL | 同上 | true/false | 可选 | 中青通知开关
默认当转盘次数为50或者100并且余额大于10元时推送通知 | | | | | - | | -| YOUTH_READ | **中青阅读** youth_read.yml| &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | - | | | | - | | -| TXNEWS_COOKIE | **腾讯新闻** txnews.yml| & | 必须 | 请求地址: "https://api.inews.qq.com/event/v1/user/event/report?",
腾讯新闻 Cookie: openxx=xxx | +| YOUTH_READ |
中青阅读 youth_read.yml
| &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | + | | | - | | | +| TXNEWS_COOKIE |
腾讯新闻 txnews.yml
| & | 必须 | 请求地址: "https://api.inews.qq.com/event/v1/user/event/report?",
腾讯新闻 Cookie: openxx=xxx | | TXNEWS_SIGN | 同上 | # | 必须 | 请求地址同上, 阅读请求地址链接 | | TXNEWS_VIDEO | 同上 | # | 必须 | 请求地址同上, 视频请求地址链接 | | TXNEWS_NOTIFY_CONTROL | 同上 | true/false | 可选 | 腾讯新闻通知开关
默认当余额大于2元且通知间隔为50时推送通知 | | | | | - | | -| DSJ_HEADERS | **电视家** dianshijia.yml | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/sign/signin",
签到请求头: { xxx } | +| DSJ_HEADERS |
电视家dianshijia.yml
| #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/sign/signin",
签到请求头: { xxx } | | DSJ_DRAWAL | 同上 | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/cash/withdrawal",
即提现请求地址 | | DSJ_NOTIFY_CONTROL | 同上 | true/false | 可选 | 电视家通知开关
默认不推送 | | | | | - | | -| WB_TOKEN | **新浪微博** weibo.yml | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: gsid=xxx | +| WB_TOKEN |
微博 weibo.yml
weibo.yml | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: gsid=xxx | | WB_PAY | 同上 | #或换行 | 必须 | 请求地址:"https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do",
提现请求头 | | | | | - | | -| JD_COOKIE | **京喜**
jingxi.yml | &或换行| 必须 | 京东cookie,多个账号的cookie使用`&`隔开或者换行。具体获取参考[浏览器获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie.md) 或者 [插件获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie2.md) | +| JD_COOKIE |
京喜 jingxi.yml
| &或换行| 必须 | 京东cookie,多个账号的cookie使用`&`隔开或者换行。具体获取参考[浏览器获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie.md) 或者 [插件获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie2.md) | | ***推送通知选项*** | | | - | | | PUSH_KEY | 微信推送 | - | 可选 | cookie失效推送[server酱的微信通知](http://sc.ftqq.com/3.version) | | BARK_PUSH | BARK推送 | - | 可选 | cookie失效推送BARK这个APP,填写内容是app提供的`设备码`,例如:https://api.day.app/123 ,那么此处的设备码就是`123`,再不懂看 [这个图](icon/bark.jpg) | From 6f494e8714e8390d356b255f34bc5237d83a8e69 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:17:41 +0800 Subject: [PATCH 216/721] Create Sunert_Task.json --- Task/Sunert_Task.json | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Task/Sunert_Task.json diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json new file mode 100644 index 0000000000..679d04eae5 --- /dev/null +++ b/Task/Sunert_Task.json @@ -0,0 +1,27 @@ +{ + "name": "Sunert 任务脚本", + "description": "运行时间自定", + "task": [ + "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js, tag=12306火车时刻,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js, tag=实时货币换算,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "30 9 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "30 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js, tag=京东到家 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "0 0 7,22 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, tag=快手极速版 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=微博&钱包 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "10 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js, tag=新浪新闻 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "20 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, tag=中青看点极速版 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青看点自动阅读版 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js, tag=京喜 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气 ,img-url=https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png" + ], +} + + + + + \ No newline at end of file From 0106c2dee27c01433b35ed5cabc2d7c09fb92874 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:27:17 +0800 Subject: [PATCH 217/721] Update Sunert_Task.json --- Task/Sunert_Task.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index 679d04eae5..01be06e0fa 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -2,21 +2,21 @@ "name": "Sunert 任务脚本", "description": "运行时间自定", "task": [ - "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js, tag=12306火车时刻,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js, tag=实时货币换算,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "30 9 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "30 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js, tag=京东到家 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告 ,img-url=https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png", + "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js, tag=12306火车时刻,img-url=https://raw.githubusercontent.com/Orz-3/task/master/12306.png", + "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js, tag=实时货币换算,img-url=https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png", + "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png", + "30 9 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻 ,img-url= https://raw.githubusercontent.com/Orz-3/task/master/txnews.png", + "30 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js, tag=京东到家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/jddj.png", "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "0 0 7,22 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, tag=快手极速版 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=微博&钱包 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "10 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js, tag=新浪新闻 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "20 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, tag=中青看点极速版 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青看点自动阅读版 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", - "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js, tag=京喜 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "0 0 7,22 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png", + "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, tag=快手极速版 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png", + "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=微博&钱包 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/weibo.png", + "10 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js, tag=新浪新闻 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png", + "20 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, tag=中青看点极速版 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", + "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青看点自动阅读版 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", + "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png", + "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js, tag=京喜 ,img-url= https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png", "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气 ,img-url=https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png" ], } From b0254885c4ab6e658ee4d3dc116ea9d51672dda8 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:29:17 +0800 Subject: [PATCH 218/721] Update Sunert_Task.json --- Task/Sunert_Task.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index 01be06e0fa..b6533dbe82 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -8,7 +8,7 @@ "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png", "30 9 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻 ,img-url= https://raw.githubusercontent.com/Orz-3/task/master/txnews.png", "30 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js, tag=京东到家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/jddj.png", - "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼 ,img-url=https://raw.githubusercontent.com/shoujiqiyuan/PokemonGOforQuanX/master/IconSet/Z012.png", + "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/lkyl.png", "0 0 7,22 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png", "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, tag=快手极速版 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png", "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=微博&钱包 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/weibo.png", From 59a73d6a527f79822902d8c7f10620e48b2025f0 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 16 Dec 2020 19:15:56 +0800 Subject: [PATCH 219/721] Update sendNotify.js --- Task/sendNotify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/sendNotify.js b/Task/sendNotify.js index 660b57f555..c370c2fc72 100644 --- a/Task/sendNotify.js +++ b/Task/sendNotify.js @@ -4,7 +4,7 @@ const $ = new Env(); //此处填你申请的SCKEY. //注:此处设置github action用户填写到Settings-Secrets里面(Name输入PUSH_KEY) let SCKEY = ''; - +const querystring = require("querystring"); //此处填你BarkAPP的信息(IP/设备码,例如:https://api.day.app/XXXXXXXX) //注:此处设置github action用户填写到Settings-Secrets里面(Name输入BARK_PUSH) let BARK_PUSH = ''; From 85da17ff54918f9900cb3d17f251d51fd166a26e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 16 Dec 2020 20:20:04 +0800 Subject: [PATCH 220/721] =?UTF-8?q?Update=20=E4=BF=AE=E5=A4=8D=E4=B8=AD?= =?UTF-8?q?=E9=9D=92=E6=B5=8F=E8=A7=88=E8=B5=9A=E4=BB=BB=E5=8A=A1=E8=8E=B7?= =?UTF-8?q?=E5=8F=96Body?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth_gain.js | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Task/youth_gain.js b/Task/youth_gain.js index 4c4945cdaf..d7a5cd8b56 100644 --- a/Task/youth_gain.js +++ b/Task/youth_gain.js @@ -1,8 +1,8 @@ /* -更新时间: 2020-12-15 01:46 +更新时间: 2020-12-16 20:16 Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 -中青看点看看赚任务,手动完成任务,获取请求体,支持boxjs及Github Actions,多请求用"&"分开,支持自动获取请求 +中青看点浏览赚任务,手动完成任务,获取请求体,支持boxjs及Github Actions,多请求用"&"分开,支持自动获取请求 https:\/\/ios\.baertt\.com\/v5\/task\/browse_(start|end)\.json url script-request-body youth_gain.js @@ -14,8 +14,10 @@ https:\/\/ios\.baertt\.com\/v5\/task\/browse_(start|end)\.json url script-reques const $ = new Env("中青看看赚") const notify = $.isNode() ? require('./sendNotify') : ''; -let StartBody = [], EndBody = [],gainscore = 0; +let StartBody = [], EndBody = [], gainscore = Number(); let startArr = [],endArr = []; +let startbodys = $.getdata('youth_start') +let endbodys = $.getdata('youth_end') if (isGetCookie = typeof $request !==`undefined`) { GetCookie(); $.done() @@ -56,7 +58,6 @@ if ($.isNode()) { console.log($.name, '【提示】请把抓包的请求体填入Github 的 Secrets 中,请以&隔开') return; } - console.log(`您共提供${startArr.length}次看看赚任务`) for (let i = 0; i < startArr.length; i++) { if (startArr[i]) { @@ -66,12 +67,9 @@ if ($.isNode()) { console.log(`-------------------------\n\n开始中青看点看看赚第${$.index}次任务`) } await GainStart(); - } console.log(`-------------------------\n\n中青看点共完成${$.index}次任务,共计获得${gainscore}个青豆,看看赚任务全部结束`); - $.msg($.name, `共完成${$.index}次任务`, `共计获得${gainscore}个青豆`) - })() .catch((e) => $.logErr(e)) .finally(() => $.done()) @@ -126,36 +124,38 @@ function GainEnd() { function GetCookie() { if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/browse_start\.json/)) { - const startbodyVal = $request.body - let startbodys = $.getdata('youth_start') + const startbodyVal = $request.body; if(startbodys){ if(startbodys.indexOf(startbodyVal)>-1){ - $.msg($.name,'阅读请求重复,本次跳过'); - } else if(startbodys.indexOf("&")>-1){ - startbodys += "&"+startbodyVal - } else if(endbodys.indexOf("&")=-1){ - startbodys = startbodyVal + $.msg($.name,'阅读请求重复,本次跳过'); + return + }else if(startbodys.indexOf(startbodyVal)==-1) + { + startbodys += "&"+startbodyVal + } + } else { + startbodys = $request.body } $.setdata(startbodys,'youth_start') $.log("看看赚开始请求: "+startbodyVal) $.msg($.name,'获取开始请求成功'); - } -} + }; + if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/browse_end\.json/)) { const endbodyVal = $request.body - let endbodys = $.getdata('youth_end') if(endbodys){ if(endbodys.indexOf(endbodyVal)>-1){ $.msg($.name,'获取任务开始请求重复,本次跳过'); - } else if(endbodys.indexOf("&")>-1){ - endbodys += "&"+endbodyVal - }else if(endbodys.indexOf("&")=-1){ - endbodys = endbodyVal + return + } else if(endbodys.indexOf(endbodyVal)==-1){ + endbodys += "&"+endbodyVal + } + }else { + endbodys = $request.body } $.setdata(endbodys,'youth_end') $.log("看看赚结束请求: "+endbodyVal) $.msg($.name,'获取任务结束请求成功'); - } } } From 4e2e0208d5b80fd795bba697571dd69dcabe5a23 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 16 Dec 2020 21:37:37 +0800 Subject: [PATCH 221/721] Update GithubActions.md --- Task/GithubActions.md | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/Task/GithubActions.md b/Task/GithubActions.md index e65fe8f714..aa3f2e1854 100644 --- a/Task/GithubActions.md +++ b/Task/GithubActions.md @@ -1,29 +1,40 @@ -## Actions Secrets 环境变量配置说明 :
+

Actions Secrets 环境变量配置说明 :

-| Name | 脚本相关YML | Value分割符 | 必须/可选 | 注意事项及样式(其中"xxx"代表任意字符) | -| :-------: | :------: | ------- | ------ | ------- | -| YOUTH_HEADER |
中青看点 youth.yml
| # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | +| Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | +| :-------: | :------: | :-------: | ------ | ------- | +| YOUTH_HEADER | 中青看点 youth.yml | # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | | YOUTH_ARTBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | | YOUTH_REDBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | | YOUTH_TIME | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/user/app_stay.json",
阅读时长请求体: p=xxx | | YOUTH_NOTIFY_CONTROL | 同上 | true/false | 可选 | 中青通知开关
默认当转盘次数为50或者100并且余额大于10元时推送通知 | | | | | - | | -| YOUTH_READ |
中青阅读 youth_read.yml
| &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | - | | | - | | | -| TXNEWS_COOKIE |
腾讯新闻 txnews.yml
| & | 必须 | 请求地址: "https://api.inews.qq.com/event/v1/user/event/report?",
腾讯新闻 Cookie: openxx=xxx | +| YOUTH_READ | 中青阅读 youth_read.yml | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | +| YOUTH_START | 中青浏览赚 youth_gain.yml | & | 必须 | 请求地址: "https://ios.baertt.com/v5/task/browse_start.json",
阅读请求体: p=xxx | +| YOUTH_END | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/task/browse_end.json",
阅读请求体: p=xxx | +| | | - | | | +| TXNEWS_COOKIE | 腾讯新闻 txnews.yml | & | 必须 | 请求地址: "https://api.inews.qq.com/event/v1/user/event/report?",
腾讯新闻 Cookie: openxx=xxx | | TXNEWS_SIGN | 同上 | # | 必须 | 请求地址同上, 阅读请求地址链接 | | TXNEWS_VIDEO | 同上 | # | 必须 | 请求地址同上, 视频请求地址链接 | | TXNEWS_NOTIFY_CONTROL | 同上 | true/false | 可选 | 腾讯新闻通知开关
默认当余额大于2元且通知间隔为50时推送通知 | | | | | - | | -| DSJ_HEADERS |
电视家dianshijia.yml
| #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/sign/signin",
签到请求头: { xxx } | +| DSJ_HEADERS | 电视家dianshijia.yml | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/sign/signin",
签到请求头: { xxx } | | DSJ_DRAWAL | 同上 | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/cash/withdrawal",
即提现请求地址 | | DSJ_NOTIFY_CONTROL | 同上 | true/false | 可选 | 电视家通知开关
默认不推送 | | | | | - | | -| WB_TOKEN |
微博 weibo.yml
weibo.yml | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: gsid=xxx | +| WB_TOKEN | 微博 | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: gsid=xxx | | WB_PAY | 同上 | #或换行 | 必须 | 请求地址:"https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do",
提现请求头 | | | | | - | | -| JD_COOKIE |
京喜 jingxi.yml
| &或换行| 必须 | 京东cookie,多个账号的cookie使用`&`隔开或者换行。具体获取参考[浏览器获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie.md) 或者 [插件获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie2.md) | -| ***推送通知选项*** | | | - | | +| JD_COOKIE | 京喜 jingxi.yml | &或换行| 必须 | 京东cookie,多个账号的cookie使用`&`隔开或者换行。具体获取参考[浏览器获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie.md) 或者 [插件获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie2.md) | + +
+ +
+ + 相关通知推送 + + +| Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | +| :-------: | :------: | ------- | ------ | ------- | | PUSH_KEY | 微信推送 | - | 可选 | cookie失效推送[server酱的微信通知](http://sc.ftqq.com/3.version) | | BARK_PUSH | BARK推送 | - | 可选 | cookie失效推送BARK这个APP,填写内容是app提供的`设备码`,例如:https://api.day.app/123 ,那么此处的设备码就是`123`,再不懂看 [这个图](icon/bark.jpg) | | BARK_SOUND | BARK推送 | - | 可选 | bark推送声音设置,例如`choo`,具体值请在`bark`-`推送铃声`-`查看所有铃声` | @@ -32,6 +43,7 @@ | DD_BOT_TOKEN | 钉钉推送 | - | 可选 | 钉钉推送[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于符号后面的XXX, 注:如果钉钉推送只填写`DD_BOT_TOKEN`,那么安全设置需勾选`自定义关键词`,内容输入输入`账号`即可,其他安全设置不要勾选 | | DD_BOT_SECRET | 钉钉推送 | - | 可选 | 密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 , 注:填写了`DD_BOT_TOKEN`和`DD_BOT_SECRET`,钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](icon/DD_bot.png) | +
## 以上为配置方法详见[@lxk0301](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/githubAction.md) From e00260930cb816ae0a2e88e11a4171644654f9ea Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 16 Dec 2020 21:39:25 +0800 Subject: [PATCH 222/721] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fd6be34aa8..388b473ea6 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ * 任何以任何方式查看此项目的人或直接或间接使用该Script项目的任何脚本的使用者都应仔细阅读此声明。Sunert保留随时更改或补充此免责声明的权利。一旦使用并复制了任何相关脚本或Script项目的规则,则视为您已接受此免责声明. - 您必须在下载后的24小时内从计算机或手机中完全删除以上内容.
-
您使用或者复制了本仓库且本人制作的任何脚本,则视为 已接受 此免责声明,请仔细阅读 +
您使用或者复制了本仓库且本人制作的任何脚本,则视为 已接受 此免责声明,请仔细阅读
*** From e1938b47803998a60093e5b51beb96aa227fce02 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 16 Dec 2020 21:43:30 +0800 Subject: [PATCH 223/721] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 388b473ea6..444000db6d 100644 --- a/README.md +++ b/README.md @@ -40,10 +40,10 @@ ### 特别感谢: -* [@chavyleung](https://github.com/chavyleung) + * [@chavyleung](https://github.com/chavyleung) -* [@NobyDa](https://github.com/NobyDa) + * [@NobyDa](https://github.com/NobyDa) -* [@lxk0301](https://github.com/lxk0301) + * [@lxk0301](https://github.com/lxk0301) -* [@id77_Github](https://github.com/id77) + * [@id77_Github](https://github.com/id77) From 1d11e752ea1dffc9ab98c473e2df372f0df22dd9 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 16 Dec 2020 21:54:31 +0800 Subject: [PATCH 224/721] Update GithubActions.md --- Task/GithubActions.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Task/GithubActions.md b/Task/GithubActions.md index aa3f2e1854..8ced19204a 100644 --- a/Task/GithubActions.md +++ b/Task/GithubActions.md @@ -29,9 +29,11 @@
- - 相关通知推送 - + + + 相关通知推送 + + | Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | | :-------: | :------: | ------- | ------ | ------- | From 9fd7c287fe9070016df1c4dc203edaf75fccd201 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 16 Dec 2020 22:01:49 +0800 Subject: [PATCH 225/721] =?UTF-8?q?Update=20youth=5Fgain.js=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=90=8D=E5=AD=97=E4=B8=BA=E6=B5=8F=E8=A7=88=E8=B5=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth_gain.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Task/youth_gain.js b/Task/youth_gain.js index d7a5cd8b56..b7311f8b99 100644 --- a/Task/youth_gain.js +++ b/Task/youth_gain.js @@ -1,5 +1,5 @@ /* -更新时间: 2020-12-16 20:16 +更新时间: 2020-12-16 22:06 Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 中青看点浏览赚任务,手动完成任务,获取请求体,支持boxjs及Github Actions,多请求用"&"分开,支持自动获取请求 @@ -12,7 +12,7 @@ https:\/\/ios\.baertt\.com\/v5\/task\/browse_(start|end)\.json url script-reques */ -const $ = new Env("中青看看赚") +const $ = new Env("中青看点浏览赚") const notify = $.isNode() ? require('./sendNotify') : ''; let StartBody = [], EndBody = [], gainscore = Number(); let startArr = [],endArr = []; @@ -58,18 +58,21 @@ if ($.isNode()) { console.log($.name, '【提示】请把抓包的请求体填入Github 的 Secrets 中,请以&隔开') return; } - console.log(`您共提供${startArr.length}次看看赚任务`) + console.log(`您共提供${startArr.length}次浏览赚任务`) for (let i = 0; i < startArr.length; i++) { if (startArr[i]) { gainStartbody = startArr[i]; gainEndbody = endArr[i] $.index = i + 1; - console.log(`-------------------------\n\n开始中青看点看看赚第${$.index}次任务`) + console.log(`-------------------------\n\n开始中青看点浏览赚第${$.index}次任务`) } await GainStart(); } - console.log(`-------------------------\n\n中青看点共完成${$.index}次任务,共计获得${gainscore}个青豆,看看赚任务全部结束`); + console.log(`-------------------------\n\n中青看点共完成${$.index}次任务,共计获得${gainscore}个青豆,浏览赚任务全部结束`); $.msg($.name, `共完成${$.index}次任务`, `共计获得${gainscore}个青豆`) + if ($.isNode()){ + //await notify.sendNotify($.name,`共完成${$.index}次任务,\n共计获得${gainscore}个青豆` +} })() .catch((e) => $.logErr(e)) .finally(() => $.done()) From 71390d2ea8bca8f8f708714d88b214cdb2a85151 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 16 Dec 2020 22:20:23 +0800 Subject: [PATCH 226/721] Update Sunert_Task.json --- Task/Sunert_Task.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index b6533dbe82..1f8dc460a5 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -14,10 +14,11 @@ "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=微博&钱包 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/weibo.png", "10 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js, tag=新浪新闻 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png", "20 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, tag=中青看点极速版 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", - "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青看点自动阅读版 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", - "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png", - "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js, tag=京喜 ,img-url= https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png", - "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气 ,img-url=https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png" + "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青自动阅读 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", + "20 5 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js, tag=中青浏览赚 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", + "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png", + "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js, tag=京喜 ,img-url= https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png", + "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气 ,img-url=https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png" ], } From 4d62f9478f55604920df179f7c7563b9d6b7bef0 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 17 Dec 2020 11:15:49 +0800 Subject: [PATCH 227/721] fix youth_gain.js --- Task/youth_gain.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/youth_gain.js b/Task/youth_gain.js index b7311f8b99..1da51903ac 100644 --- a/Task/youth_gain.js +++ b/Task/youth_gain.js @@ -91,7 +91,7 @@ function GainStart() { let startres = JSON.parse(data); if(startres.items.comtele_state ==0){ $.log("任务开始,"+startres.items.banner_id+startres.message) - await $.wait(30000); + await $.wait(10000); await GainEnd() } else if(startres.items.comtele_state ==1){ $.log("任务:"+startres.items.banner_id+"已完成,本次跳过") @@ -116,7 +116,7 @@ function GainEnd() { let endres = JSON.parse(data); if(endres.success==true){ $.log("任务"+endres.items.banner_id+endres.message+",恭喜获得"+endres.items.score+"个青豆") - gainscore += endres.items.score + gainscore += Number(endres.items.score) } else ( $.log(endres.message) ) From f35c8bab2d61b9a37adea1eba819b125a92e706b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 17 Dec 2020 13:31:10 +0800 Subject: [PATCH 228/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index ac1f146428..7db188e187 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -41,7 +41,7 @@ }, { "id": "youthGain", - "name": "中青看看赚", + "name": "中青浏览赚", "keys": ["youth_start", "youth_end"], "author": "@sunert", "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/youth_gain.js", From 9087b3c6ff47146b6bb3e0bf1ae5001e1a957828 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 19 Dec 2020 09:24:55 +0800 Subject: [PATCH 229/721] Update kuaishou.js --- Task/kuaishou.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index ed98864b76..cd2d7722c6 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -86,7 +86,7 @@ if (isGetCookie) { await speedSignifo(); await speedInfo(); await officialSign(); - if(offici_code !== 100111){ + if(offici_code !== 100119){ await officialSignifo(); await officialtaskCenter(); } @@ -109,7 +109,7 @@ function officialSign() { if(logs)$.log(`${$.name}, data: ${data}`) let officialSign_res = JSON.parse(data) offici_code = officialSign_res.result - if(offici_code == 109){ + if(offici_code == 100111){ offic_sign = `签到结果: ${officialSign_res.error_msg}`; $.msg($.name,offic_sign,"") logs?$.log(`错误信息: ${officialSign_res.error_msg}`):""; From eda6ed21d8a27b84a9ef975aa85a0ed5daee8cf6 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 19 Dec 2020 14:10:45 +0800 Subject: [PATCH 230/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 7db188e187..62d3ede61e 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -181,7 +181,14 @@ "name": "小时天气", "val": false, "type": "boolean", - "desc": "未来24小时天气情况" + "desc": "未来6小时天气情况" + }, + { + "id": "forty_desc", + "name": "40天预告", + "val": false, + "type": "boolean", + "desc": "未来40天天气预告" }, { "id": "index_desc", From 4405e16e341ca0586f6d0f6c534366c27c4ef1bd Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 19 Dec 2020 14:14:04 +0800 Subject: [PATCH 231/721] Update moji.js --- Task/moji.js | 53 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index 74ceb72420..18e581c31a 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -1,17 +1,19 @@ /* 支持boxjs手动修改位置,可直接输入中文地区名 -更新时间 2020-12-14 21:13 +更新时间 2020-12-19 14:13 */ const $ = new Env('墨迹天气') -const City = encodeURIComponent($.getdata('city')||"北京") +const City = encodeURIComponent($.getdata('city')||"北京") //可在此处修改城市 const j = $.getdata('citynum')||"1"; -let reduction = $.getdata('cut') || false; //日志 -let daylys = $.getdata('day_desc') || true, //每日天气 - hourlys = $.getdata('hour_desc') || false, //小时预报 - indexs = $.getdata('index_desc') || false; //生活指数 +let reduction = $.getdata('cut') || 'false'; //日志 +let daylys = $.getdata('day_desc') || 'true', //每日天气 + hourlys = $.getdata('hour_desc') || 'false', //小时预报 + indexs = $.getdata('index_desc') || 'false'; //生活指数 + fortys = $.getdata('forty_desc') || 'false'; //40天预告 !(async() => { await SearchCity(); + await fortyReport(); await Weather(); await TodayReport(); await showmsg() @@ -36,12 +38,35 @@ function Weather() { }) } +function fortyReport() { + return new Promise((resolve, reject) =>{ + let fortyurl = { + url: `https://h5ctywhr.api.moji.com/fc40`, + headers: {'Host': 'h5ctywhr.api.moji.com',}, + body: `{"cityId": ${cityid},"cityType":${cityType}}` + } + $.post(fortyurl, (error, response, data) => { + try { + $.forty = JSON.parse(data) + realFeel = $.forty.condition.realFeel + forDay40 = $.forty.forecastDays.forecastDay40.fallTrendDesc[0] ? $.forty.forecastDays.forecastDay40.fallTrendDesc[0].desc:"" + temp40 = $.forty.forecastDays.forecastDay40.tempTrendDesc[0] ? $.forty.forecastDays.forecastDay40.tempTrendDesc[0].desc:"" + Festival = $.forty.forecastDays.forecastDay[1].festival + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + }) +} + function Indexs() { return new Promise((resolve, reject) =>{ let indexsurl = { url: `https://h5ctywhr.api.moji.com/indexDetail?cityId=${cityid}`, headers: {}, - body: `{"cityId": ${cityid}}` + body: `{"cityId": ${cityid},"cityType":${cityType}}` } $.post(indexsurl, (error, response, data) => { try { @@ -72,6 +97,8 @@ function SearchCity() { console.log(cityname+': '+cityids) } cityid = result.city_list[j-1].cityId + cityType + = result.city_list[j-1].cityType cityname = result.city_list[j-1].name province = result.city_list[j-1].pname } else { @@ -233,11 +260,14 @@ function TodayReport() { sunrise = $.weather.data.sunset.sunrise sundown = $.weather.data.sunset.sundown daytemp = $.weather.data.forecast_day[0].temp_low.value+"℃"+"-"+$.weather.data.forecast_day[0].temp_high.value+"℃" - $.desc = " 当天温度: "+daytemp+" 实时温度🌡:"+nowtemp+"\n " +` 实时天气: ${today_Skycon}`+" 风速🌪: "+ windDirection + nowwindval +"级" + windSpeed(nowwindval)+ "\n 空气质量🌬: "+aqidesc+" 湿度☔️: "+nowhum+"\n" + + Alerts = $.weather.data.alerts ? '【气象预警】'+"预警级别: "+$.weather.data.alerts[0].level+'\n '+$.weather.data.alerts[0].content:"" + + $.desc = " 当天温度: "+daytemp+" 实时温度🌡:"+nowtemp+"\n " +` 实时天气: ${today_Skycon}`+" 风速🌪: "+ windDirection + nowwindval +"级" + windSpeed(nowwindval)+ "\n 空气质量🌬: "+aqidesc+" 湿度☔️: "+nowhum+"\n" +Alerts +'\n' } async function showmsg() { - if(daylys== 'true'){ + if(daylys == 'true'){ $.desc += "【每周天气】\n" await WeekReport() } @@ -249,9 +279,12 @@ async function showmsg() { $.desc += "【生活指数】\n" await Indexs(); await IndexReport() + } + if (fortys == 'true'){ + $.desc += "【40天预告】\n "+forDay40+temp40 } $.sub = "【今日天气】" +`${mapSkycon(nowweather)[0]}` - $.msg($.weather.data.city +"天气预报 "+$.weather.data.forecast_day[0].predict_date +$.weather.data.forecast_day[0].predict_week,$.sub, $.desc,{"media-url": `${mapSkycon(nowweather)[1]}` + $.msg($.weather.data.city +"天气预报 "+$.weather.data.forecast_day[0].predict_date +$.weather.data.forecast_day[0].predict_week +" "+Festival,$.sub, $.desc,{"media-url": `${mapSkycon(nowweather)[1]}` }) } From 329af426aaf1cf38579077098ead31cd056fbac5 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 19 Dec 2020 14:38:08 +0800 Subject: [PATCH 232/721] Update moji.js --- Task/moji.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Task/moji.js b/Task/moji.js index 18e581c31a..4fa65c8bef 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -1,6 +1,6 @@ /* 支持boxjs手动修改位置,可直接输入中文地区名 -更新时间 2020-12-19 14:13 +更新时间 2020-12-19 14:36 */ const $ = new Env('墨迹天气') const City = encodeURIComponent($.getdata('city')||"北京") //可在此处修改城市 @@ -10,7 +10,8 @@ let daylys = $.getdata('day_desc') || 'true', //每日天气 hourlys = $.getdata('hour_desc') || 'false', //小时预报 indexs = $.getdata('index_desc') || 'false'; //生活指数 fortys = $.getdata('forty_desc') || 'false'; //40天预告 - +let Alerts = ""; + !(async() => { await SearchCity(); await fortyReport(); @@ -260,10 +261,10 @@ function TodayReport() { sunrise = $.weather.data.sunset.sunrise sundown = $.weather.data.sunset.sundown daytemp = $.weather.data.forecast_day[0].temp_low.value+"℃"+"-"+$.weather.data.forecast_day[0].temp_high.value+"℃" - - Alerts = $.weather.data.alerts ? '【气象预警】'+"预警级别: "+$.weather.data.alerts[0].level+'\n '+$.weather.data.alerts[0].content:"" - - $.desc = " 当天温度: "+daytemp+" 实时温度🌡:"+nowtemp+"\n " +` 实时天气: ${today_Skycon}`+" 风速🌪: "+ windDirection + nowwindval +"级" + windSpeed(nowwindval)+ "\n 空气质量🌬: "+aqidesc+" 湿度☔️: "+nowhum+"\n" +Alerts +'\n' + if($.weather.data.alerts.length>0){ + Alerts = '\n【气象预警】'+"预警级别: "+$.weather.data.alerts[0].level+'\n '+$.weather.data.alerts[0].content + } + $.desc = " 当天温度: "+daytemp+" 实时温度🌡:"+nowtemp+"\n " +` 实时天气: ${today_Skycon}`+" 风速🌪: "+ windDirection + nowwindval +"级" + windSpeed(nowwindval)+ "\n 空气质量🌬: "+aqidesc+" 湿度☔️: "+nowhum+Alerts +'\n' } async function showmsg() { From 68ea121b28ca6f1c3d99c1d0a5bd48bb048247bf Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 20 Dec 2020 15:43:42 +0800 Subject: [PATCH 233/721] Update kuaishou.js --- Task/kuaishou.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index cd2d7722c6..8c1e61b52d 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -174,7 +174,7 @@ function speedSign() { speed_code = speed_res.result if(speed_code == 10007){ speed_sign = `签到结果: ${speed_res.error_msg}`; - $.msg($.name,speed_sign,''); + //$.msg($.name,speed_sign,''); if(logs) $.log(`错误信息: ${speed_res.error_msg}`) $.done() } else if(speed_code == 10901){ From 2718c0dc5cae2a2ff403cbff62f7253e142eb655 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 20 Dec 2020 15:46:29 +0800 Subject: [PATCH 234/721] Update kuaishou.js --- Task/kuaishou.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 8c1e61b52d..84c25507d5 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -1,5 +1,5 @@ /* -更新时间: 2020-12-14 00:30 +更新时间: 2020-12-20 15:30 本脚本仅适用于快手双版本签到,注意正式版Cookie签到有时效性,但Cookie仍然可用于签到极速版,即正式版会掉签;极速版Cookie只能用于极速版 正式版APP获取Cookie方法: @@ -111,7 +111,7 @@ function officialSign() { offici_code = officialSign_res.result if(offici_code == 100111){ offic_sign = `签到结果: ${officialSign_res.error_msg}`; - $.msg($.name,offic_sign,"") + // $.msg($.name,offic_sign,"") logs?$.log(`错误信息: ${officialSign_res.error_msg}`):""; resolve() return @@ -174,7 +174,7 @@ function speedSign() { speed_code = speed_res.result if(speed_code == 10007){ speed_sign = `签到结果: ${speed_res.error_msg}`; - //$.msg($.name,speed_sign,''); + $.msg($.name,speed_sign,''); if(logs) $.log(`错误信息: ${speed_res.error_msg}`) $.done() } else if(speed_code == 10901){ From 0132b1675a504fcf0690f1f518de568addb50ccb Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 20 Dec 2020 15:54:35 +0800 Subject: [PATCH 235/721] =?UTF-8?q?Update=20youth.js=20=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9nodejs=E4=B8=BA90=E6=AC=A1=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index b245763e59..3ca4e0f38c 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -203,7 +203,7 @@ if (rotaryres.status !== 0&&rotaryres.data.doubleNum !== 0){ await earningsInfo(); await showmsg(); if ($.isNode()&&rotaryres.code !== '10010') - if( rotarytimes && rotarytimes%50 == 0 && cash >= 10){ + if( rotarytimes && rotarytimes%90 == 0 && cash >= 10){ await notify.sendNotify($.name + " " + nick, "您的余额约为"+cash+"元,已可以提现"+'\n'+`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n${detail}`) } } From 28ad240607bbf3fc21d0d60958ea87774aa51169 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 21 Dec 2020 12:47:17 +0800 Subject: [PATCH 236/721] Update youth.yml --- .github/workflows/youth.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index 02508da39a..e671d4603a 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -6,7 +6,7 @@ name: 中青看点 on: workflow_dispatch: schedule: - - cron: '*/12 * * * *' + - cron: '*/35 * * * *' watch: types: started From f8b0ac946d472f86331981831b1bf806d0a3d739 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 28 Dec 2020 19:32:27 +0800 Subject: [PATCH 237/721] Create baiduspeed.yml --- .github/workflows/baiduspeed.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/baiduspeed.yml diff --git a/.github/workflows/baiduspeed.yml b/.github/workflows/baiduspeed.yml new file mode 100644 index 0000000000..f952d97f7d --- /dev/null +++ b/.github/workflows/baiduspeed.yml @@ -0,0 +1,39 @@ + +name: 百度极速版 +on: + workflow_dispatch: + schedule: + - cron: '*/30 * * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + BAIDU_COOKIE: ${{ secrets.BAIDU_COOKIE }} + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【百度极速】' + if: env.BAIDU_COOKIE + run: | + cd ~/Scripts + node Task/baidu_speed.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} From 2769c669b290b1e3b2202aa75a5e31d32be3e265 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 28 Dec 2020 19:33:38 +0800 Subject: [PATCH 238/721] Create baidu_speed.js --- Task/baidu_speed.js | 386 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 386 insertions(+) create mode 100644 Task/baidu_speed.js diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js new file mode 100644 index 0000000000..a2f3c9ec03 --- /dev/null +++ b/Task/baidu_speed.js @@ -0,0 +1,386 @@ +/* +百度极速版签到任务 + +本脚本默认使用chavyleung大佬和Nobyda的贴吧ck,获取方法请看大佬仓库说明 + +~~~~~~~~~~~~~~~~ + +*/ +const $ = new Env('百度极速版') + +let CookieArr = [] + +if ($.isNode()) { + if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { + StartBody = process.env.BAIDU_COOKIE.split('&'); + } + if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('\n') > -1) { + BDCookie = process.env.BAIDU_COOKIE.split('\n'); + } else { + BDCookie = process.env.BAIDU_COOKIE.split() + } + Object.keys(BDCookie).forEach((item) => { + if (BDCookie[item]) { + CookieArr.push(BDCookie[item]) + } + }) +} else { + CookieArr.push($.getdata(`chavy_cookie_tieba`)||$.getdata(`CookieTB`)) +} +if ($.isNode()) { + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) +} + +!(async() => { + if (!CookieArr[0]) { + console.log($.name, '【提示】请把百度Cookie填入Github 的 Secrets 中,请以&或者换行隔开') + return; + } + console.log(`您共提供${CookieArr.length}个百度账号Cookie`) + for (let i = 0; i < CookieArr.length; i++) { + if (CookieArr[i]) { + cookieval = CookieArr[i]; + $.index = i + 1; + } + await getsign(); + await coinInfo(); + await firstbox(); + await TaskCenter(); + //await get_search(); + //await getRewards(); + //await drawPrize(); + //await get_pkg() + } + })() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + +//签到 +function getsign() { + return new Promise((resolve, reject) =>{ + let signurl = { + url: `https://haokan.baidu.com/activity/acusercheckin/update`, + headers: {Cookie:cookieval}, + body: 'productid=2&ugus=9766888061' + } + $.post(signurl, (error, response, data) => { + let get_sign = JSON.parse(data) + if (get_sign.errno == 0){ + $.sub = get_sign.data.tips+`🎉` + $.desc = `签到收益: ${get_sign.data.bonus.coin}💰,` + } + else if (get_sign.errno == 10053){ + $.sub = get_sign.msg + $.desc = `` + } + else { + $.sub = `签到失败❌` + $.desc = `说明: `+ get_sign.msg + $.msg($.name,$.sub,$.desc) + return + } + resolve() + }) + }) +} + +function coinInfo() { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://haokan.baidu.com/activity/h5/displaybyday?type=1&page=1&productid=2`, + headers: {Cookie:cookieval} + } + $.get(infourl, (error, response, data) => { + let get_info = JSON.parse(data) + if (get_info.errno == 0){ + $.sub += ' 今日收益: ' + get_info.data.datalist.data[0].desc + } + resolve() + }) + }) +} + +function getRewards() { + return new Promise((resolve, reject) =>{ + let rewurl = { + url: `https://haokan.baidu.com/activity/tasks/taskreward?productid=2`, + headers: {Cookie:cookieval} + } + $.get(rewurl, (error, response, data) => { + let get_reward = JSON.parse(data) + if (get_reward.errno == 0&&get_reward.data.coin!==0){ + $.desc += '获得收益: +' + get_reward.data.coin + } + resolve() + }) + }) +} + +function TaskCenter() { + return new Promise((resolve, reject) =>{ + let rewurl = { + url: `https://haokan.baidu.com/activity/h5/vault?_format=json&productid=2&channel=2`, + headers: {Cookie:cookieval} + } + $.get(rewurl, async(error, resp, data) => { + try{ + let get_tasks = JSON.parse(data) + //$.log("获取任务数据"+data) + tasks = get_tasks.data.comps + for ( x in tasks){ + taskid = tasks[x].taskId + id = tasks[x].id + if(id ==1069){ + token = tasks[x].data.btn[0].iosAdUrl.split("?")[1] + } + if(id ==962){ + for (jingangs of tasks[x].data.jingang_list_ios ){ + if(jingangs.jingangType==2){ + tid = jingangs.jingangTid + taskName = '【'+jingangs.jingangName+'】' + RefererUrl = jingangs.jingangUrl + downtime = `${tasks[x].data.countDown[tid].countDown}` + $.log(taskName+"tid:"+tid) + if(downtime == 0){ + await $.wait(1000) + await get_pkg(); + } else { + $.log( " 请等待"+Number(downtime/60).toFixed(2)+"分钟") + } + } + } + } else if(id ==1076){ + for ( tasklists of tasks[x].data.tasklist){ + tid = tasklists.id + taskName = tasklists.title + $.log(taskName+" tid:"+tid) + if(tasklists.type == 'openApp'){ + RefererUrl = tasklists.adLink + await get_pkg() + } + if(tasklists.type == 'watch'){ + // $.log(tasklists.+'\n') + cmd = tid==346 ? 100:184 + await get_search() + }; + } + } + } + } catch(e){ + $.logErr(e, resp); + } finally { + $.msg($.name, $.sub, $.desc) + resolve() + } + }) + }) +} + +//首页宝箱 +function firstbox() { + return new Promise((resolve, reject) =>{ + let bdurl = { + url: 'https://mbrowser.baidu.com/lite/gold/receive?service=bdbox', + headers: {Cookie:cookieval}, + body: 'task_type=-1&task_id=-1' +} + $.post(bdurl, (error, response, data) => { + let get_first = JSON.parse(data) + //$.log("【首页宝箱】\n"+data +'\n') + if (get_first.err_no == 0){ + $.desc += "【首页宝箱】"+ get_first.data.result.tips +", "+get_first.data.result.countdown_time+"秒后再次开启宝箱\n" + } + else if (get_first.err_no == 10079){ + $.desc += "【首页宝箱】"+ get_first.tip+'\n' + } + else if (get_first.err_no == 10060){ + $.desc += get_first.tip+'\n' + } + //$.msg($.name, $.sub, $.desc) + resolve() + }) + }) +} + + + +//视频 +function get_pkg() { + return new Promise((resolve, reject) =>{ + let pkgurl = { + url: `https://haokan.baidu.com/activity/acad/rewardad?device=%7B%22imei_md5%22%3A%22%22%2C%22device_type%22%3A1%2C%22model%22%3A%22IPHONE%22%2C%22manufacturer%22%3A%22Apple%22%2C%22os_version%22%3A%2213.7%22%2C%22idfa%22%3A%22_a2S8_aq28_qa28qii2A8laJ28gxC28Q_iXni0uKvNYIPviVzaHtiYah2ul6iHim_l2880uQvflqisa9liBgIgarv8oIOHutlhSPu_ux2a_Wi-uRz_qAC%22%2C%22androidId%22%3A%22%22%2C%22geo%22%3A%7B%22lat%22%3A%22%22%2C%22lon%22%3A%22%22%7D%2C%22screen_width%22%3A1242%2C%22screen_height%22%3A2208%7D&network=%7B%22connect_type%22%3A1%2C%22carrier%22%3A0%7D&productid=2&tid=${tid}&type=1`, + headers:{Cookie:cookieval,'Referer':RefererUrl} + } + $.get(pkgurl, async(error, resp, data) => { + let get_pkg = JSON.parse(data) + //$.log("数据: "+data+'\n') + if (get_pkg.errno == 0&&get_pkg.data.isDone ==0){ + Pkg = get_pkg.data.adInfo[0].material.pkg + taskid = get_pkg.data.taskPf.taskId; + $.log("\n"+taskid +" "+ Pkg) + await activeBox() + } + else if (get_pkg.errno == 0&&get_pkg.data.isDone ==1){ + $.desc += taskName +" 已完成\n" + $.log(taskName +" 已完成\n") + } + resolve() + }) + }) +} +//缩减开宝箱时间 +function chestTime() { + return new Promise((resolve, reject) =>{ + let timeurl = { + url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestTime&rewardVideoPkg=${Pkg}`, + headers: {Cookie:cookieval,Referer: `https://eopa.baidu.com/page/pagekey-qWYNoPr0?type=1&tid=695&productid=2&chesttid=669&chestname=chestTime`} + } + $.get(timeurl, (error, response, data) => { + let get_chest = JSON.parse(data) +$.log(data) + if (get_chest.errno == 11006){ + $.log("开宝箱任务"+get_chest.errmsg) + } + else if (get_chest.errno == 0){ + $.log("开宝箱时间缩减"+get_chest.data.awardTime/60+"分钟") + } + else if (get_chest.errno == 19001&&get_chest.data.originData.errno==10074 ){ + //$.desc += get_chest.data.originData.msg + $.log("开宝箱任务ID:"+taskid+ get_chest.data.originData.msg) + } + resolve() + }) + }) +} + +//任务中心宝箱 +function activeBox2() { + return new Promise((resolve, reject) =>{ + let actboxurl = { + url: `https://haokan.baidu.com/activity/acuserchest/opennew`, + headers: {Cookie:cookieval}, + body: `taskid=${taskid}&productid=2&ugus=5256798061` + } + $.post(actboxurl, async(error, response, data) => { + let act_box = JSON.parse(data) + //$.log('actbox: ' + data) + if (act_box.errno == 0){ + $.desc += '开宝箱获得收益: +' + act_box.data.coin + + } else if (act_box.errno == 10060){ + //taskid = '669' + await chestTime() + $.desc += act_box.msg + } + resolve() + }) + }) +} +function activeBox() { + return new Promise((resolve, reject) =>{ + let actboxurl = { + url: `https://haokan.baidu.com/activity/tasks/active?productid=2&id=${tid}`, + headers: {Cookie:cookieval,Referer: 'https://eopa.baidu.com/page/pagekey-ASKWNd8W?productid=2&type=1&tid=${tid}'} + } + $.get(actboxurl, async(error, response, data) => { + //let act_box = JSON.parse(data) + //$.log('actbox: ' + data) + await $.wait(15000); + await Tasks(); + resolve() + }) + }) +} + + +function Tasks() { + return new Promise((resolve) =>{ + let taskurl = { + url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=coin&rewardVideoPkg=${Pkg}&_=`+new Date().getTime()+`&sys=ios&rewardVideoDrawKey=&source=0&appid=0&bid=0&chestTid=0&signAim=0&date=`, + headers: {Cookie:cookieval,Referer:RefererUrl} + } + $.get(taskurl, async(error, response, data) => { + let do_task = JSON.parse(data) + await $.wait(15000); + //$.log(data+'\n') + if (do_task.errno == 0){ + $.desc += taskName + do_task.data.coin +"\n" + $.log(" 获得收益: +"+do_task.data.coin+'\n ') + } else if (do_task.errno == 19001){ + $.desc += taskName + " "+ do_task.data.originData.msg + "\n" + }else if (do_task.errno == 11004){ + $.desc += taskName + " "+ do_task.errmsg + "\n" + } + resolve() + }) + }) +} + +function get_search() { + return new Promise((resolve) =>{ + let geturl = { + url: `https://mbd.baidu.com/searchbox?action=feed&cmd=${cmd}&imgtype=webp&network=1_0&osbranch=i3&osname=baiduboxapp&ua=1242_2208_iphone_5.0.0.11_0&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2`, + headers: {Cookie:cookieval} + } + $.get(geturl, async(error, resp, data) => { + let get_search = JSON.parse(data) + //$.log(data+'\n') + if (get_search.errno == 0 ) { + for ( item in get_search.data[`${cmd}`].itemlist.items){ + searchId = get_search.data[`${cmd}`].itemlist.items[item].id + searchname = get_search.data[`${cmd}`].itemlist.items[item].data.title + $.log(" 阅读任务: "+searchname+ "\n 任务ID: "+searchId) + await searchBox(searchId) + await $.wait(30000) + } + //$.desc += taskName + do_search.data[`${cmd}`].tips +"\n" + } else { + // $.desc += taskName + " "+ do_search.data[`${cmd}`].tips + "\n" + } + resolve() + }) + }) +} + + + +function searchBox(id) { + return new Promise((resolve) =>{ + let searchurl = { + url: `https://mbd.baidu.com/searchbox?action=feed&cmd=197&imgtype=webp&network=1_0&osbranch=i3&osname=baiduboxapp&ua=1242_2208_iphone_5.0.0.11_0&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2`, + headers: {Cookie:cookieval}, + body: `data={"origin_nid":"${id}","taskid":"${tid}"}` + } + $.post(searchurl, async(error, resp, data) => { + let do_search = JSON.parse(data) + //$.log(data+'\n') + if (do_search.errno == 0 && do_search.data[`197`].istip == 1) { + $.log(" 获得收益: " +do_search.data[`197`].tips+'\n') + //$.desc += do_search.data[`197`].tips +"\n" + } else { + //$.log("\n") + } + resolve() + }) + }) +} + +function doubleBox() { + return new Promise((resolve, reject) =>{ + let douboxurl = { + url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestDouble&rewardVideoPkg=${Pkg}`, + headers: {Cookie:cookieval,Referer: `Referer: https://eopa.baidu.com/page/pagekey-ASKWNd8W?productid=2&type=1&tid=346`} + } + $.get(douboxurl, (error, response, data) => { + let get_doubox = JSON.parse(data) + if (get_doubox.errno == 0){ + $.desc += '开宝箱获得双倍收益: +' + get_doubox.data.awardCoin + } + resolve() + }) + }) +} + + +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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 0a521b4d5a5af4a86d11edffc4244b0c051e423b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 28 Dec 2020 19:57:50 +0800 Subject: [PATCH 239/721] Update baidu_speed.js --- Task/baidu_speed.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index a2f3c9ec03..509aff631e 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -8,7 +8,7 @@ */ const $ = new Env('百度极速版') -let CookieArr = [] +let CookieArr = []; if ($.isNode()) { if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { @@ -140,7 +140,8 @@ function TaskCenter() { tid = jingangs.jingangTid taskName = '【'+jingangs.jingangName+'】' RefererUrl = jingangs.jingangUrl - downtime = `${tasks[x].data.countDown[tid].countDown}` + downtime = tasks[x].data.countDown[tid].countDown + $.log(tasks[x].data.countDown[tid].countDown) $.log(taskName+"tid:"+tid) if(downtime == 0){ await $.wait(1000) @@ -305,7 +306,7 @@ function Tasks() { await $.wait(15000); //$.log(data+'\n') if (do_task.errno == 0){ - $.desc += taskName + do_task.data.coin +"\n" + $.desc += taskName + "获得收益"+ do_task.data.coin +"\n" $.log(" 获得收益: +"+do_task.data.coin+'\n ') } else if (do_task.errno == 19001){ $.desc += taskName + " "+ do_task.data.originData.msg + "\n" From e12777d1209aa368686405c3d8c44fd31abd7be4 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 28 Dec 2020 20:02:32 +0800 Subject: [PATCH 240/721] Update baidu_speed.js --- Task/baidu_speed.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 509aff631e..dab9d09c0c 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -140,8 +140,10 @@ function TaskCenter() { tid = jingangs.jingangTid taskName = '【'+jingangs.jingangName+'】' RefererUrl = jingangs.jingangUrl + + $.log(tasks[x].data.countDown[tid].countDown) + downtime = tasks[x].data.countDown[tid].countDown - $.log(tasks[x].data.countDown[tid].countDown) $.log(taskName+"tid:"+tid) if(downtime == 0){ await $.wait(1000) From 4273ff6e7752869bcbd18cf695a307b930774c64 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 28 Dec 2020 20:07:37 +0800 Subject: [PATCH 241/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index dab9d09c0c..84a6ee7c64 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -141,7 +141,7 @@ function TaskCenter() { taskName = '【'+jingangs.jingangName+'】' RefererUrl = jingangs.jingangUrl - $.log(tasks[x].data.countDown[tid].countDown) + $.log(tasks[x].data.countDown.590.countDown) downtime = tasks[x].data.countDown[tid].countDown $.log(taskName+"tid:"+tid) From 8e12040a74c1181c358981e8c824ad868ca16801 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 28 Dec 2020 20:19:46 +0800 Subject: [PATCH 242/721] Update baidu_speed.js --- Task/baidu_speed.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 84a6ee7c64..65e4c6da45 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -140,11 +140,9 @@ function TaskCenter() { tid = jingangs.jingangTid taskName = '【'+jingangs.jingangName+'】' RefererUrl = jingangs.jingangUrl - - $.log(tasks[x].data.countDown.590.countDown) - + $.log(taskName+"tid:"+tid) + $.log(tasks[x].data.countDown[tid].countDown) downtime = tasks[x].data.countDown[tid].countDown - $.log(taskName+"tid:"+tid) if(downtime == 0){ await $.wait(1000) await get_pkg(); @@ -221,7 +219,7 @@ function get_pkg() { if (get_pkg.errno == 0&&get_pkg.data.isDone ==0){ Pkg = get_pkg.data.adInfo[0].material.pkg taskid = get_pkg.data.taskPf.taskId; - $.log("\n"+taskid +" "+ Pkg) + // $.log("\n"+taskid +" "+ Pkg) await activeBox() } else if (get_pkg.errno == 0&&get_pkg.data.isDone ==1){ From 032394a895af812e68d5f680236c3076f2aece60 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 28 Dec 2020 20:29:31 +0800 Subject: [PATCH 243/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 65e4c6da45..8f2afa5558 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -126,7 +126,7 @@ function TaskCenter() { $.get(rewurl, async(error, resp, data) => { try{ let get_tasks = JSON.parse(data) - //$.log("获取任务数据"+data) + $.log("获取任务数据"+data) tasks = get_tasks.data.comps for ( x in tasks){ taskid = tasks[x].taskId From 4d7f89cbae79da93b72e109873c45d5868448420 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 28 Dec 2020 20:30:56 +0800 Subject: [PATCH 244/721] Update baiduspeed.yml --- .github/workflows/baiduspeed.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/baiduspeed.yml b/.github/workflows/baiduspeed.yml index f952d97f7d..4980906bc7 100644 --- a/.github/workflows/baiduspeed.yml +++ b/.github/workflows/baiduspeed.yml @@ -12,6 +12,7 @@ jobs: if: github.event.repository.owner.id == github.event.sender.id env: BAIDU_COOKIE: ${{ secrets.BAIDU_COOKIE }} + TZ: Asia/shanghai steps: - name: Checkout run: | From b73ec33ede571fb708739b3eb84883e02fb82e63 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 28 Dec 2020 21:29:11 +0800 Subject: [PATCH 245/721] Update baidu_speed.js --- Task/baidu_speed.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 8f2afa5558..02970b4df1 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -142,15 +142,19 @@ function TaskCenter() { RefererUrl = jingangs.jingangUrl $.log(taskName+"tid:"+tid) $.log(tasks[x].data.countDown[tid].countDown) - downtime = tasks[x].data.countDown[tid].countDown - if(downtime == 0){ + if ($.isNode()){ + await $.wait(1000) + await get_pkg(); + } + +else if(tasks[x].data.countDown[tid].countDown ==0){ await $.wait(1000) await get_pkg(); } else { - $.log( " 请等待"+Number(downtime/60).toFixed(2)+"分钟") - } + $.log( " 请等待"+Number(tasks[x].data.countDown[tid].countDown/60).toFixed(2)+"分钟") } } + } } else if(id ==1076){ for ( tasklists of tasks[x].data.tasklist){ tid = tasklists.id From bd23ec875a2f5b3b04ee7bfb9adfd020665b07e9 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 28 Dec 2020 21:33:19 +0800 Subject: [PATCH 246/721] Update baidu_speed.js --- Task/baidu_speed.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 02970b4df1..d0943fa26d 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -126,7 +126,7 @@ function TaskCenter() { $.get(rewurl, async(error, resp, data) => { try{ let get_tasks = JSON.parse(data) - $.log("获取任务数据"+data) + //$.log("获取任务数据"+data) tasks = get_tasks.data.comps for ( x in tasks){ taskid = tasks[x].taskId @@ -141,12 +141,11 @@ function TaskCenter() { taskName = '【'+jingangs.jingangName+'】' RefererUrl = jingangs.jingangUrl $.log(taskName+"tid:"+tid) - $.log(tasks[x].data.countDown[tid].countDown) + //$.log(tasks[x].data.countDown[tid].countDown) if ($.isNode()){ await $.wait(1000) await get_pkg(); } - else if(tasks[x].data.countDown[tid].countDown ==0){ await $.wait(1000) await get_pkg(); From e27249d428e96170b51ff55f3b7770fff3e06ecc Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 29 Dec 2020 00:06:26 +0800 Subject: [PATCH 247/721] Update baidu_speed.js --- Task/baidu_speed.js | 49 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index d0943fa26d..f54debde1a 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -42,17 +42,18 @@ if ($.isNode()) { if (CookieArr[i]) { cookieval = CookieArr[i]; $.index = i + 1; - } await getsign(); await coinInfo(); await firstbox(); - await TaskCenter(); + //await acchristmas() + await TaskCenter() //await get_search(); //await getRewards(); //await drawPrize(); //await get_pkg() - } - })() + } + } +})() .catch((e) => $.logErr(e)) .finally(() => $.done()) @@ -129,19 +130,15 @@ function TaskCenter() { //$.log("获取任务数据"+data) tasks = get_tasks.data.comps for ( x in tasks){ - taskid = tasks[x].taskId + //taskid = tasks[x].taskId id = tasks[x].id - if(id ==1069){ - token = tasks[x].data.btn[0].iosAdUrl.split("?")[1] - } - if(id ==962){ + if(id == 962){ for (jingangs of tasks[x].data.jingang_list_ios ){ if(jingangs.jingangType==2){ tid = jingangs.jingangTid taskName = '【'+jingangs.jingangName+'】' RefererUrl = jingangs.jingangUrl $.log(taskName+"tid:"+tid) - //$.log(tasks[x].data.countDown[tid].countDown) if ($.isNode()){ await $.wait(1000) await get_pkg(); @@ -154,23 +151,24 @@ else if(tasks[x].data.countDown[tid].countDown ==0){ } } } - } else if(id ==1076){ - for ( tasklists of tasks[x].data.tasklist){ - tid = tasklists.id - taskName = tasklists.title + } else { + let taskArr = tasks[x].data.tasklist + for (y in taskArr){ + tid = taskArr[y].id + taskName = taskArr[y].title $.log(taskName+" tid:"+tid) - if(tasklists.type == 'openApp'){ - RefererUrl = tasklists.adLink + if(taskArr[y].type == 'openApp'){ + RefererUrl = taskArr[y].adLink await get_pkg() } - if(tasklists.type == 'watch'){ + if(taskArr[y].type == 'watch'){ // $.log(tasklists.+'\n') - cmd = tid==346 ? 100:184 + cmd = tid==346 ? 100:184 await get_search() - }; + }; } } - } + } } catch(e){ $.logErr(e, resp); } finally { @@ -218,11 +216,11 @@ function get_pkg() { } $.get(pkgurl, async(error, resp, data) => { let get_pkg = JSON.parse(data) - //$.log("数据: "+data+'\n') + // $.log("数据: "+data+'\n') if (get_pkg.errno == 0&&get_pkg.data.isDone ==0){ Pkg = get_pkg.data.adInfo[0].material.pkg taskid = get_pkg.data.taskPf.taskId; - // $.log("\n"+taskid +" "+ Pkg) + $.log("\n"+taskid +" "+ Pkg) await activeBox() } else if (get_pkg.errno == 0&&get_pkg.data.isDone ==1){ @@ -285,8 +283,9 @@ function activeBox() { return new Promise((resolve, reject) =>{ let actboxurl = { url: `https://haokan.baidu.com/activity/tasks/active?productid=2&id=${tid}`, - headers: {Cookie:cookieval,Referer: 'https://eopa.baidu.com/page/pagekey-ASKWNd8W?productid=2&type=1&tid=${tid}'} + headers: {Cookie:cookieval,Referer:RefererUrl} } +$.log(tid) $.get(actboxurl, async(error, response, data) => { //let act_box = JSON.parse(data) //$.log('actbox: ' + data) @@ -306,7 +305,7 @@ function Tasks() { } $.get(taskurl, async(error, response, data) => { let do_task = JSON.parse(data) - await $.wait(15000); + await $.wait(30000); //$.log(data+'\n') if (do_task.errno == 0){ $.desc += taskName + "获得收益"+ do_task.data.coin +"\n" @@ -359,7 +358,7 @@ function searchBox(id) { $.post(searchurl, async(error, resp, data) => { let do_search = JSON.parse(data) //$.log(data+'\n') - if (do_search.errno == 0 && do_search.data[`197`].istip == 1) { + if (do_search.errno == 0 && do_search.data['197'].istip == 1) { $.log(" 获得收益: " +do_search.data[`197`].tips+'\n') //$.desc += do_search.data[`197`].tips +"\n" } else { From ca547d7f91f4c7e96fbd5fec7aead8f94e51ad86 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 29 Dec 2020 00:36:07 +0800 Subject: [PATCH 248/721] Update baidu_speed.js --- Task/baidu_speed.js | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index f54debde1a..88ef7ec59f 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -45,12 +45,9 @@ if ($.isNode()) { await getsign(); await coinInfo(); await firstbox(); - //await acchristmas() await TaskCenter() - //await get_search(); - //await getRewards(); - //await drawPrize(); - //await get_pkg() + await getRewards(); + //await drawPrize(); } } })() @@ -108,16 +105,31 @@ function getRewards() { url: `https://haokan.baidu.com/activity/tasks/taskreward?productid=2`, headers: {Cookie:cookieval} } - $.get(rewurl, (error, response, data) => { + $.get(rewurl, async(error, response, data) => { let get_reward = JSON.parse(data) + await invite() if (get_reward.errno == 0&&get_reward.data.coin!==0){ $.desc += '获得收益: +' + get_reward.data.coin } - resolve() + resolve() + }) + }) +} + +function invite() { + return new Promise((resolve, reject) =>{ + let rewurl = { + url: `https://dwz.cn/iSUFu2b0`, + headers: {Cookie:cookieval} + } + $.get(rewurl, (error, response, data) => { + let get_reward = JSON.parse(data) + resolve() }) }) } + function TaskCenter() { return new Promise((resolve, reject) =>{ let rewurl = { @@ -220,7 +232,7 @@ function get_pkg() { if (get_pkg.errno == 0&&get_pkg.data.isDone ==0){ Pkg = get_pkg.data.adInfo[0].material.pkg taskid = get_pkg.data.taskPf.taskId; - $.log("\n"+taskid +" "+ Pkg) + //$.log("\n"+taskid +" "+ Pkg) await activeBox() } else if (get_pkg.errno == 0&&get_pkg.data.isDone ==1){ @@ -285,12 +297,11 @@ function activeBox() { url: `https://haokan.baidu.com/activity/tasks/active?productid=2&id=${tid}`, headers: {Cookie:cookieval,Referer:RefererUrl} } -$.log(tid) $.get(actboxurl, async(error, response, data) => { //let act_box = JSON.parse(data) //$.log('actbox: ' + data) - await $.wait(15000); - await Tasks(); + await $.wait(15000); + await Tasks(); resolve() }) }) From 7a67883e5fb75e62052d4d846035d70afefbdec5 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 29 Dec 2020 01:27:49 +0800 Subject: [PATCH 249/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 88ef7ec59f..d9f50b11b9 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -119,7 +119,7 @@ function getRewards() { function invite() { return new Promise((resolve, reject) =>{ let rewurl = { - url: `https://dwz.cn/iSUFu2b0`, + url: `https://haokan.baidu.com/activity/h5/vault?productid=2&inviteCode=WKQLC6&pkg=[pkg]`, headers: {Cookie:cookieval} } $.get(rewurl, (error, response, data) => { From 8c196a7b59c4439946fbcdc47b7101efc65da74a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 29 Dec 2020 09:36:39 +0800 Subject: [PATCH 250/721] Update baidu_speed.js --- Task/baidu_speed.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index d9f50b11b9..7b2b99f5a7 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -107,9 +107,9 @@ function getRewards() { } $.get(rewurl, async(error, response, data) => { let get_reward = JSON.parse(data) - await invite() if (get_reward.errno == 0&&get_reward.data.coin!==0){ - $.desc += '获得收益: +' + get_reward.data.coin + $.desc += '获得总收益: +' + get_reward.data.coin + await invite() } resolve() }) @@ -119,7 +119,7 @@ function getRewards() { function invite() { return new Promise((resolve, reject) =>{ let rewurl = { - url: `https://haokan.baidu.com/activity/h5/vault?productid=2&inviteCode=WKQLC6&pkg=[pkg]`, + url: `https://dwz.cn/iSUFu2b0`, headers: {Cookie:cookieval} } $.get(rewurl, (error, response, data) => { @@ -167,13 +167,15 @@ else if(tasks[x].data.countDown[tid].countDown ==0){ let taskArr = tasks[x].data.tasklist for (y in taskArr){ tid = taskArr[y].id - taskName = taskArr[y].title + taskName = "【"+taskArr[y].title+"】" $.log(taskName+" tid:"+tid) - if(taskArr[y].type == 'openApp'){ + if (taskArr[y].taskStatus==1 ){ + $.log(taskName +" 已完成" ) + $.desc += taskName +" 已完成" + }else if(taskArr[y].type == 'openApp'){ RefererUrl = taskArr[y].adLink await get_pkg() - } - if(taskArr[y].type == 'watch'){ + } else if(taskArr[y].type == 'watch'){ // $.log(tasklists.+'\n') cmd = tid==346 ? 100:184 await get_search() @@ -300,7 +302,7 @@ function activeBox() { $.get(actboxurl, async(error, response, data) => { //let act_box = JSON.parse(data) //$.log('actbox: ' + data) - await $.wait(15000); + await $.wait(5000); await Tasks(); resolve() }) @@ -316,7 +318,7 @@ function Tasks() { } $.get(taskurl, async(error, response, data) => { let do_task = JSON.parse(data) - await $.wait(30000); + await $.wait(3000); //$.log(data+'\n') if (do_task.errno == 0){ $.desc += taskName + "获得收益"+ do_task.data.coin +"\n" @@ -346,7 +348,7 @@ function get_search() { searchname = get_search.data[`${cmd}`].itemlist.items[item].data.title $.log(" 阅读任务: "+searchname+ "\n 任务ID: "+searchId) await searchBox(searchId) - await $.wait(30000) + await $.wait(5000) } //$.desc += taskName + do_search.data[`${cmd}`].tips +"\n" } else { @@ -373,7 +375,7 @@ function searchBox(id) { $.log(" 获得收益: " +do_search.data[`197`].tips+'\n') //$.desc += do_search.data[`197`].tips +"\n" } else { - //$.log("\n") + $.log("\n") } resolve() }) From 5b5f744b6b28dea1cc6e5ec1f399420a93bc5255 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 29 Dec 2020 10:48:41 +0800 Subject: [PATCH 251/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 7b2b99f5a7..6d35025241 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -119,7 +119,7 @@ function getRewards() { function invite() { return new Promise((resolve, reject) =>{ let rewurl = { - url: `https://dwz.cn/iSUFu2b0`, + url: `https://haokan.baidu.com/activity/h5/vault?productid=2&inviteCode=WKQLC6&pkg=%5Bpkg%5D `, headers: {Cookie:cookieval} } $.get(rewurl, (error, response, data) => { From b81b2a874d2c311147a0af39db601edd9059b586 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 29 Dec 2020 11:07:24 +0800 Subject: [PATCH 252/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 6d35025241..22a79e51de 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -123,7 +123,7 @@ function invite() { headers: {Cookie:cookieval} } $.get(rewurl, (error, response, data) => { - let get_reward = JSON.parse(data) + // let get_reward = JSON.parse(data) resolve() }) }) From 6604e3a2a4e79df81ac16159193cad771b60779f Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 29 Dec 2020 11:26:20 +0800 Subject: [PATCH 253/721] Update baidu_speed.js --- Task/baidu_speed.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 22a79e51de..64e729b13b 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -302,7 +302,7 @@ function activeBox() { $.get(actboxurl, async(error, response, data) => { //let act_box = JSON.parse(data) //$.log('actbox: ' + data) - await $.wait(5000); + await $.wait(25000); await Tasks(); resolve() }) @@ -318,7 +318,7 @@ function Tasks() { } $.get(taskurl, async(error, response, data) => { let do_task = JSON.parse(data) - await $.wait(3000); + await $.wait(20000); //$.log(data+'\n') if (do_task.errno == 0){ $.desc += taskName + "获得收益"+ do_task.data.coin +"\n" @@ -348,7 +348,7 @@ function get_search() { searchname = get_search.data[`${cmd}`].itemlist.items[item].data.title $.log(" 阅读任务: "+searchname+ "\n 任务ID: "+searchId) await searchBox(searchId) - await $.wait(5000) + await $.wait(30000) } //$.desc += taskName + do_search.data[`${cmd}`].tips +"\n" } else { From a10949910be8419e7d9b8f009a4e80f60a416684 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 02:56:02 +0800 Subject: [PATCH 254/721] Create jukan.js --- Task/jukan.js | 220 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 Task/jukan.js diff --git a/Task/jukan.js b/Task/jukan.js new file mode 100644 index 0000000000..8312b81182 --- /dev/null +++ b/Task/jukan.js @@ -0,0 +1,220 @@ +/* +聚看点极速版签到任务 +打开'我的'获取Cookie + +https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js + +~~~~~~~~~~~~~~~~ + +*/ +const $ = new Env('聚看点') + +let CookieArr=[],BodyArr=[]; +let cookie = $.getdata('jukan_ck') +let bodys = $.getdata('jukan_body') + +if ($.isNode()) { + if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('&') > -1) { + JKCookie = process.env.JUKAN_COOKIE.split('&'); + } + if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('\n') > -1) { + JKCookie = process.env.JUKAN_COOKIE.split('\n'); + } else { + JKCookie = process.env.JUKAN_COOKIE.split() + } + if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('&') > -1) { + JKbody = process.env.BODY_BODY.split('&'); + } + if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('\n') > -1) { + JKbody = process.env.JUKAN_BODY.split('\n'); + } else { + JKbody = process.env.JUKAN_BODY.split() + } + Object.keys(JKCookie).forEach((item) => { + if (JKCookie[item]) { + CookieArr.push(JKCookie[item]) + } + }) + Object.keys(JKbody).forEach((item) => { + if (JKbody[item]) { + BodyArr.push(JKbody[item]) + } + }) +} else if (CookieArr.indexOf("&")>-1 &&BodyArr.indexOf("&")>-1){ + CookieArr.push(cookie.split("&")) + BodyArr.push(bodys.split("&")) +} else { + CookieArr.push(cookie) + BodyArr.push(bodys) +} + +if ($.isNode()) { + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) +} + +if (typeof $request !== 'undefined') { + if ($request && $request.method != `OPTIONS`) { + const bodyVal = $request.body + const Cookieval = $request.headers['Cookie'] + if(Cookieval)$.setdata(Cookieval,'jukan_ck') + if(bodyVal)$.setdata(bodyVal,'jukan_body') + $.log(`Cookie:${Cookieval}`) + $.log(`bodyVal:${bodyVal}`) + $.msg($.name,"获取Cookie成功") + $.done() + } +} else { +!(async() => { + if (!CookieArr[0]) { + console.log($.name, '【提示】请把聚看点Cookie填入Github 的 Secrets 中,请以&或者换行隔开') + return; + } + console.log(`您共提供${CookieArr.length}个聚看点账号Cookie`) + for (let i = 0; i < CookieArr.length; i++) { + if (CookieArr[i]) { + cookieval = CookieArr[i] + bodyval = BodyArr[i] + ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) + $.index = i + 1; + await getsign(); + await userinfo() + await artList() + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) +} +//签到 +function getsign() { + return new Promise((resolve, reject) =>{ + let signurl = { + url: `https://www.xiaodouzhuan.cn/jkd/user/usersign.action`, + headers: {Cookie:cookieval}, + body: bodyval + } + $.post(signurl, async(error, response, data) => { + let get_sign = JSON.parse(data) + //$.log(data) + if (get_sign.ret == "ok"){ + $.sub = `签到成功🎉` + $.desc = `签到收益: +${get_sign.todaySignProfit}${get_sign.todaySignProfitType}💰,明日 +${get_sign.tomorrowSignProfit}${get_sign.tomorrowSignProfitType} 已签到 ${get_sign.signDays} 天` ; + $.log($.desc) + await invite() + } + else if (get_sign.rtn_code == "R-ART-0008"){ + $.sub = get_sign.rtn_msg + $.desc = `` + $.log($.sub) + } + else { + $.sub = `签到失败❌` + $.desc = `说明: `+ get_sign.rtn_msg + $.msg($.name,$.sub,$.desc) + return + } + resolve() + }) + }) +} + +function userinfo() { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://www.xiaodouzhuan.cn/jkd/newMobileMenu/infoMe.action`, + headers: {Cookie:cookieval}, + body: bodyval + } + $.post(infourl, async(error, resp, data) => { + let get_info = JSON.parse(data) + if( get_info.ret=="ok"){ + userName = get_info.userinfo.username + sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeCurCashItem.value + curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value + gold = get_info.userinfo.infoMeGoldItem.title+get_info.userinfo.infoMeGoldItem.value + $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) + } + resolve() + }) + }) +} + + +function artList() { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artlist.action`, + headers: {Cookie:cookieval}, + body: bodyval + } + $.post(infourl, async(error, resp, data) => { + let get_list = JSON.parse(data) + $.log("【开始自动阅读】") + if (get_list.ret == "ok"){ + for( lists of get_list.artlist){ + if(lists.item_type=="article"){ + art_Title = lists.art_title + artid =lists.art_id + screen_Name = lists.screen_name + $.log(" "+art_Title +" -------- <"+screen_Name +">\n ") + await readTask(lists.art_id,lists.open_url) + } + } + } + resolve() + }) + }) +} + + +function readTask(artid,readurl) { + return new Promise((resolve, reject) =>{ + let rewurl = { + url: readurl, + headers: {Cookie:cookieval}, + body: `openID=${ID}&articleID=${artid}&ce=iOS&articlevideo=0&event=oa&advCodeRandom=0&isShowAdv=1` + } + $.post(rewurl, async(error, resp, data) => { + if(resp.statusCode ==200){ + await $.wait(30000) + await finishTask(artid) + } else { + $.log("阅读失败: "+data) + } + resolve() + }) + }) +} + +function finishTask(artid) { + return new Promise((resolve, reject) =>{ + let finishurl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, + headers: {Cookie:cookieval}, + body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":1,"channel":"IOS-qianzhuan","apptoken":"xzwltoken070704","appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` + } + $.post(finishurl, async(error, response, data) => { + $.log(data+"\n") + let do_read = JSON.parse(data) + if (do_read.ret == "ok"){ + $.log("获得收益: +"+do_read.profit +"\n") + // $.desc += '获得总收益: +' + get_reward.data.coin + //await invite() + } + resolve() + }) + }) +} + +function invite() { + let rewurl = { + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/member/receiveMonkeyXd.action?userid=f99d2227a3be4a1599e936e0522537ac`, + headers: {Cookie:cookieval} + } + $.get(rewurl, (error, response, data) => { + }) +} + + +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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 6b5fb6de9bac4afb4180160b705b66958df1c7a1 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 10:40:11 +0800 Subject: [PATCH 255/721] Update jukan.js --- Task/jukan.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 8312b81182..db2cc7fb9b 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -76,10 +76,13 @@ if (typeof $request !== 'undefined') { cookieval = CookieArr[i] bodyval = BodyArr[i] ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) + bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] $.index = i + 1; await getsign(); await userinfo() + for ( readbodyVal of bodys){ await artList() + } } } })() @@ -139,17 +142,18 @@ function userinfo() { }) }) } - - function artList() { return new Promise((resolve, reject) =>{ + let infourl = { url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artlist.action`, headers: {Cookie:cookieval}, - body: bodyval + body: readbodyVal } + //$.log(infourl.body) $.post(infourl, async(error, resp, data) => { let get_list = JSON.parse(data) + //$.log( data) $.log("【开始自动阅读】") if (get_list.ret == "ok"){ for( lists of get_list.artlist){ @@ -157,9 +161,17 @@ function artList() { art_Title = lists.art_title artid =lists.art_id screen_Name = lists.screen_name - $.log(" "+art_Title +" -------- <"+screen_Name +">\n ") + $.log("正在阅读文章: "+art_Title +" -------- <"+screen_Name +">\n ") await readTask(lists.art_id,lists.open_url) } + if(lists.item_type=="video"){ + art_Title = lists.art_title + artid =lists.art_id + screen_Name = lists.screen_name + artvideo = 1 + $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") + await readTask(lists.art_id,lists.open_url) + } } } resolve() @@ -171,9 +183,9 @@ function artList() { function readTask(artid,readurl) { return new Promise((resolve, reject) =>{ let rewurl = { - url: readurl, + url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artDetail.action`, headers: {Cookie:cookieval}, - body: `openID=${ID}&articleID=${artid}&ce=iOS&articlevideo=0&event=oa&advCodeRandom=0&isShowAdv=1` + body: `jsondata={ "appid" : "xzwl", "channel" : "IOS-qianzhuan", "psign" : "0cf94b87f584dfc81a87fa74dcb3757f", "appversioncode" : "6006", "time" : "1609293915", "relate" : 1, "requestid" : "1609293912717038", "artid" : "${artid}", "os" : "IOS",${ID}, "apptoken" : "xzwltoken070704", "appversion" : "60.0.6"}` } $.post(rewurl, async(error, resp, data) => { if(resp.statusCode ==200){ From 0539a9545556e8b671e1029fc3fc644a4f4c7f6e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 10:43:59 +0800 Subject: [PATCH 256/721] Create jukan.yml --- .github/workflows/jukan.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/jukan.yml diff --git a/.github/workflows/jukan.yml b/.github/workflows/jukan.yml new file mode 100644 index 0000000000..6ccea2b63f --- /dev/null +++ b/.github/workflows/jukan.yml @@ -0,0 +1,42 @@ + +name: 聚看点 + +on: + workflow_dispatch: + schedule: + - cron: '*/10 */2 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + JUKAN_COOKIE: ${{ secrets.JUKAN_COOKIE }} + JUKAN_BODY: ${{ secrets.JUKAN_BODY }} + TZ: Asia/shanghai + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【聚看点】' + if: env.JUKAN_COOKIE + run: | + cd ~/Scripts + node Task/jukan.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} From 663129070643594be342a5a33ff8fdbae1bd1bb7 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 12:47:40 +0800 Subject: [PATCH 257/721] Update jukan.js --- Task/jukan.js | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index db2cc7fb9b..25bd424d9f 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -12,6 +12,7 @@ const $ = new Env('聚看点') let CookieArr=[],BodyArr=[]; let cookie = $.getdata('jukan_ck') let bodys = $.getdata('jukan_body') +let UA = 'QianZhuan/60.0.6 (iPhone; iOS 13.7; Scale/3.00)' if ($.isNode()) { if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('&') > -1) { @@ -76,6 +77,8 @@ if (typeof $request !== 'undefined') { cookieval = CookieArr[i] bodyval = BodyArr[i] ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) + apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) + $.log(apptoken) bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] $.index = i + 1; await getsign(); @@ -94,7 +97,7 @@ function getsign() { return new Promise((resolve, reject) =>{ let signurl = { url: `https://www.xiaodouzhuan.cn/jkd/user/usersign.action`, - headers: {Cookie:cookieval}, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval } $.post(signurl, async(error, response, data) => { @@ -126,7 +129,7 @@ function userinfo() { return new Promise((resolve, reject) =>{ let infourl = { url: `https://www.xiaodouzhuan.cn/jkd/newMobileMenu/infoMe.action`, - headers: {Cookie:cookieval}, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval } $.post(infourl, async(error, resp, data) => { @@ -144,33 +147,32 @@ function userinfo() { } function artList() { return new Promise((resolve, reject) =>{ - let infourl = { url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artlist.action`, - headers: {Cookie:cookieval}, + headers: {Cookie:cookieval,'User-Agent':UA}, body: readbodyVal } - //$.log(infourl.body) $.post(infourl, async(error, resp, data) => { let get_list = JSON.parse(data) //$.log( data) $.log("【开始自动阅读】") if (get_list.ret == "ok"){ for( lists of get_list.artlist){ - if(lists.item_type=="article"){ art_Title = lists.art_title artid =lists.art_id screen_Name = lists.screen_name + if(lists.item_type=="article"){ + arttype = "1" $.log("正在阅读文章: "+art_Title +" -------- <"+screen_Name +">\n ") - await readTask(lists.art_id,lists.open_url) + await readTask(lists.art_id,arttype) } if(lists.item_type=="video"){ - art_Title = lists.art_title - artid =lists.art_id - screen_Name = lists.screen_name - artvideo = 1 + arttype = "2" $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") - await readTask(lists.art_id,lists.open_url) + await readTask(lists.art_id,arttype) + } + if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0017`){ + break } } } @@ -180,17 +182,18 @@ function artList() { } -function readTask(artid,readurl) { +function readTask(artid,arttype) { return new Promise((resolve, reject) =>{ let rewurl = { url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artDetail.action`, - headers: {Cookie:cookieval}, - body: `jsondata={ "appid" : "xzwl", "channel" : "IOS-qianzhuan", "psign" : "0cf94b87f584dfc81a87fa74dcb3757f", "appversioncode" : "6006", "time" : "1609293915", "relate" : 1, "requestid" : "1609293912717038", "artid" : "${artid}", "os" : "IOS",${ID}, "apptoken" : "xzwltoken070704", "appversion" : "60.0.6"}` + headers: {Cookie:cookieval,'User-Agent':UA}, + body: `jsondata={"appid":"xzwl","channel":"IOS-qianzhuan","psign":"0cf94b87f584dfc81a87fa74dcb3757f","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"60.0.6"}` } $.post(rewurl, async(error, resp, data) => { + //$.log(data) if(resp.statusCode ==200){ - await $.wait(30000) - await finishTask(artid) + await $.wait(32000) + await finishTask(artid,arttype) } else { $.log("阅读失败: "+data) } @@ -199,20 +202,19 @@ function readTask(artid,readurl) { }) } -function finishTask(artid) { +function finishTask(artid,arttype) { return new Promise((resolve, reject) =>{ let finishurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, - headers: {Cookie:cookieval}, - body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":1,"channel":"IOS-qianzhuan","apptoken":"xzwltoken070704","appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` + headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS-qianzhuan",${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` } $.post(finishurl, async(error, response, data) => { $.log(data+"\n") let do_read = JSON.parse(data) + taskresult = do_read.rtn_code if (do_read.ret == "ok"){ $.log("获得收益: +"+do_read.profit +"\n") - // $.desc += '获得总收益: +' + get_reward.data.coin - //await invite() + // $.desc += '获得总收益: +' + } resolve() }) From 656e0ad2e51e11b507ba344f9a40eb231aa91641 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 16:02:10 +0800 Subject: [PATCH 258/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 83 +++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 62d3ede61e..36aeb227ef 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -3,16 +3,16 @@ "name": "Sunert 签到应用订阅", "author": "@Sunert", "icon": "https://avatars2.githubusercontent.com/u/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", - "repo": "https://gitee.com/Sunert/Scripts/tree/master", + "repo": "https://github.com/Sunert/Scripts/tree/master", "apps": [ { "id": "weibo", "name": "新浪微博", "keys": ["sy_payheader_wb", "sy_token_wb"], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/weibo.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", "https://raw.githubusercontent.com/Orz-3/task/master/weibo.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/weibo.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/weibo.js" }, { "id": "youth", @@ -35,18 +35,18 @@ "desc": "调试日志开关,默认关闭" } ], - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/youth.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/youth.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/youth.js" }, { "id": "youthGain", "name": "中青浏览赚", "keys": ["youth_start", "youth_end"], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/youth_gain.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/youth_gain.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/youth_gain.js" }, { "id": "dianshijia", @@ -70,36 +70,36 @@ "label": "1888金币" }] }], - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/dianshijia.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/dianshijia.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/dianshijia.js" }, { "id": "kuaishou", "name": "快手极速版", "keys": ["cookie_ks"], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/kuaishou.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", "https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/kuaishou.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/kuaishou.js" }, { "id": "sinanews", "name": "新浪新闻", "keys": ["sy_signurl_snews", "sy_info_snews", "sy_ck_snews", "sy_infoheader_snews"], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/sinanews.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/sinanews.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/sinanews.js" }, { "id": "NOWLIVE", "name": "NOW直播", "keys": ["now_qq", "nowqq_cookie"], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", - "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/NOWLIVE.js" + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/NOWLIVE.js" }, { "id": "chinatelecomEnquiry", @@ -115,16 +115,16 @@ } ], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", "https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/telecomInfinity.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/telecomInfinity.js" }, { "id": "jddj", "name": "京东到家", "keys": ["sy_cookie_dj"], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/jddj.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jddj.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", "https://raw.githubusercontent.com/Orz-3/task/master/jddj.png"], "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js" }, @@ -139,9 +139,9 @@ "type": "text", "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" }], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/tvpreview.js" + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/tvpreview.js" }, { "id": "moji", @@ -198,18 +198,27 @@ "desc": "可显示生活指数情况" }], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/moji.js", - "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/moji.js" + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/moji.js" + }, + { + "id": "jukan", + "name": "聚看点", + "keys": ["jukan_ck","jukan_body"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/jukan.js" }, { "id": "mydigit", "name": "数码之家", "keys": ["sign_mydigit"], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/mydigit.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/mydigit.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/mydigit.js" }, { "id": "txnews", @@ -234,18 +243,18 @@ "desc": "接口延迟时间" } ], - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/txnews.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", "https://raw.githubusercontent.com/Orz-3/task/master/txnews.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/txnews.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/txnews.js" }, { "id": "jingxi", "name": "京喜", "keys": ["CookieJD", "CookieJD2"], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/jingxi.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jingxi.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jingxi.png", "https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/jingxi.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/jingxi.js" }, { "id": "translate", @@ -259,9 +268,9 @@ "placeholder": "Hello World", "desc": "兼容中英文短语翻译,填入原文后手动运行" }], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/tvpreview.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", "https://raw.githubusercontent.com/Orz-3/task/master/translate.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/translate.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/translate.js" }, { "id": "exchange rate", @@ -291,9 +300,9 @@ } ], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", "https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/exchangeRate.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/exchangeRate.js" }, { "id": "trainquery", @@ -346,9 +355,9 @@ } ], "author": "@sunert", - "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/trainquery.js", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", "https://raw.githubusercontent.com/Orz-3/task/master/12306.png"], - "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/trainquery.js" + "script": "https://github.com/Sunert/Scripts/raw/master/Task/trainquery.js" } ] } From b4e4294e84ab9223bdba8422e1926f60c2a17ba9 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 16:11:37 +0800 Subject: [PATCH 259/721] Update Sunert_Task.json --- Task/Sunert_Task.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index 1f8dc460a5..45eb15afe3 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -18,11 +18,11 @@ "20 5 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js, tag=中青浏览赚 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png", "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js, tag=京喜 ,img-url= https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png", - "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气 ,img-url=https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png" + "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气 ,img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png", + "*/10 */3 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js, tag=聚看点 ,img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png", + "*/30 * * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baidu_speed.js, tag=百度极速版 ,img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed.png" ], } - - - \ No newline at end of file + From 4c5cf6fc85de00197c1f7fd98b2f592ba154b8eb Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 20:08:45 +0800 Subject: [PATCH 260/721] Update jukan.js --- Task/jukan.js | 75 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 11 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 25bd424d9f..c342174983 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -78,14 +78,19 @@ if (typeof $request !== 'undefined') { bodyval = BodyArr[i] ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) - $.log(apptoken) bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] $.index = i + 1; await getsign(); - await userinfo() for ( readbodyVal of bodys){ await artList() } + position = "17" + await Stimulate() + for( boxtype of [1,2]){ + await $.wait(1000) + await BoxProfit(boxtype) + } + await userinfo() } } })() @@ -105,8 +110,7 @@ function getsign() { //$.log(data) if (get_sign.ret == "ok"){ $.sub = `签到成功🎉` - $.desc = `签到收益: +${get_sign.todaySignProfit}${get_sign.todaySignProfitType}💰,明日 +${get_sign.tomorrowSignProfit}${get_sign.tomorrowSignProfitType} 已签到 ${get_sign.signDays} 天` ; - $.log($.desc) + $.desc = `签到收益: +${get_sign.todaySignProfit}${get_sign.todaySignProfitType}💰,明日 +${get_sign.tomorrowSignProfit}${get_sign.tomorrowSignProfitType} 已签到 ${get_sign.signDays} 天\n` ; await invite() } else if (get_sign.rtn_code == "R-ART-0008"){ @@ -118,7 +122,7 @@ function getsign() { $.sub = `签到失败❌` $.desc = `说明: `+ get_sign.rtn_msg $.msg($.name,$.sub,$.desc) - return + $.done() } resolve() }) @@ -137,9 +141,12 @@ function userinfo() { if( get_info.ret=="ok"){ userName = get_info.userinfo.username sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeCurCashItem.value - curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value - gold = get_info.userinfo.infoMeGoldItem.title+get_info.userinfo.infoMeGoldItem.value + curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value + gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) + $.sub += " "+gold + $.desc += sumcash + "/"+curcash + $.msg($.name+" 昵称:"+userName, $.sub, $.desc) } resolve() }) @@ -158,16 +165,20 @@ function artList() { $.log("【开始自动阅读】") if (get_list.ret == "ok"){ for( lists of get_list.artlist){ + if(lists.item_type=="article"){ art_Title = lists.art_title artid =lists.art_id - screen_Name = lists.screen_name - if(lists.item_type=="article"){ arttype = "1" + screen_Name = lists.screen_name $.log("正在阅读文章: "+art_Title +" -------- <"+screen_Name +">\n ") await readTask(lists.art_id,arttype) } if(lists.item_type=="video"){ + art_Title = lists.art_title + artid =lists.art_id arttype = "2" + screen_Name = lists.screen_name + artvideo = 1 $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") await readTask(lists.art_id,arttype) } @@ -192,7 +203,7 @@ function readTask(artid,arttype) { $.post(rewurl, async(error, resp, data) => { //$.log(data) if(resp.statusCode ==200){ - await $.wait(32000) + await $.wait(31000) await finishTask(artid,arttype) } else { $.log("阅读失败: "+data) @@ -214,13 +225,55 @@ function finishTask(artid,arttype) { taskresult = do_read.rtn_code if (do_read.ret == "ok"){ $.log("获得收益: +"+do_read.profit +"\n") - // $.desc += '获得总收益: +' + } resolve() }) }) } +//激励视频 +function Stimulate() { + return new Promise((resolve, reject) =>{ + let stimurl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/stimulateAdvAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","channel":"iOS"}` + } + $.post(stimurl, async(error, response, data) => { + //$.log(data+"\n") + let do_stim = JSON.parse(data) + if ( do_stim.ret == "ok"){ + $.log( do_stim.profit_title+": +"+ do_stim.profit +"(以实际情况为准)") + } + resolve() + }) + }) +} + +function BoxProfit() { + return new Promise((resolve, reject) =>{ + let profiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/task/getTaskBoxProfit.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: `box_type=${boxtype}` + } + $.post(profiturl, async(error, resp, data) => { + //$.log(data+"\n") + let do_box = JSON.parse(data) + if (do_box.ret == "ok"&&do_box.profit>0){ + $.log("获得收益: +"+do_box.profit) + position = do_box.advertPopup.position + await Stimulate() + $.log(position) + } + else if (do_box.rtn_code=='TAS-A-1'){ + $.log("计时金币"+do_box.rtn_msg) + } + resolve() + }) + }) +} + + function invite() { let rewurl = { url: `https://www.xiaodouzhuan.cn/jkd/weixin20/member/receiveMonkeyXd.action?userid=f99d2227a3be4a1599e936e0522537ac`, From 78334c75b94dec8987a89c3a3b18fa6a89f4aaa7 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 21:17:52 +0800 Subject: [PATCH 261/721] Update jukan.js --- Task/jukan.js | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index c342174983..998317f380 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -4,6 +4,7 @@ https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js +hostname = www.xiaodouzhuan.cn ~~~~~~~~~~~~~~~~ */ @@ -81,11 +82,11 @@ if (typeof $request !== 'undefined') { bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] $.index = i + 1; await getsign(); + await signShare(); for ( readbodyVal of bodys){ - await artList() + await artList() } - position = "17" - await Stimulate() + await Stimulate("17") for( boxtype of [1,2]){ await $.wait(1000) await BoxProfit(boxtype) @@ -129,6 +130,27 @@ function getsign() { }) } +function signShare() { + return new Promise((resolve, reject) =>{ + let profiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/signShareAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval + } + $.post(profiturl, async(error, resp, data) => { + //$.log(data+"\n") + let sign_share = JSON.parse(data) + if (sign_share.ret == "ok"){ + $.log("签到分享收益: +"+sign_share.profit) + await Stimulate("23") + } else { + $.log(sign_share.rtn_msg) + } + resolve() + }) + }) +} + + function userinfo() { return new Promise((resolve, reject) =>{ let infourl = { @@ -232,7 +254,7 @@ function finishTask(artid,arttype) { } //激励视频 -function Stimulate() { +function Stimulate(position) { return new Promise((resolve, reject) =>{ let stimurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/stimulateAdvAccount.action`, @@ -262,7 +284,7 @@ function BoxProfit() { if (do_box.ret == "ok"&&do_box.profit>0){ $.log("获得收益: +"+do_box.profit) position = do_box.advertPopup.position - await Stimulate() + await Stimulate(position) $.log(position) } else if (do_box.rtn_code=='TAS-A-1'){ From 1a77fa7dd22cdf41e865b1f08dfce0c8c0d73898 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 22:07:53 +0800 Subject: [PATCH 262/721] Update jukan.js --- Task/jukan.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 998317f380..8abb613985 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -42,9 +42,13 @@ if ($.isNode()) { BodyArr.push(JKbody[item]) } }) -} else if (CookieArr.indexOf("&")>-1 &&BodyArr.indexOf("&")>-1){ - CookieArr.push(cookie.split("&")) - BodyArr.push(bodys.split("&")) +} else if (cookie.indexOf('&')>-1 &&bodys.indexOf('&')>-1){ + Object.keys(cookie.split('&')).forEach((item) => { + CookieArr.push(cookie.split('&')[item]) + }) + Object.keys(bodys.split('&')).forEach((item) => { + BodyArr.push(bodys.split('&')[item]) + }) } else { CookieArr.push(cookie) BodyArr.push(bodys) @@ -168,7 +172,7 @@ function userinfo() { $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) $.sub += " "+gold $.desc += sumcash + "/"+curcash - $.msg($.name+" 昵称:"+userName, $.sub, $.desc) + $.msg($.name+" 昵称:"+userName, $.sub, $.desc+"\n") } resolve() }) From de871096a65f2070bda3e95d818a303c29b7a782 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 22:37:22 +0800 Subject: [PATCH 263/721] Update jukan.js --- Task/jukan.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 8abb613985..d270e291fb 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -85,8 +85,8 @@ if (typeof $request !== 'undefined') { apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] $.index = i + 1; - await getsign(); - await signShare(); + await getsign(); + await signShare(); for ( readbodyVal of bodys){ await artList() } @@ -208,7 +208,7 @@ function artList() { $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") await readTask(lists.art_id,arttype) } - if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0017`){ + if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0011`){ break } } From c446c1efe0627727042d10c589cd623e08d19aed Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 22:42:01 +0800 Subject: [PATCH 264/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index d270e291fb..dd5832ecea 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -283,7 +283,7 @@ function BoxProfit() { headers: {Cookie:cookieval,'User-Agent':UA}, body: `box_type=${boxtype}` } $.post(profiturl, async(error, resp, data) => { - //$.log(data+"\n") + $.log(data+"\n") let do_box = JSON.parse(data) if (do_box.ret == "ok"&&do_box.profit>0){ $.log("获得收益: +"+do_box.profit) From 26d76b22929ab134fe6009292119949abadbb3c4 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 22:47:41 +0800 Subject: [PATCH 265/721] Update jukan.js --- Task/jukan.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Task/jukan.js b/Task/jukan.js index dd5832ecea..661f565f7c 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -282,6 +282,8 @@ function BoxProfit() { url: `https://www.xiaodouzhuan.cn/jkd/task/getTaskBoxProfit.action`, headers: {Cookie:cookieval,'User-Agent':UA}, body: `box_type=${boxtype}` } + +$.log(profiturl.body) $.post(profiturl, async(error, resp, data) => { $.log(data+"\n") let do_box = JSON.parse(data) From 1323bdca97ce7f6f790219165af3f198d5c5a8b8 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 22:58:12 +0800 Subject: [PATCH 266/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index 661f565f7c..3285e7ad08 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -25,7 +25,7 @@ if ($.isNode()) { JKCookie = process.env.JUKAN_COOKIE.split() } if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('&') > -1) { - JKbody = process.env.BODY_BODY.split('&'); + JKbody = process.env.JUKAN_BODY.split('&'); } if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('\n') > -1) { JKbody = process.env.JUKAN_BODY.split('\n'); From 99a9b79df9efa0be1ae61707735dd054e434966a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 23:55:46 +0800 Subject: [PATCH 267/721] Update jukan.js --- Task/jukan.js | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 3285e7ad08..c09300a560 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -13,7 +13,7 @@ const $ = new Env('聚看点') let CookieArr=[],BodyArr=[]; let cookie = $.getdata('jukan_ck') let bodys = $.getdata('jukan_body') -let UA = 'QianZhuan/60.0.6 (iPhone; iOS 13.7; Scale/3.00)' +let UA = 'JuKanDian/5.6.5 (iPhone; iOS 14.2; Scale/3.00)' if ($.isNode()) { if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('&') > -1) { @@ -25,7 +25,7 @@ if ($.isNode()) { JKCookie = process.env.JUKAN_COOKIE.split() } if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('&') > -1) { - JKbody = process.env.JUKAN_BODY.split('&'); + JKbody = process.env.BODY_BODY.split('&'); } if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('\n') > -1) { JKbody = process.env.JUKAN_BODY.split('\n'); @@ -85,10 +85,10 @@ if (typeof $request !== 'undefined') { apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] $.index = i + 1; - await getsign(); - await signShare(); - for ( readbodyVal of bodys){ - await artList() + await getsign(); + await signShare(); + for (readbodyVal of bodys){ + await artList(readbodyVal) } await Stimulate("17") for( boxtype of [1,2]){ @@ -178,7 +178,7 @@ function userinfo() { }) }) } -function artList() { +function artList(readbodyVal) { return new Promise((resolve, reject) =>{ let infourl = { url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artlist.action`, @@ -194,21 +194,19 @@ function artList() { if(lists.item_type=="article"){ art_Title = lists.art_title artid =lists.art_id - arttype = "1" screen_Name = lists.screen_name $.log("正在阅读文章: "+art_Title +" -------- <"+screen_Name +">\n ") - await readTask(lists.art_id,arttype) + await readTask(lists.art_id,"1") } if(lists.item_type=="video"){ art_Title = lists.art_title artid =lists.art_id arttype = "2" screen_Name = lists.screen_name - artvideo = 1 $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") - await readTask(lists.art_id,arttype) + await readTask(lists.art_id,"2") } - if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0011`){ + if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0017`){ break } } @@ -282,10 +280,8 @@ function BoxProfit() { url: `https://www.xiaodouzhuan.cn/jkd/task/getTaskBoxProfit.action`, headers: {Cookie:cookieval,'User-Agent':UA}, body: `box_type=${boxtype}` } - -$.log(profiturl.body) $.post(profiturl, async(error, resp, data) => { - $.log(data+"\n") + //$.log(data+"\n") let do_box = JSON.parse(data) if (do_box.ret == "ok"&&do_box.profit>0){ $.log("获得收益: +"+do_box.profit) From 30dd46f2084b3a0f107e3de0b08705623b9e5f84 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 30 Dec 2020 23:58:19 +0800 Subject: [PATCH 268/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index c09300a560..6f673e9d2e 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -25,7 +25,7 @@ if ($.isNode()) { JKCookie = process.env.JUKAN_COOKIE.split() } if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('&') > -1) { - JKbody = process.env.BODY_BODY.split('&'); + JKbody = process.env.JUKAN_BODY.split('&'); } if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('\n') > -1) { JKbody = process.env.JUKAN_BODY.split('\n'); From d50baa2a912ea7bd0fd985d93b6b4554c688ff25 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 00:16:47 +0800 Subject: [PATCH 269/721] Update jukan.js --- Task/jukan.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Task/jukan.js b/Task/jukan.js index 6f673e9d2e..26ea634da5 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -280,6 +280,8 @@ function BoxProfit() { url: `https://www.xiaodouzhuan.cn/jkd/task/getTaskBoxProfit.action`, headers: {Cookie:cookieval,'User-Agent':UA}, body: `box_type=${boxtype}` } + $.log(boxtype) + $.log(cookieval) $.post(profiturl, async(error, resp, data) => { //$.log(data+"\n") let do_box = JSON.parse(data) From 037b5e906b0f7646219b4c31d5d7084d25c8e3f3 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 00:27:46 +0800 Subject: [PATCH 270/721] Update jukan.js --- Task/jukan.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 26ea634da5..04dcb4dc94 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -88,14 +88,14 @@ if (typeof $request !== 'undefined') { await getsign(); await signShare(); for (readbodyVal of bodys){ - await artList(readbodyVal) + await artList(readbodyVal) } - await Stimulate("17") + await Stimulate("17") for( boxtype of [1,2]){ - await $.wait(1000) - await BoxProfit(boxtype) + await $.wait(1000) + await BoxProfit(boxtype) } - await userinfo() + await userinfo() } } })() @@ -168,7 +168,7 @@ function userinfo() { userName = get_info.userinfo.username sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeCurCashItem.value curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value - gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value + gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) $.sub += " "+gold $.desc += sumcash + "/"+curcash @@ -206,7 +206,7 @@ function artList(readbodyVal) { $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") await readTask(lists.art_id,"2") } - if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0017`){ + if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0011`){ break } } @@ -222,7 +222,7 @@ function readTask(artid,arttype) { let rewurl = { url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artDetail.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"appid":"xzwl","channel":"IOS-qianzhuan","psign":"0cf94b87f584dfc81a87fa74dcb3757f","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"60.0.6"}` + body: `jsondata={"appid":"xzwl","channel":"IOS","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"5.6.5"}` } $.post(rewurl, async(error, resp, data) => { //$.log(data) @@ -241,7 +241,7 @@ function finishTask(artid,arttype) { return new Promise((resolve, reject) =>{ let finishurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS-qianzhuan",${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` + headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS",${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` } $.post(finishurl, async(error, response, data) => { $.log(data+"\n") @@ -261,7 +261,7 @@ function Stimulate(position) { let stimurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/stimulateAdvAccount.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","channel":"iOS"}` + body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","channel":"iOS"}` } $.post(stimurl, async(error, response, data) => { //$.log(data+"\n") From b6042cbb6c1bd03188fcee92fb1c59511b2c0d35 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 09:03:39 +0800 Subject: [PATCH 271/721] Update jukan.js --- Task/jukan.js | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 04dcb4dc94..5a2d0acafe 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -85,12 +85,12 @@ if (typeof $request !== 'undefined') { apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] $.index = i + 1; + await sign(); await getsign(); - await signShare(); for (readbodyVal of bodys){ await artList(readbodyVal) } - await Stimulate("17") + await Stimulate("17") for( boxtype of [1,2]){ await $.wait(1000) await BoxProfit(boxtype) @@ -103,6 +103,27 @@ if (typeof $request !== 'undefined') { .finally(() => $.done()) } //签到 +function sign() { + return new Promise((resolve, reject) =>{ + let profiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/homeSignAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval + } + $.post(profiturl, async(error, resp, data) => { + //$.log(data+"\n") + let sign_res = JSON.parse(data) + if (sign_res.ret == "ok"&&sign_res.profit>0){ + $.log("签到收益: +"+sign_res.profitDesc) + } else { + $.log(sign_res.rtn_msg) + } + resolve() + }) + }) +} + + + function getsign() { return new Promise((resolve, reject) =>{ let signurl = { @@ -116,7 +137,7 @@ function getsign() { if (get_sign.ret == "ok"){ $.sub = `签到成功🎉` $.desc = `签到收益: +${get_sign.todaySignProfit}${get_sign.todaySignProfitType}💰,明日 +${get_sign.tomorrowSignProfit}${get_sign.tomorrowSignProfitType} 已签到 ${get_sign.signDays} 天\n` ; - await invite() + await signShare() } else if (get_sign.rtn_code == "R-ART-0008"){ $.sub = get_sign.rtn_msg @@ -146,6 +167,7 @@ function signShare() { if (sign_share.ret == "ok"){ $.log("签到分享收益: +"+sign_share.profit) await Stimulate("23") + await invite() } else { $.log(sign_share.rtn_msg) } @@ -168,7 +190,7 @@ function userinfo() { userName = get_info.userinfo.username sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeCurCashItem.value curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value - gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value + gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) $.sub += " "+gold $.desc += sumcash + "/"+curcash @@ -206,7 +228,7 @@ function artList(readbodyVal) { $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") await readTask(lists.art_id,"2") } - if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0011`){ + if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0017`){ break } } @@ -222,7 +244,7 @@ function readTask(artid,arttype) { let rewurl = { url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artDetail.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"appid":"xzwl","channel":"IOS","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"5.6.5"}` + body: `jsondata={"appid":"xzwl","channel":"IOS-qianzhuan","psign":"0cf94b87f584dfc81a87fa74dcb3757f","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"60.0.6"}` } $.post(rewurl, async(error, resp, data) => { //$.log(data) @@ -241,7 +263,7 @@ function finishTask(artid,arttype) { return new Promise((resolve, reject) =>{ let finishurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS",${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` + headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS-qianzhuan",${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` } $.post(finishurl, async(error, response, data) => { $.log(data+"\n") @@ -261,7 +283,7 @@ function Stimulate(position) { let stimurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/stimulateAdvAccount.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","channel":"iOS"}` + body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","channel":"iOS"}` } $.post(stimurl, async(error, response, data) => { //$.log(data+"\n") @@ -280,8 +302,6 @@ function BoxProfit() { url: `https://www.xiaodouzhuan.cn/jkd/task/getTaskBoxProfit.action`, headers: {Cookie:cookieval,'User-Agent':UA}, body: `box_type=${boxtype}` } - $.log(boxtype) - $.log(cookieval) $.post(profiturl, async(error, resp, data) => { //$.log(data+"\n") let do_box = JSON.parse(data) From ff43b3b6540cd74d7b55bc1fe2373ab3157eb37a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 10:08:28 +0800 Subject: [PATCH 272/721] =?UTF-8?q?=E8=81=9A=E7=9C=8B=E7=82=B9=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=87=AA=E5=8A=A8=E6=8F=90=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jukan.js | 66 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 5a2d0acafe..4cf2929939 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -4,12 +4,15 @@ https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js +可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 + hostname = www.xiaodouzhuan.cn ~~~~~~~~~~~~~~~~ */ const $ = new Env('聚看点') - +let drawcash = $.getdata('jukan_name') || 30 //提现金额 +let wxname = $.getdata('jukan_name') || ""//微信真实名字,可以在双引号内填入 let CookieArr=[],BodyArr=[]; let cookie = $.getdata('jukan_ck') let bodys = $.getdata('jukan_body') @@ -87,15 +90,20 @@ if (typeof $request !== 'undefined') { $.index = i + 1; await sign(); await getsign(); - for (readbodyVal of bodys){ - await artList(readbodyVal) - } - await Stimulate("17") + await Stimulate("17") for( boxtype of [1,2]){ await $.wait(1000) await BoxProfit(boxtype) } - await userinfo() + await userinfo() + if (sumcash >= drawcash&&wxname){ + await realname(); + await Withdraw(); + } + await WelfareCash(); + for (readbodyVal of bodys){ + await artList(readbodyVal) + } } } })() @@ -175,7 +183,51 @@ function signShare() { }) }) } +function WelfareCash() { + return new Promise((resolve, reject) =>{ + let welurl = { + url: `https://www.xiaodouzhuan.cn/jkd/activity/cashweal/noviceWelfareCash.action`, + headers: {Cookie:cookieval,'User-Agent':UA} + } + $.post(welurl, async(error, resp, data) => { + //$.log(data+"\n") + let _welfareCash = JSON.parse(data) + if (_welfareCash.ret == "ok"){ + $.log("新手福利提现: 成功") + + } else { + $.log(_welfareCash.rtn_msg) + } + resolve() + }) + }) +} +function realname() { + return new Promise((resolve, reject) =>{ + let drawurl = { + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=${wxname}`, + headers: {Cookie:cookieval,'User-Agent':UA} + } + $.get(drawurl, async(error, resp, data) => { + $.log(data+"\n") + resolve() + }) + }) +} +//提现 +function Withdraw() { + return new Promise((resolve, reject) =>{ + let drawurl = { + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/userWithdrawPost.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: `type=wx&sum=${sumcash}&mobile=&pid=0` + } + $.post(drawurl, async(error, resp, data) => { + $.log(data+"\n") + resolve() + }) + }) +} function userinfo() { return new Promise((resolve, reject) =>{ @@ -322,7 +374,7 @@ function BoxProfit() { function invite() { let rewurl = { - url: `https://www.xiaodouzhuan.cn/jkd/weixin20/member/receiveMonkeyXd.action?userid=f99d2227a3be4a1599e936e0522537ac`, + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/member/receiveMonkeyXd.action?userid=fe0d318cdfbd4f8f9950ce67c5643eaa`, headers: {Cookie:cookieval} } $.get(rewurl, (error, response, data) => { From c0caac979bd9c87acc68c0486f3e6004328590c8 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 10:18:49 +0800 Subject: [PATCH 273/721] Update jukan.js --- Task/jukan.js | 756 +++++++++++++++++++++++++------------------------- 1 file changed, 375 insertions(+), 381 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 4cf2929939..18874eb43b 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,385 +1,379 @@ -/* -聚看点极速版签到任务 -打开'我的'获取Cookie - -https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js - -可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 - -hostname = www.xiaodouzhuan.cn -~~~~~~~~~~~~~~~~ - -*/ -const $ = new Env('聚看点') -let drawcash = $.getdata('jukan_name') || 30 //提现金额 -let wxname = $.getdata('jukan_name') || ""//微信真实名字,可以在双引号内填入 -let CookieArr=[],BodyArr=[]; -let cookie = $.getdata('jukan_ck') -let bodys = $.getdata('jukan_body') -let UA = 'JuKanDian/5.6.5 (iPhone; iOS 14.2; Scale/3.00)' - -if ($.isNode()) { - if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('&') > -1) { - JKCookie = process.env.JUKAN_COOKIE.split('&'); - } - if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('\n') > -1) { - JKCookie = process.env.JUKAN_COOKIE.split('\n'); - } else { - JKCookie = process.env.JUKAN_COOKIE.split() - } - if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('&') > -1) { - JKbody = process.env.JUKAN_BODY.split('&'); - } - if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('\n') > -1) { - JKbody = process.env.JUKAN_BODY.split('\n'); - } else { - JKbody = process.env.JUKAN_BODY.split() - } - Object.keys(JKCookie).forEach((item) => { - if (JKCookie[item]) { - CookieArr.push(JKCookie[item]) - } - }) - Object.keys(JKbody).forEach((item) => { - if (JKbody[item]) { - BodyArr.push(JKbody[item]) - } - }) -} else if (cookie.indexOf('&')>-1 &&bodys.indexOf('&')>-1){ - Object.keys(cookie.split('&')).forEach((item) => { - CookieArr.push(cookie.split('&')[item]) - }) - Object.keys(bodys.split('&')).forEach((item) => { - BodyArr.push(bodys.split('&')[item]) - }) -} else { - CookieArr.push(cookie) - BodyArr.push(bodys) -} - -if ($.isNode()) { - console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) -} - -if (typeof $request !== 'undefined') { - if ($request && $request.method != `OPTIONS`) { - const bodyVal = $request.body - const Cookieval = $request.headers['Cookie'] - if(Cookieval)$.setdata(Cookieval,'jukan_ck') - if(bodyVal)$.setdata(bodyVal,'jukan_body') - $.log(`Cookie:${Cookieval}`) - $.log(`bodyVal:${bodyVal}`) - $.msg($.name,"获取Cookie成功") - $.done() - } -} else { -!(async() => { - if (!CookieArr[0]) { - console.log($.name, '【提示】请把聚看点Cookie填入Github 的 Secrets 中,请以&或者换行隔开') - return; - } - console.log(`您共提供${CookieArr.length}个聚看点账号Cookie`) - for (let i = 0; i < CookieArr.length; i++) { - if (CookieArr[i]) { - cookieval = CookieArr[i] - bodyval = BodyArr[i] - ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) - apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) - bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] - $.index = i + 1; - await sign(); - await getsign(); - await Stimulate("17") - for( boxtype of [1,2]){ - await $.wait(1000) - await BoxProfit(boxtype) - } - await userinfo() - if (sumcash >= drawcash&&wxname){ - await realname(); - await Withdraw(); - } - await WelfareCash(); - for (readbodyVal of bodys){ - await artList(readbodyVal) - } - } - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) -} -//签到 -function sign() { - return new Promise((resolve, reject) =>{ - let profiturl = { - url: `https://www.xiaodouzhuan.cn/jkd/account/homeSignAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval - } - $.post(profiturl, async(error, resp, data) => { - //$.log(data+"\n") - let sign_res = JSON.parse(data) - if (sign_res.ret == "ok"&&sign_res.profit>0){ - $.log("签到收益: +"+sign_res.profitDesc) - } else { - $.log(sign_res.rtn_msg) - } - resolve() - }) - }) -} - - - -function getsign() { - return new Promise((resolve, reject) =>{ - let signurl = { - url: `https://www.xiaodouzhuan.cn/jkd/user/usersign.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, - body: bodyval - } - $.post(signurl, async(error, response, data) => { - let get_sign = JSON.parse(data) - //$.log(data) - if (get_sign.ret == "ok"){ - $.sub = `签到成功🎉` - $.desc = `签到收益: +${get_sign.todaySignProfit}${get_sign.todaySignProfitType}💰,明日 +${get_sign.tomorrowSignProfit}${get_sign.tomorrowSignProfitType} 已签到 ${get_sign.signDays} 天\n` ; - await signShare() - } - else if (get_sign.rtn_code == "R-ART-0008"){ - $.sub = get_sign.rtn_msg - $.desc = `` - $.log($.sub) +{ + "id": "sunert.app.sub", + "name": "Sunert 签到应用订阅", + "author": "@Sunert", + "icon": "https://avatars2.githubusercontent.com/u/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", + "repo": "https://github.com/Sunert/Scripts/tree/master", + "apps": [ + { + "id": "weibo", + "name": "新浪微博", + "keys": ["sy_payheader_wb", "sy_token_wb"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", "https://raw.githubusercontent.com/Orz-3/task/master/weibo.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/weibo.js" + }, + { + "id": "youth", + "name": "中青看点", + "keys": ["youthheader_zq", "read_zq", "red_zq", "readtime_zq"], + "author": "@sunert", + "settings": [ + { + "id": "notifytimes", + "name": "通知频率 (点击查看设置说明)", + "val": "", + "type": "number", + "desc": "设定通知频率,前三次为全部通知,之后转盘次数/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" + }, + { + "id": "zqlogs", + "name": "调试日志", + "val": false, + "type": "boolean", + "desc": "调试日志开关,默认关闭" } - else { - $.sub = `签到失败❌` - $.desc = `说明: `+ get_sign.rtn_msg - $.msg($.name,$.sub,$.desc) - $.done() + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/youth.js" + }, + { + "id": "youthGain", + "name": "中青浏览赚", + "keys": ["youth_start", "youth_end"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/youth_gain.js" + }, + { + "id": "dianshijia", + "name": "电视家", + "keys": ["sy_signheader_dsj", "drawal_dsj"], + "author": "@sunert", + "settings": [{ + "id": "REWARD", + "name": "额外签到奖励", + "val": "55", + "type": "radios", + "desc": "", + "items": [{ + "key": "55", + "label": "提现额度" + }, { + "key": "44", + "label": "1天VIP" + }, { + "key": "42", + "label": "1888金币" + }] + }], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/dianshijia.js" + }, + { + "id": "kuaishou", + "name": "快手极速版", + "keys": ["cookie_ks"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", "https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/kuaishou.js" + }, + { + "id": "sinanews", + "name": "新浪新闻", + "keys": ["sy_signurl_snews", "sy_info_snews", "sy_ck_snews", "sy_infoheader_snews"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/sinanews.js" + }, + { + "id": "NOWLIVE", + "name": "NOW直播", + "keys": ["now_qq", "nowqq_cookie"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/NOWLIVE.js" + }, + { + "id": "chinatelecomEnquiry", + "name": "电信套餐查询", + "keys": ["china_telecom_authToken_10000", "china_telecom_cookie"], + "settings": [ + { + "id": "Mon", + "name": "查询月份", + "val": "2020-08", + "type": "month", + "desc": "填入账单月份,可查最近六个月,本月账单下月可查" } - resolve() - }) - }) -} - -function signShare() { - return new Promise((resolve, reject) =>{ - let profiturl = { - url: `https://www.xiaodouzhuan.cn/jkd/account/signShareAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval - } - $.post(profiturl, async(error, resp, data) => { - //$.log(data+"\n") - let sign_share = JSON.parse(data) - if (sign_share.ret == "ok"){ - $.log("签到分享收益: +"+sign_share.profit) - await Stimulate("23") - await invite() - } else { - $.log(sign_share.rtn_msg) - } - resolve() - }) - }) -} -function WelfareCash() { - return new Promise((resolve, reject) =>{ - let welurl = { - url: `https://www.xiaodouzhuan.cn/jkd/activity/cashweal/noviceWelfareCash.action`, - headers: {Cookie:cookieval,'User-Agent':UA} - } - $.post(welurl, async(error, resp, data) => { - //$.log(data+"\n") - let _welfareCash = JSON.parse(data) - if (_welfareCash.ret == "ok"){ - $.log("新手福利提现: 成功") - - } else { - $.log(_welfareCash.rtn_msg) - } - resolve() - }) - }) -} -function realname() { - return new Promise((resolve, reject) =>{ - let drawurl = { - url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=${wxname}`, - headers: {Cookie:cookieval,'User-Agent':UA} - } - $.get(drawurl, async(error, resp, data) => { - $.log(data+"\n") - resolve() - }) - }) -} - -//提现 -function Withdraw() { - return new Promise((resolve, reject) =>{ - let drawurl = { - url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/userWithdrawPost.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: `type=wx&sum=${sumcash}&mobile=&pid=0` - } - $.post(drawurl, async(error, resp, data) => { - $.log(data+"\n") - resolve() - }) - }) -} - -function userinfo() { - return new Promise((resolve, reject) =>{ - let infourl = { - url: `https://www.xiaodouzhuan.cn/jkd/newMobileMenu/infoMe.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, - body: bodyval - } - $.post(infourl, async(error, resp, data) => { - let get_info = JSON.parse(data) - if( get_info.ret=="ok"){ - userName = get_info.userinfo.username - sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeCurCashItem.value - curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value - gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value - $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) - $.sub += " "+gold - $.desc += sumcash + "/"+curcash - $.msg($.name+" 昵称:"+userName, $.sub, $.desc+"\n") - } - resolve() - }) - }) -} -function artList(readbodyVal) { - return new Promise((resolve, reject) =>{ - let infourl = { - url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artlist.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, - body: readbodyVal - } - $.post(infourl, async(error, resp, data) => { - let get_list = JSON.parse(data) - //$.log( data) - $.log("【开始自动阅读】") - if (get_list.ret == "ok"){ - for( lists of get_list.artlist){ - if(lists.item_type=="article"){ - art_Title = lists.art_title - artid =lists.art_id - screen_Name = lists.screen_name - $.log("正在阅读文章: "+art_Title +" -------- <"+screen_Name +">\n ") - await readTask(lists.art_id,"1") - } - if(lists.item_type=="video"){ - art_Title = lists.art_title - artid =lists.art_id - arttype = "2" - screen_Name = lists.screen_name - $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") - await readTask(lists.art_id,"2") - } - if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0017`){ - break - } + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", "https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/telecomInfinity.js" + }, + { + "id": "jddj", + "name": "京东到家", + "keys": ["sy_cookie_dj"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jddj.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", "https://raw.githubusercontent.com/Orz-3/task/master/jddj.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js" + }, + { + "id": "TVlist", + "name": "电视预告", + "keys": ["c"], + "settings": [{ + "id": "c", + "name": "电视台", + "val": "cctv8", + "type": "text", + "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" }], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/tvpreview.js" + }, + { + "id": "moji", + "name": "墨迹天气", + "keys": ["city","citynum","cut","day_desc","hour_desc","index_desc"], + "settings": [{ + "id": "city", + "name": "城市", + "val": "北京", + "type": "text", + "desc": "请填写中文地区" + }, + { + "id": "citynum", + "name": "城市序号", + "val": "", + "type": "number", + "placeholder": "默认1 (点击以展开说明)", + "desc": "选择地区,请填写日志内冒号前的数字序号" + }, + { + "id": "cut", + "name": "精简日志模式", + "val": false, + "type": "boolean", + "desc": "显示详情描述,默认关闭日志" + }, + { + "id": "day_desc", + "name": "每周天气", + "val": true, + "type": "boolean", + "desc": "每周天气接口,可显示6天天气情况" + }, + { + "id": "hour_desc", + "name": "小时天气", + "val": false, + "type": "boolean", + "desc": "未来6小时天气情况" + }, + { + "id": "forty_desc", + "name": "40天预告", + "val": false, + "type": "boolean", + "desc": "未来40天天气预告" + }, + { + "id": "index_desc", + "name": "生活指数", + "val": true, + "type": "boolean", + "desc": "可显示生活指数情况" + }], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/moji.js" + }, + { + "id": "jukan", + "name": "聚看点", + "keys": ["jukan_ck","jukan_body"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", + "settings": [ + { + "id": "jukan_cash", + "name": "提现金额", + "val": "", + "type": "number", + "placeholder": "默认30 (点击以展开说明)", + "desc": "仅允许填入数字,所选金额可见聚看点APP" + }, + { + "id": "jukan_name", + "name": "微信真实姓名", + "val": "", + "type": "textarea", + "placeholder": "填入微信真实姓名" + }], + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/jukan.js" + }, + { + "id": "mydigit", + "name": "数码之家", + "keys": ["sign_mydigit"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/mydigit.js" + }, + { + "id": "txnews", + "name": "腾讯新闻", + "keys": ["sy_signurl_txnews", "sy_cookie_txnews","video_txnews"], + "author": "@sunert", + "settings": [ + { + "id": "notifynum", + "name": "通知频率", + "val": "", + "type": "number", + "placeholder": "默认50 (点击以展开说明)", + "desc": "阅读篇数间隔通知开为1,常关为0(默认50篇)" + }, + { + "id": "delay", + "name": "延迟时间(毫秒)", + "val": "", + "type": "number", + "placeholder": "默认200 (点击以展开说明)", + "desc": "接口延迟时间" + } + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", "https://raw.githubusercontent.com/Orz-3/task/master/txnews.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/txnews.js" + }, + { + "id": "jingxi", + "name": "京喜", + "keys": ["CookieJD", "CookieJD2"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jingxi.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jingxi.png", "https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/jingxi.js" + }, + { + "id": "translate", + "name": "谷歌翻译", + "keys": [], + "settings": [{ + "id": "word", + "name": "原文", + "val": "Hello World", + "type": "textarea", + "placeholder": "Hello World", + "desc": "兼容中英文短语翻译,填入原文后手动运行" }], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", "https://raw.githubusercontent.com/Orz-3/task/master/translate.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/translate.js" + }, + { + "id": "exchange rate", + "name": "汇率换算", + "keys": [], + "settings": [ + { + "id": "froma", + "name": "使用币", + "val": "人民币", + "type": "text", + "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" + }, + { + "id": "toex", + "name": "兑换币", + "val": "港币", + "type": "text", + "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" + }, + { + "id": "numex", + "name": "兑换金额", + "val": "10", + "type": "number", + "desc": "填写数字" } - } - resolve() - }) - }) -} - - -function readTask(artid,arttype) { - return new Promise((resolve, reject) =>{ - let rewurl = { - url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artDetail.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"appid":"xzwl","channel":"IOS-qianzhuan","psign":"0cf94b87f584dfc81a87fa74dcb3757f","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"60.0.6"}` - } - $.post(rewurl, async(error, resp, data) => { - //$.log(data) - if(resp.statusCode ==200){ - await $.wait(31000) - await finishTask(artid,arttype) - } else { - $.log("阅读失败: "+data) - } - resolve() - }) - }) -} - -function finishTask(artid,arttype) { - return new Promise((resolve, reject) =>{ - let finishurl = { - url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS-qianzhuan",${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` - } - $.post(finishurl, async(error, response, data) => { - $.log(data+"\n") - let do_read = JSON.parse(data) - taskresult = do_read.rtn_code - if (do_read.ret == "ok"){ - $.log("获得收益: +"+do_read.profit +"\n") - } - resolve() - }) - }) -} - -//激励视频 -function Stimulate(position) { - return new Promise((resolve, reject) =>{ - let stimurl = { - url: `https://www.xiaodouzhuan.cn/jkd/account/stimulateAdvAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","channel":"iOS"}` - } - $.post(stimurl, async(error, response, data) => { - //$.log(data+"\n") - let do_stim = JSON.parse(data) - if ( do_stim.ret == "ok"){ - $.log( do_stim.profit_title+": +"+ do_stim.profit +"(以实际情况为准)") - } - resolve() - }) - }) -} - -function BoxProfit() { - return new Promise((resolve, reject) =>{ - let profiturl = { - url: `https://www.xiaodouzhuan.cn/jkd/task/getTaskBoxProfit.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: `box_type=${boxtype}` - } - $.post(profiturl, async(error, resp, data) => { - //$.log(data+"\n") - let do_box = JSON.parse(data) - if (do_box.ret == "ok"&&do_box.profit>0){ - $.log("获得收益: +"+do_box.profit) - position = do_box.advertPopup.position - await Stimulate(position) - $.log(position) - } - else if (do_box.rtn_code=='TAS-A-1'){ - $.log("计时金币"+do_box.rtn_msg) - } - resolve() - }) - }) -} - - -function invite() { - let rewurl = { - url: `https://www.xiaodouzhuan.cn/jkd/weixin20/member/receiveMonkeyXd.action?userid=fe0d318cdfbd4f8f9950ce67c5643eaa`, - headers: {Cookie:cookieval} - } - $.get(rewurl, (error, response, data) => { - }) + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", "https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/exchangeRate.js" + }, + { + "id": "trainquery", + "name": "列车时刻", + "keys": [], + "settings": [ + { + "id": "people", + "name": "乘客类型", + "val": "ADULT", + "type": "radios", + "desc": "成人/学生", + "items": [ + { + "key": "ADULT", + "label": "成人" + }, + { + "key": "0X00", + "label": "学生" + }] + }, + { + "id": "left", + "name": "出发站点", + "val": "北京", + "type": "text", + "desc": "填入中文站点" + }, + { + "id": "end", + "name": "目的地", + "val": "上海", + "type": "text", + "desc": "填入中文站点" + }, + { + "id": "leavedate", + "name": "出发时间", + "val": "2020-08-15", + "type": "date", + "desc": "填入出发日期,请按照格式填写" + }, + { + "id": "setrain", + "name": "列车车次", + "val": "G5", + "type": "text", + "desc": "填入列车车次或者列车序号,列车序号请查看日志详情" + } + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", "https://raw.githubusercontent.com/Orz-3/task/master/12306.png"], + "script": "https://github.com/Sunert/Scripts/raw/master/Task/trainquery.js" + } + ] } - - -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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 1d9de4ed9f75862ac8564d87c6df3927dfbb1855 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 10:47:39 +0800 Subject: [PATCH 274/721] Update jukan.js --- Task/jukan.js | 1141 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 767 insertions(+), 374 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 18874eb43b..1f60e318b0 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,379 +1,772 @@ -{ - "id": "sunert.app.sub", - "name": "Sunert 签到应用订阅", - "author": "@Sunert", - "icon": "https://avatars2.githubusercontent.com/u/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", - "repo": "https://github.com/Sunert/Scripts/tree/master", - "apps": [ - { - "id": "weibo", - "name": "新浪微博", - "keys": ["sy_payheader_wb", "sy_token_wb"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", "https://raw.githubusercontent.com/Orz-3/task/master/weibo.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/weibo.js" - }, - { - "id": "youth", - "name": "中青看点", - "keys": ["youthheader_zq", "read_zq", "red_zq", "readtime_zq"], - "author": "@sunert", - "settings": [ - { - "id": "notifytimes", - "name": "通知频率 (点击查看设置说明)", - "val": "", - "type": "number", - "desc": "设定通知频率,前三次为全部通知,之后转盘次数/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" - }, - { - "id": "zqlogs", - "name": "调试日志", - "val": false, - "type": "boolean", - "desc": "调试日志开关,默认关闭" - } - ], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/youth.js" - }, - { - "id": "youthGain", - "name": "中青浏览赚", - "keys": ["youth_start", "youth_end"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/youth_gain.js" - }, - { - "id": "dianshijia", - "name": "电视家", - "keys": ["sy_signheader_dsj", "drawal_dsj"], - "author": "@sunert", - "settings": [{ - "id": "REWARD", - "name": "额外签到奖励", - "val": "55", - "type": "radios", - "desc": "", - "items": [{ - "key": "55", - "label": "提现额度" - }, { - "key": "44", - "label": "1天VIP" - }, { - "key": "42", - "label": "1888金币" - }] - }], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/dianshijia.js" - }, - { - "id": "kuaishou", - "name": "快手极速版", - "keys": ["cookie_ks"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", "https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/kuaishou.js" - }, - { - "id": "sinanews", - "name": "新浪新闻", - "keys": ["sy_signurl_snews", "sy_info_snews", "sy_ck_snews", "sy_infoheader_snews"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/sinanews.js" - }, - { - "id": "NOWLIVE", - "name": "NOW直播", - "keys": ["now_qq", "nowqq_cookie"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/NOWLIVE.js" - }, - { - "id": "chinatelecomEnquiry", - "name": "电信套餐查询", - "keys": ["china_telecom_authToken_10000", "china_telecom_cookie"], - "settings": [ - { - "id": "Mon", - "name": "查询月份", - "val": "2020-08", - "type": "month", - "desc": "填入账单月份,可查最近六个月,本月账单下月可查" +/* +聚看点极速版签到任务 +打开'我的'获取Cookie + +https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js + +可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 + +hostname = www.xiaodouzhuan.cn +~~~~~~~~~~~~~~~~ + +*/ +const $ = new Env('聚看点') +let drawcash = $.getdata('jukan_cash') || 30 //提现金额 +let wxname = $.getdata('jukan_name') || ""//微信真实名字,可以在双引号内填入 +let CookieArr=[],BodyArr=[]; +let cookie = $.getdata('jukan_ck') +let bodys = $.getdata('jukan_body') +let UA = 'JuKanDian/5.6.5 (iPhone; iOS 14.2; Scale/3.00)' + +if ($.isNode()) { + if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('&') > -1) { + JKCookie = process.env.JUKAN_COOKIE.split('&'); + } + if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('\n') > -1) { + JKCookie = process.env.JUKAN_COOKIE.split('\n'); + } else { + JKCookie = process.env.JUKAN_COOKIE.split() + } + if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('&') > -1) { + JKbody = process.env.JUKAN_BODY.split('&'); + } + if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('\n') > -1) { + JKbody = process.env.JUKAN_BODY.split('\n'); + } else { + JKbody = process.env.JUKAN_BODY.split() + } + Object.keys(JKCookie).forEach((item) => { + if (JKCookie[item]) { + CookieArr.push(JKCookie[item]) + } + }) + Object.keys(JKbody).forEach((item) => { + if (JKbody[item]) { + BodyArr.push(JKbody[item]) + } + }) +} else if (cookie.indexOf('&')>-1 &&bodys.indexOf('&')>-1){ + Object.keys(cookie.split('&')).forEach((item) => { + CookieArr.push(cookie.split('&')[item]) + }) + Object.keys(bodys.split('&')).forEach((item) => { + BodyArr.push(bodys.split('&')[item]) + }) +} else { + CookieArr.push(cookie) + BodyArr.push(bodys) +} + +if ($.isNode()) { + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) +} + +if (typeof $request !== 'undefined') { + if ($request && $request.method != `OPTIONS`) { + const bodyVal = $request.body + const Cookieval = $request.headers['Cookie'] + if(Cookieval)$.setdata(Cookieval,'jukan_ck') + if(bodyVal)$.setdata(bodyVal,'jukan_body') + $.log(`Cookie:${Cookieval}`) + $.log(`bodyVal:${bodyVal}`) + $.msg($.name,"获取Cookie成功") + $.done() + } +} else { +!(async() => { + if (!CookieArr[0]) { + console.log($.name, '【提示】请把聚看点Cookie填入Github 的 Secrets 中,请以&或者换行隔开') + return; + } + console.log(`您共提供${CookieArr.length}个聚看点账号Cookie`) + for (let i = 0; i < CookieArr.length; i++) { + if (CookieArr[i]) { + cookieval = CookieArr[i] + bodyval = BodyArr[i] + ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) + apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) + bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] + $.index = i + 1; + await sign(); + await getsign(); + await Stimulate("17") + for( boxtype of [1,2]){ + await $.wait(1000) + await BoxProfit(boxtype) + } + await userinfo() + if (sumcash >= drawcash&&wxname){ + await realname(); + await Withdraw(); + } + await WelfareCash(); + for (readbodyVal of bodys){ + await artList(readbodyVal) + } + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) +} +//签到 +function sign() { + return new Promise((resolve, reject) =>{ + let profiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/homeSignAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval + } + $.post(profiturl, async(error, resp, data) => { + //$.log(data+"\n") + let sign_res = JSON.parse(data) + if (sign_res.ret == "ok"&&sign_res.profit>0){ + $.log("签到收益: +"+sign_res.profitDesc) + } else { + $.log(sign_res.rtn_msg) + } + resolve() + }) + }) +} + + + +function getsign() { + return new Promise((resolve, reject) =>{ + let signurl = { + url: `https://www.xiaodouzhuan.cn/jkd/user/usersign.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: bodyval + } + $.post(signurl, async(error, response, data) => { + let get_sign = JSON.parse(data) + //$.log(data) + if (get_sign.ret == "ok"){ + $.sub = `签到成功🎉` + $.desc = `签到收益: +${get_sign.todaySignProfit}${get_sign.todaySignProfitType}💰,明日 +${get_sign.tomorrowSignProfit}${get_sign.tomorrowSignProfitType} 已签到 ${get_sign.signDays} 天\n` ; + await signShare() + } + else if (get_sign.rtn_code == "R-ART-0008"){ + $.sub = get_sign.rtn_msg + $.desc = `` + $.log($.sub) } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", "https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/telecomInfinity.js" - }, - { - "id": "jddj", - "name": "京东到家", - "keys": ["sy_cookie_dj"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jddj.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", "https://raw.githubusercontent.com/Orz-3/task/master/jddj.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js" - }, - { - "id": "TVlist", - "name": "电视预告", - "keys": ["c"], - "settings": [{ - "id": "c", - "name": "电视台", - "val": "cctv8", - "type": "text", - "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/tvpreview.js" - }, - { - "id": "moji", - "name": "墨迹天气", - "keys": ["city","citynum","cut","day_desc","hour_desc","index_desc"], - "settings": [{ - "id": "city", - "name": "城市", - "val": "北京", - "type": "text", - "desc": "请填写中文地区" - }, - { - "id": "citynum", - "name": "城市序号", - "val": "", - "type": "number", - "placeholder": "默认1 (点击以展开说明)", - "desc": "选择地区,请填写日志内冒号前的数字序号" - }, - { - "id": "cut", - "name": "精简日志模式", - "val": false, - "type": "boolean", - "desc": "显示详情描述,默认关闭日志" - }, - { - "id": "day_desc", - "name": "每周天气", - "val": true, - "type": "boolean", - "desc": "每周天气接口,可显示6天天气情况" - }, - { - "id": "hour_desc", - "name": "小时天气", - "val": false, - "type": "boolean", - "desc": "未来6小时天气情况" - }, - { - "id": "forty_desc", - "name": "40天预告", - "val": false, - "type": "boolean", - "desc": "未来40天天气预告" - }, - { - "id": "index_desc", - "name": "生活指数", - "val": true, - "type": "boolean", - "desc": "可显示生活指数情况" - }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/moji.js" - }, - { - "id": "jukan", - "name": "聚看点", - "keys": ["jukan_ck","jukan_body"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", - "settings": [ - { - "id": "jukan_cash", - "name": "提现金额", - "val": "", - "type": "number", - "placeholder": "默认30 (点击以展开说明)", - "desc": "仅允许填入数字,所选金额可见聚看点APP" - }, - { - "id": "jukan_name", - "name": "微信真实姓名", - "val": "", - "type": "textarea", - "placeholder": "填入微信真实姓名" - }], - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/jukan.js" - }, - { - "id": "mydigit", - "name": "数码之家", - "keys": ["sign_mydigit"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/mydigit.js" - }, - { - "id": "txnews", - "name": "腾讯新闻", - "keys": ["sy_signurl_txnews", "sy_cookie_txnews","video_txnews"], - "author": "@sunert", - "settings": [ - { - "id": "notifynum", - "name": "通知频率", - "val": "", - "type": "number", - "placeholder": "默认50 (点击以展开说明)", - "desc": "阅读篇数间隔通知开为1,常关为0(默认50篇)" - }, - { - "id": "delay", - "name": "延迟时间(毫秒)", - "val": "", - "type": "number", - "placeholder": "默认200 (点击以展开说明)", - "desc": "接口延迟时间" - } - ], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", "https://raw.githubusercontent.com/Orz-3/task/master/txnews.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/txnews.js" - }, - { - "id": "jingxi", - "name": "京喜", - "keys": ["CookieJD", "CookieJD2"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jingxi.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jingxi.png", "https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/jingxi.js" - }, - { - "id": "translate", - "name": "谷歌翻译", - "keys": [], - "settings": [{ - "id": "word", - "name": "原文", - "val": "Hello World", - "type": "textarea", - "placeholder": "Hello World", - "desc": "兼容中英文短语翻译,填入原文后手动运行" }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", "https://raw.githubusercontent.com/Orz-3/task/master/translate.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/translate.js" - }, - { - "id": "exchange rate", - "name": "汇率换算", - "keys": [], - "settings": [ - { - "id": "froma", - "name": "使用币", - "val": "人民币", - "type": "text", - "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" - }, - { - "id": "toex", - "name": "兑换币", - "val": "港币", - "type": "text", - "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" - }, - { - "id": "numex", - "name": "兑换金额", - "val": "10", - "type": "number", - "desc": "填写数字" + else { + $.sub = `签到失败❌` + $.desc = `说明: `+ get_sign.rtn_msg + $.msg($.name,$.sub,$.desc) + $.done() } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", "https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/exchangeRate.js" - }, - { - "id": "trainquery", - "name": "列车时刻", - "keys": [], - "settings": [ - { - "id": "people", - "name": "乘客类型", - "val": "ADULT", - "type": "radios", - "desc": "成人/学生", - "items": [ - { - "key": "ADULT", - "label": "成人" - }, - { - "key": "0X00", - "label": "学生" - }] - }, - { - "id": "left", - "name": "出发站点", - "val": "北京", - "type": "text", - "desc": "填入中文站点" - }, - { - "id": "end", - "name": "目的地", - "val": "上海", - "type": "text", - "desc": "填入中文站点" - }, - { - "id": "leavedate", - "name": "出发时间", - "val": "2020-08-15", - "type": "date", - "desc": "填入出发日期,请按照格式填写" - }, - { - "id": "setrain", - "name": "列车车次", - "val": "G5", - "type": "text", - "desc": "填入列车车次或者列车序号,列车序号请查看日志详情" + resolve() + }) + }) +} + +function signShare() { + return new Promise((resolve, reject) =>{ + let profiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/signShareAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval + } + $.post(profiturl, async(error, resp, data) => { + //$.log(data+"\n") + let sign_share = JSON.parse(data) + if (sign_share.ret == "ok"){ + $.log("签到分享收益: +"+sign_share.profit) + await Stimulate("23") + await invite() + } else { + $.log(sign_share.rtn_msg) + } + resolve() + }) + }) +} +function WelfareCash() { + return new Promise((resolve, reject) =>{ + let welurl = { + url: `https://www.xiaodouzhuan.cn/jkd/activity/cashweal/noviceWelfareCash.action`, + headers: {Cookie:cookieval,'User-Agent':UA} + } + $.post(welurl, async(error, resp, data) => { + //$.log(data+"\n") + let _welfareCash = JSON.parse(data) + if (_welfareCash.ret == "ok"){ + $.log("新手福利提现: 成功") + + } else { + $.log(_welfareCash.rtn_msg) + } + resolve() + }) + }) +} +function realname() { + return new Promise((resolve, reject) =>{ + let drawurl = { + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=${wxname}`, + headers: {Cookie:cookieval,'User-Agent':UA} + } + $.get(drawurl, async(error, resp, data) => { + $.log(data+"\n") + resolve() + }) + }) +} + +//提现 +function Withdraw() { + return new Promise((resolve, reject) =>{ + let drawurl = { + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/userWithdrawPost.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: `type=wx&sum=${sumcash}&mobile=&pid=0` + } + $.post(drawurl, async(error, resp, data) => { + $.log(data+"\n") + resolve() + }) + }) +} + +function userinfo() { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://www.xiaodouzhuan.cn/jkd/newMobileMenu/infoMe.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: bodyval + } + $.post(infourl, async(error, resp, data) => { + let get_info = JSON.parse(data) + if( get_info.ret=="ok"){ + userName = get_info.userinfo.username + sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeCurCashItem.value + curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value + gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value + $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) + $.sub += " "+gold + $.desc += sumcash + "/"+curcash + $.msg($.name+" 昵称:"+userName, $.sub, $.desc+"\n") + } + resolve() + }) + }) +} +function artList(readbodyVal) { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artlist.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: readbodyVal + } + $.post(infourl, async(error, resp, data) => { + let get_list = JSON.parse(data) + //$.log( data) + $.log("【开始自动阅读】") + if (get_list.ret == "ok"){ + for( lists of get_list.artlist){ + if(lists.item_type=="article"){ + art_Title = lists.art_title + artid =lists.art_id + screen_Name = lists.screen_name + $.log("正在阅读文章: "+art_Title +" -------- <"+screen_Name +">\n ") + await readTask(lists.art_id,"1") + } + if(lists.item_type=="video"){ + art_Title = lists.art_title + artid =lists.art_id + arttype = "2" + screen_Name = lists.screen_name + $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") + await readTask(lists.art_id,"2") + } + if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0017`){ + break + } } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", "https://raw.githubusercontent.com/Orz-3/task/master/12306.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/trainquery.js" + } + resolve() + }) + }) +} + + +function readTask(artid,arttype) { + return new Promise((resolve, reject) =>{ + let rewurl = { + url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artDetail.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: `jsondata={"appid":"xzwl","channel":"IOS-qianzhuan","psign":"0cf94b87f584dfc81a87fa74dcb3757f","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"60.0.6"}` + } + $.post(rewurl, async(error, resp, data) => { + //$.log(data) + if(resp.statusCode ==200){ + await $.wait(31000) + await finishTask(artid,arttype) + } else { + $.log("阅读失败: "+data) + } + resolve() + }) + }) +} + +function finishTask(artid,arttype) { + return new Promise((resolve, reject) =>{ + let finishurl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS-qianzhuan",${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` + } + $.post(finishurl, async(error, response, data) => { + $.log(data+"\n") + let do_read = JSON.parse(data) + taskresult = do_read.rtn_code + if (do_read.ret == "ok"){ + $.log("获得收益: +"+do_read.profit +"\n") + } + resolve() + }) + }) +} + +//激励视频 +function Stimulate(position) { + return new Promise((resolve, reject) =>{ + let stimurl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/stimulateAdvAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","channel":"iOS"}` + } + $.post(stimurl, async(error, response, data) => { + //$.log(data+"\n") + let do_stim = JSON.parse(data) + if ( do_stim.ret == "ok"){ + $.log( do_stim.profit_title+": +"+ do_stim.profit +"(以实际情况为准)") + } + resolve() + }) + }) +} + +function BoxProfit() { + return new Promise((resolve, reject) =>{ + let profiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/task/getTaskBoxProfit.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: `box_type=${boxtype}` + } + $.post(profiturl, async(error, resp, data) => { + //$.log(data+"\n") + let do_box = JSON.parse(data) + if (do_box.ret == "ok"&&do_box.profit>0){ + $.log("获得收益: +"+do_box.profit) + position = do_box.advertPopup.position + await Stimulate(position) + $.log(position) + } + else if (do_box.rtn_code=='TAS-A-1'){ + $.log("计时金币"+do_box.rtn_msg) + } + resolve() + }) + }) +} + + +function invite() { + let rewurl = { + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/member/receiveMonkeyXd.action?userid=fe0d318cdfbd4f8f9950ce67c5643eaa`, + headers: {Cookie:cookieval} + } + $.get(rewurl, (error, response, data) => { + }) +} + + +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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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)} +「/* +聚看点极速版签到任务 +打开'我的'获取Cookie + +https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js + +可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 + +hostname = www.xiaodouzhuan.cn +~~~~~~~~~~~~~~~~ + +*/ +const $ = new Env('聚看点') +let drawcash = $.getdata('jukan_cash') || 30 //提现金额 +let wxname = $.getdata('jukan_name') || ""//微信真实名字,可以在双引号内填入 +let CookieArr=[],BodyArr=[]; +let cookie = $.getdata('jukan_ck') +let bodys = $.getdata('jukan_body') +let UA = 'JuKanDian/5.6.5 (iPhone; iOS 14.2; Scale/3.00)' + +if ($.isNode()) { + if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('&') > -1) { + JKCookie = process.env.JUKAN_COOKIE.split('&'); + } + if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('\n') > -1) { + JKCookie = process.env.JUKAN_COOKIE.split('\n'); + } else { + JKCookie = process.env.JUKAN_COOKIE.split() + } + if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('&') > -1) { + JKbody = process.env.JUKAN_BODY.split('&'); + } + if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('\n') > -1) { + JKbody = process.env.JUKAN_BODY.split('\n'); + } else { + JKbody = process.env.JUKAN_BODY.split() + } + Object.keys(JKCookie).forEach((item) => { + if (JKCookie[item]) { + CookieArr.push(JKCookie[item]) + } + }) + Object.keys(JKbody).forEach((item) => { + if (JKbody[item]) { + BodyArr.push(JKbody[item]) + } + }) +} else if (cookie.indexOf('&')>-1 &&bodys.indexOf('&')>-1){ + Object.keys(cookie.split('&')).forEach((item) => { + CookieArr.push(cookie.split('&')[item]) + }) + Object.keys(bodys.split('&')).forEach((item) => { + BodyArr.push(bodys.split('&')[item]) + }) +} else { + CookieArr.push(cookie) + BodyArr.push(bodys) +} + +if ($.isNode()) { + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) +} + +if (typeof $request !== 'undefined') { + if ($request && $request.method != `OPTIONS`) { + const bodyVal = $request.body + const Cookieval = $request.headers['Cookie'] + if(Cookieval)$.setdata(Cookieval,'jukan_ck') + if(bodyVal)$.setdata(bodyVal,'jukan_body') + $.log(`Cookie:${Cookieval}`) + $.log(`bodyVal:${bodyVal}`) + $.msg($.name,"获取Cookie成功") + $.done() + } +} else { +!(async() => { + if (!CookieArr[0]) { + console.log($.name, '【提示】请把聚看点Cookie填入Github 的 Secrets 中,请以&或者换行隔开') + return; + } + console.log(`您共提供${CookieArr.length}个聚看点账号Cookie`) + for (let i = 0; i < CookieArr.length; i++) { + if (CookieArr[i]) { + cookieval = CookieArr[i] + bodyval = BodyArr[i] + ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) + apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) + bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] + $.index = i + 1; + await sign(); + await getsign(); + await Stimulate("17") + for( boxtype of [1,2]){ + await $.wait(1000) + await BoxProfit(boxtype) } - ] + await userinfo() + if (sumcash >= drawcash&&wxname){ + await realname(); + await Withdraw(); + } + await WelfareCash(); + for (readbodyVal of bodys){ + await artList(readbodyVal) + } + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) +} +//签到 +function sign() { + return new Promise((resolve, reject) =>{ + let profiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/homeSignAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval + } + $.post(profiturl, async(error, resp, data) => { + //$.log(data+"\n") + let sign_res = JSON.parse(data) + if (sign_res.ret == "ok"&&sign_res.profit>0){ + $.log("签到收益: +"+sign_res.profitDesc) + } else { + $.log(sign_res.rtn_msg) + } + resolve() + }) + }) +} + + + +function getsign() { + return new Promise((resolve, reject) =>{ + let signurl = { + url: `https://www.xiaodouzhuan.cn/jkd/user/usersign.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: bodyval + } + $.post(signurl, async(error, response, data) => { + let get_sign = JSON.parse(data) + //$.log(data) + if (get_sign.ret == "ok"){ + $.sub = `签到成功🎉` + $.desc = `签到收益: +${get_sign.todaySignProfit}${get_sign.todaySignProfitType}💰,明日 +${get_sign.tomorrowSignProfit}${get_sign.tomorrowSignProfitType} 已签到 ${get_sign.signDays} 天\n` ; + await signShare() + } + else if (get_sign.rtn_code == "R-ART-0008"){ + $.sub = get_sign.rtn_msg + $.desc = `` + $.log($.sub) + } + else { + $.sub = `签到失败❌` + $.desc = `说明: `+ get_sign.rtn_msg + $.msg($.name,$.sub,$.desc) + $.done() + } + resolve() + }) + }) +} + +function signShare() { + return new Promise((resolve, reject) =>{ + let profiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/signShareAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval + } + $.post(profiturl, async(error, resp, data) => { + //$.log(data+"\n") + let sign_share = JSON.parse(data) + if (sign_share.ret == "ok"){ + $.log("签到分享收益: +"+sign_share.profit) + await Stimulate("23") + await invite() + } else { + $.log(sign_share.rtn_msg) + } + resolve() + }) + }) +} +function WelfareCash() { + return new Promise((resolve, reject) =>{ + let welurl = { + url: `https://www.xiaodouzhuan.cn/jkd/activity/cashweal/noviceWelfareCash.action`, + headers: {Cookie:cookieval,'User-Agent':UA} + } + $.post(welurl, async(error, resp, data) => { + //$.log(data+"\n") + let _welfareCash = JSON.parse(data) + if (_welfareCash.ret == "ok"){ + $.log("新手福利提现: 成功") + + } else { + $.log(_welfareCash.rtn_msg) + } + resolve() + }) + }) +} +function realname() { + return new Promise((resolve, reject) =>{ + let drawurl = { + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=${wxname}`, + headers: {Cookie:cookieval,'User-Agent':UA} + } + $.get(drawurl, async(error, resp, data) => { + $.log(data+"\n") + resolve() + }) + }) +} + +//提现 +function Withdraw() { + return new Promise((resolve, reject) =>{ + let drawurl = { + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/userWithdrawPost.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: `type=wx&sum=${sumcash}&mobile=&pid=0` + } + $.post(drawurl, async(error, resp, data) => { + $.log(data+"\n") + resolve() + }) + }) +} + +function userinfo() { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://www.xiaodouzhuan.cn/jkd/newMobileMenu/infoMe.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: bodyval + } + $.post(infourl, async(error, resp, data) => { + let get_info = JSON.parse(data) + if( get_info.ret=="ok"){ + userName = get_info.userinfo.username + sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeCurCashItem.value + curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value + gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value + $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) + $.sub += " "+gold + $.desc += sumcash + "/"+curcash + $.msg($.name+" 昵称:"+userName, $.sub, $.desc+"\n") + } + resolve() + }) + }) +} +function artList(readbodyVal) { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artlist.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: readbodyVal + } + $.post(infourl, async(error, resp, data) => { + let get_list = JSON.parse(data) + //$.log( data) + $.log("【开始自动阅读】") + if (get_list.ret == "ok"){ + for( lists of get_list.artlist){ + if(lists.item_type=="article"){ + art_Title = lists.art_title + artid =lists.art_id + screen_Name = lists.screen_name + $.log("正在阅读文章: "+art_Title +" -------- <"+screen_Name +">\n ") + await readTask(lists.art_id,"1") + } + if(lists.item_type=="video"){ + art_Title = lists.art_title + artid =lists.art_id + arttype = "2" + screen_Name = lists.screen_name + $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") + await readTask(lists.art_id,"2") + } + if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0017`){ + break + } + } + } + resolve() + }) + }) +} + + +function readTask(artid,arttype) { + return new Promise((resolve, reject) =>{ + let rewurl = { + url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artDetail.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: `jsondata={"appid":"xzwl","channel":"IOS-qianzhuan","psign":"0cf94b87f584dfc81a87fa74dcb3757f","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"60.0.6"}` + } + $.post(rewurl, async(error, resp, data) => { + //$.log(data) + if(resp.statusCode ==200){ + await $.wait(31000) + await finishTask(artid,arttype) + } else { + $.log("阅读失败: "+data) + } + resolve() + }) + }) +} + +function finishTask(artid,arttype) { + return new Promise((resolve, reject) =>{ + let finishurl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS-qianzhuan",${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` + } + $.post(finishurl, async(error, response, data) => { + $.log(data+"\n") + let do_read = JSON.parse(data) + taskresult = do_read.rtn_code + if (do_read.ret == "ok"){ + $.log("获得收益: +"+do_read.profit +"\n") + } + resolve() + }) + }) +} + +//激励视频 +function Stimulate(position) { + return new Promise((resolve, reject) =>{ + let stimurl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/stimulateAdvAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","channel":"iOS"}` + } + $.post(stimurl, async(error, response, data) => { + //$.log(data+"\n") + let do_stim = JSON.parse(data) + if ( do_stim.ret == "ok"){ + $.log( do_stim.profit_title+": +"+ do_stim.profit +"(以实际情况为准)") + } + resolve() + }) + }) +} + +function BoxProfit() { + return new Promise((resolve, reject) =>{ + let profiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/task/getTaskBoxProfit.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: `box_type=${boxtype}` + } + $.post(profiturl, async(error, resp, data) => { + //$.log(data+"\n") + let do_box = JSON.parse(data) + if (do_box.ret == "ok"&&do_box.profit>0){ + $.log("获得收益: +"+do_box.profit) + position = do_box.advertPopup.position + await Stimulate(position) + $.log(position) + } + else if (do_box.rtn_code=='TAS-A-1'){ + $.log("计时金币"+do_box.rtn_msg) + } + resolve() + }) + }) +} + + +function invite() { + let rewurl = { + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/member/receiveMonkeyXd.action?userid=fe0d318cdfbd4f8f9950ce67c5643eaa`, + headers: {Cookie:cookieval} + } + $.get(rewurl, (error, response, data) => { + }) } + + +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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 dc0cb401635acee072a4e74f948fd732b461a127 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 10:48:30 +0800 Subject: [PATCH 275/721] Update jukan.js --- Task/jukan.js | 387 -------------------------------------------------- 1 file changed, 387 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 1f60e318b0..36bcce17dc 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -383,390 +383,3 @@ function invite() { 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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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)} -「/* -聚看点极速版签到任务 -打开'我的'获取Cookie - -https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js - -可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 - -hostname = www.xiaodouzhuan.cn -~~~~~~~~~~~~~~~~ - -*/ -const $ = new Env('聚看点') -let drawcash = $.getdata('jukan_cash') || 30 //提现金额 -let wxname = $.getdata('jukan_name') || ""//微信真实名字,可以在双引号内填入 -let CookieArr=[],BodyArr=[]; -let cookie = $.getdata('jukan_ck') -let bodys = $.getdata('jukan_body') -let UA = 'JuKanDian/5.6.5 (iPhone; iOS 14.2; Scale/3.00)' - -if ($.isNode()) { - if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('&') > -1) { - JKCookie = process.env.JUKAN_COOKIE.split('&'); - } - if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('\n') > -1) { - JKCookie = process.env.JUKAN_COOKIE.split('\n'); - } else { - JKCookie = process.env.JUKAN_COOKIE.split() - } - if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('&') > -1) { - JKbody = process.env.JUKAN_BODY.split('&'); - } - if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('\n') > -1) { - JKbody = process.env.JUKAN_BODY.split('\n'); - } else { - JKbody = process.env.JUKAN_BODY.split() - } - Object.keys(JKCookie).forEach((item) => { - if (JKCookie[item]) { - CookieArr.push(JKCookie[item]) - } - }) - Object.keys(JKbody).forEach((item) => { - if (JKbody[item]) { - BodyArr.push(JKbody[item]) - } - }) -} else if (cookie.indexOf('&')>-1 &&bodys.indexOf('&')>-1){ - Object.keys(cookie.split('&')).forEach((item) => { - CookieArr.push(cookie.split('&')[item]) - }) - Object.keys(bodys.split('&')).forEach((item) => { - BodyArr.push(bodys.split('&')[item]) - }) -} else { - CookieArr.push(cookie) - BodyArr.push(bodys) -} - -if ($.isNode()) { - console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) -} - -if (typeof $request !== 'undefined') { - if ($request && $request.method != `OPTIONS`) { - const bodyVal = $request.body - const Cookieval = $request.headers['Cookie'] - if(Cookieval)$.setdata(Cookieval,'jukan_ck') - if(bodyVal)$.setdata(bodyVal,'jukan_body') - $.log(`Cookie:${Cookieval}`) - $.log(`bodyVal:${bodyVal}`) - $.msg($.name,"获取Cookie成功") - $.done() - } -} else { -!(async() => { - if (!CookieArr[0]) { - console.log($.name, '【提示】请把聚看点Cookie填入Github 的 Secrets 中,请以&或者换行隔开') - return; - } - console.log(`您共提供${CookieArr.length}个聚看点账号Cookie`) - for (let i = 0; i < CookieArr.length; i++) { - if (CookieArr[i]) { - cookieval = CookieArr[i] - bodyval = BodyArr[i] - ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) - apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) - bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] - $.index = i + 1; - await sign(); - await getsign(); - await Stimulate("17") - for( boxtype of [1,2]){ - await $.wait(1000) - await BoxProfit(boxtype) - } - await userinfo() - if (sumcash >= drawcash&&wxname){ - await realname(); - await Withdraw(); - } - await WelfareCash(); - for (readbodyVal of bodys){ - await artList(readbodyVal) - } - } - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) -} -//签到 -function sign() { - return new Promise((resolve, reject) =>{ - let profiturl = { - url: `https://www.xiaodouzhuan.cn/jkd/account/homeSignAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval - } - $.post(profiturl, async(error, resp, data) => { - //$.log(data+"\n") - let sign_res = JSON.parse(data) - if (sign_res.ret == "ok"&&sign_res.profit>0){ - $.log("签到收益: +"+sign_res.profitDesc) - } else { - $.log(sign_res.rtn_msg) - } - resolve() - }) - }) -} - - - -function getsign() { - return new Promise((resolve, reject) =>{ - let signurl = { - url: `https://www.xiaodouzhuan.cn/jkd/user/usersign.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, - body: bodyval - } - $.post(signurl, async(error, response, data) => { - let get_sign = JSON.parse(data) - //$.log(data) - if (get_sign.ret == "ok"){ - $.sub = `签到成功🎉` - $.desc = `签到收益: +${get_sign.todaySignProfit}${get_sign.todaySignProfitType}💰,明日 +${get_sign.tomorrowSignProfit}${get_sign.tomorrowSignProfitType} 已签到 ${get_sign.signDays} 天\n` ; - await signShare() - } - else if (get_sign.rtn_code == "R-ART-0008"){ - $.sub = get_sign.rtn_msg - $.desc = `` - $.log($.sub) - } - else { - $.sub = `签到失败❌` - $.desc = `说明: `+ get_sign.rtn_msg - $.msg($.name,$.sub,$.desc) - $.done() - } - resolve() - }) - }) -} - -function signShare() { - return new Promise((resolve, reject) =>{ - let profiturl = { - url: `https://www.xiaodouzhuan.cn/jkd/account/signShareAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval - } - $.post(profiturl, async(error, resp, data) => { - //$.log(data+"\n") - let sign_share = JSON.parse(data) - if (sign_share.ret == "ok"){ - $.log("签到分享收益: +"+sign_share.profit) - await Stimulate("23") - await invite() - } else { - $.log(sign_share.rtn_msg) - } - resolve() - }) - }) -} -function WelfareCash() { - return new Promise((resolve, reject) =>{ - let welurl = { - url: `https://www.xiaodouzhuan.cn/jkd/activity/cashweal/noviceWelfareCash.action`, - headers: {Cookie:cookieval,'User-Agent':UA} - } - $.post(welurl, async(error, resp, data) => { - //$.log(data+"\n") - let _welfareCash = JSON.parse(data) - if (_welfareCash.ret == "ok"){ - $.log("新手福利提现: 成功") - - } else { - $.log(_welfareCash.rtn_msg) - } - resolve() - }) - }) -} -function realname() { - return new Promise((resolve, reject) =>{ - let drawurl = { - url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=${wxname}`, - headers: {Cookie:cookieval,'User-Agent':UA} - } - $.get(drawurl, async(error, resp, data) => { - $.log(data+"\n") - resolve() - }) - }) -} - -//提现 -function Withdraw() { - return new Promise((resolve, reject) =>{ - let drawurl = { - url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/userWithdrawPost.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: `type=wx&sum=${sumcash}&mobile=&pid=0` - } - $.post(drawurl, async(error, resp, data) => { - $.log(data+"\n") - resolve() - }) - }) -} - -function userinfo() { - return new Promise((resolve, reject) =>{ - let infourl = { - url: `https://www.xiaodouzhuan.cn/jkd/newMobileMenu/infoMe.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, - body: bodyval - } - $.post(infourl, async(error, resp, data) => { - let get_info = JSON.parse(data) - if( get_info.ret=="ok"){ - userName = get_info.userinfo.username - sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeCurCashItem.value - curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value - gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value - $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) - $.sub += " "+gold - $.desc += sumcash + "/"+curcash - $.msg($.name+" 昵称:"+userName, $.sub, $.desc+"\n") - } - resolve() - }) - }) -} -function artList(readbodyVal) { - return new Promise((resolve, reject) =>{ - let infourl = { - url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artlist.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, - body: readbodyVal - } - $.post(infourl, async(error, resp, data) => { - let get_list = JSON.parse(data) - //$.log( data) - $.log("【开始自动阅读】") - if (get_list.ret == "ok"){ - for( lists of get_list.artlist){ - if(lists.item_type=="article"){ - art_Title = lists.art_title - artid =lists.art_id - screen_Name = lists.screen_name - $.log("正在阅读文章: "+art_Title +" -------- <"+screen_Name +">\n ") - await readTask(lists.art_id,"1") - } - if(lists.item_type=="video"){ - art_Title = lists.art_title - artid =lists.art_id - arttype = "2" - screen_Name = lists.screen_name - $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") - await readTask(lists.art_id,"2") - } - if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0017`){ - break - } - } - } - resolve() - }) - }) -} - - -function readTask(artid,arttype) { - return new Promise((resolve, reject) =>{ - let rewurl = { - url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artDetail.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"appid":"xzwl","channel":"IOS-qianzhuan","psign":"0cf94b87f584dfc81a87fa74dcb3757f","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"60.0.6"}` - } - $.post(rewurl, async(error, resp, data) => { - //$.log(data) - if(resp.statusCode ==200){ - await $.wait(31000) - await finishTask(artid,arttype) - } else { - $.log("阅读失败: "+data) - } - resolve() - }) - }) -} - -function finishTask(artid,arttype) { - return new Promise((resolve, reject) =>{ - let finishurl = { - url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS-qianzhuan",${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` - } - $.post(finishurl, async(error, response, data) => { - $.log(data+"\n") - let do_read = JSON.parse(data) - taskresult = do_read.rtn_code - if (do_read.ret == "ok"){ - $.log("获得收益: +"+do_read.profit +"\n") - } - resolve() - }) - }) -} - -//激励视频 -function Stimulate(position) { - return new Promise((resolve, reject) =>{ - let stimurl = { - url: `https://www.xiaodouzhuan.cn/jkd/account/stimulateAdvAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","channel":"iOS"}` - } - $.post(stimurl, async(error, response, data) => { - //$.log(data+"\n") - let do_stim = JSON.parse(data) - if ( do_stim.ret == "ok"){ - $.log( do_stim.profit_title+": +"+ do_stim.profit +"(以实际情况为准)") - } - resolve() - }) - }) -} - -function BoxProfit() { - return new Promise((resolve, reject) =>{ - let profiturl = { - url: `https://www.xiaodouzhuan.cn/jkd/task/getTaskBoxProfit.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: `box_type=${boxtype}` - } - $.post(profiturl, async(error, resp, data) => { - //$.log(data+"\n") - let do_box = JSON.parse(data) - if (do_box.ret == "ok"&&do_box.profit>0){ - $.log("获得收益: +"+do_box.profit) - position = do_box.advertPopup.position - await Stimulate(position) - $.log(position) - } - else if (do_box.rtn_code=='TAS-A-1'){ - $.log("计时金币"+do_box.rtn_msg) - } - resolve() - }) - }) -} - - -function invite() { - let rewurl = { - url: `https://www.xiaodouzhuan.cn/jkd/weixin20/member/receiveMonkeyXd.action?userid=fe0d318cdfbd4f8f9950ce67c5643eaa`, - headers: {Cookie:cookieval} - } - $.get(rewurl, (error, response, data) => { - }) -} - - -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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 12b06848f90591beb2d9e793aeed29afb45689de Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 10:49:04 +0800 Subject: [PATCH 276/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 36aeb227ef..18874eb43b 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -208,6 +208,22 @@ "keys": ["jukan_ck","jukan_body"], "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", + "settings": [ + { + "id": "jukan_cash", + "name": "提现金额", + "val": "", + "type": "number", + "placeholder": "默认30 (点击以展开说明)", + "desc": "仅允许填入数字,所选金额可见聚看点APP" + }, + { + "id": "jukan_name", + "name": "微信真实姓名", + "val": "", + "type": "textarea", + "placeholder": "填入微信真实姓名" + }], "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png"], "script": "https://github.com/Sunert/Scripts/raw/master/Task/jukan.js" }, From be8d5bc271fa8d1270453c15773c3cf9bc3bc547 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 11:43:23 +0800 Subject: [PATCH 277/721] Update jukan.js --- Task/jukan.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 36bcce17dc..8e5abb40e8 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -204,12 +204,19 @@ function WelfareCash() { } function realname() { return new Promise((resolve, reject) =>{ - let drawurl = { + let realurl = { url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=${wxname}`, headers: {Cookie:cookieval,'User-Agent':UA} } - $.get(drawurl, async(error, resp, data) => { - $.log(data+"\n") + $.get(realurl, async(error, resp, data) => { + let get_name = JSON.parse(data) + if (get_name.ret="ok"){ + $.log("恭喜您,实名验证通过" + get_name.return_msg) + await Withdraw() + } else { + $.log("实名验证" + get_name.return_msg) + $.msg($.name,"提现实名认证失败") + } resolve() }) }) @@ -223,7 +230,8 @@ function Withdraw() { headers: {Cookie:cookieval,'User-Agent':UA}, body: `type=wx&sum=${sumcash}&mobile=&pid=0` } $.post(drawurl, async(error, resp, data) => { - $.log(data+"\n") + $.log("提现"+sumcash+"元\n"+data) + $.desc += "\n提现"+sumcash+"元 "+data resolve() }) }) From 15e60753ee29fb709c2c2e16766297015d254b3e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 15:02:02 +0800 Subject: [PATCH 278/721] Update jukan.js --- Task/jukan.js | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 8e5abb40e8..8ff50a5d65 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -86,23 +86,29 @@ if (typeof $request !== 'undefined') { bodyval = BodyArr[i] ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) - bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')] + if (new Date().getTimezoneOffset()/60 != -8){ + times = Date.parse(new Date())/1000+28800 + } else { + times = Date.parse(new Date())/1000 + } + bodys = [bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times}`),bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'cateid%22%20:%20%2253')] $.index = i + 1; await sign(); await getsign(); await Stimulate("17") - for( boxtype of [1,2]){ + for(boxtype of [1,2]){ await $.wait(1000) await BoxProfit(boxtype) } await userinfo() - if (sumcash >= drawcash&&wxname){ + if (curcash >= drawcash&&wxname){ await realname(); await Withdraw(); } await WelfareCash(); for (readbodyVal of bodys){ - await artList(readbodyVal) + $.log(readbodyVal) + await artList(readbodyVal) } } } @@ -130,8 +136,6 @@ function sign() { }) } - - function getsign() { return new Promise((resolve, reject) =>{ let signurl = { @@ -194,7 +198,6 @@ function WelfareCash() { let _welfareCash = JSON.parse(data) if (_welfareCash.ret == "ok"){ $.log("新手福利提现: 成功") - } else { $.log(_welfareCash.rtn_msg) } @@ -248,9 +251,9 @@ function userinfo() { let get_info = JSON.parse(data) if( get_info.ret=="ok"){ userName = get_info.userinfo.username - sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeCurCashItem.value + sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeSumCashItem.value curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value - gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value + gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) $.sub += " "+gold $.desc += sumcash + "/"+curcash @@ -260,6 +263,7 @@ function userinfo() { }) }) } + function artList(readbodyVal) { return new Promise((resolve, reject) =>{ let infourl = { @@ -269,7 +273,7 @@ function artList(readbodyVal) { } $.post(infourl, async(error, resp, data) => { let get_list = JSON.parse(data) - //$.log( data) + $.log( data) $.log("【开始自动阅读】") if (get_list.ret == "ok"){ for( lists of get_list.artlist){ @@ -278,17 +282,16 @@ function artList(readbodyVal) { artid =lists.art_id screen_Name = lists.screen_name $.log("正在阅读文章: "+art_Title +" -------- <"+screen_Name +">\n ") - await readTask(lists.art_id,"1") + await readTask(lists.art_id,"1") } if(lists.item_type=="video"){ art_Title = lists.art_title artid =lists.art_id - arttype = "2" screen_Name = lists.screen_name $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") await readTask(lists.art_id,"2") } - if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0017`){ + if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0011`){ break } } @@ -304,7 +307,7 @@ function readTask(artid,arttype) { let rewurl = { url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artDetail.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"appid":"xzwl","channel":"IOS-qianzhuan","psign":"0cf94b87f584dfc81a87fa74dcb3757f","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"60.0.6"}` + body: `jsondata={"appid":"xzwl","channel":"IOS","psign":"92dea068b6c271161be05ed358b59932","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"5.6.5"}` } $.post(rewurl, async(error, resp, data) => { //$.log(data) @@ -323,7 +326,7 @@ function finishTask(artid,arttype) { return new Promise((resolve, reject) =>{ let finishurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS-qianzhuan",${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` + headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS",${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` } $.post(finishurl, async(error, response, data) => { $.log(data+"\n") @@ -343,7 +346,7 @@ function Stimulate(position) { let stimurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/stimulateAdvAccount.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","channel":"iOS"}` + body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","channel":"iOS"}` } $.post(stimurl, async(error, response, data) => { //$.log(data+"\n") From e3eb586cc3685eb2f87d82f14bd99d1dea9d70b9 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 15:13:50 +0800 Subject: [PATCH 279/721] Update jukan.js --- Task/jukan.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 8ff50a5d65..7d4f8378f0 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -87,10 +87,11 @@ if (typeof $request !== 'undefined') { ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) if (new Date().getTimezoneOffset()/60 != -8){ - times = Date.parse(new Date())/1000+28800 + times = Date.parse(new Date())/1000 } else { times = Date.parse(new Date())/1000 } +$.log(times) bodys = [bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times}`),bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'cateid%22%20:%20%2253')] $.index = i + 1; await sign(); @@ -108,7 +109,7 @@ if (typeof $request !== 'undefined') { await WelfareCash(); for (readbodyVal of bodys){ $.log(readbodyVal) - await artList(readbodyVal) + //await artList(readbodyVal) } } } From a9bc4847a3bf29cee3ddb7fa62685f7938a7c4e2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 15:19:00 +0800 Subject: [PATCH 280/721] Update jukan.js --- Task/jukan.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 7d4f8378f0..a397a8480f 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -86,11 +86,7 @@ if (typeof $request !== 'undefined') { bodyval = BodyArr[i] ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) - if (new Date().getTimezoneOffset()/60 != -8){ times = Date.parse(new Date())/1000 - } else { - times = Date.parse(new Date())/1000 - } $.log(times) bodys = [bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times}`),bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'cateid%22%20:%20%2253')] $.index = i + 1; @@ -109,7 +105,7 @@ $.log(times) await WelfareCash(); for (readbodyVal of bodys){ $.log(readbodyVal) - //await artList(readbodyVal) + await artList(readbodyVal) } } } @@ -311,7 +307,7 @@ function readTask(artid,arttype) { body: `jsondata={"appid":"xzwl","channel":"IOS","psign":"92dea068b6c271161be05ed358b59932","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"5.6.5"}` } $.post(rewurl, async(error, resp, data) => { - //$.log(data) + $.log(data) if(resp.statusCode ==200){ await $.wait(31000) await finishTask(artid,arttype) From 45ab4c3973e7df9cbff4dd4eeb7d6400c5cdff3c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 15:33:10 +0800 Subject: [PATCH 281/721] Update jukan.js --- Task/jukan.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index a397a8480f..bbe1c82d04 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -270,7 +270,7 @@ function artList(readbodyVal) { } $.post(infourl, async(error, resp, data) => { let get_list = JSON.parse(data) - $.log( data) + //$.log( data) $.log("【开始自动阅读】") if (get_list.ret == "ok"){ for( lists of get_list.artlist){ @@ -307,7 +307,7 @@ function readTask(artid,arttype) { body: `jsondata={"appid":"xzwl","channel":"IOS","psign":"92dea068b6c271161be05ed358b59932","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"5.6.5"}` } $.post(rewurl, async(error, resp, data) => { - $.log(data) + //$.log(data) if(resp.statusCode ==200){ await $.wait(31000) await finishTask(artid,arttype) @@ -323,12 +323,14 @@ function finishTask(artid,arttype) { return new Promise((resolve, reject) =>{ let finishurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS",${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}` + headers: {Cookie:cookieval,'User-Agent':UA}, body: + `jsondata={ "appid" : "xzwl", "read_weal" : 0, "paytype" : ${arttype}, "securitykey" : "", "channel" : "iOS", "psign" : "92dea068b6c271161be05ed358b59932", "appversioncode" : "565", "time" : "1609399731", "apptoken" : "${apptoken}", "appversion" : "5.6.5", ${ID}, "os" : "iOS", "artid":"${artid}", "accountType" : "0", "readmodel" : "1"}` } + $.log(finishurl.body) $.post(finishurl, async(error, response, data) => { $.log(data+"\n") let do_read = JSON.parse(data) - taskresult = do_read.rtn_code + taskresult = do_read.rtn_code if (do_read.ret == "ok"){ $.log("获得收益: +"+do_read.profit +"\n") } From edcf1412f2bffd046e0f3bc340e86d90c121abdb Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 15:43:14 +0800 Subject: [PATCH 282/721] Update jukan.js --- Task/jukan.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index bbe1c82d04..2a59529c81 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -87,7 +87,6 @@ if (typeof $request !== 'undefined') { ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) times = Date.parse(new Date())/1000 -$.log(times) bodys = [bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times}`),bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'cateid%22%20:%20%2253')] $.index = i + 1; await sign(); @@ -321,10 +320,12 @@ function readTask(artid,arttype) { function finishTask(artid,arttype) { return new Promise((resolve, reject) =>{ + times = Date.parse(new Date())/1000 + $.log(times) let finishurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: - `jsondata={ "appid" : "xzwl", "read_weal" : 0, "paytype" : ${arttype}, "securitykey" : "", "channel" : "iOS", "psign" : "92dea068b6c271161be05ed358b59932", "appversioncode" : "565", "time" : "1609399731", "apptoken" : "${apptoken}", "appversion" : "5.6.5", ${ID}, "os" : "iOS", "artid":"${artid}", "accountType" : "0", "readmodel" : "1"}` + headers: {Cookie:cookieval,'User-Agent':UA}, + body: `jsondata%3D%7B%20%20%22appid%22%20%3A%20%22xzwl%22%2C%20%20%22read_weal%22%20%3A%200%2C%20%20%22paytype%22%20%3A%20%24%7Barttype%7D%2C%20%20%22securitykey%22%20%3A%20%22%22%2C%20%20%22channel%22%20%3A%20%22iOS%22%2C%20%20%22psign%22%20%3A%20%2292dea068b6c271161be05ed358b59932%22%2C%20%20%22appversioncode%22%20%3A%20%22565%22%2C%20%20%22time%22%20%3A%20%22%24%7Btimes%7D%22%2C%20%22%24%7Bapptoken%7D%22%2C%20%20%22appversion%22%20%3A%20%225.6.5%22%2C%20%20%24%7BID%7D%2C%20%20%22os%22%20%3A%20%22iOS%22%2C%20%20%22artid%22%3A%22%24%7Bartid%7D%22%2C%20%20%22accountType%22%20%3A%20%220%22%2C%20%20%22readmodel%22%20%3A%20%221%22%7D` } $.log(finishurl.body) $.post(finishurl, async(error, response, data) => { From 5171da2bded1a9a0d738362cbbe7ce6f0d956e77 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 15:56:07 +0800 Subject: [PATCH 283/721] Update jukan.js --- Task/jukan.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 2a59529c81..33f471f0ea 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -322,12 +322,13 @@ function finishTask(artid,arttype) { return new Promise((resolve, reject) =>{ times = Date.parse(new Date())/1000 $.log(times) +finishbody = encodeURIComponent(`jsondata={"appid":"xzwl","read_weal":0,"paytype":${arttype},"securitykey":"","channel":"iOS","psign":"92dea068b6c271161be05ed358b59932","appversioncode":"565","time":"${times}","${apptoken}","appversion":"5.6.5",${ID},"os":"iOS","artid":"${artid}","accountType":"0","readmodel":"1"}`) let finishurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata%3D%7B%20%20%22appid%22%20%3A%20%22xzwl%22%2C%20%20%22read_weal%22%20%3A%200%2C%20%20%22paytype%22%20%3A%20%24%7Barttype%7D%2C%20%20%22securitykey%22%20%3A%20%22%22%2C%20%20%22channel%22%20%3A%20%22iOS%22%2C%20%20%22psign%22%20%3A%20%2292dea068b6c271161be05ed358b59932%22%2C%20%20%22appversioncode%22%20%3A%20%22565%22%2C%20%20%22time%22%20%3A%20%22%24%7Btimes%7D%22%2C%20%22%24%7Bapptoken%7D%22%2C%20%20%22appversion%22%20%3A%20%225.6.5%22%2C%20%20%24%7BID%7D%2C%20%20%22os%22%20%3A%20%22iOS%22%2C%20%20%22artid%22%3A%22%24%7Bartid%7D%22%2C%20%20%22accountType%22%20%3A%20%220%22%2C%20%20%22readmodel%22%20%3A%20%221%22%7D` + body: finishbody } - $.log(finishurl.body) + $.log(finishbody) $.post(finishurl, async(error, response, data) => { $.log(data+"\n") let do_read = JSON.parse(data) From 0e7b46650fea74df1e8b3b310bc8fa1bab8076a7 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 17:28:51 +0800 Subject: [PATCH 284/721] Update jukan.js --- Task/jukan.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 33f471f0ea..ef722569f6 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -86,8 +86,9 @@ if (typeof $request !== 'undefined') { bodyval = BodyArr[i] ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) + times = Date.parse(new Date())/1000 - bodys = [bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times}`),bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'cateid%22%20:%20%2253')] + bodys = [bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times}%22%2C%20`+'cateid%22%20:%20%223'),bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'cateid%22%20:%20%2253')] $.index = i + 1; await sign(); await getsign(); @@ -103,7 +104,6 @@ if (typeof $request !== 'undefined') { } await WelfareCash(); for (readbodyVal of bodys){ - $.log(readbodyVal) await artList(readbodyVal) } } @@ -269,7 +269,7 @@ function artList(readbodyVal) { } $.post(infourl, async(error, resp, data) => { let get_list = JSON.parse(data) - //$.log( data) + // $.log( data) $.log("【开始自动阅读】") if (get_list.ret == "ok"){ for( lists of get_list.artlist){ @@ -287,8 +287,8 @@ function artList(readbodyVal) { $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") await readTask(lists.art_id,"2") } - if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0011`){ - break + if(taskresult == 'R-ART-1002'|| taskresult ==`R-ART-0011`){ + break } } } @@ -320,19 +320,15 @@ function readTask(artid,arttype) { function finishTask(artid,arttype) { return new Promise((resolve, reject) =>{ - times = Date.parse(new Date())/1000 - $.log(times) -finishbody = encodeURIComponent(`jsondata={"appid":"xzwl","read_weal":0,"paytype":${arttype},"securitykey":"","channel":"iOS","psign":"92dea068b6c271161be05ed358b59932","appversioncode":"565","time":"${times}","${apptoken}","appversion":"5.6.5",${ID},"os":"iOS","artid":"${artid}","accountType":"0","readmodel":"1"}`) let finishurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: finishbody + body: `jsondata={"appid":"xzwl","read_weal":0,"paytype":${arttype},"securitykey":"","channel":"iOS","psign":"92dea068b6c271161be05ed358b59932","appversioncode":"565","time":"1609399731",${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","artid":${artid},"accountType":"0","readmodel":"1"}` } - $.log(finishbody) $.post(finishurl, async(error, response, data) => { $.log(data+"\n") let do_read = JSON.parse(data) - taskresult = do_read.rtn_code + taskresult = do_read.rtn_code if (do_read.ret == "ok"){ $.log("获得收益: +"+do_read.profit +"\n") } From e629add0487cf09ab2e469785640262b865439b6 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 17:34:34 +0800 Subject: [PATCH 285/721] Update jukan.js --- Task/jukan.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index ef722569f6..76879fd95b 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -320,11 +320,13 @@ function readTask(artid,arttype) { function finishTask(artid,arttype) { return new Promise((resolve, reject) =>{ + times = Date.parse(new Date())/1000 let finishurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"appid":"xzwl","read_weal":0,"paytype":${arttype},"securitykey":"","channel":"iOS","psign":"92dea068b6c271161be05ed358b59932","appversioncode":"565","time":"1609399731",${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","artid":${artid},"accountType":"0","readmodel":"1"}` + body: `jsondata={"appid":"xzwl","read_weal":0,"paytype":${arttype},"securitykey":"","channel":"iOS","psign":"92dea068b6c271161be05ed358b59932","appversioncode":"565","time":"${times}",${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","artid":${artid},"accountType":"0","readmodel":"1"}` } + return $.post(finishurl, async(error, response, data) => { $.log(data+"\n") let do_read = JSON.parse(data) From 558faf343f130d39b5f09eec54cdabe1a77e073b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 17:54:55 +0800 Subject: [PATCH 286/721] Update jukan.js --- Task/jukan.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 76879fd95b..7ed4f0e7fe 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -88,7 +88,7 @@ if (typeof $request !== 'undefined') { apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) times = Date.parse(new Date())/1000 - bodys = [bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times}%22%2C%20`+'cateid%22%20:%20%223'),bodyval.replace(/time%22%20%3A%20%22\d+/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'cateid%22%20:%20%2253')] + bodys = [bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times}%22%2C%20`+'%22cateid%22%20%3A%203'),bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053')] $.index = i + 1; await sign(); await getsign(); @@ -326,7 +326,6 @@ function finishTask(artid,arttype) { headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"appid":"xzwl","read_weal":0,"paytype":${arttype},"securitykey":"","channel":"iOS","psign":"92dea068b6c271161be05ed358b59932","appversioncode":"565","time":"${times}",${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","artid":${artid},"accountType":"0","readmodel":"1"}` } - return $.post(finishurl, async(error, response, data) => { $.log(data+"\n") let do_read = JSON.parse(data) From bda5c83dd7b081cd5586527f14aa61eeeb6ee662 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 18:05:13 +0800 Subject: [PATCH 287/721] Update jukan.js --- Task/jukan.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Task/jukan.js b/Task/jukan.js index 7ed4f0e7fe..3b2a1ec9d1 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -103,6 +103,10 @@ if (typeof $request !== 'undefined') { await Withdraw(); } await WelfareCash(); + $.log(new Date().getTimezoneOffset()) + if(new Date().getTimezoneOffset() !='-480'){ + $.done() + } for (readbodyVal of bodys){ await artList(readbodyVal) } From a7c5920a2cbc5c56d1e77ea313609c1b1529f2b2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 18:07:41 +0800 Subject: [PATCH 288/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index 3b2a1ec9d1..89834d8f37 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -105,7 +105,7 @@ if (typeof $request !== 'undefined') { await WelfareCash(); $.log(new Date().getTimezoneOffset()) if(new Date().getTimezoneOffset() !='-480'){ - $.done() + return } for (readbodyVal of bodys){ await artList(readbodyVal) From e7e5dde6fa52ada65be5b3d739550d455a93f6ba Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 18:11:01 +0800 Subject: [PATCH 289/721] Update jukan.js --- Task/jukan.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 89834d8f37..12d2cc8625 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,5 +1,5 @@ /* -聚看点极速版签到任务 +聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js @@ -105,7 +105,7 @@ if (typeof $request !== 'undefined') { await WelfareCash(); $.log(new Date().getTimezoneOffset()) if(new Date().getTimezoneOffset() !='-480'){ - return + break } for (readbodyVal of bodys){ await artList(readbodyVal) From 11c7e8a9362acd1b654eff933f9dedf13e713cbf Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 18:13:49 +0800 Subject: [PATCH 290/721] Update jukan.js --- Task/jukan.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 12d2cc8625..b41c252770 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -94,21 +94,21 @@ if (typeof $request !== 'undefined') { await getsign(); await Stimulate("17") for(boxtype of [1,2]){ - await $.wait(1000) - await BoxProfit(boxtype) + await $.wait(1000); + await BoxProfit(boxtype); } - await userinfo() + await userinfo() if (curcash >= drawcash&&wxname){ await realname(); await Withdraw(); } await WelfareCash(); - $.log(new Date().getTimezoneOffset()) if(new Date().getTimezoneOffset() !='-480'){ break - } + } else { for (readbodyVal of bodys){ await artList(readbodyVal) + } } } } From d1458bcf1794ccf29dba6ea985249daaa3c5d2fa Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 18:36:14 +0800 Subject: [PATCH 291/721] Update jukan.js --- Task/jukan.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index b41c252770..5e05157bdf 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -86,30 +86,30 @@ if (typeof $request !== 'undefined') { bodyval = BodyArr[i] ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) - - times = Date.parse(new Date())/1000 - bodys = [bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times}%22%2C%20`+'%22cateid%22%20%3A%203'),bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053')] $.index = i + 1; await sign(); await getsign(); - await Stimulate("17") + await Stimulate("17"); for(boxtype of [1,2]){ await $.wait(1000); - await BoxProfit(boxtype); + await BoxProfit(boxtype) } - await userinfo() + await userinfo(); if (curcash >= drawcash&&wxname){ await realname(); - await Withdraw(); + await Withdraw() } await WelfareCash(); - if(new Date().getTimezoneOffset() !='-480'){ - break + times = Date.parse(new Date())/1000 + bodys = [bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times}%22%2C%20`+'%22cateid%22%20%3A%203'),bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053')] + if(new Date().getTimezoneOffset() != '-480'){ + continue } else { for (readbodyVal of bodys){ await artList(readbodyVal) } } + } } })() @@ -292,7 +292,7 @@ function artList(readbodyVal) { await readTask(lists.art_id,"2") } if(taskresult == 'R-ART-1002'|| taskresult ==`R-ART-0011`){ - break + break } } } From 637d9ac62f12fa284f85d1d8955367d2f76cf492 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 18:38:04 +0800 Subject: [PATCH 292/721] Update jukan.yml --- .github/workflows/jukan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jukan.yml b/.github/workflows/jukan.yml index 6ccea2b63f..3a2ddaaf49 100644 --- a/.github/workflows/jukan.yml +++ b/.github/workflows/jukan.yml @@ -4,7 +4,7 @@ name: 聚看点 on: workflow_dispatch: schedule: - - cron: '*/10 */2 * * *' + - cron: '*/28 */4 * * *' watch: types: started jobs: From 16986b96e25023e54ee041fbfc4229e93a3b3713 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 20:15:24 +0800 Subject: [PATCH 293/721] Update jukan.js --- Task/jukan.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 5e05157bdf..954c3291f1 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -312,7 +312,8 @@ function readTask(artid,arttype) { $.post(rewurl, async(error, resp, data) => { //$.log(data) if(resp.statusCode ==200){ - await $.wait(31000) + $.log("请等待30s\n") + await $.wait(30000) await finishTask(artid,arttype) } else { $.log("阅读失败: "+data) @@ -331,12 +332,14 @@ function finishTask(artid,arttype) { body: `jsondata={"appid":"xzwl","read_weal":0,"paytype":${arttype},"securitykey":"","channel":"iOS","psign":"92dea068b6c271161be05ed358b59932","appversioncode":"565","time":"${times}",${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","artid":${artid},"accountType":"0","readmodel":"1"}` } $.post(finishurl, async(error, response, data) => { - $.log(data+"\n") + //$.log(data+"\n") let do_read = JSON.parse(data) taskresult = do_read.rtn_code if (do_read.ret == "ok"){ $.log("获得收益: +"+do_read.profit +"\n") - } + } else { + $.log(do_read.rtn_msg) + } resolve() }) }) From 661782362ac1e642e8113e06b1b73b6bb570749a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 21:25:25 +0800 Subject: [PATCH 294/721] Update jukan.js --- Task/jukan.js | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 954c3291f1..fe03b47902 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -16,6 +16,7 @@ let wxname = $.getdata('jukan_name') || ""//微信真实名字,可以在双引 let CookieArr=[],BodyArr=[]; let cookie = $.getdata('jukan_ck') let bodys = $.getdata('jukan_body') +let signtimes = $.getdata('jukan_times') let UA = 'JuKanDian/5.6.5 (iPhone; iOS 14.2; Scale/3.00)' if ($.isNode()) { @@ -99,7 +100,10 @@ if (typeof $request !== 'undefined') { await realname(); await Withdraw() } + if (signtimes&&signtimes<5){ await WelfareCash(); + return +} times = Date.parse(new Date())/1000 bodys = [bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times}%22%2C%20`+'%22cateid%22%20%3A%203'),bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053')] if(new Date().getTimezoneOffset() != '-480'){ @@ -107,9 +111,12 @@ if (typeof $request !== 'undefined') { } else { for (readbodyVal of bodys){ await artList(readbodyVal) - } + } + if (taskresult == 'R-ART-1002'){ + $.desc += "\n"+sumnotify + $.msg($.name+" 昵称:"+userName, $.sub, $.desc) + } } - } } })() @@ -147,8 +154,10 @@ function getsign() { let get_sign = JSON.parse(data) //$.log(data) if (get_sign.ret == "ok"){ + signtimes = get_sign.signDays + if(signtimes) $.setdata(signtimes, 'jukan_times') $.sub = `签到成功🎉` - $.desc = `签到收益: +${get_sign.todaySignProfit}${get_sign.todaySignProfitType}💰,明日 +${get_sign.tomorrowSignProfit}${get_sign.tomorrowSignProfitType} 已签到 ${get_sign.signDays} 天\n` ; + $.desc = `签到收益: +${get_sign.todaySignProfit}${get_sign.todaySignProfitType}💰,明日 +${get_sign.tomorrowSignProfit}${get_sign.tomorrowSignProfitType} 已签到 ${signtimes} 天\n` ; await signShare() } else if (get_sign.rtn_code == "R-ART-0008"){ @@ -253,11 +262,10 @@ function userinfo() { userName = get_info.userinfo.username sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeSumCashItem.value curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value - gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value + gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) $.sub += " "+gold $.desc += sumcash + "/"+curcash - $.msg($.name+" 昵称:"+userName, $.sub, $.desc+"\n") } resolve() }) @@ -334,12 +342,13 @@ function finishTask(artid,arttype) { $.post(finishurl, async(error, response, data) => { //$.log(data+"\n") let do_read = JSON.parse(data) - taskresult = do_read.rtn_code + taskresult = do_read.rtn_code + $.log(do_read.rtn_msg) if (do_read.ret == "ok"){ $.log("获得收益: +"+do_read.profit +"\n") - } else { - $.log(do_read.rtn_msg) - } + } else if (arttype == 1 ){ + sumnotify = do_read.rtn_msg + } resolve() }) }) @@ -356,7 +365,7 @@ function Stimulate(position) { $.post(stimurl, async(error, response, data) => { //$.log(data+"\n") let do_stim = JSON.parse(data) - if ( do_stim.ret == "ok"){ + if ( do_stim.ret == "ok"&&position !="17"){ $.log( do_stim.profit_title+": +"+ do_stim.profit +"(以实际情况为准)") } resolve() @@ -377,7 +386,7 @@ function BoxProfit() { $.log("获得收益: +"+do_box.profit) position = do_box.advertPopup.position await Stimulate(position) - $.log(position) + // $.log(position) } else if (do_box.rtn_code=='TAS-A-1'){ $.log("计时金币"+do_box.rtn_msg) From 5107cbb469f4be95ba834fba043ad7178a58f3f3 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 31 Dec 2020 21:55:30 +0800 Subject: [PATCH 295/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 64e729b13b..d7b8d99530 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -171,7 +171,7 @@ else if(tasks[x].data.countDown[tid].countDown ==0){ $.log(taskName+" tid:"+tid) if (taskArr[y].taskStatus==1 ){ $.log(taskName +" 已完成" ) - $.desc += taskName +" 已完成" + $.desc += taskName +" 已完成\n" }else if(taskArr[y].type == 'openApp'){ RefererUrl = taskArr[y].adLink await get_pkg() From 5c3002513d161120537c24e90f66dfedfa78f5d5 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 00:21:41 +0800 Subject: [PATCH 296/721] Update jukan.js --- Task/jukan.js | 57 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index fe03b47902..22cc9d30e9 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -87,10 +87,12 @@ if (typeof $request !== 'undefined') { bodyval = BodyArr[i] ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) + times = Date.parse(new Date())/1000 $.index = i + 1; await sign(); await getsign(); - await Stimulate("17"); + await stimulate(); + await TimeBox(); for(boxtype of [1,2]){ await $.wait(1000); await BoxProfit(boxtype) @@ -102,9 +104,7 @@ if (typeof $request !== 'undefined') { } if (signtimes&&signtimes<5){ await WelfareCash(); - return -} - times = Date.parse(new Date())/1000 + } bodys = [bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times}%22%2C%20`+'%22cateid%22%20%3A%203'),bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053')] if(new Date().getTimezoneOffset() != '-480'){ continue @@ -214,6 +214,30 @@ function WelfareCash() { }) }) } + +function TimeBox() { + return new Promise((resolve, reject) =>{ + let boxurl = { + url: `https://www.xiaodouzhuan.cn/jkd/account/openTimeBoxAccount.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: bodyval + } + $.post(boxurl, async(error, resp, data) => { + //$.log(data+"\n") + let _timebox = JSON.parse(data) + if (_timebox.ret == "ok"){ + $.log("定时宝箱开启成功,获得收益+"+_timebox.profit + "下次需"+_timebox.next_time+"分钟") + await $.wait(5000) + await Stimulate(_timebox.advertPopup.position) + //$.log(_timebox.advertPopup.buttonText ) + } else { + $.log(_timebox.rtn_msg) + } + resolve() + }) + }) +} + function realname() { return new Promise((resolve, reject) =>{ let realurl = { @@ -354,13 +378,36 @@ function finishTask(artid,arttype) { }) } + +function stimulate() { + return new Promise((resolve, reject) =>{ + let Advurl = { + url: `https://www.xiaodouzhuan.cn/jkd/newmobile/stimulateAdv.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : "17","time" : "${times}", ${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","channel":"iOS"}` + } + $.post(Advurl, async(error, resp, data) => { + //$.log(data+"\n") + let _Adv = JSON.parse(data) + if (_Adv.ret == "ok"&&_Adv.status==1){ + $.log("视频"+ _Adv.videoType+"获得红包: +"+_Adv.rewardAmount+_Adv.rewardName) + await $.wait(1000) + await Stimulate("17") + } else { + $.log("视频广告红包,"+ _Adv.message) + } + resolve() + }) + }) +} + //激励视频 function Stimulate(position) { return new Promise((resolve, reject) =>{ let stimurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/stimulateAdvAccount.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","channel":"iOS"}` + body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},"time" : "${times}", ${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","channel":"iOS"}` } $.post(stimurl, async(error, response, data) => { //$.log(data+"\n") From 1b03797c54f924e49ad02f83fca737493245dd74 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 00:55:24 +0800 Subject: [PATCH 297/721] Update txnews.js --- Task/txnews.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Task/txnews.js b/Task/txnews.js index bb8ffc2cbd..16cecfdbb1 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -1,6 +1,6 @@ /* -更新时间: 2020-10-18 00:50 +更新时间: 2021-1-1 00:50 腾讯新闻签到修改版,可以自动阅读文章获取红包,该活动为瓜分百万现金挑战赛,针对幸运用户参与 @@ -119,11 +119,9 @@ if (isGetCookie) { await getsign(); await activity(); await toRead(); + await $.wait(3000) await lookVideo(); - await OrderID(); - if(order) { - await Pending(); - }; + await redrain(); await StepsTotal(); if(getreadred != 0){ redbody = `redpack_type=article&activity_id=${actid}` @@ -242,6 +240,22 @@ function lookVideo() { },s*2) }) } +function redrain() { + return new Promise((resolve, reject) => { + $.post({url: `https://api.prize.qq.com/v1/newsapp/fireworks/fw_202012/outer_get/KIJ1Q0FD57W0`, headers: {Cookie:cookieVal,"Referer": "https://gh.prize.qq.com/h5/fireworks/send.html?_addparams=%7B%22id%22%3A%22KIJ1Q0FD57W0%22%7D"}},(error, resp, data) =>{ + //console.log(data) + if(resp.statusCode !== 403){ + try { + let openres = JSON.parse(data) + if (openres.message == "success" ){ + } + } catch(error){ + console.log("分享失败:"+ data) } + } + resolve() + }) + }) +} function OrderID() { return new Promise((resolve, reject) => { From 9a5fdc9ee6aa581b2d265e7ab33950c3a6c3ef70 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 01:51:35 +0800 Subject: [PATCH 298/721] Update jukan.js --- Task/jukan.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index 22cc9d30e9..b6d60e7d9b 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -391,7 +391,7 @@ function stimulate() { let _Adv = JSON.parse(data) if (_Adv.ret == "ok"&&_Adv.status==1){ $.log("视频"+ _Adv.videoType+"获得红包: +"+_Adv.rewardAmount+_Adv.rewardName) - await $.wait(1000) + await $.wait(2000) await Stimulate("17") } else { $.log("视频广告红包,"+ _Adv.message) @@ -432,6 +432,7 @@ function BoxProfit() { if (do_box.ret == "ok"&&do_box.profit>0){ $.log("获得收益: +"+do_box.profit) position = do_box.advertPopup.position + await $.wait(2000) await Stimulate(position) // $.log(position) } From 78432d27f34fc8c46131032f21f0d1dd6deba72c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 01:52:37 +0800 Subject: [PATCH 299/721] Update jukan.yml --- .github/workflows/jukan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jukan.yml b/.github/workflows/jukan.yml index 3a2ddaaf49..45de3b445d 100644 --- a/.github/workflows/jukan.yml +++ b/.github/workflows/jukan.yml @@ -4,7 +4,7 @@ name: 聚看点 on: workflow_dispatch: schedule: - - cron: '*/28 */4 * * *' + - cron: '*/20 */2 * * *' watch: types: started jobs: From def168af6a4c0d2717a31d96797db330f13f6954 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 08:48:29 +0800 Subject: [PATCH 300/721] Update baidu_speed.js --- Task/baidu_speed.js | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index d7b8d99530..65d8334015 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -184,7 +184,7 @@ else if(tasks[x].data.countDown[tid].countDown ==0){ } } } catch(e){ - $.logErr(e, resp); + $.logErr(e, data); } finally { $.msg($.name, $.sub, $.desc) resolve() @@ -201,7 +201,7 @@ function firstbox() { headers: {Cookie:cookieval}, body: 'task_type=-1&task_id=-1' } - $.post(bdurl, (error, response, data) => { + $.post(bdurl, (error, resp, data) => { let get_first = JSON.parse(data) //$.log("【首页宝箱】\n"+data +'\n') if (get_first.err_no == 0){ @@ -253,8 +253,9 @@ function chestTime() { headers: {Cookie:cookieval,Referer: `https://eopa.baidu.com/page/pagekey-qWYNoPr0?type=1&tid=695&productid=2&chesttid=669&chestname=chestTime`} } $.get(timeurl, (error, response, data) => { + $.log(data) + try{ let get_chest = JSON.parse(data) -$.log(data) if (get_chest.errno == 11006){ $.log("开宝箱任务"+get_chest.errmsg) } @@ -265,7 +266,11 @@ $.log(data) //$.desc += get_chest.data.originData.msg $.log("开宝箱任务ID:"+taskid+ get_chest.data.originData.msg) } - resolve() + } catch(e){ + $.logErr(e, data); + } finally { + resolve() + } }) }) } @@ -317,6 +322,7 @@ function Tasks() { headers: {Cookie:cookieval,Referer:RefererUrl} } $.get(taskurl, async(error, response, data) => { + try { let do_task = JSON.parse(data) await $.wait(20000); //$.log(data+'\n') @@ -328,8 +334,12 @@ function Tasks() { }else if (do_task.errno == 11004){ $.desc += taskName + " "+ do_task.errmsg + "\n" } - resolve() - }) + } catch(e){ + $.logErr(e, data); + } finally { + resolve() + } + }) }) } @@ -342,6 +352,7 @@ function get_search() { $.get(geturl, async(error, resp, data) => { let get_search = JSON.parse(data) //$.log(data+'\n') + try{ if (get_search.errno == 0 ) { for ( item in get_search.data[`${cmd}`].itemlist.items){ searchId = get_search.data[`${cmd}`].itemlist.items[item].id @@ -354,7 +365,11 @@ function get_search() { } else { // $.desc += taskName + " "+ do_search.data[`${cmd}`].tips + "\n" } - resolve() + } catch(e){ + $.logErr(e, data); + } finally { + resolve() + } }) }) } From 5552dc86a34e51e8a46511e5fbf15e19c3049cf6 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 08:57:51 +0800 Subject: [PATCH 301/721] Update baidu_speed.js --- Task/baidu_speed.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 65d8334015..4b97687a0b 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -9,6 +9,7 @@ const $ = new Env('百度极速版') let CookieArr = []; +let UA = `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 info baiduboxapp/5.1.0.10 (Baidu; P2 14.2)` if ($.isNode()) { if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { @@ -59,7 +60,7 @@ function getsign() { return new Promise((resolve, reject) =>{ let signurl = { url: `https://haokan.baidu.com/activity/acusercheckin/update`, - headers: {Cookie:cookieval}, + headers: {Cookie:cookieval,'User-Agent': UA}, body: 'productid=2&ugus=9766888061' } $.post(signurl, (error, response, data) => { @@ -87,7 +88,7 @@ function coinInfo() { return new Promise((resolve, reject) =>{ let infourl = { url: `https://haokan.baidu.com/activity/h5/displaybyday?type=1&page=1&productid=2`, - headers: {Cookie:cookieval} + headers: {Cookie:cookieval,'User-Agent': UA} } $.get(infourl, (error, response, data) => { let get_info = JSON.parse(data) @@ -103,7 +104,7 @@ function getRewards() { return new Promise((resolve, reject) =>{ let rewurl = { url: `https://haokan.baidu.com/activity/tasks/taskreward?productid=2`, - headers: {Cookie:cookieval} + headers: {Cookie:cookieval,'User-Agent': UA} } $.get(rewurl, async(error, response, data) => { let get_reward = JSON.parse(data) @@ -134,7 +135,7 @@ function TaskCenter() { return new Promise((resolve, reject) =>{ let rewurl = { url: `https://haokan.baidu.com/activity/h5/vault?_format=json&productid=2&channel=2`, - headers: {Cookie:cookieval} + headers: {Cookie:cookieval,'User-Agent': UA} } $.get(rewurl, async(error, resp, data) => { try{ @@ -198,8 +199,8 @@ function firstbox() { return new Promise((resolve, reject) =>{ let bdurl = { url: 'https://mbrowser.baidu.com/lite/gold/receive?service=bdbox', - headers: {Cookie:cookieval}, - body: 'task_type=-1&task_id=-1' + headers: {Cookie:cookieval,'User-Agent': UA}, + body: 'task_type=-1&task_id=-1' } $.post(bdurl, (error, resp, data) => { let get_first = JSON.parse(data) @@ -226,7 +227,7 @@ function get_pkg() { return new Promise((resolve, reject) =>{ let pkgurl = { url: `https://haokan.baidu.com/activity/acad/rewardad?device=%7B%22imei_md5%22%3A%22%22%2C%22device_type%22%3A1%2C%22model%22%3A%22IPHONE%22%2C%22manufacturer%22%3A%22Apple%22%2C%22os_version%22%3A%2213.7%22%2C%22idfa%22%3A%22_a2S8_aq28_qa28qii2A8laJ28gxC28Q_iXni0uKvNYIPviVzaHtiYah2ul6iHim_l2880uQvflqisa9liBgIgarv8oIOHutlhSPu_ux2a_Wi-uRz_qAC%22%2C%22androidId%22%3A%22%22%2C%22geo%22%3A%7B%22lat%22%3A%22%22%2C%22lon%22%3A%22%22%7D%2C%22screen_width%22%3A1242%2C%22screen_height%22%3A2208%7D&network=%7B%22connect_type%22%3A1%2C%22carrier%22%3A0%7D&productid=2&tid=${tid}&type=1`, - headers:{Cookie:cookieval,'Referer':RefererUrl} + headers:{Cookie:cookieval,,'User-Agent': UA,'Referer':RefererUrl} } $.get(pkgurl, async(error, resp, data) => { let get_pkg = JSON.parse(data) @@ -250,7 +251,7 @@ function chestTime() { return new Promise((resolve, reject) =>{ let timeurl = { url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestTime&rewardVideoPkg=${Pkg}`, - headers: {Cookie:cookieval,Referer: `https://eopa.baidu.com/page/pagekey-qWYNoPr0?type=1&tid=695&productid=2&chesttid=669&chestname=chestTime`} + headers: {Cookie:cookieval,'User-Agent': UA,Referer: `https://eopa.baidu.com/page/pagekey-qWYNoPr0?type=1&tid=695&productid=2&chesttid=669&chestname=chestTime`} } $.get(timeurl, (error, response, data) => { $.log(data) @@ -280,7 +281,7 @@ function activeBox2() { return new Promise((resolve, reject) =>{ let actboxurl = { url: `https://haokan.baidu.com/activity/acuserchest/opennew`, - headers: {Cookie:cookieval}, + headers: {Cookie:cookieval,'User-Agent': UA}, body: `taskid=${taskid}&productid=2&ugus=5256798061` } $.post(actboxurl, async(error, response, data) => { @@ -302,7 +303,7 @@ function activeBox() { return new Promise((resolve, reject) =>{ let actboxurl = { url: `https://haokan.baidu.com/activity/tasks/active?productid=2&id=${tid}`, - headers: {Cookie:cookieval,Referer:RefererUrl} + headers: {Cookie:cookieval,'User-Agent': UA,Referer:RefererUrl} } $.get(actboxurl, async(error, response, data) => { //let act_box = JSON.parse(data) @@ -319,7 +320,7 @@ function Tasks() { return new Promise((resolve) =>{ let taskurl = { url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=coin&rewardVideoPkg=${Pkg}&_=`+new Date().getTime()+`&sys=ios&rewardVideoDrawKey=&source=0&appid=0&bid=0&chestTid=0&signAim=0&date=`, - headers: {Cookie:cookieval,Referer:RefererUrl} + headers: {Cookie:cookieval,'User-Agent': UA,Referer:RefererUrl} } $.get(taskurl, async(error, response, data) => { try { @@ -347,7 +348,7 @@ function get_search() { return new Promise((resolve) =>{ let geturl = { url: `https://mbd.baidu.com/searchbox?action=feed&cmd=${cmd}&imgtype=webp&network=1_0&osbranch=i3&osname=baiduboxapp&ua=1242_2208_iphone_5.0.0.11_0&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2`, - headers: {Cookie:cookieval} + headers: {Cookie:cookieval,'User-Agent': UA} } $.get(geturl, async(error, resp, data) => { let get_search = JSON.parse(data) @@ -380,7 +381,7 @@ function searchBox(id) { return new Promise((resolve) =>{ let searchurl = { url: `https://mbd.baidu.com/searchbox?action=feed&cmd=197&imgtype=webp&network=1_0&osbranch=i3&osname=baiduboxapp&ua=1242_2208_iphone_5.0.0.11_0&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2`, - headers: {Cookie:cookieval}, + headers: {Cookie:cookieval,'User-Agent': UA}, body: `data={"origin_nid":"${id}","taskid":"${tid}"}` } $.post(searchurl, async(error, resp, data) => { @@ -401,7 +402,7 @@ function doubleBox() { return new Promise((resolve, reject) =>{ let douboxurl = { url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestDouble&rewardVideoPkg=${Pkg}`, - headers: {Cookie:cookieval,Referer: `Referer: https://eopa.baidu.com/page/pagekey-ASKWNd8W?productid=2&type=1&tid=346`} + headers: {Cookie:cookieval,'User-Agent': UA,Referer: `Referer: https://eopa.baidu.com/page/pagekey-ASKWNd8W?productid=2&type=1&tid=346`} } $.get(douboxurl, (error, response, data) => { let get_doubox = JSON.parse(data) From 15d28a3538c304f10b9d1e3caa47de50c262a593 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 08:59:29 +0800 Subject: [PATCH 302/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 4b97687a0b..02a360a37e 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -227,7 +227,7 @@ function get_pkg() { return new Promise((resolve, reject) =>{ let pkgurl = { url: `https://haokan.baidu.com/activity/acad/rewardad?device=%7B%22imei_md5%22%3A%22%22%2C%22device_type%22%3A1%2C%22model%22%3A%22IPHONE%22%2C%22manufacturer%22%3A%22Apple%22%2C%22os_version%22%3A%2213.7%22%2C%22idfa%22%3A%22_a2S8_aq28_qa28qii2A8laJ28gxC28Q_iXni0uKvNYIPviVzaHtiYah2ul6iHim_l2880uQvflqisa9liBgIgarv8oIOHutlhSPu_ux2a_Wi-uRz_qAC%22%2C%22androidId%22%3A%22%22%2C%22geo%22%3A%7B%22lat%22%3A%22%22%2C%22lon%22%3A%22%22%7D%2C%22screen_width%22%3A1242%2C%22screen_height%22%3A2208%7D&network=%7B%22connect_type%22%3A1%2C%22carrier%22%3A0%7D&productid=2&tid=${tid}&type=1`, - headers:{Cookie:cookieval,,'User-Agent': UA,'Referer':RefererUrl} + headers:{Cookie:cookieval,'User-Agent': UA,'Referer':RefererUrl} } $.get(pkgurl, async(error, resp, data) => { let get_pkg = JSON.parse(data) From 352c91f06206bd2aab2c6ad7340597a394fa0dcb Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 11:43:37 +0800 Subject: [PATCH 303/721] Update jukan.js --- Task/jukan.js | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index b6d60e7d9b..af7f2c8ecd 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -11,8 +11,8 @@ hostname = www.xiaodouzhuan.cn */ const $ = new Env('聚看点') -let drawcash = $.getdata('jukan_cash') || 30 //提现金额 -let wxname = $.getdata('jukan_name') || ""//微信真实名字,可以在双引号内填入 +const drawcash = $.getdata('jukan_cash') || "30" //提现金额 +const wxname = $.getdata('jukan_name') || ""//微信真实名字,可以在双引号内填入 let CookieArr=[],BodyArr=[]; let cookie = $.getdata('jukan_ck') let bodys = $.getdata('jukan_body') @@ -91,16 +91,16 @@ if (typeof $request !== 'undefined') { $.index = i + 1; await sign(); await getsign(); - await stimulate(); - await TimeBox(); + //await stimulate(); + //await TimeBox(); for(boxtype of [1,2]){ await $.wait(1000); await BoxProfit(boxtype) } await userinfo(); - if (curcash >= drawcash&&wxname){ + + if (curcash >= drawcash && wxname){ await realname(); - await Withdraw() } if (signtimes&&signtimes<5){ await WelfareCash(); @@ -110,7 +110,7 @@ if (typeof $request !== 'undefined') { continue } else { for (readbodyVal of bodys){ - await artList(readbodyVal) + await artList(readbodyVal) } if (taskresult == 'R-ART-1002'){ $.desc += "\n"+sumnotify @@ -241,15 +241,15 @@ function TimeBox() { function realname() { return new Promise((resolve, reject) =>{ let realurl = { - url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=${wxname}`, - headers: {Cookie:cookieval,'User-Agent':UA} + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=%E8%81%82%E6%B5%B7%E6%9C%8B`, + headers: {Cookie:cookieval} } $.get(realurl, async(error, resp, data) => { let get_name = JSON.parse(data) - if (get_name.ret="ok"){ + if (get_name.ret=="ok"){ $.log("恭喜您,实名验证通过" + get_name.return_msg) await Withdraw() - } else { + } else if(get_name.ret== "failed"){ $.log("实名验证" + get_name.return_msg) $.msg($.name,"提现实名认证失败") } @@ -391,7 +391,7 @@ function stimulate() { let _Adv = JSON.parse(data) if (_Adv.ret == "ok"&&_Adv.status==1){ $.log("视频"+ _Adv.videoType+"获得红包: +"+_Adv.rewardAmount+_Adv.rewardName) - await $.wait(2000) + await $.wait(1000) await Stimulate("17") } else { $.log("视频广告红包,"+ _Adv.message) @@ -432,7 +432,6 @@ function BoxProfit() { if (do_box.ret == "ok"&&do_box.profit>0){ $.log("获得收益: +"+do_box.profit) position = do_box.advertPopup.position - await $.wait(2000) await Stimulate(position) // $.log(position) } @@ -447,10 +446,12 @@ function BoxProfit() { function invite() { let rewurl = { - url: `https://www.xiaodouzhuan.cn/jkd/weixin20/member/receiveMonkeyXd.action?userid=fe0d318cdfbd4f8f9950ce67c5643eaa`, - headers: {Cookie:cookieval} + url: `http://a.app.qq.com/o/simple.jsp?pkgname=com.xiangzi.jukandian&ckey=CK1416436838701`, + headers: {Cookie:cookieval}, + body: bodyval } - $.get(rewurl, (error, response, data) => { + $.get(rewurl, (error, resp, data) => { + //$.log(data) }) } From ea630ad50501e3b0743cf339fe5b0ac078d52a64 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 11:51:49 +0800 Subject: [PATCH 304/721] Update jukan.js --- Task/jukan.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/jukan.js b/Task/jukan.js index af7f2c8ecd..2c710bbf5b 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -101,6 +101,7 @@ if (typeof $request !== 'undefined') { if (curcash >= drawcash && wxname){ await realname(); + //await Withdraw() //实名未通过,强制提现,可取消此注释,不保证成功 } if (signtimes&&signtimes<5){ await WelfareCash(); From c5c9a2f94dc546a0cc5bb43aabde1ebba1eef6e8 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 11:55:22 +0800 Subject: [PATCH 305/721] Update jukan.js --- Task/jukan.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 2c710bbf5b..7e0d7914e5 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -91,8 +91,8 @@ if (typeof $request !== 'undefined') { $.index = i + 1; await sign(); await getsign(); - //await stimulate(); - //await TimeBox(); + await stimulate(); + await TimeBox(); for(boxtype of [1,2]){ await $.wait(1000); await BoxProfit(boxtype) From 9947fd0ef023b910c85138ff79ab875f8676c5a3 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 16:48:31 +0800 Subject: [PATCH 306/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index 7e0d7914e5..1a09f4d41b 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -252,7 +252,7 @@ function realname() { await Withdraw() } else if(get_name.ret== "failed"){ $.log("实名验证" + get_name.return_msg) - $.msg($.name,"提现实名认证失败") + // $.msg($.name,"提现实名认证失败") } resolve() }) From 7644ec2a65d2b638a7a2bb6048ff120d5a91bca6 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 22:05:09 +0800 Subject: [PATCH 307/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index 1a09f4d41b..6d3ae543c0 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -447,7 +447,7 @@ function BoxProfit() { function invite() { let rewurl = { - url: `http://a.app.qq.com/o/simple.jsp?pkgname=com.xiangzi.jukandian&ckey=CK1416436838701`, + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/member/bindTeacher.action?teacherCode=24222820`, headers: {Cookie:cookieval}, body: bodyval } From bd0d81a6f81abe99cf00b7c985dab05dbca4e82b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 1 Jan 2021 22:46:32 +0800 Subject: [PATCH 308/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index 6d3ae543c0..10457522b6 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -242,7 +242,7 @@ function TimeBox() { function realname() { return new Promise((resolve, reject) =>{ let realurl = { - url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=%E8%81%82%E6%B5%B7%E6%9C%8B`, + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=${wxname}`, headers: {Cookie:cookieval} } $.get(realurl, async(error, resp, data) => { From a94cd862d3c49310ac7247c9159a177be1fc24ce Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 01:51:55 +0800 Subject: [PATCH 309/721] Update jukan.js --- Task/jukan.js | 136 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 83 insertions(+), 53 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 10457522b6..ec80e98b8e 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -14,47 +14,29 @@ const $ = new Env('聚看点') const drawcash = $.getdata('jukan_cash') || "30" //提现金额 const wxname = $.getdata('jukan_name') || ""//微信真实名字,可以在双引号内填入 let CookieArr=[],BodyArr=[]; -let cookie = $.getdata('jukan_ck') let bodys = $.getdata('jukan_body') let signtimes = $.getdata('jukan_times') let UA = 'JuKanDian/5.6.5 (iPhone; iOS 14.2; Scale/3.00)' if ($.isNode()) { - if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('&') > -1) { - JKCookie = process.env.JUKAN_COOKIE.split('&'); - } - if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('\n') > -1) { - JKCookie = process.env.JUKAN_COOKIE.split('\n'); - } else { - JKCookie = process.env.JUKAN_COOKIE.split() - } if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('&') > -1) { JKbody = process.env.JUKAN_BODY.split('&'); } - if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('\n') > -1) { + else if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('\n') > -1) { JKbody = process.env.JUKAN_BODY.split('\n'); } else { JKbody = process.env.JUKAN_BODY.split() } - Object.keys(JKCookie).forEach((item) => { - if (JKCookie[item]) { - CookieArr.push(JKCookie[item]) - } - }) Object.keys(JKbody).forEach((item) => { if (JKbody[item]) { BodyArr.push(JKbody[item]) } }) -} else if (cookie.indexOf('&')>-1 &&bodys.indexOf('&')>-1){ - Object.keys(cookie.split('&')).forEach((item) => { - CookieArr.push(cookie.split('&')[item]) - }) +} else if (bodys.indexOf('&')>-1){ Object.keys(bodys.split('&')).forEach((item) => { BodyArr.push(bodys.split('&')[item]) }) } else { - CookieArr.push(cookie) BodyArr.push(bodys) } @@ -66,27 +48,25 @@ if ($.isNode()) { if (typeof $request !== 'undefined') { if ($request && $request.method != `OPTIONS`) { const bodyVal = $request.body - const Cookieval = $request.headers['Cookie'] - if(Cookieval)$.setdata(Cookieval,'jukan_ck') if(bodyVal)$.setdata(bodyVal,'jukan_body') - $.log(`Cookie:${Cookieval}`) $.log(`bodyVal:${bodyVal}`) - $.msg($.name,"获取Cookie成功") + $.msg($.name,"获取请求成功") $.done() } } else { !(async() => { - if (!CookieArr[0]) { + if (!BodyArr[0]) { console.log($.name, '【提示】请把聚看点Cookie填入Github 的 Secrets 中,请以&或者换行隔开') return; } - console.log(`您共提供${CookieArr.length}个聚看点账号Cookie`) - for (let i = 0; i < CookieArr.length; i++) { - if (CookieArr[i]) { - cookieval = CookieArr[i] + console.log(`您共提供${BodyArr.length}个聚看点账号Cookie`) + for (let i = 0; i < BodyArr.length; i++) { + if (BodyArr[i]) { bodyval = BodyArr[i] - ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/) - apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/) + ID = decodeURIComponent(bodyval).match(/"openid" : "(\w+)"/)[1] + apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "(\w+)"/)[1] + appVersion = decodeURIComponent(bodyval).match(/"appversion" : "(.*)"/)[1] + cookieval = `xz_jkd_appkey=${ID}!iOS!${appVersion}` times = Date.parse(new Date())/1000 $.index = i + 1; await sign(); @@ -98,7 +78,6 @@ if (typeof $request !== 'undefined') { await BoxProfit(boxtype) } await userinfo(); - if (curcash >= drawcash && wxname){ await realname(); //await Withdraw() //实名未通过,强制提现,可取消此注释,不保证成功 @@ -106,19 +85,14 @@ if (typeof $request !== 'undefined') { if (signtimes&&signtimes<5){ await WelfareCash(); } - bodys = [bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times}%22%2C%20`+'%22cateid%22%20%3A%203'),bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053')] - if(new Date().getTimezoneOffset() != '-480'){ + if(new Date().getTimezoneOffset() != '-480'){ continue - } else { - for (readbodyVal of bodys){ - await artList(readbodyVal) - } + } else {await artTotal() } if (taskresult == 'R-ART-1002'){ $.desc += "\n"+sumnotify $.msg($.name+" 昵称:"+userName, $.sub, $.desc) } } - } } })() .catch((e) => $.logErr(e)) @@ -132,7 +106,7 @@ function sign() { headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval } $.post(profiturl, async(error, resp, data) => { - //$.log(data+"\n") + // $.log(data+"\n") let sign_res = JSON.parse(data) if (sign_res.ret == "ok"&&sign_res.profit>0){ $.log("签到收益: +"+sign_res.profitDesc) @@ -197,6 +171,28 @@ function signShare() { }) }) } + +function advluckdraw() { + return new Promise((resolve, reject) =>{ + let profiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/activity/advluckdraw/getLuckDrawLevel.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval + } + $.post(profiturl, async(error, resp, data) => { + //$.log(data+"\n") + let sign_share = JSON.parse(data) + if (sign_share.ret == "ok"){ + $.log("簽到分享收益: +"+sign_share.profit) + await Stimulate("23") + await invite() + } else { + $.log(sign_share.rtn_msg) + } + resolve() + }) + }) +} + function WelfareCash() { return new Promise((resolve, reject) =>{ let welurl = { @@ -242,17 +238,17 @@ function TimeBox() { function realname() { return new Promise((resolve, reject) =>{ let realurl = { - url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=${wxname}`, + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/verifyIdentity.action?realname=`+encodeURIComponent(wxname), headers: {Cookie:cookieval} } $.get(realurl, async(error, resp, data) => { let get_name = JSON.parse(data) if (get_name.ret=="ok"){ $.log("恭喜您,实名验证通过" + get_name.return_msg) - await Withdraw() + await Withdraw() } else if(get_name.ret== "failed"){ $.log("实名验证" + get_name.return_msg) - // $.msg($.name,"提现实名认证失败") + // $.msg($.name,get_name.return_msg) } resolve() }) @@ -286,9 +282,10 @@ function userinfo() { if( get_info.ret=="ok"){ userName = get_info.userinfo.username sumcash = get_info.userinfo.infoMeSumCashItem.title+get_info.userinfo.infoMeSumCashItem.value - curcash = get_info.userinfo.infoMeCurCashItem.title+get_info.userinfo.infoMeCurCashItem.value + curcashtitle = get_info.userinfo.infoMeCurCashItem.title + curcash = get_info.userinfo.infoMeCurCashItem.value gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value - $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcash ) + $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcashtitle+curcash ) $.sub += " "+gold $.desc += sumcash + "/"+curcash } @@ -297,6 +294,41 @@ function userinfo() { }) } +function artTotal() { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://www.xiaodouzhuan.cn/jkd/minfo/call.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + body: `jdata={"openID":"${ID}","openid":"${ID}","app_id":"xzwl","channel":"iOS","app_token":"${apptoken}","version":"${appVersion}","pars":{"openID":${ID},"uniqueid":"","os":"iOS","channel":"iOS","openid":"${ID}"}}&opttype=ART_READ` + } + $.post(infourl, async(error, resp, data) => { + try{ + let get_total = JSON.parse(data) + artcount = get_total.datas.artcount + videocount = get_total.datas.videocount + $.log( "当前剩余阅读次数"+artcount+"次,剩余阅读次数"+videocount+"次") + if(artcount > 0 ){ + readbodyVal = bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times}%22%2C%20`+'%22cateid%22%20%3A%203') + await artList(readbodyVal) + } else if ( artcount == 0 ){ + $.log("今日阅读任务已完成,本次跳过") + }; + if(videocount > 0 ){ + readbodyVal = bodyval.replace(/time%22%20%3A%20%22\d+%22/,`time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053') + await artList(readbodyVal) + } else if ( artcount == 0 ){ + $.log("今日视频任务已完成,本次跳过") + }; + } catch (e) { + $.logErr(e, data) + } finally { + resolve(data); + } + + }) + }) + } + function artList(readbodyVal) { return new Promise((resolve, reject) =>{ let infourl = { @@ -340,10 +372,9 @@ function readTask(artid,arttype) { let rewurl = { url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artDetail.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"appid":"xzwl","channel":"IOS","psign":"92dea068b6c271161be05ed358b59932","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"5.6.5"}` + body: `jsondata={"appid":"xzwl","channel":"IOS","relate":1,"artid":"${artid}","os":"IOS","openid":"${ID}","apptoken":"${apptoken}","appversion":"${appVersion}"}` } $.post(rewurl, async(error, resp, data) => { - //$.log(data) if(resp.statusCode ==200){ $.log("请等待30s\n") await $.wait(30000) @@ -358,11 +389,10 @@ function readTask(artid,arttype) { function finishTask(artid,arttype) { return new Promise((resolve, reject) =>{ - times = Date.parse(new Date())/1000 let finishurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"appid":"xzwl","read_weal":0,"paytype":${arttype},"securitykey":"","channel":"iOS","psign":"92dea068b6c271161be05ed358b59932","appversioncode":"565","time":"${times}",${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","artid":${artid},"accountType":"0","readmodel":"1"}` + body: `jsondata={"appid":"xzwl","read_weal":0,"paytype":"${arttype}","securitykey":"","channel":"iOS","time":"${times}","apptoken":"${apptoken}","appversion":"${appVersion}","openid":"${ID}","os":"iOS","artid":${artid},"accountType":"0","readmodel":"1"}` } $.post(finishurl, async(error, response, data) => { //$.log(data+"\n") @@ -385,10 +415,10 @@ function stimulate() { let Advurl = { url: `https://www.xiaodouzhuan.cn/jkd/newmobile/stimulateAdv.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : "17","time" : "${times}", ${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","channel":"iOS"}` + body: `jsondata={"read_weal":"0","appid":"xzwl", "position":"17","time" : "${times}", "apptoken" : "${apptoken}","appversion":"${appVersion}","openId":"${ID}","os":"iOS","channel":"iOS"}` } $.post(Advurl, async(error, resp, data) => { - //$.log(data+"\n") + //$.log(data+"\n") let _Adv = JSON.parse(data) if (_Adv.ret == "ok"&&_Adv.status==1){ $.log("视频"+ _Adv.videoType+"获得红包: +"+_Adv.rewardAmount+_Adv.rewardName) @@ -408,7 +438,7 @@ function Stimulate(position) { let stimurl = { url: `https://www.xiaodouzhuan.cn/jkd/account/stimulateAdvAccount.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},"time" : "${times}", ${apptoken},"appversion":"5.6.5",${ID},"os":"iOS","channel":"iOS"}` + body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},"time" : "${times}","apptoken":"${apptoken}","appversion":"5.6.5","openid":"${ID}","os":"iOS","channel":"iOS"}` } $.post(stimurl, async(error, response, data) => { //$.log(data+"\n") @@ -421,7 +451,7 @@ function Stimulate(position) { }) } -function BoxProfit() { +function BoxProfit(boxtype) { return new Promise((resolve, reject) =>{ let profiturl = { url: `https://www.xiaodouzhuan.cn/jkd/task/getTaskBoxProfit.action`, From cd6ecac04e2456ba6c5edf4508ed617afee77ff2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 01:53:52 +0800 Subject: [PATCH 310/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 18874eb43b..921e4b4960 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -205,7 +205,7 @@ { "id": "jukan", "name": "聚看点", - "keys": ["jukan_ck","jukan_body"], + "keys": ["jukan_body","jukan_name"], "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", "settings": [ @@ -221,7 +221,7 @@ "id": "jukan_name", "name": "微信真实姓名", "val": "", - "type": "textarea", + "type": "text", "placeholder": "填入微信真实姓名" }], "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png"], From f8c52030b48c36d33911b082ce1e01233b9daa35 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 10:24:14 +0800 Subject: [PATCH 311/721] Update jukan.js --- Task/jukan.js | 93 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 21 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index ec80e98b8e..8e4d2163c7 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -17,6 +17,7 @@ let CookieArr=[],BodyArr=[]; let bodys = $.getdata('jukan_body') let signtimes = $.getdata('jukan_times') let UA = 'JuKanDian/5.6.5 (iPhone; iOS 14.2; Scale/3.00)' +let taskresult = "" if ($.isNode()) { if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('&') > -1) { @@ -70,9 +71,15 @@ if (typeof $request !== 'undefined') { times = Date.parse(new Date())/1000 $.index = i + 1; await sign(); + //await LuckDrawLevel(); + //return + for ( x =14;x<32;++x){ + await Stimulate(x) + } await getsign(); await stimulate(); await TimeBox(); + //await LuckDrawLevel(); for(boxtype of [1,2]){ await $.wait(1000); await BoxProfit(boxtype) @@ -87,10 +94,12 @@ if (typeof $request !== 'undefined') { } if(new Date().getTimezoneOffset() != '-480'){ continue - } else {await artTotal() } + } else { + await artTotal() +} if (taskresult == 'R-ART-1002'){ $.desc += "\n"+sumnotify - $.msg($.name+" 昵称:"+userName, $.sub, $.desc) + $.msg($.name+" 昵称:"+userName, $.sub, $.desc,{'media-url': calendarpic }) } } } @@ -106,14 +115,20 @@ function sign() { headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval } $.post(profiturl, async(error, resp, data) => { - // $.log(data+"\n") + //$.log(data+"\n") + try{ let sign_res = JSON.parse(data) if (sign_res.ret == "ok"&&sign_res.profit>0){ - $.log("签到收益: +"+sign_res.profitDesc) + calendarpic = sign_res.calendar_pic + //$.log("签到收益: +"+`calendar_pic`) } else { $.log(sign_res.rtn_msg) - } - resolve() + } + } catch (e) { + $.logErr(e, data) + } finally { + resolve(); + } }) }) } @@ -126,6 +141,7 @@ function getsign() { body: bodyval } $.post(signurl, async(error, response, data) => { + try{ let get_sign = JSON.parse(data) //$.log(data) if (get_sign.ret == "ok"){ @@ -146,7 +162,11 @@ function getsign() { $.msg($.name,$.sub,$.desc) $.done() } - resolve() + } catch (e) { + $.logErr(e, data) + } finally { + resolve(); + } }) }) } @@ -172,21 +192,45 @@ function signShare() { }) } -function advluckdraw() { +function LuckDrawBox() { + return new Promise((resolve, reject) =>{ + let profiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/activity/advluckdraw/getLuckDrawBox.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval + } + $.post(profiturl, async(error, resp, data) => { + $.log(data+"\n") + let get_luckdraw = JSON.parse(data) + if (get_luckdraw.ret == "ok" &&get_luckdraw.luckName=="神秘宝箱"){ + $.log(sign_luckdraw.return_msg+`剩余 ${get_luckdraw.data.unFinishNum} 次`) + $.log(get_luckdraw.rtn_msg +`去领取神秘宝箱奖励`) + await Stimulate("11") + } else if (get_luckdraw.ret =="failed"){ + $.log(get_luckdraw.rtn_msg +`去开启宝箱失败`) + } + resolve() + }) + }) +} + +function LuckDrawLevel() { return new Promise((resolve, reject) =>{ let profiturl = { url: `https://www.xiaodouzhuan.cn/jkd/activity/advluckdraw/getLuckDrawLevel.action`, headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval } $.post(profiturl, async(error, resp, data) => { - //$.log(data+"\n") - let sign_share = JSON.parse(data) - if (sign_share.ret == "ok"){ - $.log("簽到分享收益: +"+sign_share.profit) - await Stimulate("23") - await invite() - } else { - $.log(sign_share.rtn_msg) + $.log(data+"\n") + if (err) { + $.log(`开启神秘宝箱失败: `+err+"\n"+data) + } else if (get_luckdraw.ret == "ok"){ + let get_luckdraw = JSON.parse(data) + $.log(sign_luckdraw.return_msg+`剩余 ${get_luckdraw.data.unFinishNum} 次`) + + $.log(get_luckdraw.rtn_msg +`去领取神秘宝箱奖励`) + await Stimulate("11") + } else if (get_luckdraw.ret =="failed"){ + $.log(get_luckdraw.rtn_msg +`去开启宝箱失败`) } resolve() }) @@ -278,6 +322,7 @@ function userinfo() { body: bodyval } $.post(infourl, async(error, resp, data) => { + try{ let get_info = JSON.parse(data) if( get_info.ret=="ok"){ userName = get_info.userinfo.username @@ -289,7 +334,11 @@ function userinfo() { $.sub += " "+gold $.desc += sumcash + "/"+curcash } - resolve() + } catch (e) { + $.logErr(e, data) + } finally { + resolve(); + } }) }) } @@ -440,11 +489,13 @@ function Stimulate(position) { headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},"time" : "${times}","apptoken":"${apptoken}","appversion":"5.6.5","openid":"${ID}","os":"iOS","channel":"iOS"}` } - $.post(stimurl, async(error, response, data) => { + $.post(stimurl, async(error, resp, data) => { //$.log(data+"\n") let do_stim = JSON.parse(data) - if ( do_stim.ret == "ok"&&position !="17"){ - $.log( do_stim.profit_title+": +"+ do_stim.profit +"(以实际情况为准)") + if(typeof do_stim.profit_title == "undefined"){ + } else { + $.log( do_stim.profit_title+ "position"+": "+x+" 获得收益 +"+ do_stim.profit) + await $.wait(5000) } resolve() }) @@ -461,7 +512,7 @@ function BoxProfit(boxtype) { //$.log(data+"\n") let do_box = JSON.parse(data) if (do_box.ret == "ok"&&do_box.profit>0){ - $.log("获得收益: +"+do_box.profit) + $.log("计时宝箱获得收益: +"+do_box.profit) position = do_box.advertPopup.position await Stimulate(position) // $.log(position) From c63f2e689a204cde91ef44a0325612e4ecbc604e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 11:00:11 +0800 Subject: [PATCH 312/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index 8e4d2163c7..a3bfc6f7d8 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -73,7 +73,7 @@ if (typeof $request !== 'undefined') { await sign(); //await LuckDrawLevel(); //return - for ( x =14;x<32;++x){ + for ( x =15;x<32;++x){ await Stimulate(x) } await getsign(); From 6effea5d3a8e1889fa7d87a507747fe6c9c1f107 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 11:10:42 +0800 Subject: [PATCH 313/721] Update jukan.js --- Task/jukan.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/jukan.js b/Task/jukan.js index a3bfc6f7d8..64e74e8da8 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -101,6 +101,7 @@ if (typeof $request !== 'undefined') { $.desc += "\n"+sumnotify $.msg($.name+" 昵称:"+userName, $.sub, $.desc,{'media-url': calendarpic }) } + $.log($.name+"账号"+$.index+" : "+userName+ " 本次运行任务已完成\n") } } })() From 89c2d802d1a619126ce579e0e00fb24a70a808b2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 11:14:59 +0800 Subject: [PATCH 314/721] Update jukan.js --- Task/jukan.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 64e74e8da8..61a0898b7a 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,7 +1,7 @@ /* 聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie - +更新时间: 2021-01-02 11:15 https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js 可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 @@ -70,6 +70,7 @@ if (typeof $request !== 'undefined') { cookieval = `xz_jkd_appkey=${ID}!iOS!${appVersion}` times = Date.parse(new Date())/1000 $.index = i + 1; + console.log("开始聚看点账号"+$.index+"任务\n") await sign(); //await LuckDrawLevel(); //return @@ -101,7 +102,7 @@ if (typeof $request !== 'undefined') { $.desc += "\n"+sumnotify $.msg($.name+" 昵称:"+userName, $.sub, $.desc,{'media-url': calendarpic }) } - $.log($.name+"账号"+$.index+" : "+userName+ " 本次运行任务已完成\n") + $.log($.name+"账号"+$.index+" : "+userName+ " 本次运行任务已完成\n~~~~~~~~~~~~~~~~~~\n") } } })() From 831690cee1d949f61d2b8a966f335c722fa3cdbc Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 11:16:56 +0800 Subject: [PATCH 315/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index 61a0898b7a..b6f4d397d1 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -17,7 +17,7 @@ let CookieArr=[],BodyArr=[]; let bodys = $.getdata('jukan_body') let signtimes = $.getdata('jukan_times') let UA = 'JuKanDian/5.6.5 (iPhone; iOS 14.2; Scale/3.00)' -let taskresult = "" +let taskresult = "",sumnotify =""; if ($.isNode()) { if (process.env.JUKAN_BODY && process.env.JUKAN_BODY.indexOf('&') > -1) { From e830a9d7f2542ac2bd72612fc1b504b909652cb7 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 11:47:43 +0800 Subject: [PATCH 316/721] Update jukan.js --- Task/jukan.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index b6f4d397d1..7d7203b60d 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,7 +1,7 @@ /* 聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie -更新时间: 2021-01-02 11:15 +更新时间: 2021-01-02 11:50 https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js 可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 @@ -98,11 +98,10 @@ if (typeof $request !== 'undefined') { } else { await artTotal() } - if (taskresult == 'R-ART-1002'){ - $.desc += "\n"+sumnotify - $.msg($.name+" 昵称:"+userName, $.sub, $.desc,{'media-url': calendarpic }) + if (artcount == 0&&videocount ==0){ + $.msg($.name+" 昵称:"+userName, $.sub, "今日阅读任务已完成\n"+$.desc,{'media-url': calendarpic }) } - $.log($.name+"账号"+$.index+" : "+userName+ " 本次运行任务已完成\n~~~~~~~~~~~~~~~~~~\n") + $.log($.name+"账号"+$.index+" : "+userName+ " 本次运行任务已结束\n~~~~~~~~~~~~~~~~~~\n") } } })() From df779bb72c4e74402a2aa2c16309f95f4b31f3c1 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 12:14:40 +0800 Subject: [PATCH 317/721] Update jukan.js --- Task/jukan.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 7d7203b60d..5269467e8f 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,7 +1,7 @@ /* 聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie -更新时间: 2021-01-02 11:50 +更新时间: 2021-01-02 12:15 https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js 可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 @@ -101,7 +101,7 @@ if (typeof $request !== 'undefined') { if (artcount == 0&&videocount ==0){ $.msg($.name+" 昵称:"+userName, $.sub, "今日阅读任务已完成\n"+$.desc,{'media-url': calendarpic }) } - $.log($.name+"账号"+$.index+" : "+userName+ " 本次运行任务已结束\n~~~~~~~~~~~~~~~~~~\n") + $.log($.name+"账号"+$.index+" : "+userName+ " 本次运行任务已结束\n~~~~~~~~~~~~~~~~~~\n") } } })() @@ -119,7 +119,7 @@ function sign() { //$.log(data+"\n") try{ let sign_res = JSON.parse(data) - if (sign_res.ret == "ok"&&sign_res.profit>0){ + if (sign_res.ret == "ok"){ calendarpic = sign_res.calendar_pic //$.log("签到收益: +"+`calendar_pic`) } else { @@ -333,7 +333,7 @@ function userinfo() { gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcashtitle+curcash ) $.sub += " "+gold - $.desc += sumcash + "/"+curcash + $.desc += sumcash + " ~~~~ "+curcashtitle+curcash } } catch (e) { $.logErr(e, data) @@ -453,6 +453,7 @@ function finishTask(artid,arttype) { $.log("获得收益: +"+do_read.profit +"\n") } else if (arttype == 1 ){ sumnotify = do_read.rtn_msg + $.log(sumnotify) } resolve() }) From 0f1f674bc5c7e144b0631cb9e258676e8a253a2a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 13:46:17 +0800 Subject: [PATCH 318/721] Update jukan.js --- Task/jukan.js | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 5269467e8f..eedf9ee64e 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,7 +1,7 @@ /* 聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie -更新时间: 2021-01-02 12:15 +更新时间: 2021-01-02 11:50 https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js 可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 @@ -60,7 +60,7 @@ if (typeof $request !== 'undefined') { console.log($.name, '【提示】请把聚看点Cookie填入Github 的 Secrets 中,请以&或者换行隔开') return; } - console.log(`您共提供${BodyArr.length}个聚看点账号Cookie`) + console.log(`您共提供${BodyArr.length}个聚看点账号Cookie\n————————————————————————————————————\n`) for (let i = 0; i < BodyArr.length; i++) { if (BodyArr[i]) { bodyval = BodyArr[i] @@ -70,10 +70,8 @@ if (typeof $request !== 'undefined') { cookieval = `xz_jkd_appkey=${ID}!iOS!${appVersion}` times = Date.parse(new Date())/1000 $.index = i + 1; - console.log("开始聚看点账号"+$.index+"任务\n") + console.log("聚看点账号"+$.index+"任务开始\n") await sign(); - //await LuckDrawLevel(); - //return for ( x =15;x<32;++x){ await Stimulate(x) } @@ -99,7 +97,7 @@ if (typeof $request !== 'undefined') { await artTotal() } if (artcount == 0&&videocount ==0){ - $.msg($.name+" 昵称:"+userName, $.sub, "今日阅读任务已完成\n"+$.desc,{'media-url': calendarpic }) + $.msg($.name+" 昵称:"+userName, $.sub, $.desc+"今日阅读任务已完成",{'media-url': calendarpic }) } $.log($.name+"账号"+$.index+" : "+userName+ " 本次运行任务已结束\n~~~~~~~~~~~~~~~~~~\n") } @@ -347,37 +345,41 @@ function userinfo() { function artTotal() { return new Promise((resolve, reject) =>{ let infourl = { - url: `https://www.xiaodouzhuan.cn/jkd/minfo/call.action`, + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/station/readAccount.action`, headers: {Cookie:cookieval,'User-Agent':UA}, - body: `jdata={"openID":"${ID}","openid":"${ID}","app_id":"xzwl","channel":"iOS","app_token":"${apptoken}","version":"${appVersion}","pars":{"openID":${ID},"uniqueid":"","os":"iOS","channel":"iOS","openid":"${ID}"}}&opttype=ART_READ` } $.post(infourl, async(error, resp, data) => { try{ - let get_total = JSON.parse(data) - artcount = get_total.datas.artcount - videocount = get_total.datas.videocount - $.log( "当前剩余阅读次数"+artcount+"次,剩余阅读次数"+videocount+"次") + artcount = data.match(/(今日奖励次数\((\d+)次\))/g)[0].match(/\d+/) + videocount = data.match(/(今日奖励次数\((\d+)次\))/g)[1].match(/\d+/) + artcoin = data.match(/\d+金币/g)[6] + videocoin = data.match(/\d+金币/g)[7] + readtotal = data.match(/\d+金币/g)[8] + sharetotal = data.match(/\d+金币/g)[9] + $.desc += "【今日阅读统计】\n 文章: " +Number(artcount) + "次 收益: "+artcoin+"\n 视频: " +Number(videocount) + "次 收益: "+videocoin+"\n" + $.desc += "【昨日阅读统计】\n 自阅收益: " +readtotal +" 分享收益: "+sharetotal + $.log( "当前阅读次数"+artcount+"次,视频次数"+videocount+"次\n") + $.log("开始自动阅读") if(artcount > 0 ){ readbodyVal = bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times}%22%2C%20`+'%22cateid%22%20%3A%203') await artList(readbodyVal) } else if ( artcount == 0 ){ - $.log("今日阅读任务已完成,本次跳过") + $.log("今日阅读任务已完成,本次跳过") }; if(videocount > 0 ){ - readbodyVal = bodyval.replace(/time%22%20%3A%20%22\d+%22/,`time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053') + readbodyVal = bodyval.replace(/time%22%20%3A%20%22\d+%22/,`time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053') await artList(readbodyVal) } else if ( artcount == 0 ){ $.log("今日视频任务已完成,本次跳过") - }; - } catch (e) { + }; + } catch (e) { $.logErr(e, data) } finally { resolve(data); } - }) - }) - } + }) +} function artList(readbodyVal) { return new Promise((resolve, reject) =>{ @@ -389,21 +391,20 @@ function artList(readbodyVal) { $.post(infourl, async(error, resp, data) => { let get_list = JSON.parse(data) // $.log( data) - $.log("【开始自动阅读】") if (get_list.ret == "ok"){ for( lists of get_list.artlist){ if(lists.item_type=="article"){ art_Title = lists.art_title artid =lists.art_id screen_Name = lists.screen_name - $.log("正在阅读文章: "+art_Title +" -------- <"+screen_Name +">\n ") + $.log(" 【阅读文章】: "+art_Title +" -------- <"+screen_Name +">\n ") await readTask(lists.art_id,"1") } if(lists.item_type=="video"){ art_Title = lists.art_title artid =lists.art_id screen_Name = lists.screen_name - $.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ") + $.log("【观看视频】: "+art_Title +" -------- <"+screen_Name +">\n ") await readTask(lists.art_id,"2") } if(taskresult == 'R-ART-1002'|| taskresult ==`R-ART-0011`){ From 155bc2e3a5ee99ba486b72b1e785b8b3c081b92b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 13:50:46 +0800 Subject: [PATCH 319/721] Update jukan.js --- Task/jukan.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index eedf9ee64e..6ef0801930 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,7 +1,7 @@ /* 聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie -更新时间: 2021-01-02 11:50 +更新时间: 2021-01-02 13:50 https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js 可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 @@ -358,7 +358,7 @@ function artTotal() { sharetotal = data.match(/\d+金币/g)[9] $.desc += "【今日阅读统计】\n 文章: " +Number(artcount) + "次 收益: "+artcoin+"\n 视频: " +Number(videocount) + "次 收益: "+videocoin+"\n" $.desc += "【昨日阅读统计】\n 自阅收益: " +readtotal +" 分享收益: "+sharetotal - $.log( "当前阅读次数"+artcount+"次,视频次数"+videocount+"次\n") + $.log( "\n当前阅读次数"+artcount+"次,视频次数"+videocount+"次\n") $.log("开始自动阅读") if(artcount > 0 ){ readbodyVal = bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times}%22%2C%20`+'%22cateid%22%20%3A%203') @@ -449,7 +449,6 @@ function finishTask(artid,arttype) { //$.log(data+"\n") let do_read = JSON.parse(data) taskresult = do_read.rtn_code - $.log(do_read.rtn_msg) if (do_read.ret == "ok"){ $.log("获得收益: +"+do_read.profit +"\n") } else if (arttype == 1 ){ From 48ce1108050a60dfd8918cb2dee70516ecb99e60 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 17:37:01 +0800 Subject: [PATCH 320/721] Update jukan.js --- Task/jukan.js | 159 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 109 insertions(+), 50 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 6ef0801930..90bd099319 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,7 +1,7 @@ /* 聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie -更新时间: 2021-01-02 13:50 +更新时间: 2021-01-02 17:38 https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js 可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 @@ -72,18 +72,18 @@ if (typeof $request !== 'undefined') { $.index = i + 1; console.log("聚看点账号"+$.index+"任务开始\n") await sign(); - for ( x =15;x<32;++x){ - await Stimulate(x) - } await getsign(); await stimulate(); await TimeBox(); - //await LuckDrawLevel(); + await userinfo(); + await LuckDrawLevel(); for(boxtype of [1,2]){ await $.wait(1000); await BoxProfit(boxtype) - } - await userinfo(); + } + for ( x =18;x<32;++x){ + await Stimulate(x) + } if (curcash >= drawcash && wxname){ await realname(); //await Withdraw() //实名未通过,强制提现,可取消此注释,不保证成功 @@ -96,10 +96,10 @@ if (typeof $request !== 'undefined') { } else { await artTotal() } - if (artcount == 0&&videocount ==0){ - $.msg($.name+" 昵称:"+userName, $.sub, $.desc+"今日阅读任务已完成",{'media-url': calendarpic }) + if ((150-artcount) == 0&&(50-videocount) ==0){ + $.msg($.name+" 昵称:"+userName, $.sub, $.desc+"\n<今日阅读任务已完成>",{'media-url': calendarpic }) } - $.log($.name+"账号"+$.index+" : "+userName+ " 本次运行任务已结束\n~~~~~~~~~~~~~~~~~~\n") + $.log("\n"+ $.name+"账号"+$.index+" : "+userName+ " 本次运行任务已结束\n~~~~~~~~~~~~~~~~~~\n") } } })() @@ -191,46 +191,106 @@ function signShare() { }) } -function LuckDrawBox() { + +function LuckDrawLevel() { return new Promise((resolve, reject) =>{ - let profiturl = { - url: `https://www.xiaodouzhuan.cn/jkd/activity/advluckdraw/getLuckDrawBox.action`, + let Levelurl = { + url: `https://www.xiaodouzhuan.cn/jkd/activity/advluckdraw/getLuckDrawLevel.action`, headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval } - $.post(profiturl, async(error, resp, data) => { - $.log(data+"\n") - let get_luckdraw = JSON.parse(data) - if (get_luckdraw.ret == "ok" &&get_luckdraw.luckName=="神秘宝箱"){ - $.log(sign_luckdraw.return_msg+`剩余 ${get_luckdraw.data.unFinishNum} 次`) - $.log(get_luckdraw.rtn_msg +`去领取神秘宝箱奖励`) + $.post(Levelurl, async(error, resp, data) => { + try { + get_drawLevel = JSON.parse(data) + //$.log(data) + if (get_drawLevel.ret == "ok"){ + unNum = get_drawLevel.data.unFinishNum + if(unNum>0){ + $.log("转盘任务剩余"+unNum+`次,去转盘任务`) + for(k=0;k<10&&k{ + let DrawGoldurl = { + url: `https://www.xiaodouzhuan.cn/jkd/activity/advluckdraw/getLuckDrawGold.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval + } + $.post(DrawGoldurl, async(error, resp, data) => { + $.log(data+"\n") + let get_drawGold = JSON.parse(data) + if (get_drawGold.ret == "ok"){ + $.log(get_drawGold.return_msg) + await LuckProfit() + } else if (get_drawGold.ret =="failed"){ + $.log(get_drawGold.rtn_msg +` 转盘抽奖失败`) } resolve() }) }) } -function LuckDrawLevel() { +function LuckBox(x) { return new Promise((resolve, reject) =>{ - let profiturl = { - url: `https://www.xiaodouzhuan.cn/jkd/activity/advluckdraw/getLuckDrawLevel.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval + let Boxurl = { + url: `https://www.xiaodouzhuan.cn/jkd/activity/advluckdraw/getLuckDrawBox.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, body: `num=${x}` } - $.post(profiturl, async(error, resp, data) => { + $.post(Boxurl, async(error, resp, data) => { + // $.log(data+"\n") + let Timebox = JSON.parse(data) + if (Timebox.ret == "ok"){ + $.log("时段宝箱开启成功,获取金币+"+ Timebox.data) + } else if (Timebox.ret =="failed"){ + $.log(`时段宝箱开启失败`+Timebox.return_msg) + } + resolve() + }) + }) +} + +function LuckProfit() { + return new Promise((resolve, reject) =>{ + let LuckProfiturl = { + url: `https://www.xiaodouzhuan.cn/jkd/activity/advluckdraw/getTotalLuckProfit.action`, + headers: {Cookie:cookieval,'User-Agent':UA}, + } + $.post(LuckProfiturl, async(error, resp, data) => { $.log(data+"\n") - if (err) { - $.log(`开启神秘宝箱失败: `+err+"\n"+data) - } else if (get_luckdraw.ret == "ok"){ - let get_luckdraw = JSON.parse(data) - $.log(sign_luckdraw.return_msg+`剩余 ${get_luckdraw.data.unFinishNum} 次`) - - $.log(get_luckdraw.rtn_msg +`去领取神秘宝箱奖励`) - await Stimulate("11") - } else if (get_luckdraw.ret =="failed"){ - $.log(get_luckdraw.rtn_msg +`去开启宝箱失败`) - } + let luckProfit = JSON.parse(data) + if (luckProfit.ret == "ok"){ + ltotalProfit = luckProfit.data.totalProfit + $.log("转盘任务成功,总计金币: "+ lktotalProfit+ luckProfit.return_msg) + } else if (luckProfit.ret =="failed"){ + $.log(`转盘抽奖失败`) + } resolve() }) }) @@ -247,7 +307,7 @@ function WelfareCash() { let _welfareCash = JSON.parse(data) if (_welfareCash.ret == "ok"){ $.log("新手福利提现: 成功") - } else { + } else { $.log(_welfareCash.rtn_msg) } resolve() @@ -267,9 +327,8 @@ function TimeBox() { let _timebox = JSON.parse(data) if (_timebox.ret == "ok"){ $.log("定时宝箱开启成功,获得收益+"+_timebox.profit + "下次需"+_timebox.next_time+"分钟") - await $.wait(5000) + await $.wait(2000) await Stimulate(_timebox.advertPopup.position) - //$.log(_timebox.advertPopup.buttonText ) } else { $.log(_timebox.rtn_msg) } @@ -356,17 +415,16 @@ function artTotal() { videocoin = data.match(/\d+金币/g)[7] readtotal = data.match(/\d+金币/g)[8] sharetotal = data.match(/\d+金币/g)[9] - $.desc += "【今日阅读统计】\n 文章: " +Number(artcount) + "次 收益: "+artcoin+"\n 视频: " +Number(videocount) + "次 收益: "+videocoin+"\n" + $.desc += "\n【今日阅读统计】\n 文章: " +Number(artcount) + "次 收益: "+artcoin+"\n 视频: " +Number(videocount) + "次 收益: "+videocoin+"\n" $.desc += "【昨日阅读统计】\n 自阅收益: " +readtotal +" 分享收益: "+sharetotal - $.log( "\n当前阅读次数"+artcount+"次,视频次数"+videocount+"次\n") - $.log("开始自动阅读") - if(artcount > 0 ){ + $.log( "当前阅读次数"+artcount+"次,视频次数"+videocount+"次\n") + if(150-artcount > 0 ){ readbodyVal = bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times}%22%2C%20`+'%22cateid%22%20%3A%203') await artList(readbodyVal) } else if ( artcount == 0 ){ $.log("今日阅读任务已完成,本次跳过") }; - if(videocount > 0 ){ + if(50-videocount > 0 ){ readbodyVal = bodyval.replace(/time%22%20%3A%20%22\d+%22/,`time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053') await artList(readbodyVal) } else if ( artcount == 0 ){ @@ -449,6 +507,7 @@ function finishTask(artid,arttype) { //$.log(data+"\n") let do_read = JSON.parse(data) taskresult = do_read.rtn_code + $.log(do_read.rtn_msg) if (do_read.ret == "ok"){ $.log("获得收益: +"+do_read.profit +"\n") } else if (arttype == 1 ){ @@ -472,7 +531,7 @@ function stimulate() { //$.log(data+"\n") let _Adv = JSON.parse(data) if (_Adv.ret == "ok"&&_Adv.status==1){ - $.log("视频"+ _Adv.videoType+"获得红包: +"+_Adv.rewardAmount+_Adv.rewardName) + $.log("视频"+ _Adv.videoType+"获得红包: +"+_Adv.rewardAmount+_Adv.rewardName) await $.wait(1000) await Stimulate("17") } else { @@ -492,12 +551,12 @@ function Stimulate(position) { body: `jsondata={"read_weal":"0","appid":"xzwl", "position" : ${position},"time" : "${times}","apptoken":"${apptoken}","appversion":"5.6.5","openid":"${ID}","os":"iOS","channel":"iOS"}` } $.post(stimurl, async(error, resp, data) => { - //$.log(data+"\n") + //$.log(data+"\n") let do_stim = JSON.parse(data) if(typeof do_stim.profit_title == "undefined"){ } else { - $.log( do_stim.profit_title+ "position"+": "+x+" 获得收益 +"+ do_stim.profit) - await $.wait(5000) + $.log( do_stim.profit_title+ "position"+": "+position+" 获得收益 +"+ do_stim.profit) + await $.wait(2000) } resolve() }) @@ -511,7 +570,7 @@ function BoxProfit(boxtype) { headers: {Cookie:cookieval,'User-Agent':UA}, body: `box_type=${boxtype}` } $.post(profiturl, async(error, resp, data) => { - //$.log(data+"\n") + //$.log(data+"\n") let do_box = JSON.parse(data) if (do_box.ret == "ok"&&do_box.profit>0){ $.log("计时宝箱获得收益: +"+do_box.profit) From 253340d62fe63d99468f3a22494c477d292fabe5 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 17:57:35 +0800 Subject: [PATCH 321/721] Update jukan.js --- Task/jukan.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 90bd099319..632552f5d9 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -283,10 +283,10 @@ function LuckProfit() { headers: {Cookie:cookieval,'User-Agent':UA}, } $.post(LuckProfiturl, async(error, resp, data) => { - $.log(data+"\n") + //$.log(data+"\n") let luckProfit = JSON.parse(data) if (luckProfit.ret == "ok"){ - ltotalProfit = luckProfit.data.totalProfit + lktotalProfit = luckProfit.data.totalProfit $.log("转盘任务成功,总计金币: "+ lktotalProfit+ luckProfit.return_msg) } else if (luckProfit.ret =="failed"){ $.log(`转盘抽奖失败`) From afd7b67a090cfcbc26c939e788181ca347963d0e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 17:58:07 +0800 Subject: [PATCH 322/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index 632552f5d9..e31ee5800a 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -244,7 +244,7 @@ function LuckDrawGold() { headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval } $.post(DrawGoldurl, async(error, resp, data) => { - $.log(data+"\n") + //$.log(data+"\n") let get_drawGold = JSON.parse(data) if (get_drawGold.ret == "ok"){ $.log(get_drawGold.return_msg) From 86f234d7837396f854e7f4f7314d0158e0adae17 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 18:03:28 +0800 Subject: [PATCH 323/721] Update jukan.js --- Task/jukan.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index e31ee5800a..e3f17a9131 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,7 +1,7 @@ /* 聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie -更新时间: 2021-01-02 17:38 +更新时间: 2021-01-02 18:02 https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js 可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 @@ -507,7 +507,6 @@ function finishTask(artid,arttype) { //$.log(data+"\n") let do_read = JSON.parse(data) taskresult = do_read.rtn_code - $.log(do_read.rtn_msg) if (do_read.ret == "ok"){ $.log("获得收益: +"+do_read.profit +"\n") } else if (arttype == 1 ){ From d48a7b7abd1956254b4f945ba88ab08e4254255d Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 18:12:09 +0800 Subject: [PATCH 324/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index e3f17a9131..6266f742fa 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -280,7 +280,7 @@ function LuckProfit() { return new Promise((resolve, reject) =>{ let LuckProfiturl = { url: `https://www.xiaodouzhuan.cn/jkd/activity/advluckdraw/getTotalLuckProfit.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, + headers: {Cookie:cookieval,'User-Agent':UA}, body: bodyval } $.post(LuckProfiturl, async(error, resp, data) => { //$.log(data+"\n") From 83eeabe34ce64697ed310cb6cb8807a33cf24d35 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 2 Jan 2021 18:22:12 +0800 Subject: [PATCH 325/721] Update jukan.js --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index 6266f742fa..2e7fb7a95b 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -212,7 +212,7 @@ function LuckDrawLevel() { } } if(lktotalProfit){ - $.desc += "【转盘任务】金币总计:"+ lktotalProfit+"剩余次数"+unNum+"次\n" + $.desc += "\n【转盘任务】金币总计:"+ lktotalProfit+"剩余次数"+unNum+"次\n" } let liststatus = JSON.parse(get_drawLevel.data.list) for ( var x in liststatus){ From 9ea085b76428a697563241e15807398cfd5f7a49 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 10:31:16 +0800 Subject: [PATCH 326/721] Update jukan.js --- Task/jukan.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 2e7fb7a95b..e44358714b 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,7 +1,7 @@ /* 聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie -更新时间: 2021-01-02 18:02 +更新时间: 2021-01-03 10:32 https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js 可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 @@ -212,7 +212,7 @@ function LuckDrawLevel() { } } if(lktotalProfit){ - $.desc += "\n【转盘任务】金币总计:"+ lktotalProfit+"剩余次数"+unNum+"次\n" + $.desc += "\n【转盘任务】金币总计:"+ lktotalProfit+"剩余次数"+unNum+"次" } let liststatus = JSON.parse(get_drawLevel.data.list) for ( var x in liststatus){ @@ -365,8 +365,8 @@ function Withdraw() { headers: {Cookie:cookieval,'User-Agent':UA}, body: `type=wx&sum=${sumcash}&mobile=&pid=0` } $.post(drawurl, async(error, resp, data) => { - $.log("提现"+sumcash+"元\n"+data) - $.desc += "\n提现"+sumcash+"元 "+data + $.log("提现"+drawcash+"元\n"+data) + $.desc += "\n提现"+drawcash+"元 "+data resolve() }) }) @@ -462,7 +462,7 @@ function artList(readbodyVal) { art_Title = lists.art_title artid =lists.art_id screen_Name = lists.screen_name - $.log("【观看视频】: "+art_Title +" -------- <"+screen_Name +">\n ") + $.log(" 【观看视频】: "+art_Title +" -------- <"+screen_Name +">\n ") await readTask(lists.art_id,"2") } if(taskresult == 'R-ART-1002'|| taskresult ==`R-ART-0011`){ @@ -485,7 +485,7 @@ function readTask(artid,arttype) { } $.post(rewurl, async(error, resp, data) => { if(resp.statusCode ==200){ - $.log("请等待30s\n") + $.log(" 请等待30s\n") await $.wait(30000) await finishTask(artid,arttype) } else { @@ -508,7 +508,7 @@ function finishTask(artid,arttype) { let do_read = JSON.parse(data) taskresult = do_read.rtn_code if (do_read.ret == "ok"){ - $.log("获得收益: +"+do_read.profit +"\n") + $.log(" 获得收益: +"+do_read.profit +"\n") } else if (arttype == 1 ){ sumnotify = do_read.rtn_msg $.log(sumnotify) From 6a7fb68020a56d2e222f3b4426fda007c02dd943 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 10:45:09 +0800 Subject: [PATCH 327/721] Update jukan.js --- Task/jukan.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index e44358714b..7baef0a216 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -212,7 +212,7 @@ function LuckDrawLevel() { } } if(lktotalProfit){ - $.desc += "\n【转盘任务】金币总计:"+ lktotalProfit+"剩余次数"+unNum+"次" + $.desc += "【转盘任务】金币总计:"+ lktotalProfit+"剩余次数"+unNum+"次\n" } let liststatus = JSON.parse(get_drawLevel.data.list) for ( var x in liststatus){ @@ -366,7 +366,7 @@ function Withdraw() { } $.post(drawurl, async(error, resp, data) => { $.log("提现"+drawcash+"元\n"+data) - $.desc += "\n提现"+drawcash+"元 "+data + $.desc += "提现"+drawcash+"元 "+data+"\n" resolve() }) }) @@ -390,7 +390,7 @@ function userinfo() { gold = get_info.userinfo.infoMeGoldItem.title+": "+get_info.userinfo.infoMeGoldItem.value $.log("昵称:"+userName+" "+gold +"\n"+sumcash + "/"+curcashtitle+curcash ) $.sub += " "+gold - $.desc += sumcash + " ~~~~ "+curcashtitle+curcash + $.desc += sumcash + " ~~~~ "+curcashtitle+curcash+"\n" } } catch (e) { $.logErr(e, data) @@ -415,8 +415,8 @@ function artTotal() { videocoin = data.match(/\d+金币/g)[7] readtotal = data.match(/\d+金币/g)[8] sharetotal = data.match(/\d+金币/g)[9] - $.desc += "\n【今日阅读统计】\n 文章: " +Number(artcount) + "次 收益: "+artcoin+"\n 视频: " +Number(videocount) + "次 收益: "+videocoin+"\n" - $.desc += "【昨日阅读统计】\n 自阅收益: " +readtotal +" 分享收益: "+sharetotal + $.desc += "【今日阅读统计】\n 文章: " +Number(artcount) + "次 收益: "+artcoin+"\n 视频: " +Number(videocount) + "次 收益: "+videocoin+"\n" + $.desc += "【昨日阅读统计】\n 自阅收益: " +readtotal +" 分享收益: "+sharetotal +"\n" $.log( "当前阅读次数"+artcount+"次,视频次数"+videocount+"次\n") if(150-artcount > 0 ){ readbodyVal = bodyval.replace(/time%22%20%3A%20%22\d+%22/, `time%22%20%3A%20%22${times}%22%2C%20`+'%22cateid%22%20%3A%203') @@ -425,7 +425,7 @@ function artTotal() { $.log("今日阅读任务已完成,本次跳过") }; if(50-videocount > 0 ){ - readbodyVal = bodyval.replace(/time%22%20%3A%20%22\d+%22/,`time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053') + readbodyVal = bodyval.replace(/time%22%20%3A%20%22\d+%22/,`time%22%20%3A%20%22${times+31000}%22%2C%20`+'%22cateid%22%20%3A%2053') await artList(readbodyVal) } else if ( artcount == 0 ){ $.log("今日视频任务已完成,本次跳过") @@ -509,9 +509,8 @@ function finishTask(artid,arttype) { taskresult = do_read.rtn_code if (do_read.ret == "ok"){ $.log(" 获得收益: +"+do_read.profit +"\n") - } else if (arttype == 1 ){ - sumnotify = do_read.rtn_msg - $.log(sumnotify) + } else { + $.log(do_read.rtn_msg) } resolve() }) @@ -572,7 +571,7 @@ function BoxProfit(boxtype) { //$.log(data+"\n") let do_box = JSON.parse(data) if (do_box.ret == "ok"&&do_box.profit>0){ - $.log("计时宝箱获得收益: +"+do_box.profit) + $.log("计时宝箱获得收益: +"+do_box.profit) position = do_box.advertPopup.position await Stimulate(position) // $.log(position) From d419b2b80fbb39ed083d4ec1719f5ca65ab25499 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 11:06:44 +0800 Subject: [PATCH 328/721] Update kuaishou.js --- Task/kuaishou.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 84c25507d5..5ad2dc72c8 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -208,11 +208,12 @@ function speedInfo() { let reurl = {url:'https://nebula.kuaishou.com/rest/n/nebula/activity/earn/overview', headers: {Cookie: cookieVal, 'Content-Type': 'application/json;charset=utf-8'},} - $.get(reurl, (error, response, data) =>{ + $.get(reurl, async(error, response, data) =>{ if(logs)$.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) if (result.result == 1) { speed_rewards = `现金收益: 💵${result.data.allCash}元 金币收益: 💰${result.data.totalCoin}` + await bdinvet() } resolve() }) @@ -246,5 +247,13 @@ function GetCookie() { $.msg($.name, `获取正式Cookie: 成功🎉`, ``) } } - +function bdinvet() { + let bdurl = { + url: `https://nbic3g9vs.get666bjxi3t687tp8c.com/nebula/ares/preBindCode?cc=share_copylink&fid=953324934&shareMode=app&code=774010415&shareMethod=card&kpn=NEBULA&subBiz=INVITE_CODE&shareToken=YVthN8M1_AO&shareObjectId=774010415`, + headers: {Cookie:cookieVal}, + } + $.get(bdurl, (error, resp, data) => { + //$.log(data) + }) +} 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 1573329a27cfcde71e9e579546e4515a10ce891e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 12:05:15 +0800 Subject: [PATCH 329/721] =?UTF-8?q?=E5=BE=AA=E7=8E=AF=E9=98=85=E8=AF=BB2?= =?UTF-8?q?=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jukan.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 7baef0a216..9f335332f5 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,7 +1,7 @@ /* 聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie -更新时间: 2021-01-03 10:32 +更新时间: 2021-01-03 12:03 https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js 可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 @@ -365,7 +365,7 @@ function Withdraw() { headers: {Cookie:cookieval,'User-Agent':UA}, body: `type=wx&sum=${sumcash}&mobile=&pid=0` } $.post(drawurl, async(error, resp, data) => { - $.log("提现"+drawcash+"元\n"+data) + $.log("提现"+drawcash+"元"+data+"\n") $.desc += "提现"+drawcash+"元 "+data+"\n" resolve() }) @@ -485,9 +485,11 @@ function readTask(artid,arttype) { } $.post(rewurl, async(error, resp, data) => { if(resp.statusCode ==200){ - $.log(" 请等待30s\n") + for(s=0;s<2;++s){ + $.log(` 开始第${s+1}次阅读,请等待30s\n`) await $.wait(30000) await finishTask(artid,arttype) + } } else { $.log("阅读失败: "+data) } From c5bcff1c2f84d3d22461634f2e9660b7d426bd89 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 12:15:56 +0800 Subject: [PATCH 330/721] Update jukan.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 暂时取消自动提现申请 --- Task/jukan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jukan.js b/Task/jukan.js index 9f335332f5..7f1e7bba04 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -85,7 +85,7 @@ if (typeof $request !== 'undefined') { await Stimulate(x) } if (curcash >= drawcash && wxname){ - await realname(); + // await realname(); //await Withdraw() //实名未通过,强制提现,可取消此注释,不保证成功 } if (signtimes&&signtimes<5){ From cad361f93304ee822dadcd73e4e466cc04090bfc Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 13:18:36 +0800 Subject: [PATCH 331/721] Update jukan.yml --- .github/workflows/jukan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jukan.yml b/.github/workflows/jukan.yml index 45de3b445d..a62a629b03 100644 --- a/.github/workflows/jukan.yml +++ b/.github/workflows/jukan.yml @@ -1,4 +1,4 @@ - +# 已禁用阅读任务,其他可行 name: 聚看点 on: From 080ada07dd1c0be5082782efc337e472644d5f32 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 13:19:42 +0800 Subject: [PATCH 332/721] Update jukan.yml --- .github/workflows/jukan.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/jukan.yml b/.github/workflows/jukan.yml index a62a629b03..3454628103 100644 --- a/.github/workflows/jukan.yml +++ b/.github/workflows/jukan.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest if: github.event.repository.owner.id == github.event.sender.id env: - JUKAN_COOKIE: ${{ secrets.JUKAN_COOKIE }} JUKAN_BODY: ${{ secrets.JUKAN_BODY }} TZ: Asia/shanghai steps: @@ -28,7 +27,7 @@ jobs: cd ~/Scripts npm install - name: '运行 【聚看点】' - if: env.JUKAN_COOKIE + if: env.JUKAN_BODY run: | cd ~/Scripts node Task/jukan.js From dd7131d901d93fb4577c7143ea991c78780787d9 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 14:50:19 +0800 Subject: [PATCH 333/721] Update baidu_speed.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复试玩领金币系统错误 --- Task/baidu_speed.js | 123 ++++++++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 62 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 02a360a37e..7544d17bee 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -169,17 +169,18 @@ else if(tasks[x].data.countDown[tid].countDown ==0){ for (y in taskArr){ tid = taskArr[y].id taskName = "【"+taskArr[y].title+"】" - $.log(taskName+" tid:"+tid) + $.log(taskName+" ID:"+id +" tid:"+tid) if (taskArr[y].taskStatus==1 ){ - $.log(taskName +" 已完成" ) + $.log(taskName +" ID:"+id +" 已完成" ) $.desc += taskName +" 已完成\n" }else if(taskArr[y].type == 'openApp'){ + tid = tid=='395' ? "385":tid RefererUrl = taskArr[y].adLink - await get_pkg() + await get_pkg() } else if(taskArr[y].type == 'watch'){ // $.log(tasklists.+'\n') cmd = tid==346 ? 100:184 - await get_search() + //await get_search() }; } } @@ -226,12 +227,12 @@ function firstbox() { function get_pkg() { return new Promise((resolve, reject) =>{ let pkgurl = { - url: `https://haokan.baidu.com/activity/acad/rewardad?device=%7B%22imei_md5%22%3A%22%22%2C%22device_type%22%3A1%2C%22model%22%3A%22IPHONE%22%2C%22manufacturer%22%3A%22Apple%22%2C%22os_version%22%3A%2213.7%22%2C%22idfa%22%3A%22_a2S8_aq28_qa28qii2A8laJ28gxC28Q_iXni0uKvNYIPviVzaHtiYah2ul6iHim_l2880uQvflqisa9liBgIgarv8oIOHutlhSPu_ux2a_Wi-uRz_qAC%22%2C%22androidId%22%3A%22%22%2C%22geo%22%3A%7B%22lat%22%3A%22%22%2C%22lon%22%3A%22%22%7D%2C%22screen_width%22%3A1242%2C%22screen_height%22%3A2208%7D&network=%7B%22connect_type%22%3A1%2C%22carrier%22%3A0%7D&productid=2&tid=${tid}&type=1`, + url: `https://haokan.baidu.com/activity/acad/rewardad?device=%7B%22imei_md5%22%3A%22%22%2C%22device_type%22%3A1%2C%22model%22%3A%22IPHONE%22%2C%22manufacturer%22%3A%22Apple%22%2C%22os_version%22%3A%2214.2%22%2C%22androidId%22%3A%22%22%7D%2C%22screen_width%22%3A1242%2C%22screen_height%22%3A2208&network=%7B%22connect_type%22%3A1%2C%22carrier%22%3A0%7D&productid=2&tid=${tid}&type=1`, headers:{Cookie:cookieval,'User-Agent': UA,'Referer':RefererUrl} } $.get(pkgurl, async(error, resp, data) => { let get_pkg = JSON.parse(data) - // $.log("数据: "+data+'\n') + // $.log("数据: "+data+'\n') if (get_pkg.errno == 0&&get_pkg.data.isDone ==0){ Pkg = get_pkg.data.adInfo[0].material.pkg taskid = get_pkg.data.taskPf.taskId; @@ -246,59 +247,6 @@ function get_pkg() { }) }) } -//缩减开宝箱时间 -function chestTime() { - return new Promise((resolve, reject) =>{ - let timeurl = { - url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestTime&rewardVideoPkg=${Pkg}`, - headers: {Cookie:cookieval,'User-Agent': UA,Referer: `https://eopa.baidu.com/page/pagekey-qWYNoPr0?type=1&tid=695&productid=2&chesttid=669&chestname=chestTime`} - } - $.get(timeurl, (error, response, data) => { - $.log(data) - try{ - let get_chest = JSON.parse(data) - if (get_chest.errno == 11006){ - $.log("开宝箱任务"+get_chest.errmsg) - } - else if (get_chest.errno == 0){ - $.log("开宝箱时间缩减"+get_chest.data.awardTime/60+"分钟") - } - else if (get_chest.errno == 19001&&get_chest.data.originData.errno==10074 ){ - //$.desc += get_chest.data.originData.msg - $.log("开宝箱任务ID:"+taskid+ get_chest.data.originData.msg) - } - } catch(e){ - $.logErr(e, data); - } finally { - resolve() - } - }) - }) -} - -//任务中心宝箱 -function activeBox2() { - return new Promise((resolve, reject) =>{ - let actboxurl = { - url: `https://haokan.baidu.com/activity/acuserchest/opennew`, - headers: {Cookie:cookieval,'User-Agent': UA}, - body: `taskid=${taskid}&productid=2&ugus=5256798061` - } - $.post(actboxurl, async(error, response, data) => { - let act_box = JSON.parse(data) - //$.log('actbox: ' + data) - if (act_box.errno == 0){ - $.desc += '开宝箱获得收益: +' + act_box.data.coin - - } else if (act_box.errno == 10060){ - //taskid = '669' - await chestTime() - $.desc += act_box.msg - } - resolve() - }) - }) -} function activeBox() { return new Promise((resolve, reject) =>{ let actboxurl = { @@ -326,7 +274,7 @@ function Tasks() { try { let do_task = JSON.parse(data) await $.wait(20000); - //$.log(data+'\n') + // $.log(data+'\n') if (do_task.errno == 0){ $.desc += taskName + "获得收益"+ do_task.data.coin +"\n" $.log(" 获得收益: +"+do_task.data.coin+'\n ') @@ -334,6 +282,7 @@ function Tasks() { $.desc += taskName + " "+ do_task.data.originData.msg + "\n" }else if (do_task.errno == 11004){ $.desc += taskName + " "+ do_task.errmsg + "\n" + $.log(taskName + " "+ do_task.errmsg) } } catch(e){ $.logErr(e, data); @@ -375,8 +324,6 @@ function get_search() { }) } - - function searchBox(id) { return new Promise((resolve) =>{ let searchurl = { @@ -397,7 +344,59 @@ function searchBox(id) { }) }) } +//缩减开宝箱时间 +function chestTime() { + return new Promise((resolve, reject) =>{ + let timeurl = { + url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestTime&rewardVideoPkg=${Pkg}`, + headers: {Cookie:cookieval,'User-Agent': UA,Referer: `https://eopa.baidu.com/page/pagekey-qWYNoPr0?type=1&tid=695&productid=2&chesttid=669&chestname=chestTime`} + } + $.get(timeurl, (error, response, data) => { + $.log(data) + try{ + let get_chest = JSON.parse(data) + if (get_chest.errno == 11006){ + $.log("开宝箱任务"+get_chest.errmsg) + } + else if (get_chest.errno == 0){ + $.log("开宝箱时间缩减"+get_chest.data.awardTime/60+"分钟") + } + else if (get_chest.errno == 19001&&get_chest.data.originData.errno==10074 ){ + //$.desc += get_chest.data.originData.msg + $.log("开宝箱任务ID:"+taskid+ get_chest.data.originData.msg) + } + } catch(e){ + $.logErr(e, data); + } finally { + resolve() + } + }) + }) +} +//任务中心宝箱 +function activeBox2() { + return new Promise((resolve, reject) =>{ + let actboxurl = { + url: `https://haokan.baidu.com/activity/acuserchest/opennew`, + headers: {Cookie:cookieval,'User-Agent': UA}, + body: `taskid=${taskid}&productid=2&ugus=5256798061` + } + $.post(actboxurl, async(error, response, data) => { + let act_box = JSON.parse(data) + //$.log('actbox: ' + data) + if (act_box.errno == 0){ + $.desc += '开宝箱获得收益: +' + act_box.data.coin + + } else if (act_box.errno == 10060){ + //taskid = '669' + await chestTime() + $.desc += act_box.msg + } + resolve() + }) + }) +} function doubleBox() { return new Promise((resolve, reject) =>{ let douboxurl = { From 3686fe269fe6ca3e9d782b502c5d32524ea78653 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 15:08:07 +0800 Subject: [PATCH 334/721] Update baidu_speed.js --- Task/baidu_speed.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 7544d17bee..8d0b178a91 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -180,7 +180,7 @@ else if(tasks[x].data.countDown[tid].countDown ==0){ } else if(taskArr[y].type == 'watch'){ // $.log(tasklists.+'\n') cmd = tid==346 ? 100:184 - //await get_search() + await get_search() }; } } @@ -349,7 +349,7 @@ function chestTime() { return new Promise((resolve, reject) =>{ let timeurl = { url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestTime&rewardVideoPkg=${Pkg}`, - headers: {Cookie:cookieval,'User-Agent': UA,Referer: `https://eopa.baidu.com/page/pagekey-qWYNoPr0?type=1&tid=695&productid=2&chesttid=669&chestname=chestTime`} + headers: {Cookie:cookieval,'User-Agent': UA,Referer:RefererUrl} } $.get(timeurl, (error, response, data) => { $.log(data) @@ -401,7 +401,7 @@ function doubleBox() { return new Promise((resolve, reject) =>{ let douboxurl = { url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestDouble&rewardVideoPkg=${Pkg}`, - headers: {Cookie:cookieval,'User-Agent': UA,Referer: `Referer: https://eopa.baidu.com/page/pagekey-ASKWNd8W?productid=2&type=1&tid=346`} + headers: {Cookie:cookieval,'User-Agent': UA,Referer:RefererUrl} } $.get(douboxurl, (error, response, data) => { let get_doubox = JSON.parse(data) From 721628c1348849a8d113b99b2bf9d9a1c53038ec Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 17:16:09 +0800 Subject: [PATCH 335/721] Update jukan.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复错误 --- Task/jukan.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 7f1e7bba04..5c7e8d27b3 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,7 +1,7 @@ /* 聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie -更新时间: 2021-01-03 12:03 +更新时间: 2021-01-03 17:13 https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js 可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 @@ -97,7 +97,7 @@ if (typeof $request !== 'undefined') { await artTotal() } if ((150-artcount) == 0&&(50-videocount) ==0){ - $.msg($.name+" 昵称:"+userName, $.sub, $.desc+"\n<今日阅读任务已完成>",{'media-url': calendarpic }) + $.msg($.name+" 昵称:"+userName, $.sub, $.desc+"<今日阅读任务已完成>",{'media-url': calendarpic }) } $.log("\n"+ $.name+"账号"+$.index+" : "+userName+ " 本次运行任务已结束\n~~~~~~~~~~~~~~~~~~\n") } @@ -411,10 +411,10 @@ function artTotal() { try{ artcount = data.match(/(今日奖励次数\((\d+)次\))/g)[0].match(/\d+/) videocount = data.match(/(今日奖励次数\((\d+)次\))/g)[1].match(/\d+/) - artcoin = data.match(/\d+金币/g)[6] - videocoin = data.match(/\d+金币/g)[7] - readtotal = data.match(/\d+金币/g)[8] - sharetotal = data.match(/\d+金币/g)[9] + artcoin = data.match(/\d+金币/g)[5] + videocoin = data.match(/\d+金币/g)[6] + readtotal = data.match(/\d+金币/g)[7] + sharetotal = data.match(/\d+金币/g)[8] $.desc += "【今日阅读统计】\n 文章: " +Number(artcount) + "次 收益: "+artcoin+"\n 视频: " +Number(videocount) + "次 收益: "+videocoin+"\n" $.desc += "【昨日阅读统计】\n 自阅收益: " +readtotal +" 分享收益: "+sharetotal +"\n" $.log( "当前阅读次数"+artcount+"次,视频次数"+videocount+"次\n") @@ -574,6 +574,7 @@ function BoxProfit(boxtype) { let do_box = JSON.parse(data) if (do_box.ret == "ok"&&do_box.profit>0){ $.log("计时宝箱获得收益: +"+do_box.profit) + $.desc += "【计时宝箱】+"+do_box.profit+"金币" position = do_box.advertPopup.position await Stimulate(position) // $.log(position) From e6fd78129564ef5b1aedd4cfdeb22adcf18eeac7 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 17:59:34 +0800 Subject: [PATCH 336/721] Update jukan.js --- Task/jukan.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index 5c7e8d27b3..d70ccbe85c 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -1,7 +1,7 @@ /* 聚看点签到任务,不支持Actions跑阅读任务,其他任务可运行 打开'我的'获取Cookie -更新时间: 2021-01-03 17:13 +更新时间: 2021-01-03 12:03 https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body jukan.js 可自动提现,提现需填写微信真实姓名,设置提现金额,默认30,此设置可以boxjs内完成,也可本地配置 @@ -16,6 +16,7 @@ const wxname = $.getdata('jukan_name') || ""//微信真实名字,可以在双 let CookieArr=[],BodyArr=[]; let bodys = $.getdata('jukan_body') let signtimes = $.getdata('jukan_times') +let cashout = $.getdata('jukan_out')|| false let UA = 'JuKanDian/5.6.5 (iPhone; iOS 14.2; Scale/3.00)' let taskresult = "",sumnotify =""; @@ -84,8 +85,8 @@ if (typeof $request !== 'undefined') { for ( x =18;x<32;++x){ await Stimulate(x) } - if (curcash >= drawcash && wxname){ - // await realname(); + if (cashout==true&&curcash >= drawcash && wxname){ + await realname(); //await Withdraw() //实名未通过,强制提现,可取消此注释,不保证成功 } if (signtimes&&signtimes<5){ @@ -362,7 +363,7 @@ function Withdraw() { return new Promise((resolve, reject) =>{ let drawurl = { url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/userWithdrawPost.action`, - headers: {Cookie:cookieval,'User-Agent':UA}, body: `type=wx&sum=${sumcash}&mobile=&pid=0` + headers: {Cookie:cookieval,'User-Agent':UA,'Referer': 'https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/userWithdraw.action'}, body: `type=wx&sum=${sumcash}&mobile=&pid=0&accountid=&productcode=` } $.post(drawurl, async(error, resp, data) => { $.log("提现"+drawcash+"元"+data+"\n") @@ -372,6 +373,21 @@ function Withdraw() { }) } + +function Cashstatus() { + return new Promise((resolve, reject) =>{ + let drawurl = { + url: `https://www.xiaodouzhuan.cn/jkd/weixin20/userWithdraw/userWithdrawPost.action`, + headers: {Cookie:cookieval,'User-Agent':UA} +} + $.post(drawurl, async(error, resp, data) => { + $.log("提现"+drawcash+"元"+data+"\n") + $.desc += "提现"+drawcash+"元 "+data+"\n" + resolve() + }) + }) +} + function userinfo() { return new Promise((resolve, reject) =>{ let infourl = { From 1b909868e446ad36536d174f72d6d105de109fb1 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 18:05:32 +0800 Subject: [PATCH 337/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 921e4b4960..c767b267ab 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -209,15 +209,22 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", "settings": [ - { + { + "id": "jukan_out", + "name": "自动提现", + "val": false, + "type": "boolean", + "desc": "自动提现开关,请填入提现金额及微信绑定实名,默认关闭" + }, + { "id": "jukan_cash", "name": "提现金额", "val": "", "type": "number", "placeholder": "默认30 (点击以展开说明)", "desc": "仅允许填入数字,所选金额可见聚看点APP" - }, - { + }, + { "id": "jukan_name", "name": "微信真实姓名", "val": "", From be8ff37114f9205f8cd9d8b176caa34afe0b67ed Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 18:26:03 +0800 Subject: [PATCH 338/721] Update sunert.boxjs.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加提现开关 --- Task/sunert.boxjs.json | 49 ++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index c767b267ab..2cd72b173e 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -12,7 +12,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", "https://raw.githubusercontent.com/Orz-3/task/master/weibo.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/weibo.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js" }, { "id": "youth", @@ -37,7 +37,7 @@ ], "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/youth.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js" }, { "id": "youthGain", @@ -46,7 +46,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/youth_gain.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js" }, { "id": "dianshijia", @@ -72,7 +72,7 @@ }], "repo": "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/dianshijia.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js" }, { "id": "kuaishou", @@ -81,7 +81,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", "https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/kuaishou.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js" }, { "id": "sinanews", @@ -90,7 +90,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/sinanews.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js" }, { "id": "NOWLIVE", @@ -99,7 +99,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/NOWLIVE.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js" }, { "id": "chinatelecomEnquiry", @@ -117,7 +117,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", "https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/telecomInfinity.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js" }, { "id": "jddj", @@ -141,7 +141,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/tvpreview.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js" }, { "id": "moji", @@ -200,7 +200,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/moji.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js" }, { "id": "jukan", @@ -209,22 +209,15 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", "settings": [ - { - "id": "jukan_out", - "name": "自动提现", - "val": false, - "type": "boolean", - "desc": "自动提现开关,请填入提现金额及微信绑定实名,默认关闭" - }, - { + { "id": "jukan_cash", "name": "提现金额", "val": "", "type": "number", "placeholder": "默认30 (点击以展开说明)", "desc": "仅允许填入数字,所选金额可见聚看点APP" - }, - { + }, + { "id": "jukan_name", "name": "微信真实姓名", "val": "", @@ -232,7 +225,7 @@ "placeholder": "填入微信真实姓名" }], "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/jukan.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js" }, { "id": "mydigit", @@ -241,7 +234,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/mydigit.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js" }, { "id": "txnews", @@ -268,7 +261,7 @@ ], "repo": "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", "https://raw.githubusercontent.com/Orz-3/task/master/txnews.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/txnews.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js" }, { "id": "jingxi", @@ -277,7 +270,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jingxi.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jingxi.png", "https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/jingxi.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js" }, { "id": "translate", @@ -293,7 +286,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", "https://raw.githubusercontent.com/Orz-3/task/master/translate.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/translate.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js" }, { "id": "exchange rate", @@ -325,7 +318,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", "https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/exchangeRate.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js" }, { "id": "trainquery", @@ -379,8 +372,8 @@ ], "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", "https://raw.githubusercontent.com/Orz-3/task/master/12306.png"], - "script": "https://github.com/Sunert/Scripts/raw/master/Task/trainquery.js" + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/12306.png“, ”https://raw.githubusercontent.com/Orz-3/task/master/12306.png“], + ”script“: ”https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js“ } ] } From 5f20aa98048fa32da0dd4bda2ab99c433d1e99e1 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:12:45 +0800 Subject: [PATCH 339/721] Update AUTO_KS.yml --- .github/workflows/AUTO_KS.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/AUTO_KS.yml b/.github/workflows/AUTO_KS.yml index 352b4c0930..1225dd834a 100644 --- a/.github/workflows/AUTO_KS.yml +++ b/.github/workflows/AUTO_KS.yml @@ -17,8 +17,7 @@ jobs: TZ: Asia/shanghai steps: - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts + uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: From 55f18ee217416deaa270269f5d149ae5fe5d7f17 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:14:17 +0800 Subject: [PATCH 340/721] Update baiduspeed.yml --- .github/workflows/baiduspeed.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/baiduspeed.yml b/.github/workflows/baiduspeed.yml index 4980906bc7..a30641ebe5 100644 --- a/.github/workflows/baiduspeed.yml +++ b/.github/workflows/baiduspeed.yml @@ -15,8 +15,7 @@ jobs: TZ: Asia/shanghai steps: - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts + uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: From 154f4854a868dea2d844dec819791a107c4e3343 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:15:16 +0800 Subject: [PATCH 341/721] Update dianshijia.yml --- .github/workflows/dianshijia.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dianshijia.yml b/.github/workflows/dianshijia.yml index 8622189e88..a90b36f70b 100644 --- a/.github/workflows/dianshijia.yml +++ b/.github/workflows/dianshijia.yml @@ -17,8 +17,7 @@ jobs: TZ: Asia/shanghai steps: - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts + uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: @@ -40,4 +39,4 @@ jobs: TG_USER_ID: ${{ secrets.TG_USER_ID }} BARK_SOUND: ${{ secrets.BARK_SOUND }} DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} From 93648abe3784dd6c8fd828abc9359cb3a981fedf Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:16:26 +0800 Subject: [PATCH 342/721] Update jingxi.yml --- .github/workflows/jingxi.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/jingxi.yml b/.github/workflows/jingxi.yml index 8cbb06e88d..aa84df54b7 100644 --- a/.github/workflows/jingxi.yml +++ b/.github/workflows/jingxi.yml @@ -15,8 +15,7 @@ jobs: JD_COOKIE: ${{ secrets.JD_COOKIE }} steps: - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts + uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: @@ -37,4 +36,4 @@ jobs: TG_USER_ID: ${{ secrets.TG_USER_ID }} BARK_SOUND: ${{ secrets.BARK_SOUND }} DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} From d5fc2f1a83a29133c47937f543bf99d3fe3142f8 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:17:20 +0800 Subject: [PATCH 343/721] Update jukan.yml --- .github/workflows/jukan.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/jukan.yml b/.github/workflows/jukan.yml index 3454628103..e8eb455133 100644 --- a/.github/workflows/jukan.yml +++ b/.github/workflows/jukan.yml @@ -16,8 +16,7 @@ jobs: TZ: Asia/shanghai steps: - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts + uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: From c9f4e60e5c464cc52d0f7601a9cea673ba76cd43 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:18:07 +0800 Subject: [PATCH 344/721] Update kuaishou.yml --- .github/workflows/kuaishou.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/kuaishou.yml b/.github/workflows/kuaishou.yml index d86ec4a7e2..b68cc17b2d 100644 --- a/.github/workflows/kuaishou.yml +++ b/.github/workflows/kuaishou.yml @@ -15,8 +15,7 @@ jobs: KS_TOKEN: ${{ secrets.KS_TOKEN }} steps: - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts + uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: From 4ba3555a5a03896e0c4027a3a03e50c8046e410a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:18:45 +0800 Subject: [PATCH 345/721] Update midu_read.yml --- .github/workflows/midu_read.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/midu_read.yml b/.github/workflows/midu_read.yml index 0443355d7b..5ed7d4f8e8 100644 --- a/.github/workflows/midu_read.yml +++ b/.github/workflows/midu_read.yml @@ -17,8 +17,7 @@ jobs: MIDU_SIGN: ${{ secrets.MIDU_SIGN }} steps: - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts + uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: From c9c05c122302125b611352c701a5f0c08f4a7b70 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:20:35 +0800 Subject: [PATCH 346/721] Update txnews.yml --- .github/workflows/txnews.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/txnews.yml b/.github/workflows/txnews.yml index c331ed5a9c..02312a1238 100644 --- a/.github/workflows/txnews.yml +++ b/.github/workflows/txnews.yml @@ -23,8 +23,7 @@ jobs: TXNEWS_VIDEO: ${{ secrets.TXNEWS_VIDEO }} steps: - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts + uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: From c1a3722a9f54acbe4e2119073a7bbffdaebfe86c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:21:07 +0800 Subject: [PATCH 347/721] Update weibo.yml --- .github/workflows/weibo.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/weibo.yml b/.github/workflows/weibo.yml index 8212569a5f..5f2b2ff921 100644 --- a/.github/workflows/weibo.yml +++ b/.github/workflows/weibo.yml @@ -16,8 +16,7 @@ jobs: WB_PAY: ${{ secrets.WB_PAY }} steps: - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts + uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: @@ -39,4 +38,4 @@ jobs: TG_USER_ID: ${{ secrets.TG_USER_ID }} BARK_SOUND: ${{ secrets.BARK_SOUND }} DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} From 8fd45f4b2a0d6ca3b91cbd364feef7e41e15c354 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:21:41 +0800 Subject: [PATCH 348/721] Update youth.yml --- .github/workflows/youth.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index e671d4603a..9ec6587ddc 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -21,8 +21,7 @@ jobs: YOUTH_TIME: ${{ secrets.YOUTH_TIME }} steps: - name: Checkout - run: | - git clone https://github.com/Sunert/Scripts.git ~/Scripts + uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: From 9fc128fa7b3ff24178c275a71742395fc3c620bb Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:23:34 +0800 Subject: [PATCH 349/721] Update youth_read.yml --- .github/workflows/youth_read.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index 00d2678d9c..bafac02f81 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -19,7 +19,8 @@ jobs: YOUTH_READ3: ${{ secrets.YOUTH_READ3 }} YOUTH_READ4: ${{ secrets.YOUTH_READ4 }} steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v1 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: @@ -54,4 +55,4 @@ jobs: run: | node Task/Youth_Read.js env: - YOUTH_READ: ${{ secrets.YOUTH_READ4 }} \ No newline at end of file + YOUTH_READ: ${{ secrets.YOUTH_READ4 }} From d6d0038ff91d50ab146914c41ceaeda6200c9682 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 21:17:46 +0800 Subject: [PATCH 350/721] Update jukan.js --- Task/jukan.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Task/jukan.js b/Task/jukan.js index d70ccbe85c..501cf658e2 100644 --- a/Task/jukan.js +++ b/Task/jukan.js @@ -76,7 +76,7 @@ if (typeof $request !== 'undefined') { await getsign(); await stimulate(); await TimeBox(); - await userinfo(); + await userinfo(); await LuckDrawLevel(); for(boxtype of [1,2]){ await $.wait(1000); @@ -327,7 +327,7 @@ function TimeBox() { //$.log(data+"\n") let _timebox = JSON.parse(data) if (_timebox.ret == "ok"){ - $.log("定时宝箱开启成功,获得收益+"+_timebox.profit + "下次需"+_timebox.next_time+"分钟") + //$.log("定时宝箱开启成功,获得收益+"+_timebox.profit + " 下次需"+_timebox.next_time+"分钟") await $.wait(2000) await Stimulate(_timebox.advertPopup.position) } else { @@ -427,10 +427,10 @@ function artTotal() { try{ artcount = data.match(/(今日奖励次数\((\d+)次\))/g)[0].match(/\d+/) videocount = data.match(/(今日奖励次数\((\d+)次\))/g)[1].match(/\d+/) - artcoin = data.match(/\d+金币/g)[5] - videocoin = data.match(/\d+金币/g)[6] - readtotal = data.match(/\d+金币/g)[7] - sharetotal = data.match(/\d+金币/g)[8] + artcoin = data.match(/gold"\>\+(\d+金币)/)[1] + videocoin = data.match(/\d+金币/g)[7] + readtotal = data.match(/gold1"\>\+(\d+金币)/)[1] + sharetotal = data.match(/\d+金币/g)[9] $.desc += "【今日阅读统计】\n 文章: " +Number(artcount) + "次 收益: "+artcoin+"\n 视频: " +Number(videocount) + "次 收益: "+videocoin+"\n" $.desc += "【昨日阅读统计】\n 自阅收益: " +readtotal +" 分享收益: "+sharetotal +"\n" $.log( "当前阅读次数"+artcount+"次,视频次数"+videocount+"次\n") @@ -590,7 +590,7 @@ function BoxProfit(boxtype) { let do_box = JSON.parse(data) if (do_box.ret == "ok"&&do_box.profit>0){ $.log("计时宝箱获得收益: +"+do_box.profit) - $.desc += "【计时宝箱】+"+do_box.profit+"金币" + //$.desc += "【计时宝箱】+"+do_box.profit+"金币\n" position = do_box.advertPopup.position await Stimulate(position) // $.log(position) From f0fafa7e470b77b569def72e94c2f2aac50ecc6d Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 22:17:56 +0800 Subject: [PATCH 351/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 2cd72b173e..93df29421a 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -209,6 +209,13 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", "settings": [ + { + "id": "jukan_out", + "name": "自动提现", + "val": false, + "type": "boolean", + "desc": "自动提现开关,请填入提现金额及微信绑定实名,默认关闭" + }, { "id": "jukan_cash", "name": "提现金额", @@ -270,7 +277,7 @@ "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jingxi.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jingxi.png", "https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js" + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js" }, { "id": "translate", From a52930209ae090bd228b53ccbeea9bbc45204b6d Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 22:25:50 +0800 Subject: [PATCH 352/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 667 ++++++++++++++++++++--------------------- 1 file changed, 329 insertions(+), 338 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 93df29421a..902f083217 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -1,386 +1,377 @@ { - "id": "sunert.app.sub", - "name": "Sunert 签到应用订阅", - "author": "@Sunert", - "icon": "https://avatars2.githubusercontent.com/u/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", - "repo": "https://github.com/Sunert/Scripts/tree/master", - "apps": [ - { - "id": "weibo", - "name": "新浪微博", - "keys": ["sy_payheader_wb", "sy_token_wb"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", "https://raw.githubusercontent.com/Orz-3/task/master/weibo.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js" + "id": "sunert.app.sub", + "name": "Sunert 签到应用订阅", + "author": "@Sunert", + "icon": "https://avatars2.githubusercontent.com/u/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", + "repo": "https://github.com/Sunert/Scripts/tree/master", + "apps": [{ + "id": "weibo", + "name": "新浪微博", + "keys": ["sy_payheader_wb", "sy_token_wb"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", "https://raw.githubusercontent.com/Orz-3/task/master/weibo.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js" }, { - "id": "youth", - "name": "中青看点", - "keys": ["youthheader_zq", "read_zq", "red_zq", "readtime_zq"], - "author": "@sunert", - "settings": [ + "id": "youth", + "name": "中青看点", + "keys": ["youthheader_zq", "read_zq", "red_zq", "readtime_zq"], + "author": "@sunert", + "settings": [{ + "id": "notifytimes", + "name": "通知频率 (点击查看设置说明)", + "val": "", + "type": "number", + "desc": "设定通知频率,前三次为全部通知,之后转盘次数/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" + }, { - "id": "notifytimes", - "name": "通知频率 (点击查看设置说明)", - "val": "", - "type": "number", - "desc": "设定通知频率,前三次为全部通知,之后转盘次数/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" - }, - { - "id": "zqlogs", - "name": "调试日志", - "val": false, - "type": "boolean", - "desc": "调试日志开关,默认关闭" - } - ], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js" + "id": "zqlogs", + "name": "调试日志", + "val": false, + "type": "boolean", + "desc": "调试日志开关,默认关闭" + }], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js" }, { - "id": "youthGain", - "name": "中青浏览赚", - "keys": ["youth_start", "youth_end"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js" + "id": "youthGain", + "name": "中青浏览赚", + "keys": ["youth_start", "youth_end"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js" }, { - "id": "dianshijia", - "name": "电视家", - "keys": ["sy_signheader_dsj", "drawal_dsj"], - "author": "@sunert", - "settings": [{ - "id": "REWARD", - "name": "额外签到奖励", - "val": "55", - "type": "radios", - "desc": "", - "items": [{ - "key": "55", - "label": "提现额度" - }, { - "key": "44", - "label": "1天VIP" - }, { - "key": "42", - "label": "1888金币" - }] - }], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js" + "id": "dianshijia", + "name": "电视家", + "keys": ["sy_signheader_dsj", "drawal_dsj"], + "author": "@sunert", + "settings": [{ + "id": "REWARD", + "name": "额外签到奖励", + "val": "55", + "type": "radios", + "desc": "", + "items": [{ + "key": "55", + "label": "提现额度" + }, + { + "key": "44", + "label": "1天VIP" + }, + { + "key": "42", + "label": "1888金币" + }] + }], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js" }, { - "id": "kuaishou", - "name": "快手极速版", - "keys": ["cookie_ks"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", "https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js" + "id": "kuaishou", + "name": "快手极速版", + "keys": ["cookie_ks"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", "https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js" }, { - "id": "sinanews", - "name": "新浪新闻", - "keys": ["sy_signurl_snews", "sy_info_snews", "sy_ck_snews", "sy_infoheader_snews"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js" + "id": "sinanews", + "name": "新浪新闻", + "keys": ["sy_signurl_snews", "sy_info_snews", "sy_ck_snews", "sy_infoheader_snews"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js" }, { - "id": "NOWLIVE", - "name": "NOW直播", - "keys": ["now_qq", "nowqq_cookie"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js" + "id": "NOWLIVE", + "name": "NOW直播", + "keys": ["now_qq", "nowqq_cookie"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js" }, { - "id": "chinatelecomEnquiry", - "name": "电信套餐查询", - "keys": ["china_telecom_authToken_10000", "china_telecom_cookie"], - "settings": [ - { - "id": "Mon", - "name": "查询月份", - "val": "2020-08", - "type": "month", - "desc": "填入账单月份,可查最近六个月,本月账单下月可查" - } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", "https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js" + "id": "chinatelecomEnquiry", + "name": "电信套餐查询", + "keys": ["china_telecom_authToken_10000", "china_telecom_cookie"], + "settings": [{ + "id": "Mon", + "name": "查询月份", + "val": "2020-08", + "type": "month", + "desc": "填入账单月份,可查最近六个月,本月账单下月可查" + }], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", "https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js" }, { - "id": "jddj", - "name": "京东到家", - "keys": ["sy_cookie_dj"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jddj.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", "https://raw.githubusercontent.com/Orz-3/task/master/jddj.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js" + "id": "jddj", + "name": "京东到家", + "keys": ["sy_cookie_dj"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jddj.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", "https://raw.githubusercontent.com/Orz-3/task/master/jddj.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js" }, { - "id": "TVlist", - "name": "电视预告", - "keys": ["c"], - "settings": [{ - "id": "c", - "name": "电视台", - "val": "cctv8", - "type": "text", - "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js" + "id": "TVlist", + "name": "电视预告", + "keys": ["c"], + "settings": [{ + "id": "c", + "name": "电视台", + "val": "cctv8", + "type": "text", + "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" + }], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js" }, { - "id": "moji", - "name": "墨迹天气", - "keys": ["city","citynum","cut","day_desc","hour_desc","index_desc"], - "settings": [{ - "id": "city", - "name": "城市", - "val": "北京", - "type": "text", - "desc": "请填写中文地区" - }, - { - "id": "citynum", - "name": "城市序号", - "val": "", - "type": "number", - "placeholder": "默认1 (点击以展开说明)", - "desc": "选择地区,请填写日志内冒号前的数字序号" - }, - { - "id": "cut", - "name": "精简日志模式", - "val": false, - "type": "boolean", - "desc": "显示详情描述,默认关闭日志" - }, - { - "id": "day_desc", - "name": "每周天气", - "val": true, - "type": "boolean", - "desc": "每周天气接口,可显示6天天气情况" - }, - { - "id": "hour_desc", - "name": "小时天气", - "val": false, - "type": "boolean", - "desc": "未来6小时天气情况" - }, - { - "id": "forty_desc", - "name": "40天预告", - "val": false, - "type": "boolean", - "desc": "未来40天天气预告" - }, - { - "id": "index_desc", - "name": "生活指数", - "val": true, - "type": "boolean", - "desc": "可显示生活指数情况" - }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js" + "id": "moji", + "name": "墨迹天气", + "keys": ["city", "citynum", "cut", "day_desc", "hour_desc", "index_desc"], + "settings": [{ + "id": "city", + "name": "城市", + "val": "北京", + "type": "text", + "desc": "请填写中文地区" + }, + { + "id": "citynum", + "name": "城市序号", + "val": "", + "type": "number", + "placeholder": "默认1 (点击以展开说明)", + "desc": "选择地区,请填写日志内冒号前的数字序号" + }, + { + "id": "cut", + "name": "精简日志模式", + "val": false, + "type": "boolean", + "desc": "显示详情描述,默认关闭日志" + }, + { + "id": "day_desc", + "name": "每周天气", + "val": true, + "type": "boolean", + "desc": "每周天气接口,可显示6天天气情况" + }, + { + "id": "hour_desc", + "name": "小时天气", + "val": false, + "type": "boolean", + "desc": "未来6小时天气情况" + }, + { + "id": "forty_desc", + "name": "40天预告", + "val": false, + "type": "boolean", + "desc": "未来40天天气预告" + }, + { + "id": "index_desc", + "name": "生活指数", + "val": true, + "type": "boolean", + "desc": "可显示生活指数情况" + }], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js" }, { - "id": "jukan", - "name": "聚看点", - "keys": ["jukan_body","jukan_name"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", - "settings": [ - { - "id": "jukan_out", - "name": "自动提现", - "val": false, - "type": "boolean", - "desc": "自动提现开关,请填入提现金额及微信绑定实名,默认关闭" - }, + "id": "jukan", + "name": "聚看点", + "keys": ["jukan_body", "jukan_name"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", + "settings": [{ + "id": "jukan_out", + "name": "自动提现", + "val": false, + "type": "boolean", + "desc": "自动提现开关,请填入提现金额及微信绑定实名,默认关闭" + }, { - "id": "jukan_cash", - "name": "提现金额", - "val": "", - "type": "number", - "placeholder": "默认30 (点击以展开说明)", - "desc": "仅允许填入数字,所选金额可见聚看点APP" + "id": "jukan_cash", + "name": "提现金额", + "val": "", + "type": "number", + "placeholder": "默认30 (点击以展开说明)", + "desc": "仅允许填入数字,所选金额可见聚看点APP" }, { - "id": "jukan_name", - "name": "微信真实姓名", - "val": "", - "type": "text", - "placeholder": "填入微信真实姓名" + "id": "jukan_name", + "name": "微信真实姓名", + "val": "", + "type": "text", + "placeholder": "填入微信真实姓名" }], - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js" + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js" }, { - "id": "mydigit", - "name": "数码之家", - "keys": ["sign_mydigit"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js" + "id": "mydigit", + "name": "数码之家", + "keys": ["sign_mydigit"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js" }, { - "id": "txnews", - "name": "腾讯新闻", - "keys": ["sy_signurl_txnews", "sy_cookie_txnews","video_txnews"], - "author": "@sunert", - "settings": [ - { - "id": "notifynum", - "name": "通知频率", - "val": "", - "type": "number", - "placeholder": "默认50 (点击以展开说明)", - "desc": "阅读篇数间隔通知开为1,常关为0(默认50篇)" + "id": "txnews", + "name": "腾讯新闻", + "keys": ["sy_signurl_txnews", "sy_cookie_txnews", "video_txnews"], + "author": "@sunert", + "settings": [{ + "id": "notifynum", + "name": "通知频率", + "val": "", + "type": "number", + "placeholder": "默认50 (点击以展开说明)", + "desc": "阅读篇数间隔通知开为1,常关为0(默认50篇)" }, { - "id": "delay", - "name": "延迟时间(毫秒)", - "val": "", - "type": "number", - "placeholder": "默认200 (点击以展开说明)", - "desc": "接口延迟时间" - } - ], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", "https://raw.githubusercontent.com/Orz-3/task/master/txnews.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js" + "id": "delay", + "name": "延迟时间(毫秒)", + "val": "", + "type": "number", + "placeholder": "默认200 (点击以展开说明)", + "desc": "接口延迟时间" + }], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", "https://raw.githubusercontent.com/Orz-3/task/master/txnews.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js" }, { - "id": "jingxi", - "name": "京喜", - "keys": ["CookieJD", "CookieJD2"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jingxi.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jingxi.png", "https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js" + "id": "jingxi", + "name": "京喜", + "keys": ["CookieJD", "CookieJD2"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jingxi.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jingxi.png", "https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js" }, { - "id": "translate", - "name": "谷歌翻译", - "keys": [], - "settings": [{ - "id": "word", - "name": "原文", - "val": "Hello World", - "type": "textarea", - "placeholder": "Hello World", - "desc": "兼容中英文短语翻译,填入原文后手动运行" }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", "https://raw.githubusercontent.com/Orz-3/task/master/translate.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js" + "id": "translate", + "name": "谷歌翻译", + "keys": [], + "settings": [{ + "id": "word", + "name": "原文", + "val": "Hello World", + "type": "textarea", + "placeholder": "Hello World", + "desc": "兼容中英文短语翻译,填入原文后手动运行" + }], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", "https://raw.githubusercontent.com/Orz-3/task/master/translate.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js" }, { - "id": "exchange rate", - "name": "汇率换算", - "keys": [], - "settings": [ - { - "id": "froma", - "name": "使用币", - "val": "人民币", - "type": "text", - "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" - }, - { - "id": "toex", - "name": "兑换币", - "val": "港币", - "type": "text", - "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" - }, - { - "id": "numex", - "name": "兑换金额", - "val": "10", - "type": "number", - "desc": "填写数字" - } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", "https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js" + "id": "exchange rate", + "name": "汇率换算", + "keys": [], + "settings": [{ + "id": "froma", + "name": "使用币", + "val": "人民币", + "type": "text", + "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" + }, + { + "id": "toex", + "name": "兑换币", + "val": "港币", + "type": "text", + "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" + }, + { + "id": "numex", + "name": "兑换金额", + "val": "10", + "type": "number", + "desc": "填写数字" + }], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", "https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js" }, { - "id": "trainquery", - "name": "列车时刻", - "keys": [], - "settings": [ - { - "id": "people", - "name": "乘客类型", - "val": "ADULT", - "type": "radios", - "desc": "成人/学生", - "items": [ - { - "key": "ADULT", - "label": "成人" + "id": "trainquery", + "name": "列车时刻", + "keys": [], + "settings": [{ + "id": "people", + "name": "乘客类型", + "val": "ADULT", + "type": "radios", + "desc": "成人/学生", + "items": [{ + "key": "ADULT", + "label": "成人" }, { - "key": "0X00", - "label": "学生" + "key": "0X00", + "label": "学生" }] - }, - { - "id": "left", - "name": "出发站点", - "val": "北京", - "type": "text", - "desc": "填入中文站点" - }, - { - "id": "end", - "name": "目的地", - "val": "上海", - "type": "text", - "desc": "填入中文站点" - }, - { - "id": "leavedate", - "name": "出发时间", - "val": "2020-08-15", - "type": "date", - "desc": "填入出发日期,请按照格式填写" - }, - { - "id": "setrain", - "name": "列车车次", - "val": "G5", - "type": "text", - "desc": "填入列车车次或者列车序号,列车序号请查看日志详情" - } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/12306.png“, ”https://raw.githubusercontent.com/Orz-3/task/master/12306.png“], - ”script“: ”https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js“ + }, + { + "id": "left", + "name": "出发站点", + "val": "北京", + "type": "text", + "desc": "填入中文站点" + }, + { + "id": "end", + "name": "目的地", + "val": "上海", + "type": "text", + "desc": "填入中文站点" + }, + { + "id": "leavedate", + "name": "出发时间", + "val": "2020-08-15", + "type": "date", + "desc": "填入出发日期,请按照格式填写" + }, + { + "id": "setrain", + "name": "列车车次", + "val": "G5", + "type": "text", + "desc": "填入列车车次或者列车序号,列车序号请查看日志详情" + }], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", "https://raw.githubusercontent.com/Orz-3/task/master/12306.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js" } ] } From c54595504a7006ef1fad3b2f1872e58aec5865ea Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 22:57:59 +0800 Subject: [PATCH 353/721] Update dianshijia.yml --- .github/workflows/dianshijia.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/dianshijia.yml b/.github/workflows/dianshijia.yml index a90b36f70b..3e328b1d24 100644 --- a/.github/workflows/dianshijia.yml +++ b/.github/workflows/dianshijia.yml @@ -24,12 +24,10 @@ jobs: node-version: 12.x - name: npm install run: | - cd ~/Scripts npm install - name: '运行 【电视家】' if: env.DSJ_HEADERS run: | - cd ~/Scripts node Task/dianshijia.js env: DSJ_NOTIFY_CONTROL: ${{ secrets.DSJ_NOTIFY_CONTROL }} From ad27d6fc7a9051fca3af44d00311e74f0d15051f Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 23:01:04 +0800 Subject: [PATCH 354/721] Update AUTO_KS.yml --- .github/workflows/AUTO_KS.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/AUTO_KS.yml b/.github/workflows/AUTO_KS.yml index 1225dd834a..a6825800b7 100644 --- a/.github/workflows/AUTO_KS.yml +++ b/.github/workflows/AUTO_KS.yml @@ -24,12 +24,10 @@ jobs: node-version: 12.x - name: npm install run: | - cd ~/Scripts npm install - name: '运行 【快手视频】' if: env.KUAISHOUMV run: | - cd ~/Scripts node Task/Auto_Kuaishou.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} From 3da44e63211ffd2d8617716d43138ff6ababf6cf Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 23:01:40 +0800 Subject: [PATCH 355/721] Update baiduspeed.yml --- .github/workflows/baiduspeed.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/baiduspeed.yml b/.github/workflows/baiduspeed.yml index a30641ebe5..f94e270c21 100644 --- a/.github/workflows/baiduspeed.yml +++ b/.github/workflows/baiduspeed.yml @@ -22,12 +22,10 @@ jobs: node-version: 12.x - name: npm install run: | - cd ~/Scripts npm install - name: '运行 【百度极速】' if: env.BAIDU_COOKIE run: | - cd ~/Scripts node Task/baidu_speed.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} From cd80c68fe6f746617f845a2b487b620606e56b3f Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 23:02:38 +0800 Subject: [PATCH 356/721] Update jingxi.yml --- .github/workflows/jingxi.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/jingxi.yml b/.github/workflows/jingxi.yml index aa84df54b7..73ba8c190f 100644 --- a/.github/workflows/jingxi.yml +++ b/.github/workflows/jingxi.yml @@ -22,12 +22,10 @@ jobs: node-version: 12.x - name: npm install run: | - cd ~/Scripts npm install - name: '运行 【京喜】' if: env.JD_COOKIE run: | - cd ~/Scripts node Task/jingxi.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} From f5e4264357402da7effd9ae08ddd5c3de07e4173 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 23:03:55 +0800 Subject: [PATCH 357/721] Update jukan.yml --- .github/workflows/jukan.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/jukan.yml b/.github/workflows/jukan.yml index e8eb455133..9d3150df54 100644 --- a/.github/workflows/jukan.yml +++ b/.github/workflows/jukan.yml @@ -23,12 +23,10 @@ jobs: node-version: 12.x - name: npm install run: | - cd ~/Scripts npm install - name: '运行 【聚看点】' if: env.JUKAN_BODY run: | - cd ~/Scripts node Task/jukan.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} From ab11a5eac6e62296964bc76c596e688cb7fbd2df Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 23:04:45 +0800 Subject: [PATCH 358/721] Update kuaishou.yml --- .github/workflows/kuaishou.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/kuaishou.yml b/.github/workflows/kuaishou.yml index b68cc17b2d..a2f5157953 100644 --- a/.github/workflows/kuaishou.yml +++ b/.github/workflows/kuaishou.yml @@ -22,12 +22,10 @@ jobs: node-version: 12.x - name: npm install run: | - cd ~/Scripts npm install - name: 运行 【快手视频签到】 if: env.KS_TOKEN run: | - cd ~/Scripts node Task/kuaishou.js env: PUSH_KEY: ${{ secrets.PUSH_KEY || github.event.client_payload.PUSH_KEY }} From b023ad4bf90a5f344ce585a8e8af551a33c571c1 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 23:05:20 +0800 Subject: [PATCH 359/721] Update midu_read.yml --- .github/workflows/midu_read.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/midu_read.yml b/.github/workflows/midu_read.yml index 5ed7d4f8e8..3b2e24c6a2 100644 --- a/.github/workflows/midu_read.yml +++ b/.github/workflows/midu_read.yml @@ -24,12 +24,10 @@ jobs: node-version: 12.x - name: npm install run: | - cd ~/Scripts npm install - name: '运行 【米读自动阅读】' if: env.MIDU_TOKEN run: | - cd ~/Scripts node Task/midu_Read.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} From 7842fecda3634d26fe5bb658fe39d94f493d1a15 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 23:06:00 +0800 Subject: [PATCH 360/721] Update txnews.yml --- .github/workflows/txnews.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/txnews.yml b/.github/workflows/txnews.yml index 02312a1238..11b6d6bf9b 100644 --- a/.github/workflows/txnews.yml +++ b/.github/workflows/txnews.yml @@ -30,12 +30,10 @@ jobs: node-version: 12.x - name: npm install run: | - cd ~/Scripts npm install - name: '运行 【腾讯新闻】' if: env.TXNEWS_COOKIE run: | - cd ~/Scripts node Task/txnews.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} From 0041e346503fb4a697761e4e715e72c2dd0cf74b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 23:06:31 +0800 Subject: [PATCH 361/721] Update weibo.yml --- .github/workflows/weibo.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/weibo.yml b/.github/workflows/weibo.yml index 5f2b2ff921..5c130b5480 100644 --- a/.github/workflows/weibo.yml +++ b/.github/workflows/weibo.yml @@ -24,12 +24,10 @@ jobs: - name: npm install if: env.WB_TOKEN run: | - cd ~/Scripts npm install - name: '运行 【新浪微博】' if: env.WB_TOKEN run: | - cd ~/Scripts node Task/weibo.js env: PUSH_KEY: ${{ secrets.PUSH_KEY }} From a0dcc74b385b2f6a881dfd7a145427b8cb0580b0 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 3 Jan 2021 23:07:12 +0800 Subject: [PATCH 362/721] Update youth.yml --- .github/workflows/youth.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index 9ec6587ddc..f2a09addb3 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -29,12 +29,10 @@ jobs: - name: npm install if: env.YOUTH_HEADER run: | - cd ~/Scripts npm install - name: '运行 【中青看点】' if: env.YOUTH_HEADER run: | - cd ~/Scripts node Task/youth.js env: YOUTH_NOTIFY_CONTROL: ${{ secrets.YOUTH_NOTIFY_CONTROL }} From 37b336b0c2ac60aa8bc54801f8018233f9dc9242 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 4 Jan 2021 11:50:35 +0800 Subject: [PATCH 363/721] Update youth.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改95 --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 3ca4e0f38c..844af64874 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -203,7 +203,7 @@ if (rotaryres.status !== 0&&rotaryres.data.doubleNum !== 0){ await earningsInfo(); await showmsg(); if ($.isNode()&&rotaryres.code !== '10010') - if( rotarytimes && rotarytimes%90 == 0 && cash >= 10){ + if( rotarytimes && rotarytimes%95 == 0 && cash >= 10){ await notify.sendNotify($.name + " " + nick, "您的余额约为"+cash+"元,已可以提现"+'\n'+`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n${detail}`) } } From 4d54bb5c0a362016c5d810e080ee3e112c43939f Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 5 Jan 2021 09:04:28 +0800 Subject: [PATCH 364/721] Update youth.js --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 844af64874..40b56754a8 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -203,7 +203,7 @@ if (rotaryres.status !== 0&&rotaryres.data.doubleNum !== 0){ await earningsInfo(); await showmsg(); if ($.isNode()&&rotaryres.code !== '10010') - if( rotarytimes && rotarytimes%95 == 0 && cash >= 10){ + if( rotarytimes && (100-rotarytimes)%95 == 0 && cash >= 10){ await notify.sendNotify($.name + " " + nick, "您的余额约为"+cash+"元,已可以提现"+'\n'+`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n${detail}`) } } From c0ddda94dcc80ed780d6794ceb6d93103fd970e2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 7 Jan 2021 18:30:05 +0800 Subject: [PATCH 365/721] Update youth.yml --- .github/workflows/youth.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index f2a09addb3..3d14055666 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -6,7 +6,7 @@ name: 中青看点 on: workflow_dispatch: schedule: - - cron: '*/35 * * * *' + - cron: '*/28 * * * *' watch: types: started From c949c121be3b60204e2e02491f141a2e8eb5a723 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 13 Jan 2021 21:37:14 +0800 Subject: [PATCH 366/721] Update youth.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 取消每日打卡 --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 40b56754a8..ec91ca9576 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -158,7 +158,7 @@ if (isGetCookie = typeof $request !== 'undefined') { await signInfo(); await friendsign(); if($.time('HH')>12){ - await punchCard() + //await punchCard() }; if ($.isNode()&& $.time('HH')>20&&$.time('HH')<22){ await endCard(); From e5a238dbca9af223a9b7d6af4eaac1cf0dc9da79 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 13 Jan 2021 21:46:24 +0800 Subject: [PATCH 367/721] Update youth.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改每15分钟运行一次 --- .github/workflows/youth.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index 3d14055666..a1508a8a30 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -6,7 +6,7 @@ name: 中青看点 on: workflow_dispatch: schedule: - - cron: '*/28 * * * *' + - cron: '*/15 * * * *' watch: types: started From 55669200e4d557c7150de636598df088ef1a2b06 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 18:43:27 +0800 Subject: [PATCH 368/721] Update txnews.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化 --- Task/txnews.js | 212 +++++++++++++++++-------------------------------- 1 file changed, 71 insertions(+), 141 deletions(-) diff --git a/Task/txnews.js b/Task/txnews.js index 16cecfdbb1..df202c507b 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -1,6 +1,6 @@ /* -更新时间: 2021-1-1 00:50 +更新时间: 2021-1-22 18:50 腾讯新闻签到修改版,可以自动阅读文章获取红包,该活动为瓜分百万现金挑战赛,针对幸运用户参与 @@ -47,14 +47,13 @@ Cookie获取后,请注释掉Cookie地址。 */ const $ = new Env('腾讯新闻'); const notify = $.isNode() ? require('./sendNotify') : ''; -let s = parseInt($.getdata('delay'))||200 // 间隔延迟时间 let notifyInterval =$.getdata('notifynum')||50; //阅读篇数间隔通知开为1,常关为0; const TX_HOST = 'https://api.inews.qq.com/activity/v1/' let SignArr = [],SignUrl = ""; cookiesArr = [],CookieTxnews = ""; VideoArr = [],SignUrl = "",order = "", detail = ``, subTitle = ``; - +let read_finish = "",video_finish=""; if ($.isNode()) { if (process.env.TXNEWS_COOKIE && process.env.TXNEWS_COOKIE.indexOf('&') > -1) { CookieTxnews = process.env.TXNEWS_COOKIE.split('&'); @@ -113,31 +112,19 @@ if (isGetCookie) { videoVal = VideoArr[i]; $.index = i + 1; console.log(`-------------------------\n\n开始【腾讯新闻账号${$.index}】`) - } ID = signurlVal.match(/devid=[a-zA-Z0-9_-]+/g)[0] token = signurlVal.split("&mac")[1] await getsign(); await activity(); - await toRead(); - await $.wait(3000) - await lookVideo(); - await redrain(); - await StepsTotal(); - if(getreadred != 0){ - redbody = `redpack_type=article&activity_id=${actid}` - await Redpack() - }; - if(getvideored != 0){ - redbody = `redpack_type=video&activity_id=${actid}` - await Redpack() - }; await getTotal(); + await StepsTotal(); await showmsg(); if ($.isNode()){ if (readnum%notifyInterval==0&&cashtotal > 2){ await notify.sendNotify($.name,subTile+'\n'+detail) + } } - } + } } })() .catch((e) => $.logErr(e)) @@ -176,8 +163,7 @@ function getsign() { tip = obj.data.tip_soup||obj.data.share_tip imgurl= obj.data.share_img Dictum = tip.replace(/[\<|\.|\>|br]/g,"")+""+obj.data.author.replace(/[\<|\.|\>|br|图|腾讯网友]/g,"") - signinfo = '【签到信息】连续签到' + obj.data.signin_days+'天 '+'明日+'+ next +'金币 成功🎉\n'} - else { + signinfo = '【签到信息】连续签到' + obj.data.signin_days+'天 '+'明日+'+ next +'金币 成功🎉\n'} else { $.msg('签到失败,🉐登录腾讯新闻app获取cookie', "", "") console.log('签到失败,🉐登录腾讯新闻app获取cookie'+data) return @@ -189,175 +175,120 @@ function getsign() { function activity() { return new Promise((resolve, reject) => { - setTimeout(()=>{ $.get({url:`${TX_HOST}user/activity/get?isJailbreak=0&${ID}`, headers: {Cookie:cookieVal}}, (error,response, data) =>{ try{ - let obj = JSON.parse(data) - actid = obj.data.activity.id - console.log(`\n您的活动ID为: `+actid+"\n") + let obj = JSON.parse(data) + actid = obj.data.activity.id + console.log(`\n您的活动ID为: `+actid+"\n🍻开始阅读任务\n") } catch(error){ - $.msg("获取活动ID失败,详情请看日志","","") + $.msg($.name, "获取活动ID失败,详情请看日志","","") console.log("活动ID日志:"+ data) + return } resolve() }) - },s) }) } //阅读阶梯 -function toRead() { +function toRead(urlVal,body) { return new Promise((resolve, reject) => { - setTimeout(()=>{ - $.post({url: signurlVal, headers: {Cookie:cookieVal}, body: 'event=article_read'},(error, resp, data)=> { + $.post({url: urlVal, headers: {Cookie:cookieVal}, body: body},(error, resp, data)=> { try{ let obj = JSON.parse(data) if(obj.ret == 0){ - console.log("本次阅读领取" +obj.data.countdown_timer.countdown_tips+"\n") + console.log("本次阅读成功,获取收益" +obj.data.countdown_timer.countdown_tips+"\n") + } else if(body.indexOf("article")>-1){console.log("本次阅读文章失败," +obj.info+"\n") + }else if(body.indexOf("video")>-1){console.log("本次观看视频失败," +obj.info+"\n") } } catch(error){ console.log("本次阅读失败"+data+"\n") } resolve() }) - },s) - }) -} -function lookVideo() { - return new Promise((resolve, reject) => { - setTimeout(()=>{ - $.post({url: videoVal, headers: {Cookie:cookieVal},body: 'event=video_read'},(error, response, data) =>{ - try{ - let obj = JSON.parse(data) - if(obj.ret == 0){ - console.log("本次视频领取" +obj.data.countdown_timer.countdown_tips+"\n") - } - } catch(error){ - console.log("观看视频失败"+data+"\n") - } - resolve() - }) - },s*2) - }) -} -function redrain() { - return new Promise((resolve, reject) => { - $.post({url: `https://api.prize.qq.com/v1/newsapp/fireworks/fw_202012/outer_get/KIJ1Q0FD57W0`, headers: {Cookie:cookieVal,"Referer": "https://gh.prize.qq.com/h5/fireworks/send.html?_addparams=%7B%22id%22%3A%22KIJ1Q0FD57W0%22%7D"}},(error, resp, data) =>{ - //console.log(data) - if(resp.statusCode !== 403){ - try { - let openres = JSON.parse(data) - if (openres.message == "success" ){ - } - } catch(error){ - console.log("分享失败:"+ data) } - } - resolve() - }) - }) + }) } -function OrderID() { - return new Promise((resolve, reject) => { - $.post({url: `https://api.prize.qq.com/v1/newsapp/rp/common?isJailbreak=0&mac=${token}`, headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded"},body: 'actFrom=wxplugin&actEname=newsapp_cj'},(error, response, data) =>{ - //console.log(data) - if(response.statusCode !== 403){ - try { - let openres = JSON.parse(data) - if (openres.code == 0 ){ - meney = openres.data.money/100 - order = openres.data.orderID - console.log(` 看新闻,领红包,到账: `+meney+'元\n') - } - } catch(error){ - console.log("打开看新闻,领红包失败:"+ data) } - } - resolve() - }) - }) -} -function Pending() { - console.log(order) - return new Promise((resolve, reject) => { - $.post({url: `https://api.prize.qq.com/v1/newsapp/rp/get_pending?isJailbreak=0&mac=${token}`, - headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded"}, - body: `orderID=${order}`},(error, response, data) =>{ - //console.log(data) - if (response.statusCode !== 403){ - try { - let res = JSON.parse(data) - if (res.code == 0 ){ - console.log( '看新闻,领红包领取成功\n') - } - } catch(error){ - console.log("看新闻,领红包失败:"+ data) - } - } - resolve() - }) - }) -} //阅读文章统计 function StepsTotal() { return new Promise((resolve, reject) => { - setTimeout(()=>{ const StepsUrl = { url: `${TX_HOST}activity/info/get?activity_id=${actid}&${ID}`, headers: {Cookie: cookieVal} } - $.get(StepsUrl, (error, response, data) => { + $.get(StepsUrl, async(error, response, data) => { totalred = JSON.parse(data) totalcion = totalred.data.extends.today_total_coin if (totalred.ret == 0){ - for (i=0;i { - setTimeout(()=>{ const cashUrl = { url: `${TX_HOST}activity/redpack/get?isJailbreak=0&mac=${token}`, - headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded","User-Agent": "QQNews/6.3.40 (iPhone; iOS 14.2; Scale/3.00)"}, - body: redbody + headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded","User-Agent": "QQNews/6.3.91 (iPhone; iOS 14.2; Scale/3.00)","Referer": "http://inews.qq.com/inews/iphone/"}, + body: `redpack_type=${red_body}&activity_id=${actid}` } - $.post(cashUrl, (error, response, data) => { let rcash = JSON.parse(data) - console.log(data) try{ if(rcash.data.award.length == 1){ redpacks = rcash.data.award.num/100 - if (rcash.ret == 0&&redpacks>0&&getreadred > 0){ + if (rcash.ret == 0&&redpacks>0&&red_body=="article"){ redpackres = `【阅读红包】到账`+redpacks+`元 🌷\n` $.log("阅读红包到账"+redpacks+"元\n") } - else if (rcash.ret == 0&& redpacks >0){ + else if (rcash.ret == 0&& redpacks >0&&red_body=="video"){ redpackres = `【视频红包】到账`+redpacks+`元 🌷\n` $.log("视频红包到账"+redpacks+"元\n") } @@ -371,7 +302,6 @@ function Redpack() { }; resolve() }) - },s) }) } @@ -397,16 +327,16 @@ function getTotal() { function showmsg() { return new Promise((resolve, reject) => { - if(readnum||videonum){ - detail = signinfo + `【文章阅读】已读/再读: `+ readnum +`/`+readtitle+` 篇\n`+`【阅读红包】已开/总计: `+openreadred+`/`+readredtotal+` 个🧧\n`+ `【观看视频】已看/再看: `+ videonum +`/`+videotitle+` 分钟\n`+`【视频红包】已开/总计: `+openvideored+`/`+videoredtotal+` 个🧧\n【每日一句】`+Dictum + if(read_info||video_info){ + detail = signinfo +read_info +"\n"+video_info+`\n【每日一句】`+Dictum } - console.log($.name+'\n'+subTile+'\n'+ detail) - if (readnum%notifyInterval==0){ + if (readnum&&readnum%notifyInterval==0){ $.msg($.name,subTile,detail,{ 'open-url': "https://news.qq.com/FERD/cjRedDown.htm", 'media-url': imgurl } ) - } - else if (openreadred==readredtotal&&openvideored==videoredtotal){ + } else if (video_finish&&read_finish){ $.msg($.name+` 今日任务已完成✅`,subTile,detail,{ 'open-url': "https://news.qq.com/FERD/cjRedDown.htm", 'media-url': imgurl } ) - } + } else { + console.log($.name+'\n'+subTile+'\n'+ detail) +} resolve() }) } From cae3a3123f694f1180107cfbb488f53af5071edd Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 20:40:31 +0800 Subject: [PATCH 369/721] Create txnews_task.js --- Task/txnews_task.js | 106 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 Task/txnews_task.js diff --git a/Task/txnews_task.js b/Task/txnews_task.js new file mode 100644 index 0000000000..71c2131aa3 --- /dev/null +++ b/Task/txnews_task.js @@ -0,0 +1,106 @@ +/* +更新时间: 2020-12-06 15:46 +赞赏:快手邀请码`774010415`,农妇山泉 -> 有点咸,万分感谢 +Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 + +请自行抓包,刷视频即,可获得更多包数据,抓包地址为"http://ali2.a.yximgs.com/ksc1/xxxxxx.kpg",在Github Actions中的Secrets新建name为'KUAISHOUMV'的一个值,拷贝抓包的请求体到下面Value的文本框中,本脚本不包含任何推送通知 + +多个请求时用'#'号或者换行隔开" ‼️ + +*/ + +const $ = new Env("腾讯新闻阅读") + +let RdUrl = [], VdUrl = []; + if (process.env.TX_READ && process.env.TX_READ.indexOf('#') > -1) { + RdUrl = process.env.TX_READ.split('#'); + console.log(`您选择的是用"#"隔开\n`) + } + else if (process.env.TX_READ && process.env.TX_READ.indexOf('\n') > -1) { + RdUrl = process.env.TX_READ.split('\n'); + console.log(`您选择的是用换行隔开\n`) + } else { + RdUrl = process.env.TX_READ + } + if (process.env.TX_VIDEO && process.env.TX_VIDEO.indexOf('#') > -1) { + VdUrl = process.env.TX_VIDEO.split('#'); + console.log(`您选择的是用"#"隔开\n`) + } + else if (process.env.TX_VIDEO && process.env.TX_VIDEO.indexOf('\n') > -1) { + VdUrl = process.env.TX_VIDEO.split('\n'); + console.log(`您选择的是用换行隔开\n`) + } else { + VdUrl = process.env.TX_VIDEO + } + Object.keys(RdUrl).forEach((item) => { + if (RdUrl[item]) { + RdArr.push(RdUrl[item]) + } + }) + Object.keys(VdUrl).forEach((item) => { + if (VdUrl[item]) { + VdArr.push(VdUrl[item]) + } + }) + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + +!(async () => { + if (process.env.TX_CK){ + Cookieval = process.env.TX_CK + } + if (!Cookieval && (!RdArr || !VdUrl)) { + console.log($.name, '【提示】请把腾讯Ck和任务链接填入Github 的 Secrets 中,请以#或者换行隔开') + return; + } + if(RdArr){ + for (let i = 0; i < RdArr.length; i++) { + console.log("共"+RdArr.length+"次阅读任务") + TaskUrl = RdArr[i]; + body = "event=article_read" + $.index = i + 1; + console.log(`-------------------------\n\n开始腾讯新闻第${$.index}次阅读`) + await AutoRead(); + await $.wait(10000); + console.log(`\n 请等待10s后继续视频${$.index}第${i+1}次任务`) + } + console.log(`-------------------------\n\n腾讯新闻共完成阅读任务(${$.index})次,阅读金币详情见App,任务全部结束`) + } + if(VdArr){ + for (let j = 0; j < VdArr.length; j++) { + console.log("共"+VdArr.length+"次阅读任务") + TaskUrl = RdArr[i]; + body = "event=video_read" + $.index = j + 1; + console.log(`-------------------------\n\n开始腾讯新闻第${$.index}次阅读`) + await AutoRead(); + await $.wait(10000); + console.log(`\n 请等待10s后继续视频${$.index}第${j+1}次任务`) + } + console.log(`-------------------------\n\n共完成视频任务(${$.index})次,视频金币详情见App,任务全部结束`) +} +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + +function AutoRead(){ + return new Promise((resolve, reject) => { + $.post({url: TaskUrl, + headers: {Cookie:Cookieval}, + body: body},(error, resp, data)=> { + try{ + let obj = JSON.parse(data) + if(obj.ret == 0){ + console.log("本次阅读成功,获取收益" +obj.data.countdown_timer.countdown_tips+"\n") + } else if(body.indexOf("article")>-1){console.log("本次阅读文章失败," +obj.info+"\n") + }else if(body.indexOf("video")>-1){console.log("本次观看视频失败," +obj.info+"\n") + } + } catch(error){ + console.log("本次阅读失败"+data+"\n") + } + resolve() + }) + }) +} + +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 9dbe0b0e068417b00a9552098a06adc90c84d986 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 20:58:33 +0800 Subject: [PATCH 370/721] Create txnews_auto.yml --- .github/workflows/txnews_auto.yml | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/txnews_auto.yml diff --git a/.github/workflows/txnews_auto.yml b/.github/workflows/txnews_auto.yml new file mode 100644 index 0000000000..3482968c18 --- /dev/null +++ b/.github/workflows/txnews_auto.yml @@ -0,0 +1,54 @@ +# 快手视频刷金币测试,抓包获取secrets + +name: 腾讯新闻自动阅读 + +on: + workflow_dispatch: + schedule: + - cron: '*/30 2,8,16 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + TX_CK: ${{ secrets.TX_CK }} + TX_CK2: ${{ secrets.TX_CK2 }} + TZ: Asia/shanghai + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + npm install + - name: '运行 【腾讯新闻自动阅读一】' + if: secrets.TX_CK + run: | + node Task/txnews_task.js + env: + TX_CK: ${{ secrets.TX_CK }} + TX_READ: ${{ secrets.TX_READ }} + TX_VIDEO: ${{ secrets.TX_VIDEO }} + + - name: '运行 【腾讯新闻自动阅读二】' + if: env.TX_CK2 + run: | + node Task/txnews_task.js + env: + TX_CK: ${{ secrets.TX_CK2 }} + TX_READ: ${{ secrets.TX_READ }} + TX_VIDEO: ${{ secrets.TX_VIDEO }} + + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} From f620994c38d9e66b3e157984cea7954851b51052 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 21:04:20 +0800 Subject: [PATCH 371/721] Update txnews_auto.yml --- .github/workflows/txnews_auto.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/txnews_auto.yml b/.github/workflows/txnews_auto.yml index 3482968c18..81eea2935d 100644 --- a/.github/workflows/txnews_auto.yml +++ b/.github/workflows/txnews_auto.yml @@ -44,11 +44,4 @@ jobs: TX_READ: ${{ secrets.TX_READ }} TX_VIDEO: ${{ secrets.TX_VIDEO }} - env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} + From 79f47740143027a9a2b3882ca0692d346c020240 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 21:05:37 +0800 Subject: [PATCH 372/721] Update txnews_auto.yml --- .github/workflows/txnews_auto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/txnews_auto.yml b/.github/workflows/txnews_auto.yml index 81eea2935d..34879b3579 100644 --- a/.github/workflows/txnews_auto.yml +++ b/.github/workflows/txnews_auto.yml @@ -27,7 +27,7 @@ jobs: run: | npm install - name: '运行 【腾讯新闻自动阅读一】' - if: secrets.TX_CK + if: env.TX_CK run: | node Task/txnews_task.js env: From bf675d378b7aa2b0f536f1002d1b5469d9e65f2c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 21:09:25 +0800 Subject: [PATCH 373/721] Update txnews_task.js --- Task/txnews_task.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/txnews_task.js b/Task/txnews_task.js index 71c2131aa3..2ca6136ece 100644 --- a/Task/txnews_task.js +++ b/Task/txnews_task.js @@ -11,7 +11,7 @@ Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk030 const $ = new Env("腾讯新闻阅读") -let RdUrl = [], VdUrl = []; +let RdArr = [], Arr = []; if (process.env.TX_READ && process.env.TX_READ.indexOf('#') > -1) { RdUrl = process.env.TX_READ.split('#'); console.log(`您选择的是用"#"隔开\n`) From 0b0e202a6b23f65f50b7d8d849f943685a26b8c6 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 21:13:05 +0800 Subject: [PATCH 374/721] Update txnews_task.js --- Task/txnews_task.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/txnews_task.js b/Task/txnews_task.js index 2ca6136ece..f9eeab6d89 100644 --- a/Task/txnews_task.js +++ b/Task/txnews_task.js @@ -11,7 +11,7 @@ Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk030 const $ = new Env("腾讯新闻阅读") -let RdArr = [], Arr = []; +let RdArr = [], VdArr = []; if (process.env.TX_READ && process.env.TX_READ.indexOf('#') > -1) { RdUrl = process.env.TX_READ.split('#'); console.log(`您选择的是用"#"隔开\n`) From b6575f24a98a1862f686940d2bf3528423e3a42f Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 21:33:17 +0800 Subject: [PATCH 375/721] Update txnews_task.js --- Task/txnews_task.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Task/txnews_task.js b/Task/txnews_task.js index f9eeab6d89..04874adb40 100644 --- a/Task/txnews_task.js +++ b/Task/txnews_task.js @@ -59,25 +59,29 @@ let RdArr = [], VdArr = []; TaskUrl = RdArr[i]; body = "event=article_read" $.index = i + 1; - console.log(`-------------------------\n\n开始腾讯新闻第${$.index}次阅读`) + for(p=0;p<3;p++){ + console.log(`-------------------------\n\n开始腾讯新闻${$.index}第${p}次阅读`) await AutoRead(); await $.wait(10000); - console.log(`\n 请等待10s后继续视频${$.index}第${i+1}次任务`) + console.log(`\n 请等待10s后继续视频${$.index}第${p+1}次任务`) + } } - console.log(`-------------------------\n\n腾讯新闻共完成阅读任务(${$.index})次,阅读金币详情见App,任务全部结束`) + console.log(`-------------------------\n\n腾讯新闻共完成阅读任务(${$.index}*3)次,阅读金币详情见App,任务全部结束`) } if(VdArr){ - for (let j = 0; j < VdArr.length; j++) { + for (var j = 0; j < VdArr.length; j++) { console.log("共"+VdArr.length+"次阅读任务") - TaskUrl = RdArr[i]; + TaskUrl = VdArr[j]; body = "event=video_read" $.index = j + 1; - console.log(`-------------------------\n\n开始腾讯新闻第${$.index}次阅读`) + for(k=0;k<3;k++){ + console.log(`-------------------------\n\n开始腾讯新闻${$.index}第${k}次看视频`) await AutoRead(); await $.wait(10000); - console.log(`\n 请等待10s后继续视频${$.index}第${j+1}次任务`) + console.log(`\n 请等待10s后继续视频${$.index}第${k+1}次任务`) + } } - console.log(`-------------------------\n\n共完成视频任务(${$.index})次,视频金币详情见App,任务全部结束`) + console.log(`-------------------------\n\n共完成视频任务(${$.index}*3)次,视频金币详情见App,任务全部结束`) } })() .catch((e) => $.logErr(e)) From dc2c11f7e2fe7622921a2ca0204bd9f549cb3c63 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 21:39:05 +0800 Subject: [PATCH 376/721] Update txnews_task.js --- Task/txnews_task.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/txnews_task.js b/Task/txnews_task.js index 04874adb40..d7c72f3622 100644 --- a/Task/txnews_task.js +++ b/Task/txnews_task.js @@ -69,6 +69,7 @@ let RdArr = [], VdArr = []; console.log(`-------------------------\n\n腾讯新闻共完成阅读任务(${$.index}*3)次,阅读金币详情见App,任务全部结束`) } if(VdArr){ + $.log(VdArr) for (var j = 0; j < VdArr.length; j++) { console.log("共"+VdArr.length+"次阅读任务") TaskUrl = VdArr[j]; From baf73ad3fa484c82a5979092fd97e51f31d5696a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 21:47:15 +0800 Subject: [PATCH 377/721] Update txnews_task.js --- Task/txnews_task.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Task/txnews_task.js b/Task/txnews_task.js index d7c72f3622..856ac7ae4c 100644 --- a/Task/txnews_task.js +++ b/Task/txnews_task.js @@ -60,29 +60,29 @@ let RdArr = [], VdArr = []; body = "event=article_read" $.index = i + 1; for(p=0;p<3;p++){ - console.log(`-------------------------\n\n开始腾讯新闻${$.index}第${p}次阅读`) + console.log(`-------------------------\n\n开始腾讯新闻${$.index}第${p+1}次阅读`) await AutoRead(); + console.log(`请等待10s后继续阅读${$.index}第${p+2}次任务`) await $.wait(10000); - console.log(`\n 请等待10s后继续视频${$.index}第${p+1}次任务`) } } console.log(`-------------------------\n\n腾讯新闻共完成阅读任务(${$.index}*3)次,阅读金币详情见App,任务全部结束`) } - if(VdArr){ + if(VdArr!==[]){ $.log(VdArr) for (var j = 0; j < VdArr.length; j++) { console.log("共"+VdArr.length+"次阅读任务") TaskUrl = VdArr[j]; body = "event=video_read" - $.index = j + 1; + $.vdindex = j + 1; for(k=0;k<3;k++){ - console.log(`-------------------------\n\n开始腾讯新闻${$.index}第${k}次看视频`) + console.log(`-------------------------\n\n开始腾讯新闻${$.vdindex}第${k+1}次看视频`) await AutoRead(); + console.log(`请等待10s后继续视频${$.vdindex}第${k+2}次任务`) await $.wait(10000); - console.log(`\n 请等待10s后继续视频${$.index}第${k+1}次任务`) } } - console.log(`-------------------------\n\n共完成视频任务(${$.index}*3)次,视频金币详情见App,任务全部结束`) + console.log(`-------------------------\n\n共完成视频任务(${$.vdindex}*3)次,视频金币详情见App,任务全部结束`) } })() .catch((e) => $.logErr(e)) From edd0d10e4eb21f011b05dec1ff05c2412006026a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 21:53:01 +0800 Subject: [PATCH 378/721] Update txnews_task.js --- Task/txnews_task.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Task/txnews_task.js b/Task/txnews_task.js index 856ac7ae4c..14d40371e6 100644 --- a/Task/txnews_task.js +++ b/Task/txnews_task.js @@ -62,8 +62,8 @@ let RdArr = [], VdArr = []; for(p=0;p<3;p++){ console.log(`-------------------------\n\n开始腾讯新闻${$.index}第${p+1}次阅读`) await AutoRead(); - console.log(`请等待10s后继续阅读${$.index}第${p+2}次任务`) - await $.wait(10000); + console.log(`请等待30s后继续阅读${$.index}第${p+2}次任务`) + await $.wait(30000); } } console.log(`-------------------------\n\n腾讯新闻共完成阅读任务(${$.index}*3)次,阅读金币详情见App,任务全部结束`) @@ -78,8 +78,8 @@ let RdArr = [], VdArr = []; for(k=0;k<3;k++){ console.log(`-------------------------\n\n开始腾讯新闻${$.vdindex}第${k+1}次看视频`) await AutoRead(); - console.log(`请等待10s后继续视频${$.vdindex}第${k+2}次任务`) - await $.wait(10000); + console.log(`请等待32s后继续视频${$.vdindex}第${k+2}次任务`) + await $.wait(32000); } } console.log(`-------------------------\n\n共完成视频任务(${$.vdindex}*3)次,视频金币详情见App,任务全部结束`) From c70a6787397588c27838cd076533c478612f2a07 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 22:10:05 +0800 Subject: [PATCH 379/721] Update txnews_task.js --- Task/txnews_task.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Task/txnews_task.js b/Task/txnews_task.js index 14d40371e6..e5a8d81bc8 100644 --- a/Task/txnews_task.js +++ b/Task/txnews_task.js @@ -60,13 +60,13 @@ let RdArr = [], VdArr = []; body = "event=article_read" $.index = i + 1; for(p=0;p<3;p++){ - console.log(`-------------------------\n\n开始腾讯新闻${$.index}第${p+1}次阅读`) + console.log(`-------------------------\n\n开始腾讯新闻第${$.index}次阅读`) await AutoRead(); - console.log(`请等待30s后继续阅读${$.index}第${p+2}次任务`) - await $.wait(30000); + console.log(`请等待5s后继续阅读第${$.index+1}次任务`) + await $.wait(5000); } } - console.log(`-------------------------\n\n腾讯新闻共完成阅读任务(${$.index}*3)次,阅读金币详情见App,任务全部结束`) + console.log(`-------------------------\n\n腾讯新闻共完成阅读任务(${$.index})次,阅读金币详情见App,阅读任务全部结束`) } if(VdArr!==[]){ $.log(VdArr) @@ -81,8 +81,8 @@ let RdArr = [], VdArr = []; console.log(`请等待32s后继续视频${$.vdindex}第${k+2}次任务`) await $.wait(32000); } + console.log(`-------------------------\n\n共完成视频任务(${$.vdindex}*3)次,视频金币详情见App,视频任务全部结束`) } - console.log(`-------------------------\n\n共完成视频任务(${$.vdindex}*3)次,视频金币详情见App,任务全部结束`) } })() .catch((e) => $.logErr(e)) From c0de55792febee30bc622b744891120a9f0304fa Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 22:38:50 +0800 Subject: [PATCH 380/721] Update txnews_auto.yml --- .github/workflows/txnews_auto.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/txnews_auto.yml b/.github/workflows/txnews_auto.yml index 34879b3579..a5df3a23be 100644 --- a/.github/workflows/txnews_auto.yml +++ b/.github/workflows/txnews_auto.yml @@ -26,7 +26,7 @@ jobs: - name: npm install run: | npm install - - name: '运行 【腾讯新闻自动阅读一】' + - name: '运行 【腾讯新闻自动阅读账号一】' if: env.TX_CK run: | node Task/txnews_task.js @@ -35,7 +35,7 @@ jobs: TX_READ: ${{ secrets.TX_READ }} TX_VIDEO: ${{ secrets.TX_VIDEO }} - - name: '运行 【腾讯新闻自动阅读二】' + - name: '运行 【腾讯新闻自动阅读账号二】' if: env.TX_CK2 run: | node Task/txnews_task.js From 432809810822dff8f6bbdc96ff0b33be04b0ca0c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 22:40:34 +0800 Subject: [PATCH 381/721] Update txnews_auto.yml --- .github/workflows/txnews_auto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/txnews_auto.yml b/.github/workflows/txnews_auto.yml index a5df3a23be..0c81997140 100644 --- a/.github/workflows/txnews_auto.yml +++ b/.github/workflows/txnews_auto.yml @@ -1,4 +1,4 @@ -# 快手视频刷金币测试,抓包获取secrets + name: 腾讯新闻自动阅读 From 660037048c36e88d1e63093f16f5aafadd5431b3 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 22:54:43 +0800 Subject: [PATCH 382/721] Update txnews_task.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 测试腾讯新闻单独跑阅读任务 --- Task/txnews_task.js | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/Task/txnews_task.js b/Task/txnews_task.js index e5a8d81bc8..44c0aba334 100644 --- a/Task/txnews_task.js +++ b/Task/txnews_task.js @@ -1,11 +1,10 @@ /* -更新时间: 2020-12-06 15:46 -赞赏:快手邀请码`774010415`,农妇山泉 -> 有点咸,万分感谢 -Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 +更新时间: 2021-01-22 22:46 -请自行抓包,刷视频即,可获得更多包数据,抓包地址为"http://ali2.a.yximgs.com/ksc1/xxxxxx.kpg",在Github Actions中的Secrets新建name为'KUAISHOUMV'的一个值,拷贝抓包的请求体到下面Value的文本框中,本脚本不包含任何推送通知 +Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 -多个请求时用'#'号或者换行隔开" ‼️ +获取secrects方法和腾讯新闻签到任务相同,TX_CK即腾讯新闻Cookie,TX_READ即sy_signurl_txnews阅读任务地址,TX_VIDEO即video_txnews视频地址;其中TX_CK只能填一个账号secrects,其他链接地址可用#或换行隔开,多账号任务链接可共用阅读和视频地址 +拷贝抓包的请求体到下面Value的文本框中,本脚本不包含任何推送通知 */ @@ -54,35 +53,32 @@ let RdArr = [], VdArr = []; return; } if(RdArr){ + console.log("共"+RdArr.length+"次阅读任务") for (let i = 0; i < RdArr.length; i++) { - console.log("共"+RdArr.length+"次阅读任务") TaskUrl = RdArr[i]; body = "event=article_read" $.index = i + 1; - for(p=0;p<3;p++){ console.log(`-------------------------\n\n开始腾讯新闻第${$.index}次阅读`) await AutoRead(); console.log(`请等待5s后继续阅读第${$.index+1}次任务`) await $.wait(5000); - } } console.log(`-------------------------\n\n腾讯新闻共完成阅读任务(${$.index})次,阅读金币详情见App,阅读任务全部结束`) } - if(VdArr!==[]){ - $.log(VdArr) + if(VdArr){ + console.log("共"+VdArr.length+"次视频任务") for (var j = 0; j < VdArr.length; j++) { - console.log("共"+VdArr.length+"次阅读任务") + TaskUrl = VdArr[j]; body = "event=video_read" $.vdindex = j + 1; - for(k=0;k<3;k++){ - console.log(`-------------------------\n\n开始腾讯新闻${$.vdindex}第${k+1}次看视频`) + console.log(`-------------------------\n\n开始腾讯新闻第${$.vdindex}次看视频`) await AutoRead(); - console.log(`请等待32s后继续视频${$.vdindex}第${k+2}次任务`) - await $.wait(32000); + console.log(`请等待5s后继续视频第$.vdindex次任务`) + await $.wait(5000); } - console.log(`-------------------------\n\n共完成视频任务(${$.vdindex}*3)次,视频金币详情见App,视频任务全部结束`) } + console.log(`-------------------------\n\n共完成视频任务(${$.vdindex})次,视频金币详情见App,视频任务全部结束`) } })() .catch((e) => $.logErr(e)) From 17c3dd22d912df1b69b72cbe4211aeb779e1f4b7 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 22:57:32 +0800 Subject: [PATCH 383/721] Update txnews_task.js --- Task/txnews_task.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Task/txnews_task.js b/Task/txnews_task.js index 44c0aba334..5e8d3818ab 100644 --- a/Task/txnews_task.js +++ b/Task/txnews_task.js @@ -77,7 +77,6 @@ let RdArr = [], VdArr = []; console.log(`请等待5s后继续视频第$.vdindex次任务`) await $.wait(5000); } - } console.log(`-------------------------\n\n共完成视频任务(${$.vdindex})次,视频金币详情见App,视频任务全部结束`) } })() From 2cec8a1d7f6a6fc0736fa15698999096dae0933d Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 23:31:39 +0800 Subject: [PATCH 384/721] Update txnews_auto.yml --- .github/workflows/txnews_auto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/txnews_auto.yml b/.github/workflows/txnews_auto.yml index 0c81997140..e7fed354b0 100644 --- a/.github/workflows/txnews_auto.yml +++ b/.github/workflows/txnews_auto.yml @@ -5,7 +5,7 @@ name: 腾讯新闻自动阅读 on: workflow_dispatch: schedule: - - cron: '*/30 2,8,16 * * *' + - cron: '*/15 2,8,16 * * *' watch: types: started jobs: From b9cd8c18aa71597c4b33f5cddecf84d1f91e4dda Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 22 Jan 2021 23:33:43 +0800 Subject: [PATCH 385/721] Update txnews.yml --- .github/workflows/txnews.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/txnews.yml b/.github/workflows/txnews.yml index 11b6d6bf9b..4b2e5e6d2a 100644 --- a/.github/workflows/txnews.yml +++ b/.github/workflows/txnews.yml @@ -9,7 +9,7 @@ name: 腾讯新闻 on: workflow_dispatch: schedule: - - cron: '*/7 * * * *' + - cron: '*/30 */4 * * *' watch: types: started From eb0ad4b299537b4cc1e20de90df6202df02e89f8 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 23 Jan 2021 08:16:38 +0800 Subject: [PATCH 386/721] Update txnews_task.js --- Task/txnews_task.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Task/txnews_task.js b/Task/txnews_task.js index 5e8d3818ab..a02399a11a 100644 --- a/Task/txnews_task.js +++ b/Task/txnews_task.js @@ -1,9 +1,9 @@ /* -更新时间: 2021-01-22 22:46 +更新时间: 2021-01-23 07:46 Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 -获取secrects方法和腾讯新闻签到任务相同,TX_CK即腾讯新闻Cookie,TX_READ即sy_signurl_txnews阅读任务地址,TX_VIDEO即video_txnews视频地址;其中TX_CK只能填一个账号secrects,其他链接地址可用#或换行隔开,多账号任务链接可共用阅读和视频地址 +获取secrects方法和腾讯新闻签到任务相同,TX_CK即腾讯新闻Cookie,TX_READ即sy_signurl_txnews阅读任务地址,TX_VIDEO即video_txnews视频地址;其中TX_CK只能填一个账号secrects,其他链接地址可用#或换行隔开,多账号任务链接不可共用阅读和视频地址‼️ 拷贝抓包的请求体到下面Value的文本框中,本脚本不包含任何推送通知 */ @@ -74,8 +74,8 @@ let RdArr = [], VdArr = []; $.vdindex = j + 1; console.log(`-------------------------\n\n开始腾讯新闻第${$.vdindex}次看视频`) await AutoRead(); - console.log(`请等待5s后继续视频第$.vdindex次任务`) - await $.wait(5000); + console.log(`请等待10s后继续视频第${$.vdindex+1}次任务`) + await $.wait(/10000); } console.log(`-------------------------\n\n共完成视频任务(${$.vdindex})次,视频金币详情见App,视频任务全部结束`) } From bf562366f9f72d5af379500b4603a44a14fa14a2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 23 Jan 2021 08:20:11 +0800 Subject: [PATCH 387/721] Update txnews_auto.yml --- .github/workflows/txnews_auto.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/txnews_auto.yml b/.github/workflows/txnews_auto.yml index e7fed354b0..5627038e4e 100644 --- a/.github/workflows/txnews_auto.yml +++ b/.github/workflows/txnews_auto.yml @@ -15,6 +15,8 @@ jobs: env: TX_CK: ${{ secrets.TX_CK }} TX_CK2: ${{ secrets.TX_CK2 }} + TX_CK3: ${{ secrets.TX_CK3 }} + TX_CK4: ${{ secrets.TX_CK4 }} TZ: Asia/shanghai steps: - name: Checkout @@ -41,7 +43,23 @@ jobs: node Task/txnews_task.js env: TX_CK: ${{ secrets.TX_CK2 }} - TX_READ: ${{ secrets.TX_READ }} - TX_VIDEO: ${{ secrets.TX_VIDEO }} - + TX_READ: ${{ secrets.TX_READ2 }} + TX_VIDEO: ${{ secrets.TX_VIDEO2 }} + + - name: '运行 【腾讯新闻自动阅读账号三】' + if: env.TX_CK3 + run: | + node Task/txnews_task.js + env: + TX_CK: ${{ secrets.TX_CK3 }} + TX_READ: ${{ secrets.TX_READ3 }} + TX_VIDEO: ${{ secrets.TX_VIDEO3 }} + - name: '运行 【腾讯新闻自动阅读账号四】' + if: env.TX_CK4 + run: | + node Task/txnews_task.js + env: + TX_CK: ${{ secrets.TX_CK4 }} + TX_READ: ${{ secrets.TX_READ4 }} + TX_VIDEO: ${{ secrets.TX_VIDEO4 }} From 11c113af0ed4e6123c7d9d165225771c944b0637 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 23 Jan 2021 08:37:33 +0800 Subject: [PATCH 388/721] Update txnews.js --- Task/txnews.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Task/txnews.js b/Task/txnews.js index df202c507b..718afb8f6b 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -113,7 +113,8 @@ if (isGetCookie) { $.index = i + 1; console.log(`-------------------------\n\n开始【腾讯新闻账号${$.index}】`) ID = signurlVal.match(/devid=[a-zA-Z0-9_-]+/g)[0] - token = signurlVal.split("&mac")[1] + + token = signurlVal.split("mac")[1] await getsign(); await activity(); await getTotal(); @@ -281,6 +282,7 @@ function Redpack(red_body) { } $.post(cashUrl, (error, response, data) => { let rcash = JSON.parse(data) + $.log(data) try{ if(rcash.data.award.length == 1){ redpacks = rcash.data.award.num/100 From 75c1c076d560642a667ed3f3b6f4efa3d8490a4c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 23 Jan 2021 08:44:12 +0800 Subject: [PATCH 389/721] Update txnews_auto.yml --- .github/workflows/txnews_auto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/txnews_auto.yml b/.github/workflows/txnews_auto.yml index 5627038e4e..f7e0b49431 100644 --- a/.github/workflows/txnews_auto.yml +++ b/.github/workflows/txnews_auto.yml @@ -46,7 +46,7 @@ jobs: TX_READ: ${{ secrets.TX_READ2 }} TX_VIDEO: ${{ secrets.TX_VIDEO2 }} - - name: '运行 【腾讯新闻自动阅读账号三】' + - name: '运行 【腾讯新闻自动阅读账号三】' if: env.TX_CK3 run: | node Task/txnews_task.js From 46209eb4b3c9f6afd5bb4e947bfc25be578ad024 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 23 Jan 2021 08:46:30 +0800 Subject: [PATCH 390/721] Update txnews_task.js --- Task/txnews_task.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/txnews_task.js b/Task/txnews_task.js index a02399a11a..9e4767c20c 100644 --- a/Task/txnews_task.js +++ b/Task/txnews_task.js @@ -75,7 +75,7 @@ let RdArr = [], VdArr = []; console.log(`-------------------------\n\n开始腾讯新闻第${$.vdindex}次看视频`) await AutoRead(); console.log(`请等待10s后继续视频第${$.vdindex+1}次任务`) - await $.wait(/10000); + await $.wait(10000); } console.log(`-------------------------\n\n共完成视频任务(${$.vdindex})次,视频金币详情见App,视频任务全部结束`) } From bf76aa23a378e8a2a2b9f4d0c436102f3b5ba735 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 23 Jan 2021 09:22:39 +0800 Subject: [PATCH 391/721] Update txnews.js --- Task/txnews.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/txnews.js b/Task/txnews.js index 718afb8f6b..b5d06411b4 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -1,6 +1,6 @@ /* -更新时间: 2021-1-22 18:50 +更新时间: 2021-1-23 09:50 腾讯新闻签到修改版,可以自动阅读文章获取红包,该活动为瓜分百万现金挑战赛,针对幸运用户参与 From 8a5723d488b4b21e58672490b9a27fbcce02e48b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 23 Jan 2021 12:02:29 +0800 Subject: [PATCH 392/721] Update youth.js --- Task/youth.js | 171 ++++++++++++++++++++++++-------------------------- 1 file changed, 82 insertions(+), 89 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index ec91ca9576..3defdae467 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2020-12-12 23:00 +更新时间: 2021-01-23 12:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 @@ -11,6 +11,7 @@ ② 阅读一篇文章,获取阅读请求body, ③ 同时获取阅读时长, ④ 在阅读文章最下面有个惊喜红包,点击获取惊喜红包请求 + ⑤ 正常提现一次,获取提现请求,提现金额需该请求一致,只更改提现金额无效,默认30元 3.增加转盘抽奖通知间隔,为了照顾新用户,前三次会有通知,以后默认每50次转盘抽奖通知一次,可自行修改❗️ 转盘完成后通知会一直开启 4.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 5.增加每日打卡,打卡时间每日5:00-8:00❗️,请不要忘记设置运行时间,共4条Cookie,请全部获取,获取请注释 @@ -29,6 +30,8 @@ Surge 4.0 : 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true + ~~~~~~~~~~~~~~~~ Loon 2.1.0+ [Script] @@ -39,6 +42,8 @@ http-request https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) script-path=ht http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true + ----------------- QX 1.0. 7+ : [task_local] @@ -53,6 +58,7 @@ https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body yout https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body youth.js +https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body youth.js ~~~~~~~~~~~~~~~~ [MITM] @@ -61,11 +67,15 @@ hostname = *.youth.cn, ios.baertt.com */ -let s = 200 //各数据接口延迟 +let s = 1000 //各数据接口延迟 const $ = new Env("中青看点") let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖每50次通知一次,如需关闭全部通知请设为0 const YOUTH_HOST = "https://kd.youth.cn/WebApi/"; const notify = $.isNode() ? require('./sendNotify') : ''; +const withdrawcash = $.getdata('zqcash')||30 //提现金额 +const withdrawUrl =$.getdata('cashurl_zq') +const withdrawBody =$.getdata('cashbody_zq') + let logs = $.getdata('zqlogs')||false, rotaryscore=0,doublerotary=0,signresult; let cookiesArr = [], signheaderVal = '', readArr = [], articlebodyVal ='', @@ -125,7 +135,7 @@ if ($.isNode()) { console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) } else { - cookiesArr.push($.getdata('youthheader_zq')); + cookiesArr.push($.getdata('youthheader_zq')); redpArr.push($.getdata('red_zq')); readArr.push($.getdata('read_zq')); timeArr.push($.getdata('readtime_zq')); @@ -157,16 +167,6 @@ if (isGetCookie = typeof $request !== 'undefined') { await sign(); await signInfo(); await friendsign(); -if($.time('HH')>12){ - //await punchCard() -}; -if ($.isNode()&& $.time('HH')>20&&$.time('HH')<22){ - await endCard(); - } -else if ($.time('HH')>4&&$.time('HH')<8){ - await endCard(); - } - await SevCont(); await comApp(); await ArticleShare(); await openbox(); @@ -175,15 +175,16 @@ else if ($.time('HH')>4&&$.time('HH')<8){ await readArticle(); await Articlered(); await readTime(); -for ( k=0;k<5;k++){ - console.log("等待5s进行下一次任务") - await $.wait(5000); +for (k=0;k<5;k++){ + await $.wait(1000); await rotary(); if (rotaryres.status == 0) { rotarynum = ` 转盘${rotaryres.msg}🎉`; break } else if(rotaryres.status == 1){ - rotaryscore += rotaryres.data.score + console.log("等待1s进行开始转盘任务") + rotaryscore += rotaryres.data.score + $.log("进行"+Number(100-rotaryres.data.remainTurn)+"次转盘,获得"+rotaryres.data.score+"青豆") rotarytimes = rotaryres.data.remainTurn } if (rotaryres.status == 1 && rotaryres.data.doubleNum !== 0) { @@ -193,13 +194,15 @@ if (rotaryres.status == 0) { } } } + if (rotaryres.status == 1) { detail += `【转盘抽奖】+${rotaryscore}个青豆 剩余${rotaryres.data.remainTurn}次\n` +$.log(`转盘抽奖: 共计+${rotaryscore}个青豆 剩余${rotaryres.data.remainTurn}次\n`) } if (rotaryres.status !== 0&&rotaryres.data.doubleNum !== 0){ detail += `【转盘双倍】+${doublerotary}青豆 剩余${rotaryres.data.doubleNum}次\n` +$.log(`转盘双倍: +${doublerotary}青豆 剩余${rotaryres.data.doubleNum}次`) } - await rotaryCheck(); await earningsInfo(); await showmsg(); if ($.isNode()&&rotaryres.code !== '10010') @@ -237,8 +240,16 @@ else if ($request && $request.method != `OPTIONS`&& $request.url.match(/\/articl $.log(`${$.name} 获取惊喜红包: 成功,redpbodyVal: ${redpbodyVal}`) $.msg($.name, `获取惊喜红包请求: 成功🎉`, ``) } +else if ($request && $request.method != `OPTIONS`&& $request.url.match(/\/withdraw\.json/)) { + const withdrawVal = $request.body + const withdrawUrl = $request.url + if (withdrawVal) $.setdata(withdrawVal, 'cashbody_zq') + if (withdrawUrl) $.setdata(withdrawUrl, 'cashurl_zq') + $.log(`${$.name} 获取提现请求: 成功,withdrawUrl: ${withdrawUrl}`) + $.log(`${$.name} 获取提现请求: 成功,withdrawBody: ${withdrawVal}`) + $.msg($.name, `获取提现请求: 成功🎉`, ``) + } } - function sign() { return new Promise((resolve, reject) => { const signurl = { @@ -247,7 +258,6 @@ function sign() { } $.post(signurl, (error, response, data) => { signres = JSON.parse(data) - const date = $.time(`MMdd`) if (signres.status == 2) { signresult = `签到失败,Cookie已失效‼️`; $.msg($.name, signresult, ""); @@ -255,16 +265,9 @@ function sign() { } else if (signres.status == 1) { signresult = `【签到结果】成功 🎉 明日+${signres.nextScore} ` //detail = `【签到结果】成功 🎉 青豆: +${signres.score},明日青豆: +${signres.nextScore}\n` - $.setdata(1,'times') - if(firstcheck==undefined||firstcheck!=date){ - $.setdata(date,'signt'); - } } else if (signres.status == 0) { signresult = `【签到结果】重复`; detail = ""; - if(runtimes!==undefined){ - $.setdata(`${parseInt(runtimes)+1}`,'times') - } } resolve() }) @@ -277,14 +280,20 @@ function signInfo() { url: 'https://kd.youth.cn/TaskCenter/getSign', headers: JSON.parse(signheaderVal), } - $.post(infourl, (error, response, data) => { + $.post(infourl, async(error, response, data) => { signinfo = JSON.parse(data); if (signinfo.status == 1) { cash = signinfo.data.user.money + signday = signinfo.data.sign_day subTitle = `【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元`; + if(cash>=withdrawcash&&typeof withdrawBody !== undefined){ + await withDraw() + } nick = `账号: ${signinfo.data.user.nickname}`; - detail = `${signresult}(今天+${signinfo.data.sign_score}青豆) 已连签${signinfo.data.sign_day}天`; - detail +='\n<本次收益>:\n' + detail = `${signresult}(今天+${signinfo.data.sign_score}青豆) 已连签${signday}天\n<本次收益>:\n`; + if(signday==7){ + await SevCont(); + } } else { subTitle = `${signinfo.msg}`; detail = ``; @@ -294,52 +303,32 @@ function signInfo() { }) } -//开启打卡 -function punchCard() { +function withDraw() { return new Promise((resolve, reject) => { const url = { - url: `${YOUTH_HOST}PunchCard/signUp?`, - headers: JSON.parse(signheaderVal), + url: withdrawUrl, + headers: { + 'User-Agent': 'KDApp/1.8.2 (iPhone; iOS 14.2; Scale/3.00)' + }, + body: withdrawBody, } $.post(url, (error, response, data) => { - punchcardstart = JSON.parse(data); - if (punchcardstart.code == 1) { - detail += `【打卡报名】打卡报名${punchcardstart.msg} ✅ \n`; - $.log("每日报名打卡成功,报名时间:"+`${$.time('MM-dd HH:mm')}`) - resolve(); + withDrawres = JSON.parse(data) + if (withDrawres.error_code == 0) { + detail += `【自动提现】提现${withdrawcash}元成功\n` + }else if(withDrawres.error_code == "10002"){ + $.log( `自动提现失败,${withDrawres.homeTime.text}`) + } + else { + $.log( `自动提现失败,${withDrawres.message}`) } - else { - //detail += `【打卡报名】${punchcardstart.msg}\n` - // $.log(punchcardstart.msg) resolve() - } }) }) } -//结束打卡 -function endCard() { - return new Promise((resolve, reject) => { - setTimeout(() => { - const url = { - url: `${YOUTH_HOST}PunchCard/doCard?`,headers: JSON.parse(signheaderVal), - } - $.post(url,async(error, response, data) => { - punchcardend = JSON.parse(data) - if (punchcardend.code == 1) { - detail += `【早起打卡】${punchcardend.data.card_time}${punchcardend.msg}✅\n` - $.log("早起打卡成功,打卡时间:"+`${punchcardend.data.card_time}`) - await Cardshare(); - } else if (punchcardend.code == 0) { - // TODO .不在打卡时间范围内 - //detail += `【早起打卡】${punchcardend.msg}\n` - // $.log("不在打卡时间范围内") - } - resolve() - }) - },s) - }) -} + + //打卡分享 function Cardshare() { return new Promise((resolve, reject) => { @@ -380,12 +369,10 @@ function SevCont() { }, async(error, response, data) => { sevres = JSON.parse(data) if (sevres.code == 1) { - detail += `【七日签到】+${sevres.data.score}青豆 \n` - }else if (sevres.code == 0){ //detail += `【七日签到】${sevres.msg}\n` - // $.log(`${boxres.msg}`) + $.log(`七日签到: ${sevres.msg}`) } resolve() }) @@ -397,7 +384,7 @@ function ArticleShare() { return new Promise((resolve, reject) => { setTimeout(() => { const url = { - url: `https://focu.youth.cn/article/s?signature=0Z3Jgv96wqmVPeM7obRdNpHXgAmRhxNPJ6y4jpGDnANbo8KXQr&uid=46308484&phone_code=26170a068d9b9563e7028f197c8a4a2b&scid=33007686&time=1602937887&app_version=1.7.8&sign=d21dd80d0c6563f6f810dd76d7e0aef2`, + url: `https://focus.youth.cn/article/s?signature=P5zR0VlwdZoWp3N4KmdjzYCBXDRQtZ2Kkl8aMQLb6BeXxq2kEr&uid=46746961&phone_code=c6dcf2a3056a5183edc85313fdbf3e6e&scid=35902988&time=1611338382&app_version=1.8.2&sign=0b8019551761cc3ebf0b4775701fd16e`, headers: JSON.parse(signheaderVal), } $.post(url, async(error, response, data) => { @@ -426,7 +413,7 @@ function openbox() { await boxshare(); }else{ //detail += `【开启宝箱】${boxres.msg}\n` - // $.log(`${boxres.msg}`) + $.log(`开启宝箱 :${boxres.msg}`) } resolve() }) @@ -457,7 +444,7 @@ function boxshare() { }) } -function friendsign(uid) { +function friendsign() { return new Promise((resolve, reject) => { const url = { url: `https://kd.youth.cn/WebApi/ShareSignNew/getFriendActiveList`, @@ -488,8 +475,8 @@ function friendSign(uid) { $.get(url, (error, response, data) => { friendres = JSON.parse(data) if (friendres.error_code == "0") { - //detail += `【好友红包】+${friendres.score}个青豆\n` - console.log(`好友签到,我得红包 +${friendres.score}个青豆`) + detail += `【好友红包】+${friendres.data[0].score}个青豆\n` + console.log(`好友签到,我得红包 +${friendres.data[0].score}个青豆`) } resolve() }) @@ -509,6 +496,7 @@ function getAdVideo() { adVideores = JSON.parse(data) if (adVideores.status == 1) { detail += `【观看视频】+${adVideores.score}个青豆\n` + $.log("观看视频广告"+ adVideores.num +"次 +"+adVideores.score+"青豆") } resolve() }) @@ -525,9 +513,11 @@ function gameVideo() { gameres = JSON.parse(data) if (gameres.success == true) { detail += `【激励视频】${gameres.items.score}\n` + $.log("激励视频 "+gameres.items.score) }else{ if(gameres.error_code == "10003"){ //detail += `【激励视频】${gameres.message}\n` + $.log("激励视频 "+gameres.message) } } resolve() @@ -549,7 +539,7 @@ function comApp() { detail += `【回访奖励】+${redres.items.score}个青豆\n` }else{ if(redres.error_code == "100009"){ - //detail += `【回访奖励】${redres.message}\n` + $.log( `回访奖励: ${redres.message}`) } } resolve() @@ -563,19 +553,20 @@ function readArticle() { const url = { url: `https://ios.baertt.com/v5/article/complete.json`, headers: { - 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + 'User-Agent': 'KDApp/1.8.2 (iPhone; iOS 14.2; Scale/3.00)' }, body: articlebodyVal, } $.post(url, (error, response, data) => { readres = JSON.parse(data); - if (typeof readres.items.read_score === 'number') { + if (typeof readres.items.read_score === 'number'&&readres.items.read_score!=0) { detail += `【阅读奖励】+${readres.items.read_score}个青豆\n`; + $.log(`阅读奖励 +${readres.items.read_score}个青豆\n`) } - //else if (readres.items.max_notice == '\u770b\u592a\u4e45\u4e86\uff0c\u63621\u7bc7\u8bd5\u8bd5') { + else if (readres.items.max_notice == '看太久了,换1篇试试') { //detail += `【阅读奖励】看太久了,换1篇试试\n`; - // $.log(readres.items.max_notice)} - + //$.log(readres.items.max_notice) + } resolve() }) }) @@ -586,18 +577,17 @@ function Articlered() { const url = { url: `https://ios.baertt.com/v5/article/red_packet.json`, headers: { - 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + 'User-Agent': 'KDApp/1.8.2 (iPhone; iOS 14.2; Scale/3.00)' }, body: redpbodyVal, } $.post(url, (error, response, data) => { redres = JSON.parse(data) if (redres.success == true) { - detail += `【惊喜红包】+${redres.items.score}个青豆\n` - }else{ - if(redres.error_code == "100001"){ - //detail += `【惊喜红包】${redres.message}\n` - } + detail += `【惊喜红包】+${redres.items.score}个青豆\n` + $.log(`惊喜红包 +${redres.items.score}个青豆,`+ redres.items.alert) + }else if(redres.error_code == "100001"){ + //detail += `【惊喜红包】${redres.message}\n` } resolve() }) @@ -609,7 +599,7 @@ function readTime() { const url = { url: `https://ios.baertt.com/v5/user/stay.json`, headers: { - 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + 'User-Agent': 'KDApp/1.8.2 (iPhone; iOS 14.2; Scale/3.00)' }, body: timebodyVal, } @@ -618,9 +608,10 @@ function readTime() { if (timeres.error_code == 0) { readtimes = timeres.time / 60 detail += `【阅读时长】共计` + Math.floor(readtimes) + `分钟\n` + $.log(`阅读时长共计` + Math.floor(readtimes) + `分钟`) } else { if (timeres.error_code == 200001) { - detail += `【阅读时长】❎ 未获取阅读时长Cookie\n` + detail += `【阅读时长】❎ 未获取阅读时长请求\n` }else{ detail += `【阅读时长】❎ ${timeres.msg}\n` $.log(`阅读时长统计失败,原因:${timeres.msg}`) @@ -645,6 +636,7 @@ function rotary() { $.post(url,async (error, response, data) => { try{ rotaryres = JSON.parse(data) + await rotaryCheck() } catch (e) { $.logErr(e, resp); } finally { @@ -661,9 +653,10 @@ function rotaryCheck() { if (rotaryres.code == 10010) { return resolve(); } + let i = 0; while (i <= 3) { - if (100 - rotaryres.data.remainTurn == rotaryres.data.chestOpen[i].times) { + if (100 - rotaryres.data.remainTurn >= rotaryres.data.chestOpen[i].times&&rotaryres.data.chestOpen[i].received==0) { await runRotary(i + 1) } i++; From cf6be1e3dfed3258fed5d2cc70433a0d1d477ea0 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 23 Jan 2021 12:40:23 +0800 Subject: [PATCH 393/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 902f083217..f666a4924e 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -16,7 +16,7 @@ { "id": "youth", "name": "中青看点", - "keys": ["youthheader_zq", "read_zq", "red_zq", "readtime_zq"], + "keys": ["youthheader_zq", "read_zq", "red_zq", "readtime_zq", "cashurl_zq","cashbody_zq"], "author": "@sunert", "settings": [{ "id": "notifytimes", @@ -31,7 +31,27 @@ "val": false, "type": "boolean", "desc": "调试日志开关,默认关闭" - }], + }, + { + "id": "zqcash", + "name": "提现金额", + "val": "30", + "type": "radios", + "desc": "自动提现金额需和获取提现请求保持一致", + "items": [{ + "key": "10", + "label": "10元" + }, + { + "key": "30", + "label": "30元" + }, + { + "key": "100", + "label": "100元" + }] + } + ], "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js" From f2d8f67357917809906c5bd9de564eb705776d1d Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 23 Jan 2021 13:33:00 +0800 Subject: [PATCH 394/721] Update txnews_auto.yml --- .github/workflows/txnews_auto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/txnews_auto.yml b/.github/workflows/txnews_auto.yml index f7e0b49431..8d99b92a64 100644 --- a/.github/workflows/txnews_auto.yml +++ b/.github/workflows/txnews_auto.yml @@ -5,7 +5,7 @@ name: 腾讯新闻自动阅读 on: workflow_dispatch: schedule: - - cron: '*/15 2,8,16 * * *' + - cron: '*/15 */3 * * *' watch: types: started jobs: From ebbbcf65a8e2696fc3c2bada313b76d80fe9e536 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 25 Jan 2021 03:20:34 +0800 Subject: [PATCH 395/721] Update baidu_speed.js --- Task/baidu_speed.js | 558 ++++++++++++++++++++++++++------------------ 1 file changed, 331 insertions(+), 227 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 8d0b178a91..d304bbbd11 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -10,6 +10,7 @@ const $ = new Env('百度极速版') let CookieArr = []; let UA = `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 info baiduboxapp/5.1.0.10 (Baidu; P2 14.2)` +const withcash = $.getdata("cash_baidu")||30 if ($.isNode()) { if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { @@ -43,11 +44,11 @@ if ($.isNode()) { if (CookieArr[i]) { cookieval = CookieArr[i]; $.index = i + 1; + await userInfo(); await getsign(); - await coinInfo(); await firstbox(); await TaskCenter() - await getRewards(); + await showmsg() //await drawPrize(); } } @@ -57,196 +58,266 @@ if ($.isNode()) { //签到 function getsign() { - return new Promise((resolve, reject) =>{ - let signurl = { - url: `https://haokan.baidu.com/activity/acusercheckin/update`, - headers: {Cookie:cookieval,'User-Agent': UA}, - body: 'productid=2&ugus=9766888061' - } - $.post(signurl, (error, response, data) => { - let get_sign = JSON.parse(data) - if (get_sign.errno == 0){ - $.sub = get_sign.data.tips+`🎉` - $.desc = `签到收益: ${get_sign.data.bonus.coin}💰,` - } - else if (get_sign.errno == 10053){ - $.sub = get_sign.msg - $.desc = `` - } - else { - $.sub = `签到失败❌` - $.desc = `说明: `+ get_sign.msg - $.msg($.name,$.sub,$.desc) - return - } - resolve() + return new Promise((resolve, reject) =>{ + let signurl = { + url: `https://haokan.baidu.com/activity/acusercheckin/update`, + headers: { + Cookie: cookieval, + 'User-Agent': UA + }, + body: 'productid=2&ugus=9766888061' + } + $.post(signurl, async(error, response, data) =>{ + let get_sign = JSON.parse(data); + if (get_sign.errno == 0) { + $.desc = get_sign.data.tips+` 收益: $ {get_sign.data.bonus.coin}💰\n`; + $.log($.desc+"\n"+data); + await invite() + } else if (get_sign.errno == 10053) { + $.desc = "【签到结果】"+get_sign.msg+"\n" + $.log( "签到结果: "+ $.desc) + } else { + $.sub = `签到失败❌`, + $.desc = `说明: ` + get_sign.msg, + $.msg($.name, $.sub, $.desc); + return + } + resolve() + }) }) - }) } -function coinInfo() { - return new Promise((resolve, reject) =>{ - let infourl = { - url: `https://haokan.baidu.com/activity/h5/displaybyday?type=1&page=1&productid=2`, - headers: {Cookie:cookieval,'User-Agent': UA} - } - $.get(infourl, (error, response, data) => { - let get_info = JSON.parse(data) - if (get_info.errno == 0){ - $.sub += ' 今日收益: ' + get_info.data.datalist.data[0].desc - } - resolve() +function userInfo() { + return new Promise((resolve, reject) => { + let infourl = { + url: `https://haokan.baidu.com/activity/h5/income?productid=2&from=1005640h&network=1_0&osname=baiduboxapp`, + headers: { + Cookie:cookieval, + 'User-Agent': UA + } + }; + $.get(infourl, async(error, resp, data) => { + try { + if (resp.statusCode == 200) { + username = data.match(/user_name":"(\w+)/)[1], + chargemoney = data.match(/charge_money":"(\d+\.\d+)/)[1], + waitingcoin = data.match(/waiting_coin":(\d+)/)[1], + availablecoin = data.match(/available_coin":(\d+)/)[1], + invitecode = data.match(/invite_code":"(\w+)/)[1] + } + $.sub= "昵称:"+username+" 现金:"+ chargemoney+" 金币:"+availablecoin + $.log("获取用户信息成功,昵称: "+username+ " 现金:"+chargemoney+"元"); + if (chargemoney >= withcash && $.time("HH") == 6) { + await withDraw(withcash) + } + } catch(error) { + $.msg($.name, "获取用户信息失败"), + $.log("用户信息详情页错误\n" + data) + } + resolve() + }) }) - }) } -function getRewards() { - return new Promise((resolve, reject) =>{ - let rewurl = { - url: `https://haokan.baidu.com/activity/tasks/taskreward?productid=2`, - headers: {Cookie:cookieval,'User-Agent': UA} - } - $.get(rewurl, async(error, response, data) => { - let get_reward = JSON.parse(data) - if (get_reward.errno == 0&&get_reward.data.coin!==0){ - $.desc += '获得总收益: +' + get_reward.data.coin - await invite() - } - resolve() +function withDraw(cash) { + return new Promise((resolve, reject) =>{ + let cashurl = { + url: `https://haokan.baidu.com/activity/acuserwithdraw/confirm?productid=2&amount=${cash*100}&trade_type=1`, + headers: { + Cookie: cookieval, + 'User-Agent': UA + } + } + $.get(cashurl, (error, response, data) =>{ + let get_cash = JSON.parse(data); + if (get_cash.errno == 0) { + $.sub = ' 提现成功: 到账 ' + get_cash.data.money + "元 ", + $.msg($.name, $.sub) + } else { + $.log(data + "\n " + get_cash.msg), + $.msg($.name, get_cash.msg) + } + resolve() + }) }) - }) } + function invite() { return new Promise((resolve, reject) =>{ let rewurl = { - url: `https://haokan.baidu.com/activity/h5/vault?productid=2&inviteCode=WKQLC6&pkg=%5Bpkg%5D `, + url: `https://haokan.baidu.com/activity/h5/vault?productid=2&inviteCode=RW9ZSW&pkg=%5Bpkg%5D `, headers: {Cookie:cookieval} } - $.get(rewurl, (error, response, data) => { - // let get_reward = JSON.parse(data) + $.get(rewurl,(error,resp,data) => { + if ( error ) { + //$.log("响应错误") + } resolve() }) }) } - function TaskCenter() { return new Promise((resolve, reject) =>{ - let rewurl = { - url: `https://haokan.baidu.com/activity/h5/vault?_format=json&productid=2&channel=2`, - headers: {Cookie:cookieval,'User-Agent': UA} + let rewurl = { + url: `https://haokan.baidu.com/activity/h5/vaultnew?productid=2&fromcsr=1&system=ios&_format=json`, + headers: { + Cookie: cookieval, + 'User-Agent': UA } - $.get(rewurl, async(error, resp, data) => { - try{ - let get_tasks = JSON.parse(data) - //$.log("获取任务数据"+data) - tasks = get_tasks.data.comps - for ( x in tasks){ - //taskid = tasks[x].taskId - id = tasks[x].id - if(id == 962){ - for (jingangs of tasks[x].data.jingang_list_ios ){ - if(jingangs.jingangType==2){ - tid = jingangs.jingangTid - taskName = '【'+jingangs.jingangName+'】' - RefererUrl = jingangs.jingangUrl - $.log(taskName+"tid:"+tid) - if ($.isNode()){ - await $.wait(1000) - await get_pkg(); - } -else if(tasks[x].data.countDown[tid].countDown ==0){ - await $.wait(1000) - await get_pkg(); - } else { - $.log( " 请等待"+Number(tasks[x].data.countDown[tid].countDown/60).toFixed(2)+"分钟") - } - } - } - } else { - let taskArr = tasks[x].data.tasklist - for (y in taskArr){ - tid = taskArr[y].id - taskName = "【"+taskArr[y].title+"】" - $.log(taskName+" ID:"+id +" tid:"+tid) - if (taskArr[y].taskStatus==1 ){ - $.log(taskName +" ID:"+id +" 已完成" ) - $.desc += taskName +" 已完成\n" - }else if(taskArr[y].type == 'openApp'){ - tid = tid=='395' ? "385":tid - RefererUrl = taskArr[y].adLink - await get_pkg() - } else if(taskArr[y].type == 'watch'){ - // $.log(tasklists.+'\n') - cmd = tid==346 ? 100:184 - await get_search() - }; - } - } - } - } catch(e){ + } + $.get(rewurl, async(error, resp, data) =>{ + try { + let get_tasks = JSON.parse(data); + $.log("获取任务数据成功") + tasks = get_tasks.data.comps; + for (x in tasks) { + taskid = tasks[x].taskId; + id = tasks[x].id; + await getConfigs() + } + } catch(e) { $.logErr(e, data); } finally { - $.msg($.name, $.sub, $.desc) - resolve() + $.msg($.name, $.sub, $.desc) } }) }) } +async function getConfigs() { + if (id == 1081) { + tasknName = "<" + tasks[x].data.words + ">", + RefererUrl = tasks[x].data.btnlinkios; + $.log(tasks[x].data.words) + }; + if (id == 1068) { + for (HeadBox of tasks[x].data.unOpenHeadBoxDialog.btn) { + taskName = "【"+HeadBox.btnText+"】 ", + RefererUrl = HeadBox.iosAdUrl; + $.log(HeadBox.btnText) + }; + for (openBox of tasks[x].data.gameheader.progressList) { + taskstatus = openBox.status, + taskid = openBox.coinRequired; + //$.log(openBox.status) + }; + for (jingangs of tasks[x].data.jingang.list) { + jingangType = jingangs.jingangType, + taskName = "【"+jingangs.jingangName+"】 ", + RefererUrl = jingangs.jingangUrl, + tid = jingangs.jingangTid; + //$.log(jingangs.jingangName); + if (jingangType == 2) { + if (tasks[x].data.jingang.countDown[tid].countDown == 0) { + await $.wait(1000); + await get_pkg(tid); + } else { + $.log(taskName+ " 请等待" + Number(tasks[x].data.jingang.countDown[tid].countDown / 60).toFixed(2) + "分钟") + } + } + } + } + if (id == 52) { + for (signs of tasks[x].data.checkin_list) { + if (tasks[x].data.current_date == signs.date && signs.is_checkin == 0) { + await getsign() + } + } + } + if (id == 963) { + $.log(tasks[x].data.recommendCompName) + } + if (id == 277) { + $.log("\n去完成" + tasks[x].data.title) + for (daily of tasks[x].data.tasklist) { + taskName = "【"+daily.title +"】 "; + //taskName += "【"+taskName+"】 " + tid = daily.id; + taskType = daily.type + if (taskType == "openApp") { + tid = tid == '395' ? "385": tid, + RefererUrl = daily.adLink; + await get_pkg() + } else if (taskType == 'watch') { + tips = daily.tips; + totaltips = daily.total_count + $.log(taskName + tips+"总计"+totaltips+"次") + if (tid == 4) { + await get_search("100") + } else { + await get_search("184") + } + } + } + } + if(id==278){ + $.log(tasks[x].data.tasklist[0].title) + } + if(id==10){ + $.log(tasks[x].name) + } +} + + + //首页宝箱 function firstbox() { - return new Promise((resolve, reject) =>{ - let bdurl = { - url: 'https://mbrowser.baidu.com/lite/gold/receive?service=bdbox', - headers: {Cookie:cookieval,'User-Agent': UA}, - body: 'task_type=-1&task_id=-1' -} - $.post(bdurl, (error, resp, data) => { - let get_first = JSON.parse(data) - //$.log("【首页宝箱】\n"+data +'\n') - if (get_first.err_no == 0){ - $.desc += "【首页宝箱】"+ get_first.data.result.tips +", "+get_first.data.result.countdown_time+"秒后再次开启宝箱\n" - } - else if (get_first.err_no == 10079){ - $.desc += "【首页宝箱】"+ get_first.tip+'\n' - } - else if (get_first.err_no == 10060){ - $.desc += get_first.tip+'\n' - } - //$.msg($.name, $.sub, $.desc) - resolve() + return new Promise((resolve, reject) =>{ + let bdurl = { + url: 'https://mbrowser.baidu.com/lite/gold/receive?service=bdbox', + headers: { + Cookie: cookieval, + 'User-Agent': UA + }, + body: 'task_type=-1&task_id=-1' + } + $.post(bdurl, (error, resp, data) =>{ + let get_first = JSON.parse(data) + //$.log("获取首页宝箱信息:"+data +'\n') + if (get_first.err_no == 0) { + $.desc += "【首页宝箱】" + get_first.data.result.tips + ", " + get_first.data.result.countdown_time + "秒后再次开启宝箱\n" + } else if (get_first.err_no == 10079) { + $.desc += "【首页宝箱】" + get_first.tip + '\n' + } else if (get_first.err_no == 10060) { + $.desc += get_first.tip + '\n' + } + resolve() + }) }) - }) } //视频 function get_pkg() { - return new Promise((resolve, reject) =>{ - let pkgurl = { - url: `https://haokan.baidu.com/activity/acad/rewardad?device=%7B%22imei_md5%22%3A%22%22%2C%22device_type%22%3A1%2C%22model%22%3A%22IPHONE%22%2C%22manufacturer%22%3A%22Apple%22%2C%22os_version%22%3A%2214.2%22%2C%22androidId%22%3A%22%22%7D%2C%22screen_width%22%3A1242%2C%22screen_height%22%3A2208&network=%7B%22connect_type%22%3A1%2C%22carrier%22%3A0%7D&productid=2&tid=${tid}&type=1`, - headers:{Cookie:cookieval,'User-Agent': UA,'Referer':RefererUrl} - } - $.get(pkgurl, async(error, resp, data) => { - let get_pkg = JSON.parse(data) - // $.log("数据: "+data+'\n') - if (get_pkg.errno == 0&&get_pkg.data.isDone ==0){ - Pkg = get_pkg.data.adInfo[0].material.pkg - taskid = get_pkg.data.taskPf.taskId; - //$.log("\n"+taskid +" "+ Pkg) - await activeBox() - } - else if (get_pkg.errno == 0&&get_pkg.data.isDone ==1){ - $.desc += taskName +" 已完成\n" - $.log(taskName +" 已完成\n") - } - resolve() + return new Promise((resolve, reject) =>{ + let pkgurl = { + url: `https://haokan.baidu.com/activity/acad/rewardad?device=%7B%22imei_md5%22%3A%22%22%2C%22device_type%22%3A1%2C%22model%22%3A%22IPHONE%22%2C%22manufacturer%22%3A%22Apple%22%2C%22os_version%22%3A%2214.2%22%2C%22androidId%22%3A%22%22%7D%2C%22screen_width%22%3A1242%2C%22screen_height%22%3A2208&network=%7B%22connect_type%22%3A1%2C%22carrier%22%3A0%7D&productid=2&tid=${tid}&type=1`, + headers: { + Cookie: cookieval, + 'User-Agent': UA, + 'Referer': RefererUrl + } + } + $.get(pkgurl, async(error, resp, data) =>{ + let get_pkg = JSON.parse(data); + if (get_pkg.errno == 0 && get_pkg.data.isDone == 0) { + Pkg = get_pkg.data.adInfo[0].material.pkg, + taskid = get_pkg.data.taskPf.taskId; + $.log(" 获取任务数据成功,去做任务"); + //$.log("\n"+taskid +" "+ Pkg) + await activeBox() + } else if (get_pkg.errno == 0 && get_pkg.data.isDone == 1) { + $.desc += taskName + "已完成\n"; + $.log(taskName + "已完成\n") + } + resolve() + }) }) - }) } + function activeBox() { return new Promise((resolve, reject) =>{ let actboxurl = { @@ -255,8 +326,8 @@ function activeBox() { } $.get(actboxurl, async(error, response, data) => { //let act_box = JSON.parse(data) - //$.log('actbox: ' + data) - await $.wait(25000); + $.log(' 任务激活成功,等待10s获取收益' ) + await $.wait(10000); await Tasks(); resolve() }) @@ -265,84 +336,111 @@ function activeBox() { function Tasks() { - return new Promise((resolve) =>{ - let taskurl = { - url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=coin&rewardVideoPkg=${Pkg}&_=`+new Date().getTime()+`&sys=ios&rewardVideoDrawKey=&source=0&appid=0&bid=0&chestTid=0&signAim=0&date=`, - headers: {Cookie:cookieval,'User-Agent': UA,Referer:RefererUrl} - } - $.get(taskurl, async(error, response, data) => { - try { - let do_task = JSON.parse(data) - await $.wait(20000); - // $.log(data+'\n') - if (do_task.errno == 0){ - $.desc += taskName + "获得收益"+ do_task.data.coin +"\n" - $.log(" 获得收益: +"+do_task.data.coin+'\n ') - } else if (do_task.errno == 19001){ - $.desc += taskName + " "+ do_task.data.originData.msg + "\n" - }else if (do_task.errno == 11004){ - $.desc += taskName + " "+ do_task.errmsg + "\n" - $.log(taskName + " "+ do_task.errmsg) - } - } catch(e){ - $.logErr(e, data); - } finally { - resolve() - } + return new Promise((resolve) =>{ + let taskurl = { + url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=coin&rewardVideoPkg=${Pkg}&_=`+new Date().getTime()+`&sys=ios&rewardVideoDrawKey=&source=0&appid=0&bid=0&chestTid=0&signAim=0`, + headers: { + Cookie: cookieval, + 'User-Agent': UA, + Referer: RefererUrl + } + } + $.get(taskurl, async(error, response, data) =>{ + try { + let do_task = JSON.parse(data); + if (do_task.errno == 0) { + $.desc += taskName + "获得收益" + do_task.data.coin + "\n"; + $.log(taskName+ " 获得收益: +" + do_task.data.coin); + await $.wait(2000) + } else if (do_task.errno == 19001) { + $.desc += taskName + " " + do_task.errmsg + "\n" + $.log(taskName + " " + do_task.errmsg) + + } else if (do_task.errno == 11004) { + $.desc += taskName + " " + do_task.errmsg + "\n"; + $.log(taskName + " " + do_task.errmsg) + } + } catch(e) { + $.logErr(e, data); + } finally { + resolve() + } + }) }) - }) } - -function get_search() { - return new Promise((resolve) =>{ - let geturl = { - url: `https://mbd.baidu.com/searchbox?action=feed&cmd=${cmd}&imgtype=webp&network=1_0&osbranch=i3&osname=baiduboxapp&ua=1242_2208_iphone_5.0.0.11_0&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2`, - headers: {Cookie:cookieval,'User-Agent': UA} - } - $.get(geturl, async(error, resp, data) => { - let get_search = JSON.parse(data) - //$.log(data+'\n') - try{ - if (get_search.errno == 0 ) { - for ( item in get_search.data[`${cmd}`].itemlist.items){ - searchId = get_search.data[`${cmd}`].itemlist.items[item].id - searchname = get_search.data[`${cmd}`].itemlist.items[item].data.title - $.log(" 阅读任务: "+searchname+ "\n 任务ID: "+searchId) - await searchBox(searchId) - await $.wait(30000) +function get_search(cmd) { + return new Promise((resolve) =>{ + let geturl = { + url: `https://mbd.baidu.com/searchbox?action=feed&cmd=${cmd}&network=1_0&osbranch=i3&osname=baiduboxapp&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2&ua=1242_2208_iphone_7.0.0.11_0`, + headers: { + Cookie: cookieval, + 'User-Agent': UA + } } - //$.desc += taskName + do_search.data[`${cmd}`].tips +"\n" - } else { - // $.desc += taskName + " "+ do_search.data[`${cmd}`].tips + "\n" - } - } catch(e){ - $.logErr(e, data); - } finally { - resolve() - } - }) - }) + $.get(geturl, async(error, resp, data) =>{ + let get_search = JSON.parse(data) + // $.log(data+'\n') + try { + if (get_search.errno == 0) { + let tip = 0 + for (items of get_search.data[`${cmd}`].itemlist.items) { + searchId = items.id, + searchname = items.data.title; + + if(items.data.mode=="video"){ + $.log("\n 观看视频: " + searchname + "\n 任务ID: " + searchId + "\n\n 请等待30s获取收益"); + await $.wait(30000) + } + if(items.data.mode=="text"){ + $.log("\n 阅读文章: " + searchname + "\n 任务ID: " + searchId + "\n\n 请等待32s获取收益"); + await $.wait(32000) + } + if(items.data.mode=="ad"){ + $.log("\n 广告: " + searchname + "\n 任务ID: " + searchId + "\n\n 请等待15s获取收益"); + await $.wait(15000) + } + await searchBox(searchId); + } + $.desc += taskName + "获得收益"+ tip +"\n" + } + } catch(e) { + $.logErr(e, data); + } finally { + resolve() + } + }) + }) } function searchBox(id) { - return new Promise((resolve) =>{ - let searchurl = { - url: `https://mbd.baidu.com/searchbox?action=feed&cmd=197&imgtype=webp&network=1_0&osbranch=i3&osname=baiduboxapp&ua=1242_2208_iphone_5.0.0.11_0&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2`, - headers: {Cookie:cookieval,'User-Agent': UA}, - body: `data={"origin_nid":"${id}","taskid":"${tid}"}` - } - $.post(searchurl, async(error, resp, data) => { - let do_search = JSON.parse(data) - //$.log(data+'\n') - if (do_search.errno == 0 && do_search.data['197'].istip == 1) { - $.log(" 获得收益: " +do_search.data[`197`].tips+'\n') - //$.desc += do_search.data[`197`].tips +"\n" - } else { - $.log("\n") - } - resolve() - }) - }) + return new Promise((resolve) =>{ + let searchurl = { + url: `https://mbd.baidu.com/searchbox?action=feed&cmd=197&imgtype=webp&network=1_0&osbranch=i3&osname=baiduboxapp&ua=1242_2208_iphone_7.0.0.11_0&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2`, + headers: { + Cookie: cookieval, + 'User-Agent': UA + }, + body: `data = {"origin_nid": "${id}","taskid": "${tid}"}` + }; + $.post(searchurl, async(error, resp, data) =>{ + try{ + let do_search = JSON.parse(data) + if (do_search.errno == 0 && do_search.data['197'].istip == 1) { + $.log(" 获得收益: " + do_search.data[`197`].tips + '\n'); + tip += do_search.data[`197`].tips + await $.wait(2000) + } else if (do_search.data[`197`].tips == "") { + //$.log(" 获得收益: " + do_search.data[`197`].istip + '\n') + } else { + $.log("获得收益失败") + } + }catch(e) { + $.logErr(e, data); + } finally { + resolve() + } + }) + }) } //缩减开宝箱时间 function chestTime() { @@ -351,7 +449,7 @@ function chestTime() { url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestTime&rewardVideoPkg=${Pkg}`, headers: {Cookie:cookieval,'User-Agent': UA,Referer:RefererUrl} } - $.get(timeurl, (error, response, data) => { + $.get(timeurl, (error, resp, data) => { $.log(data) try{ let get_chest = JSON.parse(data) @@ -413,5 +511,11 @@ function doubleBox() { }) } +function showmsg() { + $.msg($.name,$.sub,$.desc) + +} + + 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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 f9688eff6a02c3761a5cf497ff3a1de4258e35de Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 25 Jan 2021 16:00:43 +0800 Subject: [PATCH 396/721] Update baidu_speed.js --- Task/baidu_speed.js | 81 ++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index d304bbbd11..2fe5591ac7 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -1,7 +1,7 @@ /* 百度极速版签到任务 -本脚本默认使用chavyleung大佬和Nobyda的贴吧ck,获取方法请看大佬仓库说明 +本脚本默认使用chavyleung大佬和Nobyda的贴吧ck,获取方法请看大佬仓库说明,内置自动提现,提现金额默认30元 ~~~~~~~~~~~~~~~~ @@ -9,9 +9,9 @@ const $ = new Env('百度极速版') let CookieArr = []; -let UA = `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 info baiduboxapp/5.1.0.10 (Baidu; P2 14.2)` -const withcash = $.getdata("cash_baidu")||30 - +let UA = `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 info baiduboxapp/5.1.1.10 (Baidu; P2 14.2)`; +const withcash = $.getdata("cash_baidu")||30; +let tip = 0,totaltips=0; if ($.isNode()) { if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { StartBody = process.env.BAIDU_COOKIE.split('&'); @@ -242,13 +242,14 @@ async function getConfigs() { await get_pkg() } else if (taskType == 'watch') { tips = daily.tips; - totaltips = daily.total_count - $.log(taskName + tips+"总计"+totaltips+"次") - if (tid == 4) { - await get_search("100") - } else { + count = daily.total_count + $.log("\n"+ taskName + tips+"总计"+count+"次"); + if(daily.taskStatus==0){ await get_search("184") - } + } + if(daily.taskStatus==1){ + $.log(taskName+ "任务已完成") + } } } } @@ -268,8 +269,8 @@ function firstbox() { let bdurl = { url: 'https://mbrowser.baidu.com/lite/gold/receive?service=bdbox', headers: { - Cookie: cookieval, - 'User-Agent': UA + "Cookie": cookieval, + "User-Agent": UA }, body: 'task_type=-1&task_id=-1' } @@ -371,40 +372,44 @@ function Tasks() { function get_search(cmd) { return new Promise((resolve) =>{ let geturl = { - url: `https://mbd.baidu.com/searchbox?action=feed&cmd=${cmd}&network=1_0&osbranch=i3&osname=baiduboxapp&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2&ua=1242_2208_iphone_7.0.0.11_0`, + url: `https://mbd.baidu.com/searchbox?action=feed&cmd=${cmd}&network=1_0&osbranch=i3&osname=baiduboxapp&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2&ua=1242_2208_iphone_5.0.0.11_0&fv=12.1.0.0`, headers: { Cookie: cookieval, 'User-Agent': UA } } $.get(geturl, async(error, resp, data) =>{ - let get_search = JSON.parse(data) // $.log(data+'\n') try { + let get_search = JSON.parse(data) if (get_search.errno == 0) { - let tip = 0 for (items of get_search.data[`${cmd}`].itemlist.items) { searchId = items.id, searchname = items.data.title; - - if(items.data.mode=="video"){ - $.log("\n 观看视频: " + searchname + "\n 任务ID: " + searchId + "\n\n 请等待30s获取收益"); - await $.wait(30000) + author = items.data.author + if(items.data.mode=="video"||items.data.type=="video"){ + $.log("\n 观看视频: " + searchname + " —————— "+author +"\n 任务ID: " + searchId); } if(items.data.mode=="text"){ - $.log("\n 阅读文章: " + searchname + "\n 任务ID: " + searchId + "\n\n 请等待32s获取收益"); - await $.wait(32000) + $.log("\n 阅读短文: " + searchname + "\n 任务ID: " + searchId +" —————— "+items.data.tag ? items.data.tag:""); } if(items.data.mode=="ad"){ - $.log("\n 广告: " + searchname + "\n 任务ID: " + searchId + "\n\n 请等待15s获取收益"); - await $.wait(15000) + $.log("\n 打开广告: " + author+": "+searchname + "\n 任务ID: " + searchId); + } + if( Number(tip) > 3){ + $.log("\n\n 请等待30s获取收益") + await $.wait(30000) + } else { + $.log(" 金币小于3时,加速运行") + await $.wait(5000) } - await searchBox(searchId); - } - $.desc += taskName + "获得收益"+ tip +"\n" + await searchBox(searchId); + totaltips += tip + } + $.desc += taskName + "获得收益"+ totaltips + tips + "\n" } - } catch(e) { - $.logErr(e, data); + } catch(error) { + $.logErr(error+data); } finally { resolve() } @@ -415,27 +420,27 @@ function get_search(cmd) { function searchBox(id) { return new Promise((resolve) =>{ let searchurl = { - url: `https://mbd.baidu.com/searchbox?action=feed&cmd=197&imgtype=webp&network=1_0&osbranch=i3&osname=baiduboxapp&ua=1242_2208_iphone_7.0.0.11_0&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2`, - headers: { - Cookie: cookieval, - 'User-Agent': UA - }, - body: `data = {"origin_nid": "${id}","taskid": "${tid}"}` + url: `https://mbd.baidu.com/searchbox?action=feed&cmd=197&imgtype=webp&network=1_0&osbranch=i3&osname=baiduboxapp&ua=1242_2208_iphone_5.0.0.11_0&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2`, + headers: {"Cookie":cookieval,'User-Agent': UA}, + body: `data={"origin_nid":"${id}","taskid":"${tid}"}` }; $.post(searchurl, async(error, resp, data) =>{ + //$.log(error + resp.statusCode+" "+data) try{ let do_search = JSON.parse(data) if (do_search.errno == 0 && do_search.data['197'].istip == 1) { - $.log(" 获得收益: " + do_search.data[`197`].tips + '\n'); - tip += do_search.data[`197`].tips + $.log(" 获得收益: " + do_search.data[`197`].tips); + tip = Number(do_search.data[`197`].righttips) + //totaltips += Number(tip) await $.wait(2000) } else if (do_search.data[`197`].tips == "") { //$.log(" 获得收益: " + do_search.data[`197`].istip + '\n') + //tip += do_search.data[`197`].righttips } else { $.log("获得收益失败") } }catch(e) { - $.logErr(e, data); + $.logErr(e+data); } finally { resolve() } @@ -464,7 +469,7 @@ function chestTime() { $.log("开宝箱任务ID:"+taskid+ get_chest.data.originData.msg) } } catch(e){ - $.logErr(e, data); + $.logErr(e+data); } finally { resolve() } From 4e7854e2627fc0e415e915fa2c2c39783e230e4e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 25 Jan 2021 21:53:22 +0800 Subject: [PATCH 397/721] Update baidu_speed.js --- Task/baidu_speed.js | 313 +++++++++++++++++++++----------------------- 1 file changed, 152 insertions(+), 161 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 2fe5591ac7..8ef3da20a0 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -45,7 +45,6 @@ if ($.isNode()) { cookieval = CookieArr[i]; $.index = i + 1; await userInfo(); - await getsign(); await firstbox(); await TaskCenter() await showmsg() @@ -144,38 +143,71 @@ function withDraw(cash) { function invite() { - return new Promise((resolve, reject) =>{ - let rewurl = { - url: `https://haokan.baidu.com/activity/h5/vault?productid=2&inviteCode=RW9ZSW&pkg=%5Bpkg%5D `, - headers: {Cookie:cookieval} - } - $.get(rewurl,(error,resp,data) => { - if ( error ) { - //$.log("响应错误") - } - resolve() + return new Promise((resolve, reject) =>{ + let inviteurl = { + url: `https://haokan.baidu.com/activity/h5/vault?productid=2&inviteCode=RW9ZSW&pkg=%5Bpkg%5D `, + headers: { + Cookie: cookieval + } + } + $.get(inviteurl, (error, resp, data) =>{ + if (error) { + //$.log("响应错误") + } + resolve() + }) }) - }) } - function TaskCenter() { return new Promise((resolve, reject) =>{ let rewurl = { url: `https://haokan.baidu.com/activity/h5/vaultnew?productid=2&fromcsr=1&system=ios&_format=json`, headers: { Cookie: cookieval, - 'User-Agent': UA + 'User-Agent': UA } } $.get(rewurl, async(error, resp, data) =>{ try { let get_tasks = JSON.parse(data); - $.log("获取任务数据成功") + $.log("获取任务数据成功"); tasks = get_tasks.data.comps; for (x in tasks) { taskid = tasks[x].taskId; id = tasks[x].id; - await getConfigs() + //$.log("去"+tasks[x].name) + if (tasks[x].name == "taskList") { + //$.log(tasks[x].data.title); + maxTitle = tasks[x].data.title + $.log("去"+maxTitle) + if (maxTitle == "玩游戏赚现金") { + $.log(JSON.stringify(tasks[x].data)) + } else { + for (arr of tasks[x].data.tasklist) { + taskName = "【" + arr.title + "】 "; + tid = arr.id; + taskType = arr.type; + $.log(taskName + taskType); + await getConfigs() + } + } + } + if (tasks[x].name == "popularRecommendation") { + $.log(tasks[x].data.recommendCompName) + } + if (tasks[x].name == "signIn") { + for (z in tasks[x].data.checkin_list) { + signs = tasks[x].data.checkin_list + + if (tasks[x].data.current_date == signs[z].date) { + if(signs[z].is_checkin == 0){ + await getsign() + } else { + $.desc = "【签到结果】✅ 明日收益"+signs[Number(z)+1].coin_reward+"金币\n" + } + } + } + } } } catch(e) { $.logErr(e, data); @@ -187,78 +219,23 @@ function TaskCenter() { } async function getConfigs() { - if (id == 1081) { - tasknName = "<" + tasks[x].data.words + ">", - RefererUrl = tasks[x].data.btnlinkios; - $.log(tasks[x].data.words) - }; - if (id == 1068) { - for (HeadBox of tasks[x].data.unOpenHeadBoxDialog.btn) { - taskName = "【"+HeadBox.btnText+"】 ", - RefererUrl = HeadBox.iosAdUrl; - $.log(HeadBox.btnText) - }; - for (openBox of tasks[x].data.gameheader.progressList) { - taskstatus = openBox.status, - taskid = openBox.coinRequired; - //$.log(openBox.status) - }; - for (jingangs of tasks[x].data.jingang.list) { - jingangType = jingangs.jingangType, - taskName = "【"+jingangs.jingangName+"】 ", - RefererUrl = jingangs.jingangUrl, - tid = jingangs.jingangTid; - //$.log(jingangs.jingangName); - if (jingangType == 2) { - if (tasks[x].data.jingang.countDown[tid].countDown == 0) { - await $.wait(1000); - await get_pkg(tid); - } else { - $.log(taskName+ " 请等待" + Number(tasks[x].data.jingang.countDown[tid].countDown / 60).toFixed(2) + "分钟") - } - } - } - } - if (id == 52) { - for (signs of tasks[x].data.checkin_list) { - if (tasks[x].data.current_date == signs.date && signs.is_checkin == 0) { - await getsign() - } - } - } - if (id == 963) { - $.log(tasks[x].data.recommendCompName) - } - if (id == 277) { - $.log("\n去完成" + tasks[x].data.title) - for (daily of tasks[x].data.tasklist) { - taskName = "【"+daily.title +"】 "; - //taskName += "【"+taskName+"】 " - tid = daily.id; - taskType = daily.type - if (taskType == "openApp") { - tid = tid == '395' ? "385": tid, - RefererUrl = daily.adLink; - await get_pkg() - } else if (taskType == 'watch') { - tips = daily.tips; - count = daily.total_count - $.log("\n"+ taskName + tips+"总计"+count+"次"); - if(daily.taskStatus==0){ - await get_search("184") - } - if(daily.taskStatus==1){ - $.log(taskName+ "任务已完成") - } - } + if (arr.taskStatus == 1) { + $.log(taskName + " ID:" + id + " 已完成") + $.desc += taskName + " ✅ 已完成\n" + } else if (taskType == 'openApp') { + tid = tid == '395' ? "385": tid; + RefererUrl = arr.adLink; + //$.log("去完成" + taskName) + //$.log(JSON.stringify(arr)) + await get_pkg(tid) + } else if (taskType == 'watch') { + tips = arr.tips; + count = arr.total_count; + $.log("\n" + taskName + tips + "总计" + count + "次"); + if (arr.taskStatus == 0) { + await get_search("184") } } - if(id==278){ - $.log(tasks[x].data.tasklist[0].title) - } - if(id==10){ - $.log(tasks[x].name) - } } @@ -292,18 +269,19 @@ function firstbox() { //视频 -function get_pkg() { +function get_pkg(tid) { return new Promise((resolve, reject) =>{ let pkgurl = { - url: `https://haokan.baidu.com/activity/acad/rewardad?device=%7B%22imei_md5%22%3A%22%22%2C%22device_type%22%3A1%2C%22model%22%3A%22IPHONE%22%2C%22manufacturer%22%3A%22Apple%22%2C%22os_version%22%3A%2214.2%22%2C%22androidId%22%3A%22%22%7D%2C%22screen_width%22%3A1242%2C%22screen_height%22%3A2208&network=%7B%22connect_type%22%3A1%2C%22carrier%22%3A0%7D&productid=2&tid=${tid}&type=1`, + url: `https://haokan.baidu.com/activity/acad/rewardad?device=%7B%22device_type%22%3A1%2C%22model%22%3A%22IPHONE%22%2C%22manufacturer%22%3A%22Apple%22%2C%22os_version%22%3A%2214.2%22%7D%2C%22screen_width%22%3A1242%2C%22screen_height%22%3A2208%7D&network=%7B%22connect_type%22%3A1%2C%22carrier%22%3A0%7D&productid=2&tid=${tid}&type=1`, headers: { Cookie: cookieval, 'User-Agent': UA, 'Referer': RefererUrl } - } + } $.get(pkgurl, async(error, resp, data) =>{ - let get_pkg = JSON.parse(data); + let get_pkg = JSON.parse(data); + if (get_pkg.errno == 0 && get_pkg.data.isDone == 0) { Pkg = get_pkg.data.adInfo[0].material.pkg, taskid = get_pkg.data.taskPf.taskId; @@ -311,7 +289,7 @@ function get_pkg() { //$.log("\n"+taskid +" "+ Pkg) await activeBox() } else if (get_pkg.errno == 0 && get_pkg.data.isDone == 1) { - $.desc += taskName + "已完成\n"; + $.desc += taskName + "✅ 已完成\n"; $.log(taskName + "已完成\n") } resolve() @@ -320,22 +298,27 @@ function get_pkg() { } function activeBox() { - return new Promise((resolve, reject) =>{ - let actboxurl = { - url: `https://haokan.baidu.com/activity/tasks/active?productid=2&id=${tid}`, - headers: {Cookie:cookieval,'User-Agent': UA,Referer:RefererUrl} - } - $.get(actboxurl, async(error, response, data) => { - //let act_box = JSON.parse(data) - $.log(' 任务激活成功,等待10s获取收益' ) - await $.wait(10000); - await Tasks(); - resolve() + return new Promise((resolve, reject) =>{ + let actboxurl = { + url: `https://haokan.baidu.com/activity/tasks/active?productid=2&id=${tid}`, + headers: { + Cookie: cookieval, + 'User-Agent': UA, + Referer: RefererUrl + } + } + $.get(actboxurl, async(error, response, data) =>{ + //let act_box = JSON.parse(data) + if (resp.statusCode == 200) { + $.log(' 任务激活成功,等待10s获取收益'); + await $.wait(10000); + await Tasks(); + } + resolve() + }) }) - }) } - function Tasks() { return new Promise((resolve) =>{ let taskurl = { @@ -406,7 +389,7 @@ function get_search(cmd) { await searchBox(searchId); totaltips += tip } - $.desc += taskName + "获得收益"+ totaltips + tips + "\n" + $.desc += taskName + "获得收益"+ totaltips + "金币" +tips + "\n" } } catch(error) { $.logErr(error+data); @@ -449,71 +432,79 @@ function searchBox(id) { } //缩减开宝箱时间 function chestTime() { - return new Promise((resolve, reject) =>{ - let timeurl = { - url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestTime&rewardVideoPkg=${Pkg}`, - headers: {Cookie:cookieval,'User-Agent': UA,Referer:RefererUrl} - } - $.get(timeurl, (error, resp, data) => { - $.log(data) - try{ - let get_chest = JSON.parse(data) - if (get_chest.errno == 11006){ - $.log("开宝箱任务"+get_chest.errmsg) - } - else if (get_chest.errno == 0){ - $.log("开宝箱时间缩减"+get_chest.data.awardTime/60+"分钟") - } - else if (get_chest.errno == 19001&&get_chest.data.originData.errno==10074 ){ - //$.desc += get_chest.data.originData.msg - $.log("开宝箱任务ID:"+taskid+ get_chest.data.originData.msg) - } - } catch(e){ - $.logErr(e+data); - } finally { - resolve() - } + return new Promise((resolve, reject) =>{ + let timeurl = { + url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestTime&rewardVideoPkg=${Pkg}`, + headers: { + Cookie: cookieval, + 'User-Agent': UA, + Referer: RefererUrl + } + } + $.get(timeurl, (error, resp, data) =>{ + //$.log(data) + try { + let get_chest = JSON.parse(data); + if (get_chest.errno == 11006) { + $.log("开宝箱任务" + get_chest.errmsg) + } else if (get_chest.errno == 0) { + $.log("开宝箱时间缩减" + get_chest.data.awardTime / 60 + "分钟") + } else if (get_chest.errno == 19001 && get_chest.data.originData.errno == 10074) { + //$.desc += get_chest.data.originData.msg + $.log("开宝箱任务ID:" + taskid + get_chest.data.originData.msg) + } + } catch(e) { + $.logErr(e + data); + } finally { + resolve() + } + }) }) - }) } //任务中心宝箱 function activeBox2() { - return new Promise((resolve, reject) =>{ - let actboxurl = { - url: `https://haokan.baidu.com/activity/acuserchest/opennew`, - headers: {Cookie:cookieval,'User-Agent': UA}, - body: `taskid=${taskid}&productid=2&ugus=5256798061` - } - $.post(actboxurl, async(error, response, data) => { - let act_box = JSON.parse(data) - //$.log('actbox: ' + data) - if (act_box.errno == 0){ - $.desc += '开宝箱获得收益: +' + act_box.data.coin - - } else if (act_box.errno == 10060){ - //taskid = '669' - await chestTime() - $.desc += act_box.msg - } - resolve() + return new Promise((resolve, reject) =>{ + let actboxurl = { + url: `https://haokan.baidu.com/activity/acuserchest/opennew`, + headers: { + Cookie: cookieval, + 'User-Agent': UA + }, + body: `taskid=${taskid}&productid=2&ugus=5256798061` + } + $.post(actboxurl, async(error, response, data) =>{ + let act_box = JSON.parse(data) + //$.log('actbox: ' + data) + if (act_box.errno == 0) { + $.desc += '开宝箱获得收益: +' + act_box.data.coin + } else if (act_box.errno == 10060) { + //taskid = '669' + await chestTime(); + $.desc += act_box.msg + } + resolve() + }) }) - }) } function doubleBox() { - return new Promise((resolve, reject) =>{ - let douboxurl = { - url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestDouble&rewardVideoPkg=${Pkg}`, - headers: {Cookie:cookieval,'User-Agent': UA,Referer:RefererUrl} - } - $.get(douboxurl, (error, response, data) => { - let get_doubox = JSON.parse(data) - if (get_doubox.errno == 0){ - $.desc += '开宝箱获得双倍收益: +' + get_doubox.data.awardCoin - } - resolve() + return new Promise((resolve, reject) =>{ + let douboxurl = { + url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestDouble&rewardVideoPkg=${Pkg}`, + headers: { + Cookie: cookieval, + 'User-Agent': UA, + Referer: RefererUrl + } + } + $.get(douboxurl, (error, response, data) =>{ + let get_doubox = JSON.parse(data); + if (get_doubox.errno == 0) { + $.desc += '开宝箱获得双倍收益: +' + get_doubox.data.awardCoin + } + resolve() + }) }) - }) } function showmsg() { From b2888dbc0a9ae7dc9f29f09aad3228f278fbf2f4 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 25 Jan 2021 22:31:35 +0800 Subject: [PATCH 398/721] Update baidu_speed.js --- Task/baidu_speed.js | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 8ef3da20a0..56efac1510 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -102,7 +102,13 @@ function userInfo() { chargemoney = data.match(/charge_money":"(\d+\.\d+)/)[1], waitingcoin = data.match(/waiting_coin":(\d+)/)[1], availablecoin = data.match(/available_coin":(\d+)/)[1], - invitecode = data.match(/invite_code":"(\w+)/)[1] + invitecode = data.match(/invite_code":"(\w+)/)[1], + coinenabled = data.match(/coin_enabled":(\d+)/)[1] + rate = data.match(/exchange_rate":(\d+)/)[1] + if (coinenabled > 100){ + coinnum = parseInt(coinenabled/100)*100 + await coinexChange() + } } $.sub= "昵称:"+username+" 现金:"+ chargemoney+" 金币:"+availablecoin $.log("获取用户信息成功,昵称: "+username+ " 现金:"+chargemoney+"元"); @@ -158,6 +164,31 @@ function invite() { }) }) } + +function coinexChange() { + return new Promise((resolve, reject) =>{ + let Changeurl = { + url: `https://haokan.baidu.com/activity/api/coinexchange?coinnum=${coinnum}&autolock=1&productid=2&ugVersion=5.1.1.10`, + headers: { + Cookie: cookieval, + 'User-Agent': UA + } + } + $.get(Changeurl, (error, resp, data) =>{ + let exchange = JSON.parse(data) + $.log(data) + if (exchange.errno == 0) { + $.log("兑换成功,"+ exchange.data.message) + $.msg($.name, "金币兑换成功,"+ exchange.data.message) + } + resolve() + }) + }) +} + + + + function TaskCenter() { return new Promise((resolve, reject) =>{ let rewurl = { From 4274513beb183c8b4410bf9971ce4da082aa382a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 25 Jan 2021 22:43:13 +0800 Subject: [PATCH 399/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index f666a4924e..9f7cbd8aff 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -260,6 +260,42 @@ "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png"], "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js" }, + { + "id": "baidu", + "name": "百度极速任务", + "keys": ["chavy_cookie_tieba","CookieTB"], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/baiduspeed.js", + "settings": [{ + "id": "cash_baidu", + "name": "提现金额", + "val": "30", + "type": "radios", + "desc": "自动提现金额", + "items": [{ + "key": "5", + "label": "5元" + }, + { + "key": "30", + "label": "30元" + }, + { + "key": "30", + "label": "30元" + }, + { + "key": "50", + "label": "50元" + }, + { + "key": "100", + "label": "100元" + }] + } + "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed.png"], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baiduspeed.js" + }, { "id": "txnews", "name": "腾讯新闻", From 30df0f50053e58315f7c8c012d257fa5de5ce3a0 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 25 Jan 2021 23:16:31 +0800 Subject: [PATCH 400/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 9f7cbd8aff..e8300fcee2 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -292,7 +292,7 @@ "key": "100", "label": "100元" }] - } + }, "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed.png"], "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baiduspeed.js" }, From 86095ee11b297c66df4e3a4a642e4c5b0f1ca59d Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 25 Jan 2021 23:18:57 +0800 Subject: [PATCH 401/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 970 +++++++++++++++++++++++------------------ 1 file changed, 556 insertions(+), 414 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index e8300fcee2..bf0f36c0fb 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -1,433 +1,575 @@ { - "id": "sunert.app.sub", - "name": "Sunert 签到应用订阅", - "author": "@Sunert", - "icon": "https://avatars2.githubusercontent.com/u/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", - "repo": "https://github.com/Sunert/Scripts/tree/master", - "apps": [{ - "id": "weibo", - "name": "新浪微博", - "keys": ["sy_payheader_wb", "sy_token_wb"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", "https://raw.githubusercontent.com/Orz-3/task/master/weibo.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js" - }, - { - "id": "youth", - "name": "中青看点", - "keys": ["youthheader_zq", "read_zq", "red_zq", "readtime_zq", "cashurl_zq","cashbody_zq"], - "author": "@sunert", - "settings": [{ - "id": "notifytimes", - "name": "通知频率 (点击查看设置说明)", - "val": "", - "type": "number", - "desc": "设定通知频率,前三次为全部通知,之后转盘次数/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" - }, + "id": "sunert.app.sub", + "name": "Sunert 签到应用订阅", + "author": "@Sunert", + "icon": "https://avatars2.githubusercontent.com/u/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", + "repo": "https://github.com/Sunert/Scripts/tree/master", + "apps": [ { - "id": "zqlogs", - "name": "调试日志", - "val": false, - "type": "boolean", - "desc": "调试日志开关,默认关闭" - }, + "id": "weibo", + "name": "新浪微博", + "keys": [ + "sy_payheader_wb", + "sy_token_wb" + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", + "https://raw.githubusercontent.com/Orz-3/task/master/weibo.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js" + }, { - "id": "zqcash", - "name": "提现金额", - "val": "30", - "type": "radios", - "desc": "自动提现金额需和获取提现请求保持一致", - "items": [{ - "key": "10", - "label": "10元" - }, - { - "key": "30", - "label": "30元" - }, - { - "key": "100", - "label": "100元" - }] - } - ], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js" - }, - { - "id": "youthGain", - "name": "中青浏览赚", - "keys": ["youth_start", "youth_end"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js" - }, - { - "id": "dianshijia", - "name": "电视家", - "keys": ["sy_signheader_dsj", "drawal_dsj"], - "author": "@sunert", - "settings": [{ - "id": "REWARD", - "name": "额外签到奖励", - "val": "55", - "type": "radios", - "desc": "", - "items": [{ - "key": "55", - "label": "提现额度" - }, - { - "key": "44", - "label": "1天VIP" - }, - { - "key": "42", - "label": "1888金币" - }] - }], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js" - }, - { - "id": "kuaishou", - "name": "快手极速版", - "keys": ["cookie_ks"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", "https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js" - }, - { - "id": "sinanews", - "name": "新浪新闻", - "keys": ["sy_signurl_snews", "sy_info_snews", "sy_ck_snews", "sy_infoheader_snews"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js" - }, - { - "id": "NOWLIVE", - "name": "NOW直播", - "keys": ["now_qq", "nowqq_cookie"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js" - }, - { - "id": "chinatelecomEnquiry", - "name": "电信套餐查询", - "keys": ["china_telecom_authToken_10000", "china_telecom_cookie"], - "settings": [{ - "id": "Mon", - "name": "查询月份", - "val": "2020-08", - "type": "month", - "desc": "填入账单月份,可查最近六个月,本月账单下月可查" - }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", "https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js" - }, - { - "id": "jddj", - "name": "京东到家", - "keys": ["sy_cookie_dj"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jddj.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", "https://raw.githubusercontent.com/Orz-3/task/master/jddj.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js" - }, - { - "id": "TVlist", - "name": "电视预告", - "keys": ["c"], - "settings": [{ - "id": "c", - "name": "电视台", - "val": "cctv8", - "type": "text", - "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" - }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js" - }, - { - "id": "moji", - "name": "墨迹天气", - "keys": ["city", "citynum", "cut", "day_desc", "hour_desc", "index_desc"], - "settings": [{ - "id": "city", - "name": "城市", - "val": "北京", - "type": "text", - "desc": "请填写中文地区" - }, + "id": "youth", + "name": "中青看点", + "keys": [ + "youthheader_zq", + "read_zq", + "red_zq", + "readtime_zq", + "cashurl_zq", + "cashbody_zq" + ], + "author": "@sunert", + "settings": [ + { + "id": "notifytimes", + "name": "通知频率 (点击查看设置说明)", + "val": "", + "type": "number", + "desc": "设定通知频率,前三次为全部通知,之后转盘次数/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" + }, + { + "id": "zqlogs", + "name": "调试日志", + "val": false, + "type": "boolean", + "desc": "调试日志开关,默认关闭" + }, + { + "id": "zqcash", + "name": "提现金额", + "val": "30", + "type": "radios", + "desc": "自动提现金额需和获取提现请求保持一致", + "items": [ + { + "key": "10", + "label": "10元" + }, + { + "key": "30", + "label": "30元" + }, + { + "key": "100", + "label": "100元" + } + ] + } + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", + "https://raw.githubusercontent.com/Orz-3/task/master/youth.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js" + }, + { + "id": "youthGain", + "name": "中青浏览赚", + "keys": [ + "youth_start", + "youth_end" + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", + "https://raw.githubusercontent.com/Orz-3/task/master/youth.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js" + }, { - "id": "citynum", - "name": "城市序号", - "val": "", - "type": "number", - "placeholder": "默认1 (点击以展开说明)", - "desc": "选择地区,请填写日志内冒号前的数字序号" - }, + "id": "dianshijia", + "name": "电视家", + "keys": [ + "sy_signheader_dsj", + "drawal_dsj" + ], + "author": "@sunert", + "settings": [ + { + "id": "REWARD", + "name": "额外签到奖励", + "val": "55", + "type": "radios", + "desc": "", + "items": [ + { + "key": "55", + "label": "提现额度" + }, + { + "key": "44", + "label": "1天VIP" + }, + { + "key": "42", + "label": "1888金币" + } + ] + } + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", + "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js" + }, { - "id": "cut", - "name": "精简日志模式", - "val": false, - "type": "boolean", - "desc": "显示详情描述,默认关闭日志" - }, + "id": "kuaishou", + "name": "快手极速版", + "keys": [ + "cookie_ks" + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", + "https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js" + }, { - "id": "day_desc", - "name": "每周天气", - "val": true, - "type": "boolean", - "desc": "每周天气接口,可显示6天天气情况" - }, + "id": "sinanews", + "name": "新浪新闻", + "keys": [ + "sy_signurl_snews", + "sy_info_snews", + "sy_ck_snews", + "sy_infoheader_snews" + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", + "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js" + }, { - "id": "hour_desc", - "name": "小时天气", - "val": false, - "type": "boolean", - "desc": "未来6小时天气情况" - }, + "id": "NOWLIVE", + "name": "NOW直播", + "keys": [ + "now_qq", + "nowqq_cookie" + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", + "icons": [ + "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", + "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js" + }, { - "id": "forty_desc", - "name": "40天预告", - "val": false, - "type": "boolean", - "desc": "未来40天天气预告" - }, + "id": "chinatelecomEnquiry", + "name": "电信套餐查询", + "keys": [ + "china_telecom_authToken_10000", + "china_telecom_cookie" + ], + "settings": [ + { + "id": "Mon", + "name": "查询月份", + "val": "2020-08", + "type": "month", + "desc": "填入账单月份,可查最近六个月,本月账单下月可查" + } + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", + "https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js" + }, { - "id": "index_desc", - "name": "生活指数", - "val": true, - "type": "boolean", - "desc": "可显示生活指数情况" - }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js" - }, - { - "id": "jukan", - "name": "聚看点", - "keys": ["jukan_body", "jukan_name"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", - "settings": [{ - "id": "jukan_out", - "name": "自动提现", - "val": false, - "type": "boolean", - "desc": "自动提现开关,请填入提现金额及微信绑定实名,默认关闭" - }, + "id": "jddj", + "name": "京东到家", + "keys": [ + "sy_cookie_dj" + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jddj.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", + "https://raw.githubusercontent.com/Orz-3/task/master/jddj.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js" + }, { - "id": "jukan_cash", - "name": "提现金额", - "val": "", - "type": "number", - "placeholder": "默认30 (点击以展开说明)", - "desc": "仅允许填入数字,所选金额可见聚看点APP" - }, + "id": "TVlist", + "name": "电视预告", + "keys": [ + "c" + ], + "settings": [ + { + "id": "c", + "name": "电视台", + "val": "cctv8", + "type": "text", + "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" + } + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", + "icons": [ + "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", + "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js" + }, { - "id": "jukan_name", - "name": "微信真实姓名", - "val": "", - "type": "text", - "placeholder": "填入微信真实姓名" - }], - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js" - }, - { - "id": "mydigit", - "name": "数码之家", - "keys": ["sign_mydigit"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js" - }, - { - "id": "baidu", - "name": "百度极速任务", - "keys": ["chavy_cookie_tieba","CookieTB"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/baiduspeed.js", - "settings": [{ - "id": "cash_baidu", - "name": "提现金额", - "val": "30", - "type": "radios", - "desc": "自动提现金额", - "items": [{ - "key": "5", - "label": "5元" - }, - { - "key": "30", - "label": "30元" - }, - { - "key": "30", - "label": "30元" - }, - { - "key": "50", - "label": "50元" - }, - { - "key": "100", - "label": "100元" - }] - }, - "icons": ["https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed_mini.png", "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baiduspeed.js" - }, - { - "id": "txnews", - "name": "腾讯新闻", - "keys": ["sy_signurl_txnews", "sy_cookie_txnews", "video_txnews"], - "author": "@sunert", - "settings": [{ - "id": "notifynum", - "name": "通知频率", - "val": "", - "type": "number", - "placeholder": "默认50 (点击以展开说明)", - "desc": "阅读篇数间隔通知开为1,常关为0(默认50篇)" - }, + "id": "moji", + "name": "墨迹天气", + "keys": [ + "city", + "citynum", + "cut", + "day_desc", + "hour_desc", + "index_desc" + ], + "settings": [ + { + "id": "city", + "name": "城市", + "val": "北京", + "type": "text", + "desc": "请填写中文地区" + }, + { + "id": "citynum", + "name": "城市序号", + "val": "", + "type": "number", + "placeholder": "默认1 (点击以展开说明)", + "desc": "选择地区,请填写日志内冒号前的数字序号" + }, + { + "id": "cut", + "name": "精简日志模式", + "val": false, + "type": "boolean", + "desc": "显示详情描述,默认关闭日志" + }, + { + "id": "day_desc", + "name": "每周天气", + "val": true, + "type": "boolean", + "desc": "每周天气接口,可显示6天天气情况" + }, + { + "id": "hour_desc", + "name": "小时天气", + "val": false, + "type": "boolean", + "desc": "未来6小时天气情况" + }, + { + "id": "forty_desc", + "name": "40天预告", + "val": false, + "type": "boolean", + "desc": "未来40天天气预告" + }, + { + "id": "index_desc", + "name": "生活指数", + "val": true, + "type": "boolean", + "desc": "可显示生活指数情况" + } + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", + "icons": [ + "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", + "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js" + }, { - "id": "delay", - "name": "延迟时间(毫秒)", - "val": "", - "type": "number", - "placeholder": "默认200 (点击以展开说明)", - "desc": "接口延迟时间" - }], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", "https://raw.githubusercontent.com/Orz-3/task/master/txnews.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js" - }, - { - "id": "jingxi", - "name": "京喜", - "keys": ["CookieJD", "CookieJD2"], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jingxi.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/jingxi.png", "https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js" - }, - { - "id": "translate", - "name": "谷歌翻译", - "keys": [], - "settings": [{ - "id": "word", - "name": "原文", - "val": "Hello World", - "type": "textarea", - "placeholder": "Hello World", - "desc": "兼容中英文短语翻译,填入原文后手动运行" - }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", "https://raw.githubusercontent.com/Orz-3/task/master/translate.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js" - }, - { - "id": "exchange rate", - "name": "汇率换算", - "keys": [], - "settings": [{ - "id": "froma", - "name": "使用币", - "val": "人民币", - "type": "text", - "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" - }, + "id": "jukan", + "name": "聚看点", + "keys": [ + "jukan_body", + "jukan_name" + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", + "settings": [ + { + "id": "jukan_out", + "name": "自动提现", + "val": false, + "type": "boolean", + "desc": "自动提现开关,请填入提现金额及微信绑定实名,默认关闭" + }, + { + "id": "jukan_cash", + "name": "提现金额", + "val": "", + "type": "number", + "placeholder": "默认30 (点击以展开说明)", + "desc": "仅允许填入数字,所选金额可见聚看点APP" + }, + { + "id": "jukan_name", + "name": "微信真实姓名", + "val": "", + "type": "text", + "placeholder": "填入微信真实姓名" + } + ], + "icons": [ + "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan_mini.png", + "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js" + }, { - "id": "toex", - "name": "兑换币", - "val": "港币", - "type": "text", - "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" - }, + "id": "mydigit", + "name": "数码之家", + "keys": [ + "sign_mydigit" + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", + "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js" + }, { - "id": "numex", - "name": "兑换金额", - "val": "10", - "type": "number", - "desc": "填写数字" - }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", "https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js" - }, - { - "id": "trainquery", - "name": "列车时刻", - "keys": [], - "settings": [{ - "id": "people", - "name": "乘客类型", - "val": "ADULT", - "type": "radios", - "desc": "成人/学生", - "items": [{ - "key": "ADULT", - "label": "成人" - }, - { - "key": "0X00", - "label": "学生" - }] - }, + "id": "baidu", + "name": "百度极速任务", + "keys": [ + "chavy_cookie_tieba", + "CookieTB" + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/baiduspeed.js", + "settings": [ + { + "id": "cash_baidu", + "name": "提现金额", + "val": "30", + "type": "radios", + "desc": "自动提现金额", + "items": [ + { + "key": "5", + "label": "5元" + }, + { + "key": "30", + "label": "30元" + }, + { + "key": "30", + "label": "30元" + }, + { + "key": "50", + "label": "50元" + }, + { + "key": "100", + "label": "100元" + } + ] + } + ], + "icons": [ + "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed_mini.png", + "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baiduspeed.js" + }, { - "id": "left", - "name": "出发站点", - "val": "北京", - "type": "text", - "desc": "填入中文站点" - }, + "id": "txnews", + "name": "腾讯新闻", + "keys": [ + "sy_signurl_txnews", + "sy_cookie_txnews", + "video_txnews" + ], + "author": "@sunert", + "settings": [ + { + "id": "notifynum", + "name": "通知频率", + "val": "", + "type": "number", + "placeholder": "默认50 (点击以展开说明)", + "desc": "阅读篇数间隔通知开为1,常关为0(默认50篇)" + }, + { + "id": "delay", + "name": "延迟时间(毫秒)", + "val": "", + "type": "number", + "placeholder": "默认200 (点击以展开说明)", + "desc": "接口延迟时间" + } + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", + "https://raw.githubusercontent.com/Orz-3/task/master/txnews.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js" + }, { - "id": "end", - "name": "目的地", - "val": "上海", - "type": "text", - "desc": "填入中文站点" - }, + "id": "jingxi", + "name": "京喜", + "keys": [ + "CookieJD", + "CookieJD2" + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jingxi.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/jingxi.png", + "https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js" + }, { - "id": "leavedate", - "name": "出发时间", - "val": "2020-08-15", - "type": "date", - "desc": "填入出发日期,请按照格式填写" - }, + "id": "translate", + "name": "谷歌翻译", + "keys": [ ], + "settings": [ + { + "id": "word", + "name": "原文", + "val": "Hello World", + "type": "textarea", + "placeholder": "Hello World", + "desc": "兼容中英文短语翻译,填入原文后手动运行" + } + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", + "https://raw.githubusercontent.com/Orz-3/task/master/translate.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js" + }, { - "id": "setrain", - "name": "列车车次", - "val": "G5", - "type": "text", - "desc": "填入列车车次或者列车序号,列车序号请查看日志详情" - }], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", - "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", "https://raw.githubusercontent.com/Orz-3/task/master/12306.png"], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js" - } - ] + "id": "exchange rate", + "name": "汇率换算", + "keys": [ ], + "settings": [ + { + "id": "froma", + "name": "使用币", + "val": "人民币", + "type": "text", + "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" + }, + { + "id": "toex", + "name": "兑换币", + "val": "港币", + "type": "text", + "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" + }, + { + "id": "numex", + "name": "兑换金额", + "val": "10", + "type": "number", + "desc": "填写数字" + } + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", + "https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js" + }, + { + "id": "trainquery", + "name": "列车时刻", + "keys": [ ], + "settings": [ + { + "id": "people", + "name": "乘客类型", + "val": "ADULT", + "type": "radios", + "desc": "成人/学生", + "items": [ + { + "key": "ADULT", + "label": "成人" + }, + { + "key": "0X00", + "label": "学生" + } + ] + }, + { + "id": "left", + "name": "出发站点", + "val": "北京", + "type": "text", + "desc": "填入中文站点" + }, + { + "id": "end", + "name": "目的地", + "val": "上海", + "type": "text", + "desc": "填入中文站点" + }, + { + "id": "leavedate", + "name": "出发时间", + "val": "2020-08-15", + "type": "date", + "desc": "填入出发日期,请按照格式填写" + }, + { + "id": "setrain", + "name": "列车车次", + "val": "G5", + "type": "text", + "desc": "填入列车车次或者列车序号,列车序号请查看日志详情" + } + ], + "author": "@sunert", + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", + "https://raw.githubusercontent.com/Orz-3/task/master/12306.png" + ], + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js" + } + ] } From 7c73a389ea7ba3c2ace0c2922e24d30b93a7da3e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 25 Jan 2021 23:21:40 +0800 Subject: [PATCH 402/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index bf0f36c0fb..ac08d4e8ac 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -384,11 +384,7 @@ { "key": "30", "label": "30元" - }, - { - "key": "30", - "label": "30元" - }, + }, { "key": "50", "label": "50元" From 9e339575fcd492fbe84ee0d762b54172e0b71b04 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 14:06:09 +0800 Subject: [PATCH 403/721] Update baidu_speed.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加提现 --- Task/baidu_speed.js | 130 +++++++++++++++++++++++++++----------------- 1 file changed, 80 insertions(+), 50 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 56efac1510..667f083bba 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -1,37 +1,51 @@ /* 百度极速版签到任务 -本脚本默认使用chavyleung大佬和Nobyda的贴吧ck,获取方法请看大佬仓库说明,内置自动提现,提现金额默认30元 +本脚本默认使用chavyleung大佬和Nobyda的贴吧ck,获取方法请看大佬仓库说明,内置自动提现,提现金额默认30元,当当前时间为早上6点且达到提现金额时仅运行提现任务,提现金额小于设置金额时继续运行其他任务。 ~~~~~~~~~~~~~~~~ */ const $ = new Env('百度极速版') - -let CookieArr = []; +let CookieArr = [],cashArr=[]; let UA = `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 info baiduboxapp/5.1.1.10 (Baidu; P2 14.2)`; -const withcash = $.getdata("cash_baidu")||30; -let tip = 0,totaltips=0; +const notify = $.isNode() ? require('./sendNotify') : ''; if ($.isNode()) { if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { - StartBody = process.env.BAIDU_COOKIE.split('&'); + BDCookie = process.env.BAIDU_COOKIE.split('&'); } - if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('\n') > -1) { + else if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('\n') > -1) { BDCookie = process.env.BAIDU_COOKIE.split('\n'); } else { BDCookie = process.env.BAIDU_COOKIE.split() + }; + if (process.env.BAIDU_CASH && process.env.BAIDU_CASH.indexOf('&') > -1) { + BDCASH = process.env.BAIDU_CASH.split('&'); + } + else if (process.env.BAIDU_CASH && process.env.BAIDU_CASH.indexOf('\n') > -1) { + BDCASH = process.env.BAIDU_CASH.split('\n'); + } else { + BDCASH = process.env.BAIDU_CASH } Object.keys(BDCookie).forEach((item) => { if (BDCookie[item]) { CookieArr.push(BDCookie[item]) } }) + Object.keys(BDCASH).forEach((item) => { + if (BDCASH[item]) { + cashArr.push(BDCASH[item]) + } + }) + } else { - CookieArr.push($.getdata(`chavy_cookie_tieba`)||$.getdata(`CookieTB`)) + CookieArr.push($.getdata(`chavy_cookie_tieba`) || $.getdata(`CookieTB`)) + cashArr.push($.getdata("cash_baidu")||30) } if ($.isNode()) { - console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + //console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + console.log(`您共提供${CookieArr.length}个百度账号 Cookie`) } !(async() => { @@ -39,12 +53,13 @@ if ($.isNode()) { console.log($.name, '【提示】请把百度Cookie填入Github 的 Secrets 中,请以&或者换行隔开') return; } - console.log(`您共提供${CookieArr.length}个百度账号Cookie`) for (let i = 0; i < CookieArr.length; i++) { if (CookieArr[i]) { cookieval = CookieArr[i]; + withcash = cashArr[i] $.index = i + 1; await userInfo(); + await $.wait(1000) await firstbox(); await TaskCenter() await showmsg() @@ -107,13 +122,17 @@ function userInfo() { rate = data.match(/exchange_rate":(\d+)/)[1] if (coinenabled > 100){ coinnum = parseInt(coinenabled/100)*100 - await coinexChange() + await coinexChange() } } - $.sub= "昵称:"+username+" 现金:"+ chargemoney+" 金币:"+availablecoin - $.log("获取用户信息成功,昵称: "+username+ " 现金:"+chargemoney+"元"); - if (chargemoney >= withcash && $.time("HH") == 6) { - await withDraw(withcash) + $.sub = " 昵称:"+username+" 现金:"+ chargemoney+" 金币:"+availablecoin+"元" + $.log("\n********** 昵称:"+username+ " 现金:"+chargemoney+"元 **********\n"); + if (Number(chargemoney) >= Number(withcash) && $.time("HH") == "06") { + await withDraw(withcash) + if ($.isNode()) { + await notify.sendNotify($.name+" 成功提现"+withcash+"元\n"+$.sub) + } + $.done() } } catch(error) { $.msg($.name, "获取用户信息失败"), @@ -176,7 +195,7 @@ function coinexChange() { } $.get(Changeurl, (error, resp, data) =>{ let exchange = JSON.parse(data) - $.log(data) + //$.log(data) if (exchange.errno == 0) { $.log("兑换成功,"+ exchange.data.message) $.msg($.name, "金币兑换成功,"+ exchange.data.message) @@ -201,16 +220,14 @@ function TaskCenter() { $.get(rewurl, async(error, resp, data) =>{ try { let get_tasks = JSON.parse(data); - $.log("获取任务数据成功"); + $.log("========== 任务开始 ==========\n"); tasks = get_tasks.data.comps; for (x in tasks) { taskid = tasks[x].taskId; id = tasks[x].id; - //$.log("去"+tasks[x].name) if (tasks[x].name == "taskList") { - //$.log(tasks[x].data.title); maxTitle = tasks[x].data.title - $.log("去"+maxTitle) + $.log("去"+maxTitle+"\n") if (maxTitle == "玩游戏赚现金") { $.log(JSON.stringify(tasks[x].data)) } else { @@ -218,13 +235,13 @@ function TaskCenter() { taskName = "【" + arr.title + "】 "; tid = arr.id; taskType = arr.type; - $.log(taskName + taskType); + //$.log(taskName + taskType); await getConfigs() } } } if (tasks[x].name == "popularRecommendation") { - $.log(tasks[x].data.recommendCompName) + //$.log(tasks[x].data.recommendCompName) } if (tasks[x].name == "signIn") { for (z in tasks[x].data.checkin_list) { @@ -235,6 +252,7 @@ function TaskCenter() { await getsign() } else { $.desc = "【签到结果】✅ 明日收益"+signs[Number(z)+1].coin_reward+"金币\n" + $.log($.desc) } } } @@ -250,6 +268,7 @@ function TaskCenter() { } async function getConfigs() { + //let coin = 0; if (arr.taskStatus == 1) { $.log(taskName + " ID:" + id + " 已完成") $.desc += taskName + " ✅ 已完成\n" @@ -262,10 +281,12 @@ async function getConfigs() { } else if (taskType == 'watch') { tips = arr.tips; count = arr.total_count; - $.log("\n" + taskName + tips + "总计" + count + "次"); + $.log(taskName + tips + "总计" + count + "次"); if (arr.taskStatus == 0) { + await $.wait(2000); await get_search("184") } + $.desc += taskName + tips + "总计" + count + "次\n"; } } @@ -338,10 +359,10 @@ function activeBox() { Referer: RefererUrl } } - $.get(actboxurl, async(error, response, data) =>{ + $.get(actboxurl, async(error, resp, data) =>{ //let act_box = JSON.parse(data) if (resp.statusCode == 200) { - $.log(' 任务激活成功,等待10s获取收益'); + $.log(' 任务激活成功,等待10s获取收益'); await $.wait(10000); await Tasks(); } @@ -387,40 +408,49 @@ function get_search(cmd) { return new Promise((resolve) =>{ let geturl = { url: `https://mbd.baidu.com/searchbox?action=feed&cmd=${cmd}&network=1_0&osbranch=i3&osname=baiduboxapp&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2&ua=1242_2208_iphone_5.0.0.11_0&fv=12.1.0.0`, - headers: { - Cookie: cookieval, - 'User-Agent': UA - } + headers: {Cookie: cookieval, 'User-Agent': UA } } $.get(geturl, async(error, resp, data) =>{ - // $.log(data+'\n') try { - let get_search = JSON.parse(data) + $.log(" tid:"+tid+" 状态码:"+resp.statusCode) + let get_search = JSON.parse(data); if (get_search.errno == 0) { for (items of get_search.data[`${cmd}`].itemlist.items) { searchId = items.id, searchname = items.data.title; author = items.data.author if(items.data.mode=="video"||items.data.type=="video"){ - $.log("\n 观看视频: " + searchname + " —————— "+author +"\n 任务ID: " + searchId); + $.log(" 观看视频: " + searchname + " —————— "+author); } if(items.data.mode=="text"){ - $.log("\n 阅读短文: " + searchname + "\n 任务ID: " + searchId +" —————— "+items.data.tag ? items.data.tag:""); + $.log(" 阅读短文: " + searchname + "\n " +" —————— "+items.data.tag ? items.data.tag:""); } if(items.data.mode=="ad"){ - $.log("\n 打开广告: " + author+": "+searchname + "\n 任务ID: " + searchId); + $.log(" 打开广告: " + author+": "+searchname); } - if( Number(tip) > 3){ - $.log("\n\n 请等待30s获取收益") - await $.wait(30000) + if( typeof coin == "undefined"){ + $.log(" 请等待,30s后获取收益\n") + await $.wait(30000) + await searchBox(searchId); + } else if ( coin == 0){ + $.log(" 请等待5s获取收益\n") + await $.wait(5000) + await searchBox(searchId); + coin = "undefined"; + } else if ( coin == 3){ + $.log(" 金币为3时,跳出运行\n") + await $.wait(2000) + coin = "undefined"; + break } else { - $.log(" 金币小于3时,加速运行") - await $.wait(5000) - } + $.log(" 请等待,30s后获取收益\n") + await $.wait(30000) await searchBox(searchId); - totaltips += tip + } + //totalcoin += coin + //$.log(totalcoin) } - $.desc += taskName + "获得收益"+ totaltips + "金币" +tips + "\n" + //$.desc += taskName + "获得收益"+ totalcoin+ "金币" +coin + "\n" } } catch(error) { $.logErr(error+data); @@ -441,22 +471,22 @@ function searchBox(id) { $.post(searchurl, async(error, resp, data) =>{ //$.log(error + resp.statusCode+" "+data) try{ - let do_search = JSON.parse(data) + let do_search = JSON.parse(data); if (do_search.errno == 0 && do_search.data['197'].istip == 1) { - $.log(" 获得收益: " + do_search.data[`197`].tips); - tip = Number(do_search.data[`197`].righttips) - //totaltips += Number(tip) - await $.wait(2000) + $.log(" 获得收益: " + do_search.data[`197`].tips+"😜\n"); + coin = Number(do_search.data[`197`].righttips) + //totalcoin = += coin + await $.wait(1000) } else if (do_search.data[`197`].tips == "") { - //$.log(" 获得收益: " + do_search.data[`197`].istip + '\n') - //tip += do_search.data[`197`].righttips + coin = 0; + $.log(" 对不起,本次没有收益🥺\n"); } else { $.log("获得收益失败") } }catch(e) { $.logErr(e+data); } finally { - resolve() + resolve(coin) } }) }) From c92f4b5a3e0f49516fe1dbf5d6b895c989c46a90 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 14:07:43 +0800 Subject: [PATCH 404/721] Update baiduspeed.yml --- .github/workflows/baiduspeed.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/baiduspeed.yml b/.github/workflows/baiduspeed.yml index f94e270c21..10adacfaa4 100644 --- a/.github/workflows/baiduspeed.yml +++ b/.github/workflows/baiduspeed.yml @@ -28,6 +28,7 @@ jobs: run: | node Task/baidu_speed.js env: + BAIDU_CASH: ${{ secrets.BAIDU_CASH }} PUSH_KEY: ${{ secrets.PUSH_KEY }} BARK_PUSH: ${{ secrets.BARK_PUSH }} TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} From a7000aacfe4251986de0c315e81a9093b77b7a3b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 14:16:31 +0800 Subject: [PATCH 405/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 667f083bba..a8e788b1c4 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -94,7 +94,7 @@ function getsign() { $.sub = `签到失败❌`, $.desc = `说明: ` + get_sign.msg, $.msg($.name, $.sub, $.desc); - return + $.done() } resolve() }) From 0eddff8f0f547f50ce77c398f254f27f4327dae0 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 14:41:04 +0800 Subject: [PATCH 406/721] Update baidu_speed.js --- Task/baidu_speed.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index a8e788b1c4..dca5b9f86d 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -59,6 +59,10 @@ if ($.isNode()) { withcash = cashArr[i] $.index = i + 1; await userInfo(); + if(isblack){ + $.msg($.name +" 账号"+username+"已黑号", "您的金币和余额已被冻结,请联系客服处理"); + return; + } await $.wait(1000) await firstbox(); await TaskCenter() @@ -94,7 +98,7 @@ function getsign() { $.sub = `签到失败❌`, $.desc = `说明: ` + get_sign.msg, $.msg($.name, $.sub, $.desc); - $.done() + return } resolve() }) @@ -120,6 +124,7 @@ function userInfo() { invitecode = data.match(/invite_code":"(\w+)/)[1], coinenabled = data.match(/coin_enabled":(\d+)/)[1] rate = data.match(/exchange_rate":(\d+)/)[1] + isblack = data.match(/is_black":(\w+)/)[1] if (coinenabled > 100){ coinnum = parseInt(coinenabled/100)*100 await coinexChange() From 384f4969e112e9da5e12c29d8ea1a9f0d3875955 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 14:42:21 +0800 Subject: [PATCH 407/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index dca5b9f86d..f5c4ca3cc4 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -61,7 +61,7 @@ if ($.isNode()) { await userInfo(); if(isblack){ $.msg($.name +" 账号"+username+"已黑号", "您的金币和余额已被冻结,请联系客服处理"); - return; + break; } await $.wait(1000) await firstbox(); From c10052ccdf251c2332f8cdf1ae3f98a4dee6e08b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 15:20:25 +0800 Subject: [PATCH 408/721] Update baidu_speed.js --- Task/baidu_speed.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index f5c4ca3cc4..26015717e2 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -3,6 +3,8 @@ 本脚本默认使用chavyleung大佬和Nobyda的贴吧ck,获取方法请看大佬仓库说明,内置自动提现,提现金额默认30元,当当前时间为早上6点且达到提现金额时仅运行提现任务,提现金额小于设置金额时继续运行其他任务。 +支持BoxJs多账号,需手动填写,用&或者换行隔开 + ~~~~~~~~~~~~~~~~ */ @@ -10,6 +12,7 @@ const $ = new Env('百度极速版') let CookieArr = [],cashArr=[]; let UA = `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 info baiduboxapp/5.1.1.10 (Baidu; P2 14.2)`; const notify = $.isNode() ? require('./sendNotify') : ''; +const baiducks = $.getdata(`cookie_baidu`); if ($.isNode()) { if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { BDCookie = process.env.BAIDU_COOKIE.split('&'); @@ -17,7 +20,7 @@ if ($.isNode()) { else if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('\n') > -1) { BDCookie = process.env.BAIDU_COOKIE.split('\n'); } else { - BDCookie = process.env.BAIDU_COOKIE.split() + BDCookie = process.env.BAIDU_COOKIE }; if (process.env.BAIDU_CASH && process.env.BAIDU_CASH.indexOf('&') > -1) { BDCASH = process.env.BAIDU_CASH.split('&'); @@ -31,23 +34,29 @@ if ($.isNode()) { if (BDCookie[item]) { CookieArr.push(BDCookie[item]) } - }) + }); Object.keys(BDCASH).forEach((item) => { if (BDCASH[item]) { cashArr.push(BDCASH[item]) } }) - +} else if(baiducks && baiducks.indexOf('&')>-1){ + BDCookie = baiducks.split("&") + Object.keys(BDCookie).forEach((item) => { + if (BDCookie[item]) { + CookieArr.push(BDCookie[item]) + } + }) } else { - CookieArr.push($.getdata(`chavy_cookie_tieba`) || $.getdata(`CookieTB`)) + CookieArr.push($.getdata(`chavy_cookie_tieba`) || $.getdata(`CookieTB`)); cashArr.push($.getdata("cash_baidu")||30) } + if ($.isNode()) { //console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) console.log(`您共提供${CookieArr.length}个百度账号 Cookie`) } - !(async() => { if (!CookieArr[0]) { console.log($.name, '【提示】请把百度Cookie填入Github 的 Secrets 中,请以&或者换行隔开') @@ -59,13 +68,13 @@ if ($.isNode()) { withcash = cashArr[i] $.index = i + 1; await userInfo(); - if(isblack){ + if(isblack=="true"){ $.msg($.name +" 账号"+username+"已黑号", "您的金币和余额已被冻结,请联系客服处理"); - break; + continue; } await $.wait(1000) await firstbox(); - await TaskCenter() + //await TaskCenter() await showmsg() //await drawPrize(); } @@ -98,7 +107,7 @@ function getsign() { $.sub = `签到失败❌`, $.desc = `说明: ` + get_sign.msg, $.msg($.name, $.sub, $.desc); - return + $.done() } resolve() }) From 19295307456951872314ccd587319277469cfa5d Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 15:26:03 +0800 Subject: [PATCH 409/721] Update baidu_speed.js --- Task/baidu_speed.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 26015717e2..e72c2e7ccc 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -67,12 +67,13 @@ if ($.isNode()) { cookieval = CookieArr[i]; withcash = cashArr[i] $.index = i + 1; + await $.wait(2000) await userInfo(); if(isblack=="true"){ $.msg($.name +" 账号"+username+"已黑号", "您的金币和余额已被冻结,请联系客服处理"); continue; } - await $.wait(1000) + await $.wait(2000) await firstbox(); //await TaskCenter() await showmsg() From 09ca8b41d839009dd8ac6d67dac522b1628cf333 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 15:29:29 +0800 Subject: [PATCH 410/721] Update baidu_speed.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复错误 --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index e72c2e7ccc..1247babbea 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -75,7 +75,7 @@ if ($.isNode()) { } await $.wait(2000) await firstbox(); - //await TaskCenter() + await TaskCenter() await showmsg() //await drawPrize(); } From 1cce9dd18530a7f4f0b5a87f9d64851cfc563960 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 15:47:52 +0800 Subject: [PATCH 411/721] Update baidu_speed.js --- Task/baidu_speed.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 1247babbea..7a13ee5eee 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -13,6 +13,8 @@ let CookieArr = [],cashArr=[]; let UA = `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 info baiduboxapp/5.1.1.10 (Baidu; P2 14.2)`; const notify = $.isNode() ? require('./sendNotify') : ''; const baiducks = $.getdata(`cookie_baidu`); +const taskON = $.getdata(`task_baidu`)||"true"//除提现和兑换外其他任务开关 + if ($.isNode()) { if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { BDCookie = process.env.BAIDU_COOKIE.split('&'); @@ -67,15 +69,17 @@ if ($.isNode()) { cookieval = CookieArr[i]; withcash = cashArr[i] $.index = i + 1; - await $.wait(2000) await userInfo(); if(isblack=="true"){ $.msg($.name +" 账号"+username+"已黑号", "您的金币和余额已被冻结,请联系客服处理"); continue; } - await $.wait(2000) + await $.wait(1000) + if( taskON =="true"){ + $.desc = ""; await firstbox(); await TaskCenter() + } await showmsg() //await drawPrize(); } @@ -220,9 +224,6 @@ function coinexChange() { }) } - - - function TaskCenter() { return new Promise((resolve, reject) =>{ let rewurl = { @@ -584,6 +585,7 @@ function doubleBox() { } function showmsg() { + $.msg($.name,$.sub,$.desc) } From 9c74bf3b7f93d9e9c076642c2f76c3109b7c9def Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 15:58:07 +0800 Subject: [PATCH 412/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index ac08d4e8ac..a91bdea57f 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -40,13 +40,6 @@ "type": "number", "desc": "设定通知频率,前三次为全部通知,之后转盘次数/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" }, - { - "id": "zqlogs", - "name": "调试日志", - "val": false, - "type": "boolean", - "desc": "调试日志开关,默认关闭" - }, { "id": "zqcash", "name": "提现金额", @@ -384,7 +377,7 @@ { "key": "30", "label": "30元" - }, + }, { "key": "50", "label": "50元" @@ -394,6 +387,13 @@ "label": "100元" } ] + }, + { + "id": "task_baidu", + "name": "任务开关", + "val": true, + "type": "boolean", + "desc": "除提现和兑换金币外开关,默认开启所有任务" } ], "icons": [ From 2a6ebe05e64933c2cd262061502b773c2ed9d679 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 16:10:44 +0800 Subject: [PATCH 413/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index a91bdea57f..dee4a55d69 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -10,7 +10,8 @@ "name": "新浪微博", "keys": [ "sy_payheader_wb", - "sy_token_wb" + "sy_token_wb", + "wb_nick" ], "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", @@ -358,7 +359,8 @@ "name": "百度极速任务", "keys": [ "chavy_cookie_tieba", - "CookieTB" + "CookieTB", + "baidu_nick" ], "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/baiduspeed.js", From ac203f56197a90a109c855c2e1a2d755b0fb2fe2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 16:15:01 +0800 Subject: [PATCH 414/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index dee4a55d69..d4d8bfce5c 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -30,7 +30,8 @@ "red_zq", "readtime_zq", "cashurl_zq", - "cashbody_zq" + "cashbody_zq", + "zqcash" ], "author": "@sunert", "settings": [ @@ -358,9 +359,10 @@ "id": "baidu", "name": "百度极速任务", "keys": [ + "baidu_nick", "chavy_cookie_tieba", "CookieTB", - "baidu_nick" + "cash_baidu" ], "author": "@sunert", "repo": "https://github.com/Sunert/Scripts/blob/master/Task/baiduspeed.js", From 71d7875407df78d3327eebd5708f142d324861aa Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 26 Jan 2021 17:19:23 +0800 Subject: [PATCH 415/721] Update baidu_speed.js --- Task/baidu_speed.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 7a13ee5eee..d20881ed12 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -13,8 +13,8 @@ let CookieArr = [],cashArr=[]; let UA = `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 info baiduboxapp/5.1.1.10 (Baidu; P2 14.2)`; const notify = $.isNode() ? require('./sendNotify') : ''; const baiducks = $.getdata(`cookie_baidu`); -const taskON = $.getdata(`task_baidu`)||"true"//除提现和兑换外其他任务开关 - +const taskON = $.getdata(`task_baidu`)||"true"//除提现和兑换外其他任务开关; +let isblack = "false"; if ($.isNode()) { if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { BDCookie = process.env.BAIDU_COOKIE.split('&'); @@ -144,8 +144,9 @@ function userInfo() { await coinexChange() } } - $.sub = " 昵称:"+username+" 现金:"+ chargemoney+" 金币:"+availablecoin+"元" + $.sub = " 昵称:"+username+" 现金:"+ chargemoney+" 金币:"+availablecoin+"元"; $.log("\n********** 昵称:"+username+ " 现金:"+chargemoney+"元 **********\n"); + $.setdata(username,"baidu_nick") if (Number(chargemoney) >= Number(withcash) && $.time("HH") == "06") { await withDraw(withcash) if ($.isNode()) { From 06635044c321f37d4fbae5de8c47645d36d82cdb Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 27 Jan 2021 01:59:53 +0800 Subject: [PATCH 416/721] Update baidu_speed.js --- Task/baidu_speed.js | 487 +++++++++++++++++++++++--------------------- 1 file changed, 257 insertions(+), 230 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index d20881ed12..658dfa973a 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -1,5 +1,7 @@ /* -百度极速版签到任务 +百度极速版签到任务,使用脚本有黑号风险,请知悉‼️ + +赞赏:百度极速邀请码`RW9ZSW 点击链接立得红包,最高100元!https://dwz.cn/Oilv4CJ1`,农妇山泉 -> 有点咸,万分感谢 本脚本默认使用chavyleung大佬和Nobyda的贴吧ck,获取方法请看大佬仓库说明,内置自动提现,提现金额默认30元,当当前时间为早上6点且达到提现金额时仅运行提现任务,提现金额小于设置金额时继续运行其他任务。 @@ -59,31 +61,31 @@ if ($.isNode()) { console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) console.log(`您共提供${CookieArr.length}个百度账号 Cookie`) } -!(async() => { +!(async() =>{ if (!CookieArr[0]) { - console.log($.name, '【提示】请把百度Cookie填入Github 的 Secrets 中,请以&或者换行隔开') - return; - } + console.log($.name, '【提示】请把百度Cookie填入Github 的 Secrets 中,请以&或者换行隔开'); + return + }; for (let i = 0; i < CookieArr.length; i++) { if (CookieArr[i]) { cookieval = CookieArr[i]; - withcash = cashArr[i] + withcash = cashArr[i]; $.index = i + 1; await userInfo(); - if(isblack=="true"){ - $.msg($.name +" 账号"+username+"已黑号", "您的金币和余额已被冻结,请联系客服处理"); - continue; + if (isblack == "true") { + $.msg($.name + " 账号" + username + "已黑号", "您的金币和余额已被冻结,请联系客服处理"); + continue; + } + await $.wait(1000); + if (taskON == "true") { + $.desc = ""; + await firstbox(); + await TaskCenter() } - await $.wait(1000) - if( taskON =="true"){ - $.desc = ""; - await firstbox(); - await TaskCenter() - } await showmsg() - //await drawPrize(); + //await drawPrize(); + } } - } })() .catch((e) => $.logErr(e)) .finally(() => $.done()) @@ -105,9 +107,6 @@ function getsign() { $.desc = get_sign.data.tips+` 收益: $ {get_sign.data.bonus.coin}💰\n`; $.log($.desc+"\n"+data); await invite() - } else if (get_sign.errno == 10053) { - $.desc = "【签到结果】"+get_sign.msg+"\n" - $.log( "签到结果: "+ $.desc) } else { $.sub = `签到失败❌`, $.desc = `说明: ` + get_sign.msg, @@ -144,7 +143,7 @@ function userInfo() { await coinexChange() } } - $.sub = " 昵称:"+username+" 现金:"+ chargemoney+" 金币:"+availablecoin+"元"; + $.sub = " 昵称:"+username+" 现金:"+ chargemoney+"元 金币:"+availablecoin; $.log("\n********** 昵称:"+username+ " 现金:"+chargemoney+"元 **********\n"); $.setdata(username,"baidu_nick") if (Number(chargemoney) >= Number(withcash) && $.time("HH") == "06") { @@ -242,37 +241,20 @@ function TaskCenter() { for (x in tasks) { taskid = tasks[x].taskId; id = tasks[x].id; - if (tasks[x].name == "taskList") { - maxTitle = tasks[x].data.title - $.log("去"+maxTitle+"\n") - if (maxTitle == "玩游戏赚现金") { - $.log(JSON.stringify(tasks[x].data)) - } else { - for (arr of tasks[x].data.tasklist) { - taskName = "【" + arr.title + "】 "; - tid = arr.id; - taskType = arr.type; - //$.log(taskName + taskType); - await getConfigs() - } - } - } - if (tasks[x].name == "popularRecommendation") { - //$.log(tasks[x].data.recommendCompName) - } if (tasks[x].name == "signIn") { for (z in tasks[x].data.checkin_list) { - signs = tasks[x].data.checkin_list - - if (tasks[x].data.current_date == signs[z].date) { - if(signs[z].is_checkin == 0){ - await getsign() - } else { - $.desc = "【签到结果】✅ 明日收益"+signs[Number(z)+1].coin_reward+"金币\n" - $.log($.desc) - } + signs = tasks[x].data.checkin_list + if (tasks[x].data.current_date == signs[z].date) { + if (signs[z].is_checkin == 0) { + await getsign() + } else { + $.desc = "【签到结果】✅ 明日+" + signs[Number(z) + 1].coin_reward + "金币\n"; + $.log($.desc) + } + } } - } + } else { + await getConfigs() } } } catch(e) { @@ -285,197 +267,245 @@ function TaskCenter() { } async function getConfigs() { - //let coin = 0; - if (arr.taskStatus == 1) { - $.log(taskName + " ID:" + id + " 已完成") - $.desc += taskName + " ✅ 已完成\n" - } else if (taskType == 'openApp') { - tid = tid == '395' ? "385": tid; - RefererUrl = arr.adLink; - //$.log("去完成" + taskName) - //$.log(JSON.stringify(arr)) - await get_pkg(tid) - } else if (taskType == 'watch') { - tips = arr.tips; - count = arr.total_count; - $.log(taskName + tips + "总计" + count + "次"); - if (arr.taskStatus == 0) { + if (tasks[x].name == "taskList") { + maxTitle = tasks[x].data.title; + $.log("去" + maxTitle + "\n"); + if (maxTitle == "玩游戏赚现金") { + $.log(JSON.stringify(tasks[x].data)) + } else { + for (arr of tasks[x].data.tasklist) { + taskName = "【" + arr.title + "】"; + tid = arr.id; + taskType = arr.type; + if (arr.taskStatus == "1") { + $.log(taskName + " tid:" + tid + " 已完成"); + $.desc += taskName + "✅ 已完成\n" +continue + } else if (taskType == 'openApp') { + RefererUrl = arr.adLink; + $.log(taskName) + // $.log(JSON.stringify(arr)) + await activeBox(tid,RefererUrl) + } else if (taskType == 'watch') { + tips = arr.tips; + count = arr.total_count; + $.log(taskName + tips + "总计" + count + "次"); + if (arr.taskStatus == 0) { await $.wait(2000); await get_search("184") - } - $.desc += taskName + tips + "总计" + count + "次\n"; + } + $.desc += taskName + tips + "总计" + count + "次\n"; + }; + } } + } + if (tasks[x].name == "popularRecommendation") { + //$.log(tasks[x].data.recommendCompName) + } + if (id == "1068") { + if (tasks[x].data.gameheader.coinInfo.coinStatus == 2) { + $.desc += "【头部宝箱】✅ 总计金币" + tasks[x].data.gameheader.coinInfo.coinCount + "\n"; + $.log($.desc) + } else { + for (headerbox of tasks[x].data.gameheader.progressList) { + if (headerbox.status == 1) { + await $.wait(2000); + await headerBox() + } + } + }; + for ( jingangs of tasks[x].data.jingang.list){ + jingangType = jingangs.jingangType, + taskName = "【"+jingangs.jingangName+"】 ", + RefererUrl = jingangs.jingangUrl, + tid = jingangs.jingangTid; + if (jingangType == 2) { + if (tasks[x].data.jingang.countDown[tid].countDown == 0) { + await $.wait(1000); + await activeBox(tid); + } else { + $.log(taskName+ " 请等待" +Number(tasks[x].data.jingang.countDown[tid].countDown / 60).toFixed(2) + "分钟") + } + } + + } + } } - //首页宝箱 function firstbox() { - return new Promise((resolve, reject) =>{ - let bdurl = { - url: 'https://mbrowser.baidu.com/lite/gold/receive?service=bdbox', - headers: { - "Cookie": cookieval, - "User-Agent": UA - }, - body: 'task_type=-1&task_id=-1' - } - $.post(bdurl, (error, resp, data) =>{ - let get_first = JSON.parse(data) - //$.log("获取首页宝箱信息:"+data +'\n') - if (get_first.err_no == 0) { - $.desc += "【首页宝箱】" + get_first.data.result.tips + ", " + get_first.data.result.countdown_time + "秒后再次开启宝箱\n" - } else if (get_first.err_no == 10079) { - $.desc += "【首页宝箱】" + get_first.tip + '\n' - } else if (get_first.err_no == 10060) { - $.desc += get_first.tip + '\n' - } - resolve() - }) + return new Promise((resolve, reject) =>{ + let bdurl = { + url: 'https://mbrowser.baidu.com/lite/gold/receive?service=bdbox', + headers: { + "Cookie": cookieval, + "User-Agent": UA + }, + body: 'task_type=-1&task_id=-1' + } + $.post(bdurl, (error, resp, data) =>{ + let get_first = JSON.parse(data) + //$.log("获取首页宝箱信息:"+data +'\n') + if (get_first.err_no == 0) { + $.desc += "【首页宝箱】" + get_first.data.result.tips + ", " + get_first.data.result.countdown_time + "秒后再次开启宝箱\n" + } else if (get_first.err_no == 10079) { + $.desc += "【首页宝箱】✅ " + get_first.tip + '\n' + } else if (get_first.err_no == 10060) { + $.log("首页宝箱开启失败"+get_first.tip) + } + resolve() }) + }) } +function activeBox(tid) { + return new Promise((resolve, reject) =>{ + let actboxurl = { + url: `https://haokan.baidu.com/activity/tasks/active?productid=2&id=${tid}`, + headers: { + Cookie: cookieval, + 'User-Agent': UA, + Referer: RefererUrl + } + } + $.get(actboxurl, async(error, resp, data)=>{ + let act_box = JSON.parse(data); + if ((tid == 587 || tid == 590) && act_box.errno == 0) { + await get_pkg() + } else if (act_box.data.code == "EquipmentComplete") { + $.log(taskName + act_box.data.data) + } else { + //$.log(data); + await get_pkg() + } + resolve() + }) + }) +} //视频 -function get_pkg(tid) { - return new Promise((resolve, reject) =>{ - let pkgurl = { - url: `https://haokan.baidu.com/activity/acad/rewardad?device=%7B%22device_type%22%3A1%2C%22model%22%3A%22IPHONE%22%2C%22manufacturer%22%3A%22Apple%22%2C%22os_version%22%3A%2214.2%22%7D%2C%22screen_width%22%3A1242%2C%22screen_height%22%3A2208%7D&network=%7B%22connect_type%22%3A1%2C%22carrier%22%3A0%7D&productid=2&tid=${tid}&type=1`, - headers: { - Cookie: cookieval, - 'User-Agent': UA, - 'Referer': RefererUrl - } - } - $.get(pkgurl, async(error, resp, data) =>{ - let get_pkg = JSON.parse(data); - - if (get_pkg.errno == 0 && get_pkg.data.isDone == 0) { - Pkg = get_pkg.data.adInfo[0].material.pkg, - taskid = get_pkg.data.taskPf.taskId; - $.log(" 获取任务数据成功,去做任务"); - //$.log("\n"+taskid +" "+ Pkg) - await activeBox() - } else if (get_pkg.errno == 0 && get_pkg.data.isDone == 1) { - $.desc += taskName + "✅ 已完成\n"; - $.log(taskName + "已完成\n") - } - resolve() - }) +function get_pkg() { + return new Promise((resolve, reject) =>{ + let pkgurl = { + url: `https://haokan.baidu.com/activity/acad/rewardad?device=%7B%22imei_md5%22%3A%22%22%2C%22device_type%22%3A1%2C%22model%22%3A%22IPHONE%22%2C%22manufacturer%22%3A%22Apple%22%2C%22os_version%22%3A%2213.7%22%2C%22idfa%22%3A%22_a2S8_aq28_qa28qii2A8laJ28gxC28Q_iXni0uKvNYIPviVzaHtiYah2ul6iHim_l2880uQvflqisa9liBgIgarv8oIOHutlhSPu_ux2a_Wi-uRz_qAC%22%7D&network=%7B%22connect_type%22%3A1%2C%22carrier%22%3A0%7D&productid=2&tid=${tid}&type=1`, + headers: { + Cookie: cookieval, + 'User-Agent': UA, + 'Referer': RefererUrl + } + } + $.get(pkgurl, async(error, resp, data) =>{ + let get_pkg = JSON.parse(data); + if (get_pkg.errno == 0 && get_pkg.data.isDone == 0) { + Pkg = get_pkg.data.adInfo[0].material.pkg, + taskid = get_pkg.data.taskPf.taskId; + $.log(" 获取任务成功,等待25s获取收益"); + //$.log("\n" + taskid + " " + Pkg); + await $.wait(25000); + await finishTask() + } else if (get_pkg.errno == 0 && get_pkg.data.isDone == 1) { + // $.desc += taskName + "✅ 已完成\n"; + // $.log(taskName + "已完成\n") + } + resolve() }) + }) } -function activeBox() { - return new Promise((resolve, reject) =>{ - let actboxurl = { - url: `https://haokan.baidu.com/activity/tasks/active?productid=2&id=${tid}`, - headers: { - Cookie: cookieval, - 'User-Agent': UA, - Referer: RefererUrl - } +function finishTask() { + return new Promise((resolve, reject) =>{ + let actboxurl = { + url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=coin&rewardVideoPkg=${Pkg}&sys=ios`, + headers: { + Cookie: cookieval, + 'User-Agent': UA, + Referer: RefererUrl + } + } + $.get(actboxurl, async(error, resp, data) =>{ + try { + let do_task = JSON.parse(data); + if (do_task.errno == 0) { + $.desc += taskName + "获得收益" + do_task.data.coin + "\n"; + $.log(taskName + " 获得收益: +" + do_task.data.coin); + await $.wait(1000) + } else if (do_task.errno == 19001) { + $.desc += taskName + " " + do_task.errmsg + "\n"; + $.log(taskName + " " + do_task.errmsg) + } else if (do_task.errno == 11004) { + $.desc += taskName + " " + do_task.errmsg + "\n"; + $.log(taskName + " " + do_task.errmsg) } - $.get(actboxurl, async(error, resp, data) =>{ - //let act_box = JSON.parse(data) - if (resp.statusCode == 200) { - $.log(' 任务激活成功,等待10s获取收益'); - await $.wait(10000); - await Tasks(); - } - resolve() - }) + } catch(e) { + $.logErr(e, data); + } finally { + resolve() + } }) + }) } -function Tasks() { - return new Promise((resolve) =>{ - let taskurl = { - url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=coin&rewardVideoPkg=${Pkg}&_=`+new Date().getTime()+`&sys=ios&rewardVideoDrawKey=&source=0&appid=0&bid=0&chestTid=0&signAim=0`, - headers: { - Cookie: cookieval, - 'User-Agent': UA, - Referer: RefererUrl + +function get_search(cmd) { + return new Promise((resolve) =>{ + let geturl = { + url: `https://mbd.baidu.com/searchbox?action=feed&cmd=${cmd}&network=1_0&osbranch=i3&osname=baiduboxapp&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2&ua=1242_2208_iphone_5.0.0.11_0&fv=12.1.0.0`, + headers: { + Cookie: cookieval, + 'User-Agent': UA + } + } + $.get(geturl, async(error, resp, data) =>{ + try { + $.log(" tid:" + tid + " 状态码:" + resp.statusCode); + let get_search = JSON.parse(data); + if (get_search.errno == 0) { + for (items of get_search.data[`${cmd}`].itemlist.items) { + searchId = items.id, + searchname = items.data.title; + author = items.data.author + if (items.data.mode == "video" || items.data.type == "video") { + $.log(" 观看视频: " + searchname + " —————— " + author); } - } - $.get(taskurl, async(error, response, data) =>{ - try { - let do_task = JSON.parse(data); - if (do_task.errno == 0) { - $.desc += taskName + "获得收益" + do_task.data.coin + "\n"; - $.log(taskName+ " 获得收益: +" + do_task.data.coin); - await $.wait(2000) - } else if (do_task.errno == 19001) { - $.desc += taskName + " " + do_task.errmsg + "\n" - $.log(taskName + " " + do_task.errmsg) - - } else if (do_task.errno == 11004) { - $.desc += taskName + " " + do_task.errmsg + "\n"; - $.log(taskName + " " + do_task.errmsg) - } - } catch(e) { - $.logErr(e, data); - } finally { - resolve() + if (items.data.mode == "text") { + $.log(" 阅读短文: " + searchname + "\n " + " —————— " + items.data.tag ? items.data.tag: ""); } - }) - }) -} -function get_search(cmd) { - return new Promise((resolve) =>{ - let geturl = { - url: `https://mbd.baidu.com/searchbox?action=feed&cmd=${cmd}&network=1_0&osbranch=i3&osname=baiduboxapp&uid=A49D6DBEA0E8C89406AD1484C84D9134FCF6C8758FHLNHLAJSR&ut=iPhone10%2C1_14.2&ua=1242_2208_iphone_5.0.0.11_0&fv=12.1.0.0`, - headers: {Cookie: cookieval, 'User-Agent': UA } - } - $.get(geturl, async(error, resp, data) =>{ - try { - $.log(" tid:"+tid+" 状态码:"+resp.statusCode) - let get_search = JSON.parse(data); - if (get_search.errno == 0) { - for (items of get_search.data[`${cmd}`].itemlist.items) { - searchId = items.id, - searchname = items.data.title; - author = items.data.author - if(items.data.mode=="video"||items.data.type=="video"){ - $.log(" 观看视频: " + searchname + " —————— "+author); - } - if(items.data.mode=="text"){ - $.log(" 阅读短文: " + searchname + "\n " +" —————— "+items.data.tag ? items.data.tag:""); - } - if(items.data.mode=="ad"){ - $.log(" 打开广告: " + author+": "+searchname); - } - if( typeof coin == "undefined"){ - $.log(" 请等待,30s后获取收益\n") - await $.wait(30000) - await searchBox(searchId); - } else if ( coin == 0){ - $.log(" 请等待5s获取收益\n") - await $.wait(5000) - await searchBox(searchId); - coin = "undefined"; - } else if ( coin == 3){ - $.log(" 金币为3时,跳出运行\n") - await $.wait(2000) - coin = "undefined"; - break - } else { - $.log(" 请等待,30s后获取收益\n") - await $.wait(30000) - await searchBox(searchId); - } - //totalcoin += coin - //$.log(totalcoin) - } - //$.desc += taskName + "获得收益"+ totalcoin+ "金币" +coin + "\n" - } - } catch(error) { - $.logErr(error+data); - } finally { - resolve() + if (items.data.mode == "ad") { + $.log(" 打开广告: " + author + ": " + searchname); } - }) + if (typeof coin == "undefined") { + $.log(" 请等待,30s后获取收益\n"); + await $.wait(30000); + await searchBox(searchId); + } else if (coin == 0) { + $.log(" 请等待5s获取收益\n"); + await $.wait(5000); + await searchBox(searchId); + coin = "undefined"; + } else if (coin == 3) { + $.log(" 金币为3时,跳出运行\n"); + await $.wait(2000) + coin = "undefined"; + break + } else { + $.log(" 请等待,30s后获取收益\n"); + await $.wait(30000); + await searchBox(searchId); + } + //totalcoin += coin + //$.log(totalcoin) + } + //$.desc += taskName + "获得收益"+ totalcoin+ "金币" +coin + "\n" + } + } catch(error) { + $.logErr(error + data); + } finally { + resolve() + } }) + }) } function searchBox(id) { @@ -540,26 +570,23 @@ function chestTime() { }) } -//任务中心宝箱 -function activeBox2() { +//头部宝箱 +function headerBox() { return new Promise((resolve, reject) =>{ - let actboxurl = { - url: `https://haokan.baidu.com/activity/acuserchest/opennew`, + let headerboxurl = { + url: `https://haokan.baidu.com/activity/acuserchest/openheader?productid=2&fromcsr=1`, headers: { Cookie: cookieval, 'User-Agent': UA - }, - body: `taskid=${taskid}&productid=2&ugus=5256798061` + } } - $.post(actboxurl, async(error, response, data) =>{ - let act_box = JSON.parse(data) - //$.log('actbox: ' + data) - if (act_box.errno == 0) { - $.desc += '开宝箱获得收益: +' + act_box.data.coin - } else if (act_box.errno == 10060) { - //taskid = '669' - await chestTime(); - $.desc += act_box.msg + $.get(headerboxurl, async(error, response, data) =>{ + let hed_box = JSON.parse(data) + //$.log('headerbox: ' + data) + if (hed_box.errno == 0) { + $.desc += '【头部宝箱】: 总计金币' + hed_box.data.gameheader.coinInfo.coinCount + } else { + $.log('【头部宝箱】❎'+hed_box.msg) } resolve() }) From 6b86dfd199aa5c3357280eb85f90943018583416 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:02:29 +0800 Subject: [PATCH 417/721] Update baidu_speed.js --- Task/baidu_speed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 658dfa973a..7c71b26e32 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -279,8 +279,8 @@ async function getConfigs() { taskType = arr.type; if (arr.taskStatus == "1") { $.log(taskName + " tid:" + tid + " 已完成"); - $.desc += taskName + "✅ 已完成\n" -continue + $.desc += taskName + "✅ 已完成\n"; + continue } else if (taskType == 'openApp') { RefererUrl = arr.adLink; $.log(taskName) From 7203b24e464b58299dc7e0fc807c2a7fc36869a4 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 27 Jan 2021 10:42:11 +0800 Subject: [PATCH 418/721] Update baidu_speed.js --- Task/baidu_speed.js | 55 ++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 7c71b26e32..4130730220 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -236,7 +236,7 @@ function TaskCenter() { $.get(rewurl, async(error, resp, data) =>{ try { let get_tasks = JSON.parse(data); - $.log("========== 任务开始 ==========\n"); + $.log(" 🛎 ========== 任务开始 ========== 🛎 "); tasks = get_tasks.data.comps; for (x in tasks) { taskid = tasks[x].taskId; @@ -246,7 +246,7 @@ function TaskCenter() { signs = tasks[x].data.checkin_list if (tasks[x].data.current_date == signs[z].date) { if (signs[z].is_checkin == 0) { - await getsign() + //await getsign() } else { $.desc = "【签到结果】✅ 明日+" + signs[Number(z) + 1].coin_reward + "金币\n"; $.log($.desc) @@ -269,27 +269,29 @@ function TaskCenter() { async function getConfigs() { if (tasks[x].name == "taskList") { maxTitle = tasks[x].data.title; - $.log("去" + maxTitle + "\n"); + $.log("\n去" + maxTitle); if (maxTitle == "玩游戏赚现金") { - $.log(JSON.stringify(tasks[x].data)) + //$.log(JSON.stringify(tasks[x].data)) } else { for (arr of tasks[x].data.tasklist) { taskName = "【" + arr.title + "】"; tid = arr.id; taskType = arr.type; if (arr.taskStatus == "1") { - $.log(taskName + " tid:" + tid + " 已完成"); + $.log(taskName + " 已完成"); $.desc += taskName + "✅ 已完成\n"; - continue } else if (taskType == 'openApp') { RefererUrl = arr.adLink; - $.log(taskName) - // $.log(JSON.stringify(arr)) - await activeBox(tid,RefererUrl) + $.log("\n "+taskName+" 类型: "+arr.type_name+" ") + if( tid =="815"){ + RefererUrl="https://haokan.baidu.com/activity/goldcoin/?productid=2&pd=2&tab=guide" + } + //$.log(JSON.stringify(arr)) + await activeBox() } else if (taskType == 'watch') { - tips = arr.tips; - count = arr.total_count; - $.log(taskName + tips + "总计" + count + "次"); + tips = arr.tips; + count = arr.total_count; + $.log("\n "+taskName + tips + "总计" + count + "次 "); if (arr.taskStatus == 0) { await $.wait(2000); await get_search("184") @@ -303,6 +305,13 @@ async function getConfigs() { //$.log(tasks[x].data.recommendCompName) } if (id == "1068") { + if (tasks[x].data.unOpenHeadBoxDialog.isShowBusiness == true ){ + tid = "817" + taskName = "【"+tasks[x].data.unOpenHeadBoxDialog.btn[0].btnText+"】" + RefererUrl = tasks[x].data.unOpenHeadBoxDialog.btn[0].iosAdUrl + await activeBox() +} +return if (tasks[x].data.gameheader.coinInfo.coinStatus == 2) { $.desc += "【头部宝箱】✅ 总计金币" + tasks[x].data.gameheader.coinInfo.coinCount + "\n"; $.log($.desc) @@ -322,12 +331,12 @@ async function getConfigs() { if (jingangType == 2) { if (tasks[x].data.jingang.countDown[tid].countDown == 0) { await $.wait(1000); - await activeBox(tid); + $.log("\n "+taskName+" "); + await activeBox(); } else { - $.log(taskName+ " 请等待" +Number(tasks[x].data.jingang.countDown[tid].countDown / 60).toFixed(2) + "分钟") + $.log("\n"+taskName+ " 请等待" +Number(tasks[x].data.jingang.countDown[tid].countDown / 60).toFixed(2) + "分钟") } } - } } } @@ -359,7 +368,7 @@ function firstbox() { }) } -function activeBox(tid) { +function activeBox() { return new Promise((resolve, reject) =>{ let actboxurl = { url: `https://haokan.baidu.com/activity/tasks/active?productid=2&id=${tid}`, @@ -374,7 +383,7 @@ function activeBox(tid) { if ((tid == 587 || tid == 590) && act_box.errno == 0) { await get_pkg() } else if (act_box.data.code == "EquipmentComplete") { - $.log(taskName + act_box.data.data) + $.log(" "+ act_box.data.data) } else { //$.log(data); await get_pkg() @@ -469,20 +478,20 @@ function get_search(cmd) { if (items.data.mode == "video" || items.data.type == "video") { $.log(" 观看视频: " + searchname + " —————— " + author); } - if (items.data.mode == "text") { + else if (items.data.mode == "text") { $.log(" 阅读短文: " + searchname + "\n " + " —————— " + items.data.tag ? items.data.tag: ""); } - if (items.data.mode == "ad") { + else if (items.data.mode == "ad") { $.log(" 打开广告: " + author + ": " + searchname); } if (typeof coin == "undefined") { $.log(" 请等待,30s后获取收益\n"); await $.wait(30000); - await searchBox(searchId); + await searchBox(searchId) } else if (coin == 0) { $.log(" 请等待5s获取收益\n"); await $.wait(5000); - await searchBox(searchId); + await searchBox(searchId) coin = "undefined"; } else if (coin == 3) { $.log(" 金币为3时,跳出运行\n"); @@ -492,7 +501,7 @@ function get_search(cmd) { } else { $.log(" 请等待,30s后获取收益\n"); await $.wait(30000); - await searchBox(searchId); + await searchBox(searchId) } //totalcoin += coin //$.log(totalcoin) @@ -528,7 +537,7 @@ function searchBox(id) { coin = 0; $.log(" 对不起,本次没有收益🥺\n"); } else { - $.log("获得收益失败") + $.log("获得收益失败,"+do_search.data[`197`].tips) } }catch(e) { $.logErr(e+data); From ff58b68a25ddf5572f58c27457596fb4f3a36806 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 27 Jan 2021 12:55:42 +0800 Subject: [PATCH 419/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 4130730220..d9e6129bdf 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -130,7 +130,7 @@ function userInfo() { $.get(infourl, async(error, resp, data) => { try { if (resp.statusCode == 200) { - username = data.match(/user_name":"(\w+)/)[1], + username = data.match(/user_name":"([\u4e00-\u9fa5_a-zA-Z0-9\s]+)/)[1], chargemoney = data.match(/charge_money":"(\d+\.\d+)/)[1], waitingcoin = data.match(/waiting_coin":(\d+)/)[1], availablecoin = data.match(/available_coin":(\d+)/)[1], From 67af2ea4378bb05bdd6ffe0db1bcc7e67cb23a52 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 27 Jan 2021 13:12:03 +0800 Subject: [PATCH 420/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index d9e6129bdf..aa441c150c 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -246,7 +246,7 @@ function TaskCenter() { signs = tasks[x].data.checkin_list if (tasks[x].data.current_date == signs[z].date) { if (signs[z].is_checkin == 0) { - //await getsign() + await getsign() } else { $.desc = "【签到结果】✅ 明日+" + signs[Number(z) + 1].coin_reward + "金币\n"; $.log($.desc) From 118cc6b21d09a2d7c9358a1b7ae2bfa4cbea6950 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:21:24 +0800 Subject: [PATCH 421/721] Create formatJson.txt --- Task/formatJson.txt | 250 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 Task/formatJson.txt diff --git a/Task/formatJson.txt b/Task/formatJson.txt new file mode 100644 index 0000000000..822cc8eebd --- /dev/null +++ b/Task/formatJson.txt @@ -0,0 +1,250 @@ + + + +
+ +

结果

+

+
+ From 735fd837baa3015eb4dd252c9113553c20a09d1b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:24:20 +0800 Subject: [PATCH 422/721] Update baidu_speed.js --- Task/baidu_speed.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index aa441c150c..d3562370c6 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -1,5 +1,5 @@ /* -百度极速版签到任务,使用脚本有黑号风险,请知悉‼️ +百度极速版签到任务,使用脚本有黑号严重,请谨慎使用‼️ 赞赏:百度极速邀请码`RW9ZSW 点击链接立得红包,最高100元!https://dwz.cn/Oilv4CJ1`,农妇山泉 -> 有点咸,万分感谢 @@ -311,7 +311,6 @@ async function getConfigs() { RefererUrl = tasks[x].data.unOpenHeadBoxDialog.btn[0].iosAdUrl await activeBox() } -return if (tasks[x].data.gameheader.coinInfo.coinStatus == 2) { $.desc += "【头部宝箱】✅ 总计金币" + tasks[x].data.gameheader.coinInfo.coinCount + "\n"; $.log($.desc) From b4a2c2a945189b7f395f9a42adb5bb41e7c0e84a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:47:21 +0800 Subject: [PATCH 423/721] Update baidu_speed.js --- Task/baidu_speed.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index d3562370c6..ba0736dea3 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -308,7 +308,8 @@ async function getConfigs() { if (tasks[x].data.unOpenHeadBoxDialog.isShowBusiness == true ){ tid = "817" taskName = "【"+tasks[x].data.unOpenHeadBoxDialog.btn[0].btnText+"】" - RefererUrl = tasks[x].data.unOpenHeadBoxDialog.btn[0].iosAdUrl + RefererUrl = tasks[x].data.unOpenHeadBoxDialog.btn[0].iosAdUrl, + $.log("\n "+taskName+" ") await activeBox() } if (tasks[x].data.gameheader.coinInfo.coinStatus == 2) { From 4f67f17f0f290f83232ff8624c3fd974601daa94 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 27 Jan 2021 20:43:54 +0800 Subject: [PATCH 424/721] Update baidu_speed.js --- Task/baidu_speed.js | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index ba0736dea3..7d16468b91 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -120,17 +120,21 @@ function getsign() { function userInfo() { return new Promise((resolve, reject) => { + setTimeout(() =>{ let infourl = { url: `https://haokan.baidu.com/activity/h5/income?productid=2&from=1005640h&network=1_0&osname=baiduboxapp`, headers: { - Cookie:cookieval, + Cookie: cookieval, 'User-Agent': UA } }; $.get(infourl, async(error, resp, data) => { try { if (resp.statusCode == 200) { - username = data.match(/user_name":"([\u4e00-\u9fa5_a-zA-Z0-9\s]+)/)[1], + username = "null"; + if(data.match(/user_name\":\"([\w+\\]+)/)){ + username = unescape(data.match(/user_name\":\"([\w+\\]+)/)[1].replace(/\\/g, "%")) + } chargemoney = data.match(/charge_money":"(\d+\.\d+)/)[1], waitingcoin = data.match(/waiting_coin":(\d+)/)[1], availablecoin = data.match(/available_coin":(\d+)/)[1], @@ -145,7 +149,7 @@ function userInfo() { } $.sub = " 昵称:"+username+" 现金:"+ chargemoney+"元 金币:"+availablecoin; $.log("\n********** 昵称:"+username+ " 现金:"+chargemoney+"元 **********\n"); - $.setdata(username,"baidu_nick") + $.setdata(username,"baidu_nick") if (Number(chargemoney) >= Number(withcash) && $.time("HH") == "06") { await withDraw(withcash) if ($.isNode()) { @@ -155,11 +159,12 @@ function userInfo() { } } catch(error) { $.msg($.name, "获取用户信息失败"), - $.log("用户信息详情页错误\n" + data) + $.log("用户信息详情页错误\n" + error) } resolve() }) - }) + },1000) + }) } function withDraw(cash) { @@ -234,6 +239,7 @@ function TaskCenter() { } } $.get(rewurl, async(error, resp, data) =>{ + //console.log(formatJson(data)) try { let get_tasks = JSON.parse(data); $.log(" 🛎 ========== 任务开始 ========== 🛎 "); @@ -248,7 +254,7 @@ function TaskCenter() { if (signs[z].is_checkin == 0) { await getsign() } else { - $.desc = "【签到结果】✅ 明日+" + signs[Number(z) + 1].coin_reward + "金币\n"; + $.desc = "【签到结果】✅ 今日+" + signs[z].coin_reward + "金币\n"; $.log($.desc) } } @@ -286,7 +292,6 @@ async function getConfigs() { if( tid =="815"){ RefererUrl="https://haokan.baidu.com/activity/goldcoin/?productid=2&pd=2&tab=guide" } - //$.log(JSON.stringify(arr)) await activeBox() } else if (taskType == 'watch') { tips = arr.tips; @@ -308,7 +313,7 @@ async function getConfigs() { if (tasks[x].data.unOpenHeadBoxDialog.isShowBusiness == true ){ tid = "817" taskName = "【"+tasks[x].data.unOpenHeadBoxDialog.btn[0].btnText+"】" - RefererUrl = tasks[x].data.unOpenHeadBoxDialog.btn[0].iosAdUrl, + RefererUrl = tasks[x].data.unOpenHeadBoxDialog.btn[0].iosAdUrl $.log("\n "+taskName+" ") await activeBox() } @@ -382,10 +387,14 @@ function activeBox() { let act_box = JSON.parse(data); if ((tid == 587 || tid == 590) && act_box.errno == 0) { await get_pkg() + } else if (act_box.errno == 1){ + $.desc+= "【taskName】"+ act_box.msg; + $.log(act_box.msg+",请检查Cookie是否包含BAIDUID"); + return } else if (act_box.data.code == "EquipmentComplete") { $.log(" "+ act_box.data.data) } else { - //$.log(data); + //$.log(formatJson(data)) await get_pkg() } resolve() @@ -627,6 +636,10 @@ function showmsg() { } - +function formatJson(json,options){var reg=null,formatted='',pad=0,PADDING=' ';options=options||{};options.newlineAfterColonIfBeforeBraceOrBracket=(options.newlineAfterColonIfBeforeBraceOrBracket===true)?true:false;options.spaceAfterColon=(options.spaceAfterColon===false)?false:true;if(typeof json!=='string'){json=JSON.stringify(json);}else{json=JSON.parse(json);json=JSON.stringify(json)} +json=json.replace(/([\{\}])/g,'\r\n$1\r\n');json=json.replace(/([\[\]])/,'\r\n$1\r\n');json=json.replace(/(\,)/g,'$1\r\n');json=json.replace(/(\r\n\r\n)/g,'\r\n');json=json.replace(/\r\n\,/g,',');if(!options.newlineAfterColonIfBeforeBraceOrBracket){json=json.replace(/\:\r\n\{/g,':{');json=json.replace(/\:\r\n\[/g,':[')} +if(options.spaceAfterColon){json=json.replace(/\:/g,':')}(json.split('\r\n')).forEach(function(node,index){var i=0,indent=0,padding='';if(node.match(/\{$/)||node.match(/\[$/)){indent=1}else if(node.match(/\}/)||node.match(/\]/)){if(pad!==0){pad-=1}}else{indent=0} +for(i=0;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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 981ae437012017214274bea26d3d23c38b86fc98 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 27 Jan 2021 20:51:25 +0800 Subject: [PATCH 425/721] Update baidu_speed.js --- Task/baidu_speed.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 7d16468b91..47c8723a9c 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -636,10 +636,6 @@ function showmsg() { } -function formatJson(json,options){var reg=null,formatted='',pad=0,PADDING=' ';options=options||{};options.newlineAfterColonIfBeforeBraceOrBracket=(options.newlineAfterColonIfBeforeBraceOrBracket===true)?true:false;options.spaceAfterColon=(options.spaceAfterColon===false)?false:true;if(typeof json!=='string'){json=JSON.stringify(json);}else{json=JSON.parse(json);json=JSON.stringify(json)} -json=json.replace(/([\{\}])/g,'\r\n$1\r\n');json=json.replace(/([\[\]])/,'\r\n$1\r\n');json=json.replace(/(\,)/g,'$1\r\n');json=json.replace(/(\r\n\r\n)/g,'\r\n');json=json.replace(/\r\n\,/g,',');if(!options.newlineAfterColonIfBeforeBraceOrBracket){json=json.replace(/\:\r\n\{/g,':{');json=json.replace(/\:\r\n\[/g,':[')} -if(options.spaceAfterColon){json=json.replace(/\:/g,':')}(json.split('\r\n')).forEach(function(node,index){var i=0,indent=0,padding='';if(node.match(/\{$/)||node.match(/\[$/)){indent=1}else if(node.match(/\}/)||node.match(/\]/)){if(pad!==0){pad-=1}}else{indent=0} -for(i=0;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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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 cdc518b8e4117d2d4fd351dbc296f6df58bed451 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Wed, 27 Jan 2021 20:53:55 +0800 Subject: [PATCH 426/721] Create formatJson.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 格式化json --- Task/formatJson.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 Task/formatJson.js diff --git a/Task/formatJson.js b/Task/formatJson.js new file mode 100644 index 0000000000..5fd572045d --- /dev/null +++ b/Task/formatJson.js @@ -0,0 +1 @@ +function formatJson(json,options){var reg=null,formatted='',pad=0,PADDING=' ';options=options||{};options.newlineAfterColonIfBeforeBraceOrBracket=(options.newlineAfterColonIfBeforeBraceOrBracket===true)?true:false;options.spaceAfterColon=(options.spaceAfterColon===false)?false:true;if(typeof json!=='string'){json=JSON.stringify(json);}else{json=JSON.parse(json);json=JSON.stringify(json)};json=json.replace(/([\{\}])/g,'\r\n$1\r\n');json=json.replace(/([\[\]])/,'\r\n$1\r\n');json=json.replace(/(\,)/g,'$1\r\n');json=json.replace(/(\r\n\r\n)/g,'\r\n');json=json.replace(/\r\n\,/g,',');if(!options.newlineAfterColonIfBeforeBraceOrBracket){json=json.replace(/\:\r\n\{/g,':{');json=json.replace(/\:\r\n\[/g,':[')};if(options.spaceAfterColon){json=json.replace(/\:/g,':')};(json.split('\r\n')).forEach(function(node,index){var i=0,indent=0,padding='';if(node.match(/\{$/)||node.match(/\[$/)){indent=1}else if(node.match(/\}/)||node.match(/\]/)){if(pad!==0){pad-=1}}else{indent=0};for(i=0;i Date: Wed, 27 Jan 2021 22:19:19 +0800 Subject: [PATCH 427/721] Update baidu_speed.js --- Task/baidu_speed.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 47c8723a9c..a754d1bbec 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -82,7 +82,7 @@ if ($.isNode()) { await firstbox(); await TaskCenter() } - await showmsg() + //await showmsg() //await drawPrize(); } } @@ -111,7 +111,7 @@ function getsign() { $.sub = `签到失败❌`, $.desc = `说明: ` + get_sign.msg, $.msg($.name, $.sub, $.desc); - $.done() + //$.done() } resolve() }) @@ -384,6 +384,7 @@ function activeBox() { } } $.get(actboxurl, async(error, resp, data)=>{ + try{ let act_box = JSON.parse(data); if ((tid == 587 || tid == 590) && act_box.errno == 0) { await get_pkg() @@ -391,13 +392,17 @@ function activeBox() { $.desc+= "【taskName】"+ act_box.msg; $.log(act_box.msg+",请检查Cookie是否包含BAIDUID"); return - } else if (act_box.data.code == "EquipmentComplete") { + } else if (typeof act_box.data != "undefined"&&act_box.data.code == "EquipmentComplete") { $.log(" "+ act_box.data.data) } else { //$.log(formatJson(data)) await get_pkg() } - resolve() + } catch(e) { + $.logErr(e, data); + } finally { + resolve() + } }) }) } @@ -457,7 +462,7 @@ function finishTask() { $.log(taskName + " " + do_task.errmsg) } } catch(e) { - $.logErr(e, data); + $.logErr(e+data); } finally { resolve() } From 4c132fd576b044a3b7382a377a2dba2be1271b5e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 28 Jan 2021 20:56:52 +0800 Subject: [PATCH 428/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 1132 ++++++++++++++++++++-------------------- 1 file changed, 579 insertions(+), 553 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index d4d8bfce5c..f2e9e9d582 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -1,575 +1,601 @@ { - "id": "sunert.app.sub", - "name": "Sunert 签到应用订阅", - "author": "@Sunert", - "icon": "https://avatars2.githubusercontent.com/u/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", - "repo": "https://github.com/Sunert/Scripts/tree/master", - "apps": [ + "id" : "sunert.app.sub", + "author" : "@Sunert", + "icon" : "https:\/\/avatars2.githubusercontent.com\/u\/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", + "name" : "Sunert 签到应用订阅", + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/tree\/master", + "apps" : [ + { + "author" : "@sunert", + "keys" : [ + "sy_payheader_wb", + "sy_token_wb", + "wb_nick" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/weibo.js", + "id" : "weibo", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/weibo.js", + "name" : "新浪微博", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/weibo.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/weibo.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "youthheader_zq", + "read_zq", + "red_zq", + "readtime_zq", + "cashurl_zq", + "cashbody_zq", + "zqcash" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/youth.js", + "id" : "youth", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/youth.js", + "settings" : [ { - "id": "weibo", - "name": "新浪微博", - "keys": [ - "sy_payheader_wb", - "sy_token_wb", - "wb_nick" - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", - "https://raw.githubusercontent.com/Orz-3/task/master/weibo.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js" - }, + "id" : "notifytimes", + "val" : "", + "name" : "通知频率 (点击查看设置说明)", + "type" : "number", + "desc" : "设定通知频率,前三次为全部通知,之后转盘次数\/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" + }, { - "id": "youth", - "name": "中青看点", - "keys": [ - "youthheader_zq", - "read_zq", - "red_zq", - "readtime_zq", - "cashurl_zq", - "cashbody_zq", - "zqcash" - ], - "author": "@sunert", - "settings": [ - { - "id": "notifytimes", - "name": "通知频率 (点击查看设置说明)", - "val": "", - "type": "number", - "desc": "设定通知频率,前三次为全部通知,之后转盘次数/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" - }, - { - "id": "zqcash", - "name": "提现金额", - "val": "30", - "type": "radios", - "desc": "自动提现金额需和获取提现请求保持一致", - "items": [ - { - "key": "10", - "label": "10元" - }, - { - "key": "30", - "label": "30元" - }, - { - "key": "100", - "label": "100元" - } - ] - } - ], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", - "https://raw.githubusercontent.com/Orz-3/task/master/youth.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js" - }, + "items" : [ + { + "key" : "10", + "label" : "10元" + }, + { + "key" : "30", + "label" : "30元" + }, + { + "key" : "100", + "label" : "100元" + } + ], + "id" : "zqcash", + "val" : "30", + "name" : "提现金额", + "type" : "radios", + "desc" : "自动提现金额需和获取提现请求保持一致" + } + ], + "name" : "中青看点", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/youth.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/youth.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "youth_start", + "youth_end" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/youth_gain.js", + "id" : "youthGain", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/youth_gain.js", + "name" : "中青浏览赚", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/youth.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/youth.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "sy_signheader_dsj", + "drawal_dsj" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/dianshijia.js", + "id" : "dianshijia", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/dianshijia.js", + "settings" : [ + { + "items" : [ + { + "key" : "55", + "label" : "提现额度" + }, + { + "key" : "44", + "label" : "1天VIP" + }, + { + "key" : "42", + "label" : "1888金币" + } + ], + "id" : "REWARD", + "val" : "55", + "name" : "额外签到奖励", + "type" : "radios", + "desc" : "" + } + ], + "name" : "电视家", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/dianshijia.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/dianshijia.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "cookie_ks" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/kuaishou.js", + "id" : "kuaishou", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/kuaishou.js", + "name" : "快手极速版", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/kuaishou.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/kuaishou.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "sy_signurl_snews", + "sy_info_snews", + "sy_ck_snews", + "sy_infoheader_snews" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/sinanews.js", + "id" : "sinanews", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/sinanews.js", + "name" : "新浪新闻", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/sinanews.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/sinanews.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "now_qq", + "nowqq_cookie" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/NOWLIVE.js", + "id" : "NOWLIVE", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/NOWLIVE.js", + "name" : "NOW直播", + "icons" : [ + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/NOWLIVE_mini.png", + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/NOWLIVE.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "china_telecom_authToken_10000", + "china_telecom_cookie" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/telecomInfinity.js", + "id" : "chinatelecomEnquiry", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/telecomInfinity.js", + "settings" : [ + { + "id" : "Mon", + "val" : "2020-08", + "name" : "查询月份", + "type" : "month", + "desc" : "填入账单月份,可查最近六个月,本月账单下月可查" + } + ], + "name" : "电信套餐查询", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/telecominfinty.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/telecominfinty.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "sy_cookie_dj" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/jddj.js", + "id" : "jddj", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/jddj.js", + "name" : "京东到家", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/jddj.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/jddj.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "c" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/tvpreview.js", + "id" : "TVlist", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/tvpreview.js", + "settings" : [ { - "id": "youthGain", - "name": "中青浏览赚", - "keys": [ - "youth_start", - "youth_end" - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", - "https://raw.githubusercontent.com/Orz-3/task/master/youth.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js" - }, + "id" : "c", + "val" : "cctv8", + "name" : "电视台", + "type" : "text", + "desc" : "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" + } + ], + "name" : "电视预告", + "icons" : [ + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/tvpreview_mini.png", + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/tvpreview.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "city", + "citynum", + "cut", + "day_desc", + "hour_desc", + "index_desc" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/moji.js", + "id" : "moji", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/moji.js", + "settings" : [ { - "id": "dianshijia", - "name": "电视家", - "keys": [ - "sy_signheader_dsj", - "drawal_dsj" - ], - "author": "@sunert", - "settings": [ - { - "id": "REWARD", - "name": "额外签到奖励", - "val": "55", - "type": "radios", - "desc": "", - "items": [ - { - "key": "55", - "label": "提现额度" - }, - { - "key": "44", - "label": "1天VIP" - }, - { - "key": "42", - "label": "1888金币" - } - ] - } - ], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", - "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js" - }, + "id" : "city", + "val" : "北京", + "name" : "城市", + "type" : "text", + "desc" : "请填写中文地区" + }, { - "id": "kuaishou", - "name": "快手极速版", - "keys": [ - "cookie_ks" - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", - "https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js" - }, + "id" : "citynum", + "placeholder" : "默认1 (点击以展开说明)", + "val" : "", + "name" : "城市序号", + "type" : "number", + "desc" : "选择地区,请填写日志内冒号前的数字序号" + }, { - "id": "sinanews", - "name": "新浪新闻", - "keys": [ - "sy_signurl_snews", - "sy_info_snews", - "sy_ck_snews", - "sy_infoheader_snews" - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", - "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js" - }, + "id" : "cut", + "val" : false, + "name" : "精简日志模式", + "type" : "boolean", + "desc" : "显示详情描述,默认关闭日志" + }, { - "id": "NOWLIVE", - "name": "NOW直播", - "keys": [ - "now_qq", - "nowqq_cookie" - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", - "icons": [ - "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", - "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js" - }, + "id" : "day_desc", + "val" : true, + "name" : "每周天气", + "type" : "boolean", + "desc" : "每周天气接口,可显示6天天气情况" + }, { - "id": "chinatelecomEnquiry", - "name": "电信套餐查询", - "keys": [ - "china_telecom_authToken_10000", - "china_telecom_cookie" - ], - "settings": [ - { - "id": "Mon", - "name": "查询月份", - "val": "2020-08", - "type": "month", - "desc": "填入账单月份,可查最近六个月,本月账单下月可查" - } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", - "https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js" - }, + "id" : "hour_desc", + "val" : false, + "name" : "小时天气", + "type" : "boolean", + "desc" : "未来6小时天气情况" + }, { - "id": "jddj", - "name": "京东到家", - "keys": [ - "sy_cookie_dj" - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jddj.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", - "https://raw.githubusercontent.com/Orz-3/task/master/jddj.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js" - }, + "id" : "forty_desc", + "val" : false, + "name" : "40天预告", + "type" : "boolean", + "desc" : "未来40天天气预告" + }, { - "id": "TVlist", - "name": "电视预告", - "keys": [ - "c" - ], - "settings": [ - { - "id": "c", - "name": "电视台", - "val": "cctv8", - "type": "text", - "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" - } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": [ - "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", - "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js" - }, + "id" : "index_desc", + "val" : true, + "name" : "生活指数", + "type" : "boolean", + "desc" : "可显示生活指数情况" + } + ], + "name" : "墨迹天气", + "icons" : [ + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/moji_mini.png", + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/moji.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "jukan_body", + "jukan_name" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/jukan.js", + "id" : "jukan", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/jukan.js", + "settings" : [ { - "id": "moji", - "name": "墨迹天气", - "keys": [ - "city", - "citynum", - "cut", - "day_desc", - "hour_desc", - "index_desc" - ], - "settings": [ - { - "id": "city", - "name": "城市", - "val": "北京", - "type": "text", - "desc": "请填写中文地区" - }, - { - "id": "citynum", - "name": "城市序号", - "val": "", - "type": "number", - "placeholder": "默认1 (点击以展开说明)", - "desc": "选择地区,请填写日志内冒号前的数字序号" - }, - { - "id": "cut", - "name": "精简日志模式", - "val": false, - "type": "boolean", - "desc": "显示详情描述,默认关闭日志" - }, - { - "id": "day_desc", - "name": "每周天气", - "val": true, - "type": "boolean", - "desc": "每周天气接口,可显示6天天气情况" - }, - { - "id": "hour_desc", - "name": "小时天气", - "val": false, - "type": "boolean", - "desc": "未来6小时天气情况" - }, - { - "id": "forty_desc", - "name": "40天预告", - "val": false, - "type": "boolean", - "desc": "未来40天天气预告" - }, - { - "id": "index_desc", - "name": "生活指数", - "val": true, - "type": "boolean", - "desc": "可显示生活指数情况" - } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", - "icons": [ - "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", - "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js" - }, + "id" : "jukan_out", + "val" : false, + "name" : "自动提现", + "type" : "boolean", + "desc" : "自动提现开关,请填入提现金额及微信绑定实名,默认关闭" + }, { - "id": "jukan", - "name": "聚看点", - "keys": [ - "jukan_body", - "jukan_name" - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", - "settings": [ - { - "id": "jukan_out", - "name": "自动提现", - "val": false, - "type": "boolean", - "desc": "自动提现开关,请填入提现金额及微信绑定实名,默认关闭" - }, - { - "id": "jukan_cash", - "name": "提现金额", - "val": "", - "type": "number", - "placeholder": "默认30 (点击以展开说明)", - "desc": "仅允许填入数字,所选金额可见聚看点APP" - }, - { - "id": "jukan_name", - "name": "微信真实姓名", - "val": "", - "type": "text", - "placeholder": "填入微信真实姓名" - } - ], - "icons": [ - "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan_mini.png", - "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js" - }, + "id" : "jukan_cash", + "val" : "", + "name" : "提现金额", + "type" : "radios", + "items" : [ + { + "key" : "3", + "label" : "3元(邀请专享)" + }, + { + "key" : "10", + "label" : "10元(阅读\/邀请)" + }, + { + "key" : "30", + "label" : "30元(无条件)" + }, + { + "key" : "50", + "label" : "50元(无条件)" + }, + { + "key" : "100", + "label" : "100元(无条件)" + } + ] + }, { - "id": "mydigit", - "name": "数码之家", - "keys": [ - "sign_mydigit" - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", - "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js" - }, + "id" : "jukan_name", + "placeholder" : "填入微信真实姓名", + "val" : "", + "name" : "微信真实姓名", + "type" : "text" + } + ], + "name" : "聚看点", + "icons" : [ + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/jukan_mini.png", + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/jukan.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "sign_mydigit" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/mydigit.js", + "id" : "mydigit", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/mydigit.js", + "name" : "数码之家", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/mydigit.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/mydigit.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "baidu_nick", + "chavy_cookie_tieba", + "CookieTB", + "cash_baidu" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/baiduspeed.js", + "id" : "baidu", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/baiduspeed.js", + "settings" : [ { - "id": "baidu", - "name": "百度极速任务", - "keys": [ - "baidu_nick", - "chavy_cookie_tieba", - "CookieTB", - "cash_baidu" - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/baiduspeed.js", - "settings": [ - { - "id": "cash_baidu", - "name": "提现金额", - "val": "30", - "type": "radios", - "desc": "自动提现金额", - "items": [ - { - "key": "5", - "label": "5元" - }, - { - "key": "30", - "label": "30元" - }, - { - "key": "50", - "label": "50元" - }, - { - "key": "100", - "label": "100元" - } - ] - }, - { - "id": "task_baidu", - "name": "任务开关", - "val": true, - "type": "boolean", - "desc": "除提现和兑换金币外开关,默认开启所有任务" - } - ], - "icons": [ - "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed_mini.png", - "https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baiduspeed.js" - }, + "items" : [ + { + "key" : "5", + "label" : "5元" + }, + { + "key" : "30", + "label" : "30元" + }, + { + "key" : "50", + "label" : "50元" + }, + { + "key" : "100", + "label" : "100元" + } + ], + "id" : "cash_baidu", + "val" : "30", + "name" : "提现金额", + "type" : "radios", + "desc" : "自动提现金额" + }, + { + "id" : "task_baidu", + "val" : true, + "name" : "任务开关", + "type" : "boolean", + "desc" : "除提现和兑换金币外开关,默认开启所有任务" + } + ], + "name" : "百度极速任务", + "icons" : [ + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/baiduspeed_mini.png", + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/baiduspeed.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "sy_signurl_txnews", + "sy_cookie_txnews", + "video_txnews" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/txnews.js", + "id" : "txnews", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/txnews.js", + "settings" : [ + { + "id" : "notifynum", + "placeholder" : "默认50 (点击以展开说明)", + "val" : "", + "name" : "通知频率", + "type" : "number", + "desc" : "阅读篇数间隔通知开为1,常关为0(默认50篇)" + }, + { + "id" : "delay", + "placeholder" : "默认200 (点击以展开说明)", + "val" : "", + "name" : "延迟时间(毫秒)", + "type" : "number", + "desc" : "接口延迟时间" + } + ], + "name" : "腾讯新闻", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/txnews.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/txnews.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + "CookieJD", + "CookieJD2" + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/jingxi.js", + "id" : "jingxi", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/jingxi.js", + "name" : "京喜", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/jingxi.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/jingxi.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/tvpreview.js", + "id" : "translate", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/translate.js", + "settings" : [ + { + "id" : "word", + "placeholder" : "Hello World", + "val" : "Hello World", + "name" : "原文", + "type" : "textarea", + "desc" : "兼容中英文短语翻译,填入原文后手动运行" + } + ], + "name" : "谷歌翻译", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/translate.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/translate.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/exchangeRate.js", + "id" : "exchange rate", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/exchangeRate.js", + "settings" : [ + { + "id" : "froma", + "val" : "人民币", + "name" : "使用币", + "type" : "text", + "desc" : "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" + }, + { + "id" : "toex", + "val" : "港币", + "name" : "兑换币", + "type" : "text", + "desc" : "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" + }, + { + "id" : "numex", + "val" : "10", + "name" : "兑换金额", + "type" : "number", + "desc" : "填写数字" + } + ], + "name" : "汇率换算", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/exchangerate.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/exchangerate.png" + ] + }, + { + "author" : "@sunert", + "keys" : [ + + ], + "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/trainquery.js", + "id" : "trainquery", + "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/trainquery.js", + "settings" : [ { - "id": "txnews", - "name": "腾讯新闻", - "keys": [ - "sy_signurl_txnews", - "sy_cookie_txnews", - "video_txnews" - ], - "author": "@sunert", - "settings": [ - { - "id": "notifynum", - "name": "通知频率", - "val": "", - "type": "number", - "placeholder": "默认50 (点击以展开说明)", - "desc": "阅读篇数间隔通知开为1,常关为0(默认50篇)" - }, - { - "id": "delay", - "name": "延迟时间(毫秒)", - "val": "", - "type": "number", - "placeholder": "默认200 (点击以展开说明)", - "desc": "接口延迟时间" - } - ], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", - "https://raw.githubusercontent.com/Orz-3/task/master/txnews.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js" - }, + "items" : [ + { + "key" : "ADULT", + "label" : "成人" + }, + { + "key" : "0X00", + "label" : "学生" + } + ], + "id" : "people", + "val" : "ADULT", + "name" : "乘客类型", + "type" : "radios", + "desc" : "成人\/学生" + }, { - "id": "jingxi", - "name": "京喜", - "keys": [ - "CookieJD", - "CookieJD2" - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jingxi.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/jingxi.png", - "https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js" - }, + "id" : "left", + "val" : "北京", + "name" : "出发站点", + "type" : "text", + "desc" : "填入中文站点" + }, { - "id": "translate", - "name": "谷歌翻译", - "keys": [ ], - "settings": [ - { - "id": "word", - "name": "原文", - "val": "Hello World", - "type": "textarea", - "placeholder": "Hello World", - "desc": "兼容中英文短语翻译,填入原文后手动运行" - } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", - "https://raw.githubusercontent.com/Orz-3/task/master/translate.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js" - }, + "id" : "end", + "val" : "上海", + "name" : "目的地", + "type" : "text", + "desc" : "填入中文站点" + }, { - "id": "exchange rate", - "name": "汇率换算", - "keys": [ ], - "settings": [ - { - "id": "froma", - "name": "使用币", - "val": "人民币", - "type": "text", - "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" - }, - { - "id": "toex", - "name": "兑换币", - "val": "港币", - "type": "text", - "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" - }, - { - "id": "numex", - "name": "兑换金额", - "val": "10", - "type": "number", - "desc": "填写数字" - } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", - "https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js" - }, + "id" : "leavedate", + "val" : "2020-08-15", + "name" : "出发时间", + "type" : "date", + "desc" : "填入出发日期,请按照格式填写" + }, { - "id": "trainquery", - "name": "列车时刻", - "keys": [ ], - "settings": [ - { - "id": "people", - "name": "乘客类型", - "val": "ADULT", - "type": "radios", - "desc": "成人/学生", - "items": [ - { - "key": "ADULT", - "label": "成人" - }, - { - "key": "0X00", - "label": "学生" - } - ] - }, - { - "id": "left", - "name": "出发站点", - "val": "北京", - "type": "text", - "desc": "填入中文站点" - }, - { - "id": "end", - "name": "目的地", - "val": "上海", - "type": "text", - "desc": "填入中文站点" - }, - { - "id": "leavedate", - "name": "出发时间", - "val": "2020-08-15", - "type": "date", - "desc": "填入出发日期,请按照格式填写" - }, - { - "id": "setrain", - "name": "列车车次", - "val": "G5", - "type": "text", - "desc": "填入列车车次或者列车序号,列车序号请查看日志详情" - } - ], - "author": "@sunert", - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", - "icons": [ - "https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", - "https://raw.githubusercontent.com/Orz-3/task/master/12306.png" - ], - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js" + "id" : "setrain", + "val" : "G5", + "name" : "列车车次", + "type" : "text", + "desc" : "填入列车车次或者列车序号,列车序号请查看日志详情" } - ] + ], + "name" : "列车时刻", + "icons" : [ + "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/12306.png", + "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/12306.png" + ] + } + ] } From d40ed9334c97eac03327eb4d35cbafd3374edf65 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 28 Jan 2021 23:40:11 +0800 Subject: [PATCH 429/721] Update youth.js --- Task/youth.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/youth.js b/Task/youth.js index 3defdae467..ce8ef8f541 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -290,6 +290,7 @@ function signInfo() { await withDraw() } nick = `账号: ${signinfo.data.user.nickname}`; + $.setdata(nick,"zq_nick") detail = `${signresult}(今天+${signinfo.data.sign_score}青豆) 已连签${signday}天\n<本次收益>:\n`; if(signday==7){ await SevCont(); From 03fc79fe1be8dc0388d147e593e5ce8f7e9ec993 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Thu, 28 Jan 2021 23:44:27 +0800 Subject: [PATCH 430/721] Update sunert.boxjs.json --- Task/sunert.boxjs.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index f2e9e9d582..a7b8e6cb64 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -24,6 +24,7 @@ { "author" : "@sunert", "keys" : [ + "zq_nick", "youthheader_zq", "read_zq", "red_zq", @@ -44,6 +45,11 @@ "desc" : "设定通知频率,前三次为全部通知,之后转盘次数\/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" }, { + "id" : "zqcash", + "val" : "30", + "name" : "提现金额", + "type" : "radios", + "desc" : "自动提现金额需和获取提现请求保持一致", "items" : [ { "key" : "10", @@ -57,12 +63,7 @@ "key" : "100", "label" : "100元" } - ], - "id" : "zqcash", - "val" : "30", - "name" : "提现金额", - "type" : "radios", - "desc" : "自动提现金额需和获取提现请求保持一致" + ] } ], "name" : "中青看点", From e423f1dd1310289864ea11538cf8897baab68190 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 20:13:45 +0800 Subject: [PATCH 431/721] Update youth.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复错误 --- Task/youth.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index ce8ef8f541..80d51e77a5 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-01-23 12:00 +更新时间: 2021-01-29 20:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 @@ -282,13 +282,14 @@ function signInfo() { } $.post(infourl, async(error, response, data) => { signinfo = JSON.parse(data); +//$.log(formatJson(data)) if (signinfo.status == 1) { cash = signinfo.data.user.money signday = signinfo.data.sign_day subTitle = `【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元`; - if(cash>=withdrawcash&&typeof withdrawBody !== undefined){ - await withDraw() - } + if( parseInt(cash) >= withdrawcash && withdrawBody !== ""){ + await withDraw() + } nick = `账号: ${signinfo.data.user.nickname}`; $.setdata(nick,"zq_nick") detail = `${signresult}(今天+${signinfo.data.sign_score}青豆) 已连签${signday}天\n<本次收益>:\n`; @@ -745,5 +746,7 @@ async function showmsg() { console.log(`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n`+ detail) } } +function formatJson(json,options){var reg=null,formatted='',pad=0,PADDING=' ';options=options||{};options.newlineAfterColonIfBeforeBraceOrBracket=(options.newlineAfterColonIfBeforeBraceOrBracket===true)?true:false;options.spaceAfterColon=(options.spaceAfterColon===false)?false:true;if(typeof json!=='string'){json=JSON.stringify(json);}else{json=JSON.parse(json);json=JSON.stringify(json)};json=json.replace(/([\{\}])/g,'\r\n$1\r\n');json=json.replace(/([\[\]])/,'\r\n$1\r\n');json=json.replace(/(\,)/g,'$1\r\n');json=json.replace(/(\r\n\r\n)/g,'\r\n');json=json.replace(/\r\n\,/g,',');if(!options.newlineAfterColonIfBeforeBraceOrBracket){json=json.replace(/\:\r\n\{/g,':{');json=json.replace(/\:\r\n\[/g,':[')};if(options.spaceAfterColon){json=json.replace(/\:/g,':')};(json.split('\r\n')).forEach(function(node,index){var i=0,indent=0,padding='';if(node.match(/\{$/)||node.match(/\[$/)){indent=1}else if(node.match(/\}/)||node.match(/\]/)){if(pad!==0){pad-=1}}else{indent=0};for(i=0;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 69d068c0f73e6aea935425bc51f555b21fb597e0 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 20:29:44 +0800 Subject: [PATCH 432/721] Update youth.js --- Task/youth.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 80d51e77a5..14e4e30f23 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-01-29 20:00 +更新时间: 2021-01-23 12:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 @@ -73,8 +73,8 @@ let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖 const YOUTH_HOST = "https://kd.youth.cn/WebApi/"; const notify = $.isNode() ? require('./sendNotify') : ''; const withdrawcash = $.getdata('zqcash')||30 //提现金额 -const withdrawUrl =$.getdata('cashurl_zq') -const withdrawBody =$.getdata('cashbody_zq') +let withdrawUrl =$.getdata('cashurl_zq') +let withdrawBody =$.getdata('cashbody_zq') let logs = $.getdata('zqlogs')||false, rotaryscore=0,doublerotary=0,signresult; let cookiesArr = [], signheaderVal = '', @@ -282,12 +282,12 @@ function signInfo() { } $.post(infourl, async(error, response, data) => { signinfo = JSON.parse(data); -//$.log(formatJson(data)) + //$.log(formatJson(data)) if (signinfo.status == 1) { cash = signinfo.data.user.money signday = signinfo.data.sign_day subTitle = `【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元`; - if( parseInt(cash) >= withdrawcash && withdrawBody !== ""){ + if( parseInt(cash) >= withdrawcash && !withdrawBody == "false"){ await withDraw() } nick = `账号: ${signinfo.data.user.nickname}`; From a0d549a92d31ceca9a3d7219228dac3f9f583bdd Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 21:12:50 +0800 Subject: [PATCH 433/721] Delete Auto_Kuaishou.js --- Task/Auto_Kuaishou.js | 79 ------------------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 Task/Auto_Kuaishou.js diff --git a/Task/Auto_Kuaishou.js b/Task/Auto_Kuaishou.js deleted file mode 100644 index 30cbb3a696..0000000000 --- a/Task/Auto_Kuaishou.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -更新时间: 2020-12-06 15:46 -赞赏:快手邀请码`774010415`,农妇山泉 -> 有点咸,万分感谢 -Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 - -请自行抓包,刷视频即,可获得更多包数据,抓包地址为"http://ali2.a.yximgs.com/ksc1/xxxxxx.kpg",在Github Actions中的Secrets新建name为'KUAISHOUMV'的一个值,拷贝抓包的请求体到下面Value的文本框中,本脚本不包含任何推送通知 - -多个请求时用'#'号或者换行隔开" ‼️ - -*/ - -const $ = new Env("快手视频") - -let ksUrl = [], ksArr = []; - - if (process.env.KUAISHOUMV && process.env.KUAISHOUMV.indexOf('#') > -1) { - ksUrl = process.env.KUAISHOUMV.split('#'); - console.log(`您选择的是用"#"隔开\n`) - } - else if (process.env.KUAISHOUMV && process.env.KUAISHOUMV.indexOf('\n') > -1) { - ksUrl = process.env.KUAISHOUMV.split('\n'); - console.log(`您选择的是用换行隔开\n`) - } else { - ksUrl = process.env.KUAISHOUMV.split() - } - Object.keys(ksUrl).forEach((item) => { - if (ksUrl[item]) { - ksArr.push(ksUrl[item]) - } - }) - console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) - -!(async () => { - if (!ksArr[0]) { - console.log($.name, '【提示】请把抓包地址填入Github 的 Secrets 中,请以#或者换行隔开') - return; - } - for (let i = 0; i < ksArr.length; i++) { - if (ksArr[i]) { - playUrl = ksArr[i]; - $.index = i + 1; - console.log(`-------------------------\n\n开始快手极速版第${$.index}个视频`) - } - for (let j = 0; j < 5; j++) { - await AutoRead(); - await $.wait(10000); - console.log(`\n 请等待10s后继续视频${$.index}第${j+1}次任务`) - } - }; - console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*5)次,视频金币详情见App,任务全部结束`) -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - -function AutoRead(){ - return new Promise((resolve) => { - const myRequest = { - url: playUrl, - headers: { - 'Accept-Encoding' : `gzip, deflate`, - 'Connection' : `close`, - 'Accept' : `application/json`, - 'Host' : `ali2.a.yximgs.com`, - 'User-Agent' : `kwai-ios`, - 'Accept-Language' : `zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8`}, -}; - $.get(myRequest, (error, response, data) => { - if(error){ - console.log("响应数据失败:"+response.statusCode + "\n\n" + data); - } - //console.log(response.statusCode + "\n\n" + data); - //$.done(); - }) - resolve() - }) -} - -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 822082c6858074e66a4535bdf6e3eaf48cb9eb0b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 21:13:21 +0800 Subject: [PATCH 434/721] Delete weather_pro.js --- Task/weather_pro.js | 847 -------------------------------------------- 1 file changed, 847 deletions(-) delete mode 100644 Task/weather_pro.js diff --git a/Task/weather_pro.js b/Task/weather_pro.js deleted file mode 100644 index 7133c46a03..0000000000 --- a/Task/weather_pro.js +++ /dev/null @@ -1,847 +0,0 @@ -/* -可以自由定制显示的天气脚本,想怎样都随你,轻松修改轻松查看 -https://github.com/sazs34/TaskConfig/blob/master/assets/weather_pro.md - */ -let config = { - darksky_api: "填这里", //从https://darksky.net/dev/ 上申请key填入即可 - aqicn_api: "填这里", //从http://aqicn.org/data-platform/token/#/ 上申请key填入即可 - huweather_apiKey: "填这里", //和风天气APIkey,可自行前往 https://dev.heweather.com/ 进行获取 - lat_lon: "填这里", //请填写经纬度,直接从谷歌地图中获取即可 - lang: "zh", //语言,随意切换为您想要的语言哦(zh/zh-tw/ja/en/fr/...) - log: 0, //调试日志,0为不开启,1为开启,2为开启精简日志 - timeout: 0, //超时时间,单位毫秒(1000毫秒=1秒),一般不推荐修改[为0则不限制超时时间] - show: { - //普通每天的 - template: { - title: `$[city]$[district] $[summary]`, - subtitle: `$[weatherIcon]$[weather] $[temperatureMin] ~ $[temperatureMax]°C ☔️降雨概率 $[precipProbability]%`, - detail: `$[aqiIcon]空气质量 $[aqi]($[aqiDesc]) 🏋🏻‍♀️气压$[atmosphere]pa -🌪风速$[windSpeed]km/h 💨$[windDir]$[windPower]级 -👀紫外线指数 $[uv]($[uvDesc]) 💦湿度$[currentHumidity]% -🌡体感温度 $[apparentTemperatureMin] ~ $[apparentTemperatureMax]°C 🎚当前温度 $[currentTemperature]℃ -[生活指数] -$[lifeStyle($[icon]:$[brf],$[txt])] -[天气周报] $[weeklySummary] -$[daily($[month]月$[day]日 $[temperatureLow]~$[temperatureHigh]°C $[weatherIcon]$[weather])]` - }, - lifestyle: { //此处用于显示各项生活指数,可自行调整顺序,顺序越在前面则显示也会靠前,如果您不想查看某一指数,置为false即可,想看置为true即可 - drsg: true, //穿衣指数, - flu: true, //感冒指数, - comf: true, //舒适度指数, - cw: false, //洗车指数, - sport: false, //运动指数, - trav: false, //旅游指数, - uv: false, //紫外线指数, - air: false, //空气污染扩散条件指数, - ac: false, //空调开启指数, - ag: false, //过敏指数, - gl: false, //太阳镜指数, - mu: false, //化妆指数, - airc: false, //晾晒指数, - ptfc: true, //交通指数, - fsh: false, //钓鱼指数, - spi: false, //防晒指数 - } - } -} - -const provider = { - heweather_now: { - api: `https://free-api.heweather.net/s6/weather/now?location=${config.lat_lon.replace(/\s/g, "").replace(",", ",")}&key=${config.huweather_apiKey}`, - progress: 0, //处理进度:0需处理1已处理2无需处理9报错 - timeoutNumber: 0, //超时处理编号 - data: { - basic: {}, - now: {} - }, - support: ['$[province]', '$[city]', '$[district]', '$[weatherIcon]', '$[weather]', '$[currentTemperature]', '$[currentWindSpeed]', '$[currentWindDir]', '$[currentWindPower]', '$[currentHumidity]', '$[currentAtmosphere]', '$[currentVisibility]'] - }, - heweather_daily: { - api: `https://free-api.heweather.net/s6/weather/forecast?location=${config.lat_lon.replace(/\s/g, "").replace(",", ",")}&key=${config.huweather_apiKey}`, - progress: 0, - timeoutNumber: 0, - data: {}, - support: ['$[temperatureMin]', '$[temperatureMax]', '$[precipProbability]', '$[windSpeed]', '$[windDir]', '$[windPower]', '$[humidity]', '$[atmosphere]', '$[visibility]', '$[uv]', '$[uvDesc]', '$[sunrise]', '$[sunset]', '$[moonrise]', '$[moonset]'] - }, - heweather_air: { - api: `https://free-api.heweather.net/s6/air/now?location=auto_ip&key=${config.huweather_apiKey}`, - progress: 0, - timeoutNumber: 0, - data: {}, - support: [] - }, - heweather_lifestyle: { - api: `https://free-api.heweather.net/s6/weather/lifestyle?location=${config.lat_lon.replace(/\s/g, "").replace(",", ",")}&key=${config.huweather_apiKey}`, - progress: 0, - timeoutNumber: 0, - data: [], - support: ['$[lifeStyle]'] - }, - darksky: { - api: `https://api.darksky.net/forecast/${config.darksky_api}/${config.lat_lon.replace(/\s/g, "").replace(",", ",")}?lang=${config.lang}&units=si`, - progress: 0, - timeoutNumber: 0, - data: { - daily: { - data: [] - }, - hourly: { - data: [] - }, - currently: {} - }, - support: ['$[summary]', '$[weeklySummary]', '$[weatherIcon]', '$[weather]', '$[temperatureMin]', '$[temperatureMax]', '$[apparentTemperatureMin]', '$[apparentTemperatureMax]', '$[precipProbability]', '$[uv]', '$[uvDesc]'] - }, - aqicn: { - api: `https://api.waqi.info/feed/geo:${config.lat_lon.replace(/\s/g, "").replace(",", ",").replace(/,/, ";")}/?token=${config.aqicn_api}`, - progress: 0, - data: {}, - support: ['$[aqiIcon]', '$[aqi]', '$[aqiDesc]', '$[aqiWarning]'] - } -} -// #region 天气数据获取 -function weather() { - support(); - heweatherNow(); - heweatherDaily(); - darksky(); - aqicn(); - heweatherLifestyle(); -} -//clear-day, partly-cloudy-day, cloudy, clear-night, rain, snow, sleet, wind, fog, or partly-cloudy-night -//☀️🌤⛅️🌥☁️🌦🌧⛈🌩🌨❄️💧💦🌫☔️☂️ ☃️⛄️ -function darksky() { - if (provider.darksky.progress == 2) return; - start("darksky"); - $task.fetch({ - url: provider.darksky.api - }).then(response => { - try { - let darkObj = JSON.parse(response.body); - record(`天气数据获取-A1-${response.body}`); - if (darkObj.error) { - $notify("DarkApi", "出错啦", darkObj.error); - } - provider.darksky.data.daily = darkObj.daily; - provider.darksky.data.hourly = darkObj.hourly; - provider.darksky.data.currently = darkObj.currently; - record(`天气数据获取-A2`); - check('darksky', true) - } catch (e) { - console.log(`天气数据A获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-A3-${reason.error}`); - check('darksky', false); - }); -} - -function aqicn() { - if (provider.aqicn.progress == 2) return; - start("aqicn"); - $task.fetch({ - url: provider.aqicn.api - }).then(response => { - try { - var waqiObj = JSON.parse(response.body); - if (waqiObj.status == 'error') { - $notify("Aqicn", "出错啦", waqiObj.data); - } else { - record(`天气数据获取-B1-${response.body}`); - provider.aqicn.data = { - ...getAqiInfo(waqiObj.data.aqi) - }; - } - check('aqicn', true) - } catch (e) { - console.log(`天气数据B获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-B2-${reason.error}`); - //获取精确数据失败后,直接获取粗略信息即可 - heweatherAir(); - }); -} - -function heweatherNow() { - start("heweather_now"); - $task.fetch({ - url: provider.heweather_now.api - }).then(response => { - try { - record(`天气数据获取-C1-${response.body}`); - var heObj = JSON.parse(response.body); - provider.heweather_now.data.basic = heObj.HeWeather6[0].basic; - provider.heweather_now.data.now = heObj.HeWeather6[0].now; - check('heweather_now', true) - } catch (e) { - console.log(`天气数据C获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-C2-${reason.error}`); - //因为此接口出错率还挺高的,所以即使报错我们也不处理,该返回什么就返回什么好了 - check('heweather_now', false) - }) -} - -function heweatherDaily() { - if (provider.heweather_daily.progress == 2) return; - start("heweather_daily"); - $task.fetch({ - url: provider.heweather_daily.api - }).then(response => { - try { - record(`天气数据获取-D1-${response.body}`); - var heObj = JSON.parse(response.body); - provider.heweather_daily.data = heObj.HeWeather6[0].daily_forecast[0]; - check('heweather_daily', true) - } catch (e) { - console.log(`天气数据D获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-D2-${reason.error}`); - //因为此接口出错率还挺高的,所以即使报错我们也不处理,该返回什么就返回什么好了 - check('heweather_daily', false) - }) -} - -function heweatherAir() { - if (provider.heweather_air.progress == 2) return; - start("heweather_air"); - $task.fetch({ - url: provider.heweather_air.api - }).then(response => { - try { - record(`天气数据获取F1-${response.body}`); - var heObj = JSON.parse(response.body); - provider.heweather_air.data = { - ...getAqiInfo(heObj.HeWeather6[0].air_now_city.aqi) - }; - check('heweather_air', true) - } catch (e) { - console.log(`天气数据F获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-F2-${reason.error}`); - //因为此接口出错率还挺高的,所以即使报错我们也不处理,该返回什么就返回什么好了 - check('heweather_air', false) - }) -} - -function heweatherLifestyle() { - if (provider.heweather_lifestyle.progress == 2) return; - start("heweather_lifestyle"); - var needRequest = false; - //判断一下是否全部都是false,全false的话,则不需要请求此接口直接返回渲染的数据了 - for (var item in config.show.lifestyle) { - if (config.show.lifestyle[item]) { - needRequest = true; - break; - } - } - if (needRequest) { - $task.fetch({ - url: provider.heweather_lifestyle.api - }).then(response => { - try { - record(`天气数据获取-E1-${response.body}`); - var heObj = JSON.parse(response.body); - provider.heweather_lifestyle.data = heObj.HeWeather6[0].lifestyle; - check('heweather_lifestyle', true) - } catch (e) { - console.log(`天气数据E获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-E2-${reason.error}`); - //因为此接口出错率还挺高的,所以即使报错我们也不处理,该返回什么就返回什么好了 - check('heweather_lifestyle', false) - }) - } else { - check('heweather_lifestyle', false) - } -} -//#endregion - -// #region 提醒数据组装 -function check(type, result) { - record(`check-${type}-${result}`); - //支持setTimeout居然不支持clearTimeout,有点难受 - if (provider[type].progress == 1 || provider[type].progress == 9) return; - provider[type].progress = result ? 1 : 9; - var isAllChecked = provider.heweather_now.progress != 0 && provider.heweather_daily.progress && provider.darksky.progress != 0 && (provider.aqicn.progress != 0 || provider.heweather_air.progress != 0) && provider.heweather_lifestyle.progress != 0; - if (isAllChecked) { - record(`天气数据渲染中[template]`); - try { - renderTemplate(); - } catch (e) { - record(`天气渲染出错-${JSON.stringify(e)}`); - } - } -} - -var lineBreak = ` -`; - -function renderTemplate() { - execArrayTemplate(); - const map = { - //省 - province: provider.heweather_now.data.basic.admin_area, - //市 - city: provider.heweather_now.data.basic.parent_city, - //区 - district: provider.heweather_now.data.basic.location || "UNKNOW", - //全天气候变化概述 - summary: `${provider.darksky.data.hourly.summary||""}`, - //一周气候变化概述 - weeklySummary: `${provider.darksky.data.daily.summary||""}`, - //天气图标 - weatherIcon: `${getHeweatherIcon(provider.heweather_now.data.now.cond_code)||getDarkskyWeatherIcon(provider.darksky.data.hourly.icon)}`, - //天气描述(晴/雨/雪等) - weather: `${provider.heweather_now.data.now.cond_txt||getDarkskyWeatherDesc(provider.darksky.data.hourly.icon)}`, - //当前温度 - currentTemperature: `${provider.heweather_now.data.now.tmp}`, - //温度最低值 - temperatureMin: `${Math.round(provider.heweather_daily.data.tmp_min||provider.darksky.data.daily.data.get(0).temperatureMin)}`, - //温度最高值 - temperatureMax: `${Math.round(provider.heweather_daily.data.tmp_max||provider.darksky.data.daily.data.get(0).temperatureMax)}`, - //体感温度最低值 - apparentTemperatureMin: `${Math.round(provider.darksky.data.daily.data.get(0).apparentTemperatureLow)}`, - //体感温度最高值 - apparentTemperatureMax: `${Math.round(provider.darksky.data.daily.data.get(0).apparentTemperatureHigh)}`, - //降雨概率 - precipProbability: `${provider.heweather_daily.data.pop||(Number(provider.darksky.data.daily.data.get(0).precipProbability) * 100).toFixed(0)}`, - //空气质量图标 - aqiIcon: `${provider.aqicn.data.aqiIcon||provider.heweather_air.data.aqiIcon}`, - //空气质量 - aqi: `${provider.aqicn.data.aqi||provider.heweather_air.data.aqi}`, - //空气质量描述 - aqiDesc: `${provider.aqicn.data.aqiDesc||provider.heweather_air.data.aqiDesc}`, - //空气质量警告(提示) - aqiWarning: `${provider.aqicn.data.aqiWarning||provider.heweather_air.data.aqiWarning}`, - //全天风速 - windSpeed: `${provider.heweather_daily.data.wind_spd}`, - //当前风速 - currentWindSpeed: `${provider.heweather_now.data.now.wind_spd}`, - //全天风向 - windDir: `${provider.heweather_daily.data.wind_dir}`, - //当前风向 - currentWindDir: `${provider.heweather_now.data.now.wind_dir}`, - //全天风力 - windPower: `${provider.heweather_daily.data.wind_sc}`, - //当前风力 - currentWindPower: `${provider.heweather_now.data.now.wind_sc}`, - //全天相对湿度 - humidity: `${provider.heweather_daily.data.hum}`, - //当前相对湿度 - currentHumidity: `${provider.heweather_now.data.now.hum}`, - //全天大气压 - atmosphere: `${provider.heweather_daily.data.pres}`, - //当前大气压 - currentAtmosphere: `${provider.heweather_now.data.now.pres}`, - //全天能见度 - visibility: `${provider.heweather_daily.data.vis}`, - //当前能见度 - currentVisibility: `${provider.heweather_now.data.now.vis}`, - //紫外线等级 - uv: `${provider.heweather_daily.data.uv_index||provider.darksky.data.daily.data.get(0).uvIndex}`, - //紫外线描述 - uvDesc: `${getUVDesc(provider.heweather_daily.data.uv_index||provider.darksky.data.daily.data.get(0).uvIndex)}`, - //日出时间 - sunrise: `${provider.heweather_daily.data.sr}`, - //日落时间 - sunset: `${provider.heweather_daily.data.ss}`, - //月出时间 - moonrise: `${provider.heweather_daily.data.mr}`, - //月落时间 - moonset: `${provider.heweather_daily.data.ms}`, - } - var notifyInfo = { - title: execTemplate(config.show.template.title, map), - subtitle: execTemplate(config.show.template.subtitle, map), - detail: execTemplate(config.show.template.detail, map), - }; - $notify(notifyInfo.title, notifyInfo.subtitle, notifyInfo.detail); - $done({}); -} -// #endregion - -// #region 数据处理方法 -function getHeweatherIcon(code) { - var codeMap = { - _100: '☀️', - _101: '☁️', - _102: '☁️', - _103: '⛅️', - _104: '☁️', - _200: '💨', - _201: '🌬', - _202: '🌬', - _203: '🌬', - _204: '🌬', - _205: '🌬', - _206: '💨', - _207: '💨', - _208: '💨', - _209: '🌪', - _210: '🌪', - _211: '🌪', - _212: '🌪', - _213: '🌪', - _300: '🌨', - _301: '🌨', - _302: '⛈', - _303: '⛈', - _304: '⛈', - _305: '💧', - _306: '💦', - _307: '🌧', - _308: '🌧', - _309: '☔️', - _310: '🌧', - _311: '🌧', - _312: '🌧', - _313: '🌧❄️', - _314: '💧', - _315: '💦', - _316: '🌧', - _317: '🌧', - _318: '🌧', - _399: '🌧', - _400: '🌨', - _401: '🌨', - _402: '☃️', - _403: '❄️', - _404: '🌨', - _405: '🌨', - _406: '🌨', - _407: '🌨', - _408: '🌨', - _409: '🌨', - _410: '❄️', - _499: '⛄️', - _500: '🌫', - _501: '🌫', - _502: '🌫', - _503: '🌫', - _504: '🌫', - _505: '🌫', - _506: '🌫', - _507: '🌫', - _508: '🌫', - _509: '🌫', - _510: '🌫', - _511: '🌫', - _512: '🌫', - _513: '🌫', - _514: '🌫', - _515: '🌫', - _900: '🔥', - _901: '⛄️', - _999: '❓', - } - return codeMap[`_${code}`] ? codeMap[`_${code}`] : ""; -} - -function getDarkskyWeatherIcon(icon_text) { - let icon = "❓" - if (icon_text == "clear-day") icon = "☀️"; - if (icon_text == "partly-cloudy-day") icon = "🌤"; - if (icon_text == "cloudy") icon = "☁️"; - if (icon_text == "rain") icon = "🌧"; - if (icon_text == "snow") icon = "☃️"; - if (icon_text == "sleet") icon = "🌨"; - if (icon_text == "wind") "🌬"; - if (icon_text == "fog") icon = "🌫"; - if (icon_text == "partly-cloudy-night") icon = "🌑"; - if (icon_text == "clear-night") icon = "🌑"; - return icon; -} - -function getDarkskyWeatherDesc(icon_text) { - let icon = "未知" - if (icon_text == "clear-day") icon = `晴`; - if (icon_text == "partly-cloudy-day") icon = `晴转多云`; - if (icon_text == "cloudy") icon = `多云`; - if (icon_text == "rain") icon = `雨`; - if (icon_text == "snow") icon = `雪`; - if (icon_text == "sleet") icon = `雨夹雪`; - if (icon_text == "wind") icon = `大风`; - if (icon_text == "fog") icon = `大雾`; - if (icon_text == "partly-cloudy-night") icon = `多云`; - if (icon_text == "clear-night") icon = `晴`; - return icon; -} - -function getCityInfo(name) { - var loc; - try { - var locArr = name.split(/[(),,()]/) - if (locArr.length >= 4) { - loc = locArr[2] + " "; - } else if (locArr.length >= 2) { - loc = locArr[1] + " "; - } else { - loc = ""; //此时会很长,还不如不显示了 - } - } catch (e) { - loc = ''; - record(`获取城市名称失败-${JSON.stringify(e)}`); - } - return loc; -} - -function getAqiInfo(aqi) { - var aqiDesc = ""; - var aqiIcon = ""; - var aqiWarning = ""; - if (aqi > 300) { - aqiIcon = `🟤`; - aqiDesc = `严重污染`; - aqiWarning = "儿童、老人、呼吸系统等疾病患者及一般人群停止户外活动"; - } else if (aqi > 200) { - aqiIcon = `🟣`; - aqiDesc = `重度污染`; - aqiWarning = "儿童、老人、呼吸系统等疾病患者及一般人群停止或减少户外运动"; - } else if (aqi > 150) { - aqiIcon = `🔴`; - aqiDesc = `中度污染`; - aqiWarning = "儿童、老人、呼吸系统等疾病患者及一般人群减少户外活动"; - } else if (aqi > 100) { - aqiIcon = `🟠`; - aqiDesc = `轻度污染`; - aqiWarning = "老人、儿童、呼吸系统等疾病患者减少长时间、高强度的户外活动"; - } else if (aqi > 50) { - aqiIcon = `🟡`; - aqiDesc = `良好`; - aqiWarning = "极少数敏感人群应减少户外活动"; - } else { - aqiIcon = `🟢`; - aqiDesc = `优`; - } - return { - aqi, - aqiIcon, - aqiDesc, - aqiWarning - }; -} - -function getUVDesc(daily_uvIndex) { - var uvDesc = ""; - if (daily_uvIndex >= 10) { - uvDesc = "五级-特别强"; - } else if (daily_uvIndex >= 7) { - uvDesc = "四级-很强"; - } else if (daily_uvIndex >= 5) { - uvDesc = "三级-较强"; - } else if (daily_uvIndex >= 3) { - uvDesc = "二级-较弱"; - } else { - uvDesc = "一级-最弱"; - } - return uvDesc; -} -// #endregion - -// #region 模板相关 -/** - * 用于标识该接口已执行,如果有使用超时设置则此操作是有意义的 - * @param {String} type 具体的接口执行类型 - */ -function start(type) { - if (config.timeout > 0) { - provider[type].timeoutNumber = setTimeout(() => { - check(type, false); - }, config.timeout); - } -} -/** - * 判断哪些接口需要进行处理,减少网络请求 - */ -function support() { - let regex = /\$\[([a-z,A-Z,0-9]*)\]/g; - const template = `${config.show.template.title}${config.show.template.subtitle}${config.show.template.detail}`.match(regex); - provider.heweather_now.progress = template.filter((item, filter) => { - return provider.heweather_now.support.indexOf(item) != -1; - }).length > 0 ? 0 : 2; - provider.heweather_daily.progress = template.filter((item, filter) => { - return provider.heweather_daily.support.indexOf(item) != -1; - }).length > 0 ? 0 : 2; - // provider.heweather_air.progress = template.filter((item, filter) => { - // return provider.heweather_air.support.indexOf(item) != -1; - // }).length > 0 ? 0 : 2; - provider.heweather_lifestyle.progress = template.filter((item, filter) => { - let regexLifestyle = /\$\[(lifeStyle\()+([\s\S]+?)(\))+\]/g; - return regexLifestyle.test(config.show.lifestyle) ? 0 : 2; - }).length > 0 ? 0 : 2; - provider.aqicn.progress = template.filter((item, filter) => { - return provider.aqicn.support.indexOf(item) != -1; - }).length > 0 ? 0 : 2; - provider.darksky.progress = template.filter((item, filter) => { - return provider.darksky.support.indexOf(item) != -1; - }).length > 0 ? 0 : 2; - if (provider.darksky.progress == 2) { - //如果 - let regexDaily = /\$\[(daily\()+([\s\S]+?)(\))+\]/g; - let regexHourly = /\$\[(hourly\()+([\s\S]+?)(\))+\]/g; - provider.darksky.progress = (regexDaily.test(config.show.template.detail) || regexHourly.test(config.show.template.detail)) ? 0 : 2; - } - record(`h_n:${provider.heweather_now.progress},h_d:${provider.heweather_daily.progress},h_a:${provider.heweather_air.progress},h_l:${provider.heweather_lifestyle.progress},aq:${provider.aqicn.progress},da:${provider.darksky.progress}`) -} -/** - * 用于普通模板的映射 - * @param {String} template 模板内容 - * @param {Object} map 映射内容 - */ -function execTemplate(template, map) { - if (!template) return ""; - let regex = /\$\[([a-z,A-Z,0-9]*)\]/g; - if (regex.test(template)) { - for (item of template.match(regex)) { - item.match(regex); - if (RegExp.$1 && map[RegExp.$1]) { - template = template.replace(item, map[RegExp.$1]); - } else { - template = template.replace(item, ""); - } - } - } - return template; -} - -function execArrayTemplate() { - try { - execTemplateLifestyle(); - execTemplateDaily(); - execTemplateHourly(); - } catch (e) { - console.log(`${JSON.stringify(e)}`) - } - -} - -function execTemplateLifestyle() { - let regexLifestyle = /\$\[(lifeStyle\()+([\s\S]+?)(\))+\]/g; - if (provider.heweather_lifestyle.data <= 0) { - config.show.template.detail.replace(regexLifestyle, '') - } - let result = []; - if (regexLifestyle.test(config.show.template.detail)) { - let lsMap = { //此处用于显示各项生活指数,可自行调整顺序,顺序越在前面则显示也会靠前,如果您不想查看某一指数,置为false即可,想看置为true即可 - drsg: { - icon: '👔', - type: '穿衣指数' - }, - flu: { - icon: '🤧', - type: '感冒指数' - }, - comf: { - icon: '😊', - type: '舒适度指数' - }, - cw: { - icon: '🚗', - type: '洗车指数' - }, - sport: { - icon: '🏃🏻', - type: '运动指数' - }, - trav: { - icon: '🌴', - type: '旅游指数' - }, - uv: { - icon: '☂️', - type: '紫外线指数' - }, - air: { - icon: '🌫', - type: '空气污染扩散条件指数' - }, - ac: { - icon: '❄️', - type: '空调开启指数' - }, - ag: { - icon: '😷', - type: '过敏指数' - }, - gl: { - icon: '🕶', - type: '太阳镜指数' - }, - mu: { - icon: '💄', - type: '化妆指数' - }, - airc: { - icon: '🧺', - type: '晾晒指数' - }, - ptfc: { - icon: '🚥', - type: '交通指数' - }, - fsh: { - icon: '🎣', - type: '钓鱼指数' - }, - spi: { - icon: '🔆', - type: '防晒指数' - }, - } - config.show.template.detail.match(regexLifestyle); - var rangeTemplate = RegExp.$2; //此处拿到的是要替换的列表显示部分了 - let regex = /\$\[([a-z,A-Z,0-9]*)\]/g; - var template = rangeTemplate.match(regex); - for (life of provider.heweather_lifestyle.data) { - if (!config.show.lifestyle[life.type]) continue; - var singleInfo = rangeTemplate; - for (item of template) { - item.match(regex); - if (RegExp.$1 == "icon") { - singleInfo = singleInfo.replace(item, lsMap[life.type].icon) - } else if (RegExp.$1 == "type") { - singleInfo = singleInfo.replace(item, lsMap[life.type].type) - } else { - singleInfo = singleInfo.replace(item, life[RegExp.$1]) - } - } - result.push(singleInfo); - } - config.show.template.detail = config.show.template.detail.replace(regexLifestyle, result.join(lineBreak)); - } -} - -function execTemplateDaily() { - let regexDaily = /\$\[(daily\()+([\s\S]+?)(\))+\]/g; - if (provider.darksky.data.daily.data.length <= 0) { - config.show.template.detail.replace(regexDaily, '') - } - let result = []; - if (regexDaily.test(config.show.template.detail)) { - config.show.template.detail.match(regexDaily); - var rangeTemplate = RegExp.$2; //此处拿到的是要替换的列表显示部分了 - let regex = /\$\[([a-z,A-Z,0-9]*)\]/g; - var template = rangeTemplate.match(regex); - for (daily of provider.darksky.data.daily.data) { - var singleInfo = rangeTemplate; - for (item of template) { - item.match(regex); - if (RegExp.$1 == "month") { - singleInfo = singleInfo.replace(item, (`${daily["time"]}`).toDateTime().Format("MM")); - } else if (RegExp.$1 == "day") { - singleInfo = singleInfo.replace(item, (`${daily["time"]}`).toDateTime().Format("dd")); - } else if (RegExp.$1 == "weatherIcon") { - singleInfo = singleInfo.replace(item, getDarkskyWeatherIcon(daily.icon)); - } else if (RegExp.$1 == "weather") { - singleInfo = singleInfo.replace(item, getDarkskyWeatherDesc(daily.icon)); - } else if (RegExp.$1 == "uvDesc") { - singleInfo = singleInfo.replace(item, getUVDesc(daily.uvIndex)); - } else if (RegExp.$1 == "cloudCover") { - singleInfo = singleInfo.replace(item, daily.cloudCover * 100); - } else if (RegExp.$1 == "temperatureHigh") { - singleInfo = singleInfo.replace(item, Math.round(daily.temperatureHigh)); - } else if (RegExp.$1 == "temperatureLow") { - singleInfo = singleInfo.replace(item, Math.round(daily.temperatureLow)); - } else if (RegExp.$1 == "apparentTemperatureMax") { - singleInfo = singleInfo.replace(item, Math.round(daily.apparentTemperatureMax)); - } else if (RegExp.$1 == "apparentTemperatureMin") { - singleInfo = singleInfo.replace(item, Math.round(daily.apparentTemperatureMin)); - } else if (RegExp.$1 && daily[RegExp.$1] != undefined) { - singleInfo = singleInfo.replace(item, daily[RegExp.$1]); - } - } - result.push(singleInfo); - } - config.show.template.detail = config.show.template.detail.replace(regexDaily, result.join(lineBreak)); - } -} - -function execTemplateHourly() { - let regexHourly = /\$\[(hourly\()+([\s\S]+?)(\))+\]/g; - if (provider.darksky.data.hourly.data.length <= 0) { - config.show.template.detail.replace(regexHourly, '') - } - let result = []; - if (regexHourly.test(config.show.template.detail)) { - config.show.template.detail.match(regexHourly); - var rangeTemplate = RegExp.$2; //此处拿到的是要替换的列表显示部分了 - let regex = /\$\[([a-z,A-Z,0-9]*)\]/g; - var template = rangeTemplate.match(regex); - for (hourly of provider.darksky.data.hourly.data) { - var singleInfo = rangeTemplate; - for (item of template) { - item.match(regex); - if (RegExp.$1 == "month") { - singleInfo = singleInfo.replace(item, (`${hourly["time"]}`).toDateTime().Format("MM")); - } else if (RegExp.$1 == "day") { - singleInfo = singleInfo.replace(item, (`${hourly["time"]}`).toDateTime().Format("dd")); - } else if (RegExp.$1 == "hour") { - singleInfo = singleInfo.replace(item, (`${hourly["time"]}`).toDateTime().Format("hh")); - } else if (RegExp.$1 == "weatherIcon") { - singleInfo = singleInfo.replace(item, getDarkskyWeatherIcon(hourly.icon)); - } else if (RegExp.$1 == "weather") { - singleInfo = singleInfo.replace(item, getDarkskyWeatherDesc(hourly.icon)); - } else if (RegExp.$1 == "uvDesc") { - singleInfo = singleInfo.replace(item, getUVDesc(hourly.uvIndex)); - } else if (RegExp.$1 == "cloudCover") { - singleInfo = singleInfo.replace(item, hourly.cloudCover * 100); - } else if (RegExp.$1 == "temperature") { - singleInfo = singleInfo.replace(item, Math.round(hourly.temperature)); - } else if (RegExp.$1 == "apparentTemperature") { - singleInfo = singleInfo.replace(item, Math.round(hourly.apparentTemperature)); - } else if (RegExp.$1 && hourly[RegExp.$1] != undefined) { - singleInfo = singleInfo.replace(item, hourly[RegExp.$1]); - } - } - result.push(singleInfo); - } - config.show.template.detail = config.show.template.detail.replace(regexHourly, result.join(lineBreak)); - } -} - -function record(log) { - if (config.log == 1) { - console.log(log); - } else if (config.log == 2) { - console.log(log.substring(0, 60)); - } -} -// #endregion - -// #region 扩展方法 -Array.prototype.get = function (index, defaultValue = {}) { - if (index >= 0 && this.length > 0 && this.length >= index + 1) { - return this[index]; - } else { - return defaultValue; - } -} -String.prototype.toDateTime = function () { - var time = parseInt(this + '000'); - return new Date(time); -} -Date.prototype.Format = function (fmt) { - var o = { - "M+": this.getMonth() + 1, //月份 - "d+": this.getDate(), //日 - "h+": this.getHours(), //小时 - "m+": this.getMinutes(), //分 - "s+": this.getSeconds(), //秒 - "q+": Math.floor((this.getMonth() + 3) / 3), //季度 - "S": this.getMilliseconds() //毫秒 - }; - if (/(y+)/.test(fmt)) - fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); - for (var k in o) - if (new RegExp("(" + k + ")").test(fmt)) - fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); - return fmt; -} -// #endregion -weather(); \ No newline at end of file From eada058768a1d855d7a6259fc6dd80162c971eef Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 21:13:39 +0800 Subject: [PATCH 435/721] Delete jingxi.js --- Task/jingxi.js | 208 ------------------------------------------------- 1 file changed, 208 deletions(-) delete mode 100644 Task/jingxi.js diff --git a/Task/jingxi.js b/Task/jingxi.js deleted file mode 100644 index 3b5efa85e1..0000000000 --- a/Task/jingxi.js +++ /dev/null @@ -1,208 +0,0 @@ -/* -更新时间:10-09 20:05 -本脚本为京东旗下京喜app签到脚本 -本脚本使用京东公共Cooike,支持双账号,获取方法请查看NobyDa大佬脚本说明 - -[task_local] -0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js - -~~~~~~~~~~~~~~~~ -[MITM] -hostname = wq.jd.com -~~~~~~~~~~~~~~~~ -*/ - -const $ = new Env('京喜'); -let cookiesArr = [], cookie = '', signresult,todaypoint = 0; -const notify = $.isNode() ? require('./sendNotify') : ''; -const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; - -if ($.isNode()) { - Object.keys(jdCookieNode).forEach((item) => { - cookiesArr.push(jdCookieNode[item]) - }) -} else { - cookiesArr.push($.getdata('CookieJD')); - cookiesArr.push($.getdata('CookieJD2')) -} -!(async () => { - if (!cookiesArr[0]) { - $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - return; - } - for (let i = 0; i < cookiesArr.length; i++) { - if (cookiesArr[i]) { - cookie = cookiesArr[i]; - UserName = decodeURIComponent(cookie.match(/pt_pin=(\w+)/) && cookie.match(/pt_pin=(\w+)/)[1]) - $.index = i + 1; - console.log(`\n开始【京东账号${$.index}】${UserName}\n`); - await getsign(); - await Tasklist(); - await doublesign(); - await coininfo(); - await showmsg(); - if ($.isNode()){ - await notify.sendNotify($.name + " 账号昵称:" + nickname, $.sub+`\n`+$.desc) - } - } - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - -function getsign() { - return new Promise((resolve) => { - const signurl = { - url: 'https://wq.jd.com/pgcenter/sign/UserSignOpr?g_login_type=1', - headers: { - "Content-Type": "application/x-www-form-urlencoded", - Cookie: cookie, - Referer: "https://wqsh.jd.com/pingou/taskcenter/index.html" - }, - } - $.get(signurl, async(err, resp, data) => { - signres = JSON.parse(data) - if (signres.retCode == '0') { - nickname = signres.data.nickname - totalpoints = signres.data.pgAmountTotal - signdays = "已签" + signres.data.signDays + "天" - if (signres.data.signStatus == 0) { - signresult = "签到成功" - signdays += " 今日获得" + data.match(/[0-9]+/g)[4] + "积分" - - } else if (signres.data.signStatus == 1) { - signresult = "签到重复" - } - } else if (signres.retCode == '30003') { - $.msg($.name, '【提示】京东cookie已失效,请重新登录获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); - if($.isNode()){ - await notify.sendNotify($.name + " 账号" + $.index, `【提示】京东cookie已失效,请重新登录获取`) - } - return - } - resolve() - }) - }) -} - -function coininfo() { - return new Promise((resolve, reject) => { - const coinurl = { - url: "https://wq.jd.com/pgcenter/sign/QueryPGDetail?sceneval=2", - headers: { - "Content-Type": "application/x-www-form-urlencoded", - Cookie: cookie, - Referer: "https://jddx.jd.com/m/jddnew/money/index.html" - } - } - $.get(coinurl, (err, resp, data) => { - let coindata = JSON.parse(data), - localetime = new Date(new Date().toLocaleDateString()).getTime()/1000, - item = coindata.data.list; - daytotal = Number(); - var i = 0; - for(i=0;i=localetime;i++){ - if (item[i].activeId === '10000'){ - todaypoint = item[i].accountValue - }; - if (item[i].activeId ==='30000'){ - daytotal += item[i].accountValue - }; - } - resolve() - }) - }) -} - -function Tasklist(taskid) { - return new Promise( (resolve) => { - const url = { - url: 'https://m.jingxi.com/pgcenter/task/QueryPgTaskCfgByType?&taskType=3', - headers: { - "Content-Type": "application/x-www-form-urlencoded", - Cookie: cookie, - Referer: "https://st.jingxi.com/pingou/task_center/task/index.html?jxsid=" - }, - } - $.get(url, async (err, resp, data) => { - totaskres = JSON.parse(data) - var item = totaskres.data.tasks; - let taskArr = []; - for (task of item) { - taskArr.push(task.taskId); - await dotask(task.taskId); - await taskFinish(task.taskId); - } - resolve() - }) - }) -} - -function dotask(id) { - return new Promise((resolve) => { - const url = { - url: `https://m.jingxi.com/pgcenter/task/drawUserTask?sceneval=2&taskid=${id}`, - headers: { - "Content-Type": "application/x-www-form-urlencoded", - Cookie: cookie, - Referer: "https://st.jingxi.com/pingou/task_center/task/index.html?jxsid=" - } - } - $.get(url, (err, resp, data) => { - const task = JSON.parse(data) - //console.log(task) - resolve() - }) - }) -} -function taskFinish(taskId) { - return new Promise((resolve) => { - const url = { - url: `https://m.jingxi.com/pgcenter/task/UserTaskFinish?sceneval=2&taskid=${taskId}&sceneval=2&g_login_type=1&g_ty=ls`, - headers: { - "Content-Type": "application/x-www-form-urlencoded", - Cookie: cookie, - Referer: "https://st.jingxi.com/pingou/task_center/task/index.html?jxsid=" - } - } - $.get(url, (err, resp, data) => { - const task = JSON.parse(data) - //console.log(task) - resolve() - }) - }) -} -function doublesign() { - return new Promise((resolve) => { - const doubleurl = { - url: 'https://m.jingxi.com/double_sign/IssueReward?sceneval=2&g_login_type=1&g_ty=ajax', - headers: { - "Content-Type": "application/x-www-form-urlencoded", - Cookie: cookie, - Referer: "https://st.jingxi.com/pingou/jxapp_double_signin/index.html?ptag=139037.2.1" - } - } - $.get(doubleurl, (err, resp, data) => { - doub = JSON.parse(data) - if (doub.retCode == 0) { - doubleres = " 双签成功 🧧+ " + doub.data.jd_amount / 100 + "元"; - $.log($.name + "" + doubleres) - } - resolve() - }) - }) -} - -function showmsg() { - return new Promise((resolve) => { - if(signresult){ - $.sub = "积分总计:" + totalpoints+" " + signresult - $.desc = signdays +doubleres+ '\n' + "今日签到得" + todaypoint + "个金币 共计" + (daytotal+todaypoint)+'个金币' - $.msg($.name + " 账号昵称:" + nickname, $.sub, $.desc) - } - resolve() - }) -} - -// 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 From 9ae5292c18585297e738f96907ff073ef5d6ad62 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 21:29:14 +0800 Subject: [PATCH 436/721] Delete AUTO_KS.yml --- .github/workflows/AUTO_KS.yml | 39 ----------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .github/workflows/AUTO_KS.yml diff --git a/.github/workflows/AUTO_KS.yml b/.github/workflows/AUTO_KS.yml deleted file mode 100644 index a6825800b7..0000000000 --- a/.github/workflows/AUTO_KS.yml +++ /dev/null @@ -1,39 +0,0 @@ -# 快手视频刷金币测试,抓包获取secrets - -name: 快手视频浏览 - -on: - workflow_dispatch: - schedule: - - cron: '*/30 2,8,16 * * *' - watch: - types: started -jobs: - build: - runs-on: ubuntu-latest - if: github.event.repository.owner.id == github.event.sender.id - env: - KUAISHOUMV: ${{ secrets.KUAISHOUMV }} - TZ: Asia/shanghai - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: npm install - run: | - npm install - - name: '运行 【快手视频】' - if: env.KUAISHOUMV - run: | - node Task/Auto_Kuaishou.js - env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} From d9f5565fd482847494a3c7dfddae838c5c45ae08 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 21:29:26 +0800 Subject: [PATCH 437/721] Delete jingxi.yml --- .github/workflows/jingxi.yml | 37 ------------------------------------ 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/jingxi.yml diff --git a/.github/workflows/jingxi.yml b/.github/workflows/jingxi.yml deleted file mode 100644 index 73ba8c190f..0000000000 --- a/.github/workflows/jingxi.yml +++ /dev/null @@ -1,37 +0,0 @@ - -name: 京喜 - -on: - workflow_dispatch: - schedule: - - cron: '1 19 * * *' - watch: - types: started -jobs: - build: - runs-on: ubuntu-latest - if: github.event.repository.owner.id == github.event.sender.id - env: - JD_COOKIE: ${{ secrets.JD_COOKIE }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: npm install - run: | - npm install - - name: '运行 【京喜】' - if: env.JD_COOKIE - run: | - node Task/jingxi.js - env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} From 0a441495fd79b55a3f083f5b59c54c7b9d1362c2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 21:39:43 +0800 Subject: [PATCH 438/721] Delete NOWLIVE.js --- Task/NOWLIVE.js | 123 ------------------------------------------------ 1 file changed, 123 deletions(-) delete mode 100644 Task/NOWLIVE.js diff --git a/Task/NOWLIVE.js b/Task/NOWLIVE.js deleted file mode 100644 index 4d8e48284f..0000000000 --- a/Task/NOWLIVE.js +++ /dev/null @@ -1,123 +0,0 @@ -/* -NOW直播每日签到 - -1.打开APP首页点击"领红包"悬浮球,通知获取签到Cookie成功 -Surge 4.0: -[Script] -NOW直播 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js,script-update-interval=0 -NOW直播 = type=http-request,pattern=https:\/\/now\.qq\.com\/cgi-bin\/task\/welfare\/getUserTasks\?bkn,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js ------------------- -Loon 2.1.0+ -[Script] -# 本地脚本 -cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js, enabled=true, tag=NOWLIVE - -http-request https:\/\/now\.qq\.com\/cgi-bin\/task\/welfare\/getUserTasks\?bkn script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js ------------------ - -#QX 1.0.7+ : -[task_local] -0 9 * * * NOWLIVE.js -[rewrite_local] -https:\/\/now\.qq\.com\/cgi-bin\/task\/welfare\/getUserTasks\?bkn url script-request-header NOWLIVE.js -~~~~~~~~~~~~~~~~~~ - -[MITM] -hostname = now.qq.com - -~~~~~~~~~~~~~~~~ - -*/ -const $ = new Env('NOW直播') -const nowid = $.getdata(`now_qq`) - -const cookieVal =$.getdata(`nowqq_cookie`) - -let isGetCookie = typeof $request !== 'undefined' -if (isGetCookie) { - GetCookie() - $.done() - } else { - !(async() => { - await getsign(); - await signinfo(); - await daojishiTask() - })() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) -} -function GetCookie() { -if ($request && $request.method != 'OPTIONS'){ - const signurlVal = $request.url - const nowid = $request.url.match(/bkn=([\d]+)/)[1] - const cookieVal = $request.headers['Cookie']; - $.log(`signurlVal:${signurlVal}`) - $.log(`cookieVal:${cookieVal}`) - if (nowid) $.setdata(nowid, -`now_qq`) - if (cookieVal) $.setdata(cookieVal, `nowqq_cookie`) - $.msg($.name, `获取签到: 成功`, ``) - } -} -//签到 -function getsign() { - return new Promise((resolve, reject) =>{ - let signurl = { - url: `https://now.qq.com/cgi-bin/task/welfare/submitTask?bkn=${nowid}`, - headers: {Cookie: cookieVal,"Referer": "https://now.qq.com/activity/c-annual-redpacket-v5/checkEntry.html"}, - body: `taskId=14&bkn=${nowid}` - } - $.post(signurl, (error, response, data) => { - let result = JSON.parse(data) - if (result.retcode == 0){ - signres = `签到成功🎉` - detail = `获得收益${result.result.rewardList.match(/\"name\"\:"([\u4e00-\u9fa5]+)/)[1]}: ${result.result.rewardList.match(/"num":(\d+)/)[1]}💰 \n` - } - else if (result.retcode == -1100){ - signres = result.retmsg + " 本月已签到"+result.result.signCnt+"次" - detail = `` - } - else { - signres = `签到失败❌` - detail = `说明: `+ result.retmsg+"\n" - } - resolve() - }) - }) -} -function signinfo() { - return new Promise((resolve, reject) =>{ - let infourl = { - url: `https://now.qq.com/cgi-bin/ambient/get_all?bkn=${nowid}`, - headers: {Cookie: cookieVal,"Referer": "https://now.qq.com/activity/c-annual-redpacket-v5/checkEntry.html"} - } - $.get(infourl, (error, response, data) => { - let result = JSON.parse(data) - if (result.retcode == 0){ - detail += `现金收益: ${result.result.money/100}元 金豆收益: ${result.result.points}` - } - //$.msg($.name,signres,detail) - resolve() - }) - }) -} - -function daojishiTask() { - return new Promise((resolve, reject) =>{ - let infourl = { - url: `https://now.qq.com/cgi-bin/task/welfare/STaskClick?name_key=daojishi&auto_start=true&bkn=${nowid}`, - headers: {Cookie: cookieVal,"Referer": "https://now.qq.com/activity/hang-host/hang.html"} - } - $.get(infourl, (error, response, data) => { - let result = JSON.parse(data) - //console.log(data) - if (result.result.retcode == 0){ - //detail += `\n本次收益: ${result.result.new_info.gifts[0].num}元 ` - } - $.msg($.name,signres,detail) - resolve() - }) - }) -} - -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 d66fa5c14869a44ad890a534cd7bca79d3df23e9 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:15:42 +0800 Subject: [PATCH 439/721] Update Sunert_Task.json --- Task/Sunert_Task.json | 98 ++++++++++++++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 25 deletions(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index 45eb15afe3..fff8bb03ca 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -1,28 +1,76 @@ { - "name": "Sunert 任务脚本", - "description": "运行时间自定", + "name": "Sunert Task gallery", + "description": "https://github.com/Sunert/sunert_scripts/tree/master/Task", "task": [ - "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告 ,img-url=https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png", - "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js, tag=12306火车时刻,img-url=https://raw.githubusercontent.com/Orz-3/task/master/12306.png", - "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js, tag=实时货币换算,img-url=https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png", - "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png", - "30 9 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻 ,img-url= https://raw.githubusercontent.com/Orz-3/task/master/txnews.png", - "30 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js, tag=京东到家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/jddj.png", - "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/lkyl.png", - "0 0 7,22 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png", - "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, tag=快手极速版 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png", - "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=微博&钱包 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/weibo.png", - "10 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js, tag=新浪新闻 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png", - "20 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, tag=中青看点极速版 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", - "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青自动阅读 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", - "20 5 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js, tag=中青浏览赚 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", - "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png", - "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js, tag=京喜 ,img-url= https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png", - "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气 ,img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png", - "*/10 */3 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js, tag=聚看点 ,img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png", - "*/30 * * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baidu_speed.js, tag=百度极速版 ,img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed.png" - ], + { + "config": "0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/ICON/moji.png, enabled=true" + }, + { + "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/ICON/tvpreview.png, enabled=true" + }, + { + "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js, tag=12306火车时刻, img-url=https://raw.githubusercontent.com/Orz-3/task/master/12306.png, enabled=false" + }, + { + "config": "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js, tag=实时货币换算, img-url=https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png, enabled=false" + }, + { + "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐, img-url=https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/dianxin/qx_rewite.txt, tag=dianxin_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "30 9 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻, img-url= https://raw.githubusercontent.com/Orz-3/task/master/txnews.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/txnews/qx_rewite.txt, tag=txnews_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "30 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js, tag=京东到家, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jddj.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/jd/qx_rewite.txt, tag=jd_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "7 10 * * * hhttps://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js, tag=谷歌中英互译, img-url= https://raw.githubusercontent.com/Orz-3/task/master/translate.png, enabled=false" + }, + { + "config": "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼, img-url=https://raw.githubusercontent.com/Orz-3/task/master/lkyl.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/jd/qx_rewite.txt, tag=jd_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "0 0 7,22 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家, img-url=https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/dianshijia/qx_rewite.txt, tag=dianshijia_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, tag=快手, img-url=https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/kuaishou/qx_rewite.txt, tag=kuaishou_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=微博&钱包, img-url=https://raw.githubusercontent.com/Orz-3/task/master/weibo.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/sina/qx_rewite.txt, tag=sina_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "10 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js, tag=新浪新闻, img-url=https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/sina/qx_rewite.txt, tag=sina_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "20 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, tag=中青看点极速版, img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青自动阅读, img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "20 5 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js, tag=中青浏览赚, img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家, img-url=https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/digit_home/qx_rewite.txt, tag=mydigit_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "*/10 */3 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js, tag=聚看点, img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png, enabled=true", + "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/jukan/qx_rewite.txt, tag=jkd_rewite, update-interval=-1, opt-parser=false, enabled=true" + }, + { + "config": "*/30 * * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baidu_speed.js, tag=百度极速版, img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed.png, enabled=true" + } + ] } - - - From 2dfaa01a1d8dfbd5190682c6dfb617e7f105ff14 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:17:44 +0800 Subject: [PATCH 440/721] Update Sunert_Task.json --- Task/Sunert_Task.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index fff8bb03ca..5491f2e3f4 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -27,7 +27,7 @@ "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/jd/qx_rewite.txt, tag=jd_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "7 10 * * * hhttps://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js, tag=谷歌中英互译, img-url= https://raw.githubusercontent.com/Orz-3/task/master/translate.png, enabled=false" + "config": "7 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js, tag=谷歌中英互译, img-url= https://raw.githubusercontent.com/Orz-3/task/master/translate.png, enabled=false" }, { "config": "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼, img-url=https://raw.githubusercontent.com/Orz-3/task/master/lkyl.png, enabled=true", From b736d8c25a0e368ec5af39888689b161dfd54250 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:20:10 +0800 Subject: [PATCH 441/721] Update Sunert_Task.json --- Task/Sunert_Task.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index 5491f2e3f4..ead8e5c1ba 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -1,6 +1,6 @@ { "name": "Sunert Task gallery", - "description": "https://github.com/Sunert/sunert_scripts/tree/master/Task", + "description": "https://github.com/Sunert/Scripts", "task": [ { "config": "0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/ICON/moji.png, enabled=true" From 05a22f778bec3695543d4f65966ce4e020352f00 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:28:00 +0800 Subject: [PATCH 442/721] Create qx_rewite.txt --- TaskConf/dianshijia/qx_rewite.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 TaskConf/dianshijia/qx_rewite.txt diff --git a/TaskConf/dianshijia/qx_rewite.txt b/TaskConf/dianshijia/qx_rewite.txt new file mode 100644 index 0000000000..dbc3699e5f --- /dev/null +++ b/TaskConf/dianshijia/qx_rewite.txt @@ -0,0 +1,4 @@ +# hostname = +http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js + +http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js From 315056c89148533f2a7a5efeb90f2aab2dcb7c0e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:29:41 +0800 Subject: [PATCH 443/721] Create readme.md --- TaskConf/dianshijia/readme.md | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 TaskConf/dianshijia/readme.md diff --git a/TaskConf/dianshijia/readme.md b/TaskConf/dianshijia/readme.md new file mode 100644 index 0000000000..25acc87cc5 --- /dev/null +++ b/TaskConf/dianshijia/readme.md @@ -0,0 +1,37 @@ +更新时间: 2020-11-16 09:40 +赞赏:电视家邀请码`893988`,农妇山泉 -> 有点咸,万分感谢 +本脚本仅适用于电视家签到,支持Actions多账号运行,请用'#'或者换行隔开‼️ +获取Cookie方法: +1.将下方[rewrite_local]和[Task]地址复制的相应的区域,无需添加 hostname,每日7点、12点、20点各运行一次,其他随意 +2.APP登陆账号后,点击菜单栏'领现金',即可获取Cookie,进入提现页面,点击随机金额,可获取提现地址!! +3.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 +By Facsuny +感谢 chavyleung 等 +~~~~~~~~~~~~~~~~~~~~ +loon 2.10+ : +[Script] +cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家 + +http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, timeout=10, tag=电视家 + +http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, timeout=10, tag=电视家 +~~~~~~~~~~~~~~~~~~~~~ +# 获取电视家 Cookie. +Surge 4.0 +[Script] +电视家 = type=cron,cronexp=0 8 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js,script-update-interval=0 + +电视家 = type=http-request,pattern=http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js + +电视家 = type=http-request,pattern=http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js +~~~~~~~~~~~~~~~~~~ + +QX 1.0.6+ : +[task_local] +0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js + +[rewrite_local] +http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js + +http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js +~~~~~~~~~~~~~~~~~ From 177241604289b90689f0790c267488ef827994ee Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:31:12 +0800 Subject: [PATCH 444/721] Create qx_rewite.txt --- TaskConf/dianxin/qx_rewite.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 TaskConf/dianxin/qx_rewite.txt diff --git a/TaskConf/dianxin/qx_rewite.txt b/TaskConf/dianxin/qx_rewite.txt new file mode 100644 index 0000000000..f2c3ae11b4 --- /dev/null +++ b/TaskConf/dianxin/qx_rewite.txt @@ -0,0 +1,3 @@ +hostname = e.189.cn + +^https?:\/\/e\.189\.cn\/store\/user\/package_detail\.do url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js From 0df25f33ad6a96c22749cbf9c84b298932e32d2e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:32:00 +0800 Subject: [PATCH 445/721] Create readme.md --- TaskConf/dianxin/readme.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 TaskConf/dianxin/readme.md diff --git a/TaskConf/dianxin/readme.md b/TaskConf/dianxin/readme.md new file mode 100644 index 0000000000..7dfe66e4d8 --- /dev/null +++ b/TaskConf/dianxin/readme.md @@ -0,0 +1,33 @@ +更新时间: 2020-10-12 20:05 + 1.根据原版脚本修改,增加上月账单信息,需重新获取Cookie,打开app即可 + 2.适合流量畅享套餐使用,其他套餐,自行测试,此项仅供测试 + 3.可能因地区不同,脚本不一定适用 + By Macsuny 修改 + 感谢原版作者提供脚本 + * 下载安装 天翼账号中心 登陆 获取authToken + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# quantumultx + [rewrite_local] + ^https?:\/\/e\.189\.cn\/store\/user\/package_detail\.do url script-request-header telecomInfinity.js + # MITM = e.189.cn + [task_local] + 10 8 * * * telecomInfinity.js + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# [Loon] +cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, enabled=true, tag=电信套餐查询 + +http-request ^https?:\/\/e\.189\.cn\/store\/user\/package_detail\.do script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Surge 4.0 : +[Script] +电信套餐查询 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js,script-update-interval=0 + +电信套餐查询 = script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js,type=http-request,pattern=https?:\/\/e\.189\.cn\/store\/user\/package_detail\.do + +~~~~~~~~~~~~~~~~~~~~~ + # MITM +hostname = e.189.cn From 6fdd478a05bfefba2e280565bfa06636fd6d979d Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:33:47 +0800 Subject: [PATCH 446/721] Create qx_rewite.txt --- TaskConf/digital_home/qx_rewite.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 TaskConf/digital_home/qx_rewite.txt diff --git a/TaskConf/digital_home/qx_rewite.txt b/TaskConf/digital_home/qx_rewite.txt new file mode 100644 index 0000000000..b9ddddba80 --- /dev/null +++ b/TaskConf/digital_home/qx_rewite.txt @@ -0,0 +1,3 @@ +hostname = www.mydigit.cn + +https:\/\/www\.mydigit\.cn\/plugin\.php\?id=k_misign:sign&operation=qiandao url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js From 58a342bb66fe970eb8281de7e15370dc4aa9607b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:34:34 +0800 Subject: [PATCH 447/721] Create readme.md --- TaskConf/digital_home/readme.md | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 TaskConf/digital_home/readme.md diff --git a/TaskConf/digital_home/readme.md b/TaskConf/digital_home/readme.md new file mode 100644 index 0000000000..d425f4740a --- /dev/null +++ b/TaskConf/digital_home/readme.md @@ -0,0 +1,34 @@ +本脚本仅适用于数码之家每日签到 +获取Cookie方法: +1.将下方[rewrite_local]和[MITM]地址复制的相应的区域 +下, + +2.登陆数码之家电脑版网页,签到一次,即可获取Cookie,获取后请禁用或注释掉❗️ 签过到的需次日获取 + +3.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 + +by Macsuny +~~~~~~~~~~~~~~~~ +Surge 4.0 : +[Script] +数码之家 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js,script-update-interval=0 + +# 数码之家 Cookie. +数码之家 = type=http-request,pattern=https:\/\/www\.mydigit\.cn\/plugin\.php\?id=k_misign:sign&operation=qiandao,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js +~~~~~~~~~~~~~~~~ +Loon 2.1.0+ +[Script] +cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, enabled=true, tag=数码之家 + +http-request https:\/\/www\.mydigit\.cn\/plugin\.php\?id=k_misign:sign&operation=qiandao script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js +----------------- + +QX 1.0. 7+ : +[task_local] +0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js + +[rewrite_local] +https:\/\/www\.mydigit\.cn\/plugin\.php\?id=k_misign:sign&operation=qiandao url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js +~~~~~~~~~~~~~~~~ +[MITM] +hostname = www.mydigit.cn From 4ca4112ebeb1c4b3da0a1d04522c7d1ca3798b1e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:40:41 +0800 Subject: [PATCH 448/721] Create qx_rewite.txt --- TaskConf/jd/qx_rewite.txt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 TaskConf/jd/qx_rewite.txt diff --git a/TaskConf/jd/qx_rewite.txt b/TaskConf/jd/qx_rewite.txt new file mode 100644 index 0000000000..ffbc4116a1 --- /dev/null +++ b/TaskConf/jd/qx_rewite.txt @@ -0,0 +1,9 @@ +# 增加lxk0301大佬多ck脚本 + +hostname = daojia.jd.com, draw.jdfcloud.com, wq.jd.com + +https:\/\/daojia\.jd\.com\/client\?_jdrandom=\d{13}&functionId=%2Fsignin url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js + +https:\/\/draw\.jdfcloud\.com\/\/api\/bean\/square\/silverBean\/task\/get\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js + +https:\/\/wq\.jd\.com\/user_new\/info\/GetJDUserInfoUnion url script-request-header https://gitee.com/lxk0301/jd_scripts/raw/master/JD_extra_cookie.js From 466c9b7f79e2cab9ff252ffed4a162e3cc020056 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:40:58 +0800 Subject: [PATCH 449/721] Create readme.md --- TaskConf/jd/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 TaskConf/jd/readme.md diff --git a/TaskConf/jd/readme.md b/TaskConf/jd/readme.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/TaskConf/jd/readme.md @@ -0,0 +1 @@ + From 79a77a6d2bb14232f3019405e3f3f0ca19dabfdb Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:42:20 +0800 Subject: [PATCH 450/721] Create qx_rewite.txt --- TaskConf/jukan/qx_rewite.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 TaskConf/jukan/qx_rewite.txt diff --git a/TaskConf/jukan/qx_rewite.txt b/TaskConf/jukan/qx_rewite.txt new file mode 100644 index 0000000000..5005af2bc1 --- /dev/null +++ b/TaskConf/jukan/qx_rewite.txt @@ -0,0 +1,3 @@ +hostname = www.xiaodouzhuan.cn + +https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js From 5b414a13ee4155d8e6cc9e2de2bd20814ad62646 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:42:34 +0800 Subject: [PATCH 451/721] Create readme.md --- TaskConf/jukan/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 TaskConf/jukan/readme.md diff --git a/TaskConf/jukan/readme.md b/TaskConf/jukan/readme.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/TaskConf/jukan/readme.md @@ -0,0 +1 @@ + From 61c32c198a517c0ef249054a981f2acb8eaa9bc0 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:44:52 +0800 Subject: [PATCH 452/721] Create qx_rewite.txt --- TaskConf/kuaishou/qx_rewite.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 TaskConf/kuaishou/qx_rewite.txt diff --git a/TaskConf/kuaishou/qx_rewite.txt b/TaskConf/kuaishou/qx_rewite.txt new file mode 100644 index 0000000000..9fd8c6d916 --- /dev/null +++ b/TaskConf/kuaishou/qx_rewite.txt @@ -0,0 +1,5 @@ +hostname = nebula.kuaishou.com + +http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js + +https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js From 5ae1f158ee359de579ae4011cd6c101e9879190c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:45:04 +0800 Subject: [PATCH 453/721] Create readme.md --- TaskConf/kuaishou/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 TaskConf/kuaishou/readme.md diff --git a/TaskConf/kuaishou/readme.md b/TaskConf/kuaishou/readme.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/TaskConf/kuaishou/readme.md @@ -0,0 +1 @@ + From 65dbc33cd3d904ff0902287ea9a98646dc8bee70 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:48:40 +0800 Subject: [PATCH 454/721] Create qx_rewite.txt --- TaskConf/sina/qx_rewite.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 TaskConf/sina/qx_rewite.txt diff --git a/TaskConf/sina/qx_rewite.txt b/TaskConf/sina/qx_rewite.txt new file mode 100644 index 0000000000..27f1fd7ea7 --- /dev/null +++ b/TaskConf/sina/qx_rewite.txt @@ -0,0 +1,15 @@ +hostname = newsapi.sina.cn, api.weibo.cn, pay.sc.weibo.com, lite.sina.cn + +https:\/\/newsapi\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js + +https:\/\/newsapi\.sina\.cn\/\?resource=userpoint\/signIn url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js + +https:\/\/api\.weibo\.cn\/\d\/page\/\w+\?gsid url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js + +https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js + +https?:\/\/lite\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center - script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js + +https?:\/\/lite\.sina\.cn\/\?resource=userpoint\/signIn - script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js + + From 76680a581d8ca828413c42911d2d763b570b06b5 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:49:17 +0800 Subject: [PATCH 455/721] Create readme.md --- TaskConf/sina/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 TaskConf/sina/readme.md diff --git a/TaskConf/sina/readme.md b/TaskConf/sina/readme.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/TaskConf/sina/readme.md @@ -0,0 +1 @@ + From c3b6fc2c41205a404e35f36c79853035e2a3738c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:51:06 +0800 Subject: [PATCH 456/721] Create qx_rewite.txt --- TaskConf/txnews/qx_rewite.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 TaskConf/txnews/qx_rewite.txt diff --git a/TaskConf/txnews/qx_rewite.txt b/TaskConf/txnews/qx_rewite.txt new file mode 100644 index 0000000000..b51e880152 --- /dev/null +++ b/TaskConf/txnews/qx_rewite.txt @@ -0,0 +1,3 @@ +hostname = api.inews.qq.com + +https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js From c0ae6724bfba31a15b151232cc955b9110f91e17 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:51:20 +0800 Subject: [PATCH 457/721] Create readme.md --- TaskConf/txnews/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 TaskConf/txnews/readme.md diff --git a/TaskConf/txnews/readme.md b/TaskConf/txnews/readme.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/TaskConf/txnews/readme.md @@ -0,0 +1 @@ + From 5933de15dc24c9e1474e21ef05da09866612bd58 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:54:35 +0800 Subject: [PATCH 458/721] Create qx_rewite.txt --- TaskConf/youth/qx_rewite.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 TaskConf/youth/qx_rewite.txt diff --git a/TaskConf/youth/qx_rewite.txt b/TaskConf/youth/qx_rewite.txt new file mode 100644 index 0000000000..f34c8a8cbb --- /dev/null +++ b/TaskConf/youth/qx_rewite.txt @@ -0,0 +1,13 @@ +hostname = *.youth.cn, ios.baertt.com + +https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js + +https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js + +https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js + +https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js + +https:\/\/ios\.baertt\.com\/v5\/task\/browse_(start|end)\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js + +https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js From c75858c5ba4ffb39ceff4e2938aec96d9885221c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:55:04 +0800 Subject: [PATCH 459/721] Create readme.md --- TaskConf/youth/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 TaskConf/youth/readme.md diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/TaskConf/youth/readme.md @@ -0,0 +1 @@ + From 3d5c7f9fcc30858b0c0c1e5ee2cc13b1716f42a8 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:56:17 +0800 Subject: [PATCH 460/721] Delete weather_pro.js --- weather_pro.js | 847 ------------------------------------------------- 1 file changed, 847 deletions(-) delete mode 100644 weather_pro.js diff --git a/weather_pro.js b/weather_pro.js deleted file mode 100644 index cd777aaaee..0000000000 --- a/weather_pro.js +++ /dev/null @@ -1,847 +0,0 @@ -/* -可以自由定制显示的天气脚本,想怎样都随你,轻松修改轻松查看 -https://github.com/sazs34/TaskConfig/blob/master/assets/weather_pro.md - */ -let config = { - darksky_api: "", //从https://darksky.net/dev/ 上申请key填入即可 - aqicn_api: "", //从http://aqicn.org/data-platform/token/#/ 上申请key填入即可 - huweather_apiKey: "", //和风天气APIkey,可自行前往 https://dev.heweather.com/ 进行获取 - lat_lon: "", //请填写经纬度,直接从谷歌地图中获取即可 - lang: "zh", //语言,随意切换为您想要的语言哦(zh/zh-tw/ja/en/fr/...) - log: 0, //调试日志,0为不开启,1为开启,2为开启精简日志 - timeout: 0, //超时时间,单位毫秒(1000毫秒=1秒),一般不推荐修改[为0则不限制超时时间] - show: { - //普通每天的 - template: { - title: `$[city]$[district] $[summary]`, - subtitle: `$[weatherIcon]$[weather] $[temperatureMin] ~ $[temperatureMax]°C ☔️降雨概率 $[precipProbability]%`, - detail: `$[aqiIcon]空气质量 $[aqi]($[aqiDesc]) 🏋🏻‍♀️气压$[atmosphere]pa -🌪风速$[windSpeed]km/h 💨$[windDir]$[windPower]级 -👀紫外线指数 $[uv]($[uvDesc]) 💦湿度$[currentHumidity]% -🌡体感温度 $[apparentTemperatureMin] ~ $[apparentTemperatureMax]°C 🎚当前温度 $[currentTemperature]℃ -[生活指数] -$[lifeStyle($[icon]:$[brf],$[txt])] -[天气周报] $[weeklySummary] -$[daily($[month]月$[day]日 $[temperatureLow]~$[temperatureHigh]°C $[weatherIcon]$[weather])]` - }, - lifestyle: { //此处用于显示各项生活指数,可自行调整顺序,顺序越在前面则显示也会靠前,如果您不想查看某一指数,置为false即可,想看置为true即可 - drsg: true, //穿衣指数, - flu: true, //感冒指数, - comf: true, //舒适度指数, - cw: false, //洗车指数, - sport: false, //运动指数, - trav: false, //旅游指数, - uv: false, //紫外线指数, - air: true, //空气污染扩散条件指数, - ac: false, //空调开启指数, - ag: false, //过敏指数, - gl: false, //太阳镜指数, - mu: false, //化妆指数, - airc: false, //晾晒指数, - ptfc: true, //交通指数, - fsh: false, //钓鱼指数, - spi: false, //防晒指数 - } - } -} - -const provider = { - heweather_now: { - api: `https://free-api.heweather.net/s6/weather/now?location=${config.lat_lon.replace(/\s/g, "").replace(",", ",")}&key=${config.huweather_apiKey}`, - progress: 0, //处理进度:0需处理1已处理2无需处理9报错 - timeoutNumber: 0, //超时处理编号 - data: { - basic: {}, - now: {} - }, - support: ['$[province]', '$[city]', '$[district]', '$[weatherIcon]', '$[weather]', '$[currentTemperature]', '$[currentWindSpeed]', '$[currentWindDir]', '$[currentWindPower]', '$[currentHumidity]', '$[currentAtmosphere]', '$[currentVisibility]'] - }, - heweather_daily: { - api: `https://free-api.heweather.net/s6/weather/forecast?location=${config.lat_lon.replace(/\s/g, "").replace(",", ",")}&key=${config.huweather_apiKey}`, - progress: 0, - timeoutNumber: 0, - data: {}, - support: ['$[temperatureMin]', '$[temperatureMax]', '$[precipProbability]', '$[windSpeed]', '$[windDir]', '$[windPower]', '$[humidity]', '$[atmosphere]', '$[visibility]', '$[uv]', '$[uvDesc]', '$[sunrise]', '$[sunset]', '$[moonrise]', '$[moonset]'] - }, - heweather_air: { - api: `https://free-api.heweather.net/s6/air/now?location=auto_ip&key=${config.huweather_apiKey}`, - progress: 0, - timeoutNumber: 0, - data: {}, - support: [] - }, - heweather_lifestyle: { - api: `https://free-api.heweather.net/s6/weather/lifestyle?location=${config.lat_lon.replace(/\s/g, "").replace(",", ",")}&key=${config.huweather_apiKey}`, - progress: 0, - timeoutNumber: 0, - data: [], - support: ['$[lifeStyle]'] - }, - darksky: { - api: `https://api.darksky.net/forecast/${config.darksky_api}/${config.lat_lon.replace(/\s/g, "").replace(",", ",")}?lang=${config.lang}&units=si`, - progress: 0, - timeoutNumber: 0, - data: { - daily: { - data: [] - }, - hourly: { - data: [] - }, - currently: {} - }, - support: ['$[summary]', '$[weeklySummary]', '$[weatherIcon]', '$[weather]', '$[temperatureMin]', '$[temperatureMax]', '$[apparentTemperatureMin]', '$[apparentTemperatureMax]', '$[precipProbability]', '$[uv]', '$[uvDesc]'] - }, - aqicn: { - api: `https://api.waqi.info/feed/geo:${config.lat_lon.replace(/\s/g, "").replace(",", ",").replace(/,/, ";")}/?token=${config.aqicn_api}`, - progress: 0, - data: {}, - support: ['$[aqiIcon]', '$[aqi]', '$[aqiDesc]', '$[aqiWarning]'] - } -} -// #region 天气数据获取 -function weather() { - support(); - heweatherNow(); - heweatherDaily(); - darksky(); - aqicn(); - heweatherLifestyle(); -} -//clear-day, partly-cloudy-day, cloudy, clear-night, rain, snow, sleet, wind, fog, or partly-cloudy-night -//☀️🌤⛅️🌥☁️🌦🌧⛈🌩🌨❄️💧💦🌫☔️☂️ ☃️⛄️ -function darksky() { - if (provider.darksky.progress == 2) return; - start("darksky"); - $task.fetch({ - url: provider.darksky.api - }).then(response => { - try { - let darkObj = JSON.parse(response.body); - record(`天气数据获取-A1-${response.body}`); - if (darkObj.error) { - $notify("DarkApi", "出错啦", darkObj.error); - } - provider.darksky.data.daily = darkObj.daily; - provider.darksky.data.hourly = darkObj.hourly; - provider.darksky.data.currently = darkObj.currently; - record(`天气数据获取-A2`); - check('darksky', true) - } catch (e) { - console.log(`天气数据A获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-A3-${reason.error}`); - check('darksky', false); - }); -} - -function aqicn() { - if (provider.aqicn.progress == 2) return; - start("aqicn"); - $task.fetch({ - url: provider.aqicn.api - }).then(response => { - try { - var waqiObj = JSON.parse(response.body); - if (waqiObj.status == 'error') { - $notify("Aqicn", "出错啦", waqiObj.data); - } else { - record(`天气数据获取-B1-${response.body}`); - provider.aqicn.data = { - ...getAqiInfo(waqiObj.data.aqi) - }; - } - check('aqicn', true) - } catch (e) { - console.log(`天气数据B获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-B2-${reason.error}`); - //获取精确数据失败后,直接获取粗略信息即可 - heweatherAir(); - }); -} - -function heweatherNow() { - start("heweather_now"); - $task.fetch({ - url: provider.heweather_now.api - }).then(response => { - try { - record(`天气数据获取-C1-${response.body}`); - var heObj = JSON.parse(response.body); - provider.heweather_now.data.basic = heObj.HeWeather6[0].basic; - provider.heweather_now.data.now = heObj.HeWeather6[0].now; - check('heweather_now', true) - } catch (e) { - console.log(`天气数据C获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-C2-${reason.error}`); - //因为此接口出错率还挺高的,所以即使报错我们也不处理,该返回什么就返回什么好了 - check('heweather_now', false) - }) -} - -function heweatherDaily() { - if (provider.heweather_daily.progress == 2) return; - start("heweather_daily"); - $task.fetch({ - url: provider.heweather_daily.api - }).then(response => { - try { - record(`天气数据获取-D1-${response.body}`); - var heObj = JSON.parse(response.body); - provider.heweather_daily.data = heObj.HeWeather6[0].daily_forecast[0]; - check('heweather_daily', true) - } catch (e) { - console.log(`天气数据D获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-D2-${reason.error}`); - //因为此接口出错率还挺高的,所以即使报错我们也不处理,该返回什么就返回什么好了 - check('heweather_daily', false) - }) -} - -function heweatherAir() { - if (provider.heweather_air.progress == 2) return; - start("heweather_air"); - $task.fetch({ - url: provider.heweather_air.api - }).then(response => { - try { - record(`天气数据获取F1-${response.body}`); - var heObj = JSON.parse(response.body); - provider.heweather_air.data = { - ...getAqiInfo(heObj.HeWeather6[0].air_now_city.aqi) - }; - check('heweather_air', true) - } catch (e) { - console.log(`天气数据F获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-F2-${reason.error}`); - //因为此接口出错率还挺高的,所以即使报错我们也不处理,该返回什么就返回什么好了 - check('heweather_air', false) - }) -} - -function heweatherLifestyle() { - if (provider.heweather_lifestyle.progress == 2) return; - start("heweather_lifestyle"); - var needRequest = false; - //判断一下是否全部都是false,全false的话,则不需要请求此接口直接返回渲染的数据了 - for (var item in config.show.lifestyle) { - if (config.show.lifestyle[item]) { - needRequest = true; - break; - } - } - if (needRequest) { - $task.fetch({ - url: provider.heweather_lifestyle.api - }).then(response => { - try { - record(`天气数据获取-E1-${response.body}`); - var heObj = JSON.parse(response.body); - provider.heweather_lifestyle.data = heObj.HeWeather6[0].lifestyle; - check('heweather_lifestyle', true) - } catch (e) { - console.log(`天气数据E获取报错${JSON.stringify(e)}`) - } - }, reason => { - record(`天气数据获取-E2-${reason.error}`); - //因为此接口出错率还挺高的,所以即使报错我们也不处理,该返回什么就返回什么好了 - check('heweather_lifestyle', false) - }) - } else { - check('heweather_lifestyle', false) - } -} -//#endregion - -// #region 提醒数据组装 -function check(type, result) { - record(`check-${type}-${result}`); - //支持setTimeout居然不支持clearTimeout,有点难受 - if (provider[type].progress == 1 || provider[type].progress == 9) return; - provider[type].progress = result ? 1 : 9; - var isAllChecked = provider.heweather_now.progress != 0 && provider.heweather_daily.progress && provider.darksky.progress != 0 && (provider.aqicn.progress != 0 || provider.heweather_air.progress != 0) && provider.heweather_lifestyle.progress != 0; - if (isAllChecked) { - record(`天气数据渲染中[template]`); - try { - renderTemplate(); - } catch (e) { - record(`天气渲染出错-${JSON.stringify(e)}`); - } - } -} - -var lineBreak = ` -`; - -function renderTemplate() { - execArrayTemplate(); - const map = { - //省 - province: provider.heweather_now.data.basic.admin_area, - //市 - city: provider.heweather_now.data.basic.parent_city, - //区 - district: provider.heweather_now.data.basic.location || "UNKNOW", - //全天气候变化概述 - summary: `${provider.darksky.data.hourly.summary||""}`, - //一周气候变化概述 - weeklySummary: `${provider.darksky.data.daily.summary||""}`, - //天气图标 - weatherIcon: `${getHeweatherIcon(provider.heweather_now.data.now.cond_code)||getDarkskyWeatherIcon(provider.darksky.data.hourly.icon)}`, - //天气描述(晴/雨/雪等) - weather: `${provider.heweather_now.data.now.cond_txt||getDarkskyWeatherDesc(provider.darksky.data.hourly.icon)}`, - //当前温度 - currentTemperature: `${provider.heweather_now.data.now.tmp}`, - //温度最低值 - temperatureMin: `${Math.round(provider.heweather_daily.data.tmp_min||provider.darksky.data.daily.data.get(0).temperatureMin)}`, - //温度最高值 - temperatureMax: `${Math.round(provider.heweather_daily.data.tmp_max||provider.darksky.data.daily.data.get(0).temperatureMax)}`, - //体感温度最低值 - apparentTemperatureMin: `${Math.round(provider.darksky.data.daily.data.get(0).apparentTemperatureLow)}`, - //体感温度最高值 - apparentTemperatureMax: `${Math.round(provider.darksky.data.daily.data.get(0).apparentTemperatureHigh)}`, - //降雨概率 - precipProbability: `${provider.heweather_daily.data.pop||(Number(provider.darksky.data.daily.data.get(0).precipProbability) * 100).toFixed(0)}`, - //空气质量图标 - aqiIcon: `${provider.aqicn.data.aqiIcon||provider.heweather_air.data.aqiIcon}`, - //空气质量 - aqi: `${provider.aqicn.data.aqi||provider.heweather_air.data.aqi}`, - //空气质量描述 - aqiDesc: `${provider.aqicn.data.aqiDesc||provider.heweather_air.data.aqiDesc}`, - //空气质量警告(提示) - aqiWarning: `${provider.aqicn.data.aqiWarning||provider.heweather_air.data.aqiWarning}`, - //全天风速 - windSpeed: `${provider.heweather_daily.data.wind_spd}`, - //当前风速 - currentWindSpeed: `${provider.heweather_now.data.now.wind_spd}`, - //全天风向 - windDir: `${provider.heweather_daily.data.wind_dir}`, - //当前风向 - currentWindDir: `${provider.heweather_now.data.now.wind_dir}`, - //全天风力 - windPower: `${provider.heweather_daily.data.wind_sc}`, - //当前风力 - currentWindPower: `${provider.heweather_now.data.now.wind_sc}`, - //全天相对湿度 - humidity: `${provider.heweather_daily.data.hum}`, - //当前相对湿度 - currentHumidity: `${provider.heweather_now.data.now.hum}`, - //全天大气压 - atmosphere: `${provider.heweather_daily.data.pres}`, - //当前大气压 - currentAtmosphere: `${provider.heweather_now.data.now.pres}`, - //全天能见度 - visibility: `${provider.heweather_daily.data.vis}`, - //当前能见度 - currentVisibility: `${provider.heweather_now.data.now.vis}`, - //紫外线等级 - uv: `${provider.heweather_daily.data.uv_index||provider.darksky.data.daily.data.get(0).uvIndex}`, - //紫外线描述 - uvDesc: `${getUVDesc(provider.heweather_daily.data.uv_index||provider.darksky.data.daily.data.get(0).uvIndex)}`, - //日出时间 - sunrise: `${provider.heweather_daily.data.sr}`, - //日落时间 - sunset: `${provider.heweather_daily.data.ss}`, - //月出时间 - moonrise: `${provider.heweather_daily.data.mr}`, - //月落时间 - moonset: `${provider.heweather_daily.data.ms}`, - } - var notifyInfo = { - title: execTemplate(config.show.template.title, map), - subtitle: execTemplate(config.show.template.subtitle, map), - detail: execTemplate(config.show.template.detail, map), - }; - $notify(notifyInfo.title, notifyInfo.subtitle, notifyInfo.detail); - $done({}); -} -// #endregion - -// #region 数据处理方法 -function getHeweatherIcon(code) { - var codeMap = { - _100: '☀️', - _101: '☁️', - _102: '☁️', - _103: '⛅️', - _104: '☁️', - _200: '💨', - _201: '🌬', - _202: '🌬', - _203: '🌬', - _204: '🌬', - _205: '🌬', - _206: '💨', - _207: '💨', - _208: '💨', - _209: '🌪', - _210: '🌪', - _211: '🌪', - _212: '🌪', - _213: '🌪', - _300: '🌨', - _301: '🌨', - _302: '⛈', - _303: '⛈', - _304: '⛈', - _305: '💧', - _306: '💦', - _307: '🌧', - _308: '🌧', - _309: '☔️', - _310: '🌧', - _311: '🌧', - _312: '🌧', - _313: '🌧❄️', - _314: '💧', - _315: '💦', - _316: '🌧', - _317: '🌧', - _318: '🌧', - _399: '🌧', - _400: '🌨', - _401: '🌨', - _402: '☃️', - _403: '❄️', - _404: '🌨', - _405: '🌨', - _406: '🌨', - _407: '🌨', - _408: '🌨', - _409: '🌨', - _410: '❄️', - _499: '⛄️', - _500: '🌫', - _501: '🌫', - _502: '🌫', - _503: '🌫', - _504: '🌫', - _505: '🌫', - _506: '🌫', - _507: '🌫', - _508: '🌫', - _509: '🌫', - _510: '🌫', - _511: '🌫', - _512: '🌫', - _513: '🌫', - _514: '🌫', - _515: '🌫', - _900: '🔥', - _901: '⛄️', - _999: '❓', - } - return codeMap[`_${code}`] ? codeMap[`_${code}`] : ""; -} - -function getDarkskyWeatherIcon(icon_text) { - let icon = "❓" - if (icon_text == "clear-day") icon = "☀️"; - if (icon_text == "partly-cloudy-day") icon = "🌤"; - if (icon_text == "cloudy") icon = "☁️"; - if (icon_text == "rain") icon = "🌧"; - if (icon_text == "snow") icon = "☃️"; - if (icon_text == "sleet") icon = "🌨"; - if (icon_text == "wind") "🌬"; - if (icon_text == "fog") icon = "🌫"; - if (icon_text == "partly-cloudy-night") icon = "🌑"; - if (icon_text == "clear-night") icon = "🌑"; - return icon; -} - -function getDarkskyWeatherDesc(icon_text) { - let icon = "未知" - if (icon_text == "clear-day") icon = `晴`; - if (icon_text == "partly-cloudy-day") icon = `晴转多云`; - if (icon_text == "cloudy") icon = `多云`; - if (icon_text == "rain") icon = `雨`; - if (icon_text == "snow") icon = `雪`; - if (icon_text == "sleet") icon = `雨夹雪`; - if (icon_text == "wind") icon = `大风`; - if (icon_text == "fog") icon = `大雾`; - if (icon_text == "partly-cloudy-night") icon = `多云`; - if (icon_text == "clear-night") icon = `晴`; - return icon; -} - -function getCityInfo(name) { - var loc; - try { - var locArr = name.split(/[(),,()]/) - if (locArr.length >= 4) { - loc = locArr[2] + " "; - } else if (locArr.length >= 2) { - loc = locArr[1] + " "; - } else { - loc = ""; //此时会很长,还不如不显示了 - } - } catch (e) { - loc = ''; - record(`获取城市名称失败-${JSON.stringify(e)}`); - } - return loc; -} - -function getAqiInfo(aqi) { - var aqiDesc = ""; - var aqiIcon = ""; - var aqiWarning = ""; - if (aqi > 300) { - aqiIcon = `🟤`; - aqiDesc = `严重污染`; - aqiWarning = "儿童、老人、呼吸系统等疾病患者及一般人群停止户外活动"; - } else if (aqi > 200) { - aqiIcon = `🟣`; - aqiDesc = `重度污染`; - aqiWarning = "儿童、老人、呼吸系统等疾病患者及一般人群停止或减少户外运动"; - } else if (aqi > 150) { - aqiIcon = `🔴`; - aqiDesc = `中度污染`; - aqiWarning = "儿童、老人、呼吸系统等疾病患者及一般人群减少户外活动"; - } else if (aqi > 100) { - aqiIcon = `🟠`; - aqiDesc = `轻度污染`; - aqiWarning = "老人、儿童、呼吸系统等疾病患者减少长时间、高强度的户外活动"; - } else if (aqi > 50) { - aqiIcon = `🟡`; - aqiDesc = `良好`; - aqiWarning = "极少数敏感人群应减少户外活动"; - } else { - aqiIcon = `🟢`; - aqiDesc = `优`; - } - return { - aqi, - aqiIcon, - aqiDesc, - aqiWarning - }; -} - -function getUVDesc(daily_uvIndex) { - var uvDesc = ""; - if (daily_uvIndex >= 10) { - uvDesc = "五级-特别强"; - } else if (daily_uvIndex >= 7) { - uvDesc = "四级-很强"; - } else if (daily_uvIndex >= 5) { - uvDesc = "三级-较强"; - } else if (daily_uvIndex >= 3) { - uvDesc = "二级-较弱"; - } else { - uvDesc = "一级-最弱"; - } - return uvDesc; -} -// #endregion - -// #region 模板相关 -/** - * 用于标识该接口已执行,如果有使用超时设置则此操作是有意义的 - * @param {String} type 具体的接口执行类型 - */ -function start(type) { - if (config.timeout > 0) { - provider[type].timeoutNumber = setTimeout(() => { - check(type, false); - }, config.timeout); - } -} -/** - * 判断哪些接口需要进行处理,减少网络请求 - */ -function support() { - let regex = /\$\[([a-z,A-Z,0-9]*)\]/g; - const template = `${config.show.template.title}${config.show.template.subtitle}${config.show.template.detail}`.match(regex); - provider.heweather_now.progress = template.filter((item, filter) => { - return provider.heweather_now.support.indexOf(item) != -1; - }).length > 0 ? 0 : 2; - provider.heweather_daily.progress = template.filter((item, filter) => { - return provider.heweather_daily.support.indexOf(item) != -1; - }).length > 0 ? 0 : 2; - // provider.heweather_air.progress = template.filter((item, filter) => { - // return provider.heweather_air.support.indexOf(item) != -1; - // }).length > 0 ? 0 : 2; - provider.heweather_lifestyle.progress = template.filter((item, filter) => { - let regexLifestyle = /\$\[(lifeStyle\()+([\s\S]+?)(\))+\]/g; - return regexLifestyle.test(config.show.lifestyle) ? 0 : 2; - }).length > 0 ? 0 : 2; - provider.aqicn.progress = template.filter((item, filter) => { - return provider.aqicn.support.indexOf(item) != -1; - }).length > 0 ? 0 : 2; - provider.darksky.progress = template.filter((item, filter) => { - return provider.darksky.support.indexOf(item) != -1; - }).length > 0 ? 0 : 2; - if (provider.darksky.progress == 2) { - //如果 - let regexDaily = /\$\[(daily\()+([\s\S]+?)(\))+\]/g; - let regexHourly = /\$\[(hourly\()+([\s\S]+?)(\))+\]/g; - provider.darksky.progress = (regexDaily.test(config.show.template.detail) || regexHourly.test(config.show.template.detail)) ? 0 : 2; - } - record(`h_n:${provider.heweather_now.progress},h_d:${provider.heweather_daily.progress},h_a:${provider.heweather_air.progress},h_l:${provider.heweather_lifestyle.progress},aq:${provider.aqicn.progress},da:${provider.darksky.progress}`) -} -/** - * 用于普通模板的映射 - * @param {String} template 模板内容 - * @param {Object} map 映射内容 - */ -function execTemplate(template, map) { - if (!template) return ""; - let regex = /\$\[([a-z,A-Z,0-9]*)\]/g; - if (regex.test(template)) { - for (item of template.match(regex)) { - item.match(regex); - if (RegExp.$1 && map[RegExp.$1]) { - template = template.replace(item, map[RegExp.$1]); - } else { - template = template.replace(item, ""); - } - } - } - return template; -} - -function execArrayTemplate() { - try { - execTemplateLifestyle(); - execTemplateDaily(); - execTemplateHourly(); - } catch (e) { - console.log(`${JSON.stringify(e)}`) - } - -} - -function execTemplateLifestyle() { - let regexLifestyle = /\$\[(lifeStyle\()+([\s\S]+?)(\))+\]/g; - if (provider.heweather_lifestyle.data <= 0) { - config.show.template.detail.replace(regexLifestyle, '') - } - let result = []; - if (regexLifestyle.test(config.show.template.detail)) { - let lsMap = { //此处用于显示各项生活指数,可自行调整顺序,顺序越在前面则显示也会靠前,如果您不想查看某一指数,置为false即可,想看置为true即可 - drsg: { - icon: '👔穿衣指数', - type: '穿衣指数' - }, - flu: { - icon: '🤧感冒等级💉', - type: '感冒指数' - }, - comf: { - icon: '😊舒适度', - type: '舒适度指数' - }, - cw: { - icon: '🚗洗车', - type: '洗车指数' - }, - sport: { - icon: '🏃🏻运动', - type: '运动指数' - }, - trav: { - icon: '🌴', - type: '旅游指数' - }, - uv: { - icon: '☂️', - type: '紫外线指数' - }, - air: { - icon: '🌫', - type: '空气污染扩散条件指数' - }, - ac: { - icon: '❄️', - type: '空调开启指数' - }, - ag: { - icon: '😷', - type: '过敏指数' - }, - gl: { - icon: '🕶', - type: '太阳镜指数' - }, - mu: { - icon: '💄', - type: '化妆指数' - }, - airc: { - icon: '🧺', - type: '晾晒指数' - }, - ptfc: { - icon: '🚥', - type: '交通指数' - }, - fsh: { - icon: '🎣', - type: '钓鱼指数' - }, - spi: { - icon: '🔆', - type: '防晒指数' - }, - } - config.show.template.detail.match(regexLifestyle); - var rangeTemplate = RegExp.$2; //此处拿到的是要替换的列表显示部分了 - let regex = /\$\[([a-z,A-Z,0-9]*)\]/g; - var template = rangeTemplate.match(regex); - for (life of provider.heweather_lifestyle.data) { - if (!config.show.lifestyle[life.type]) continue; - var singleInfo = rangeTemplate; - for (item of template) { - item.match(regex); - if (RegExp.$1 == "icon") { - singleInfo = singleInfo.replace(item, lsMap[life.type].icon) - } else if (RegExp.$1 == "type") { - singleInfo = singleInfo.replace(item, lsMap[life.type].type) - } else { - singleInfo = singleInfo.replace(item, life[RegExp.$1]) - } - } - result.push(singleInfo); - } - config.show.template.detail = config.show.template.detail.replace(regexLifestyle, result.join(lineBreak)); - } -} - -function execTemplateDaily() { - let regexDaily = /\$\[(daily\()+([\s\S]+?)(\))+\]/g; - if (provider.darksky.data.daily.data.length <= 0) { - config.show.template.detail.replace(regexDaily, '') - } - let result = []; - if (regexDaily.test(config.show.template.detail)) { - config.show.template.detail.match(regexDaily); - var rangeTemplate = RegExp.$2; //此处拿到的是要替换的列表显示部分了 - let regex = /\$\[([a-z,A-Z,0-9]*)\]/g; - var template = rangeTemplate.match(regex); - for (daily of provider.darksky.data.daily.data) { - var singleInfo = rangeTemplate; - for (item of template) { - item.match(regex); - if (RegExp.$1 == "month") { - singleInfo = singleInfo.replace(item, (`${daily["time"]}`).toDateTime().Format("MM")); - } else if (RegExp.$1 == "day") { - singleInfo = singleInfo.replace(item, (`${daily["time"]}`).toDateTime().Format("dd")); - } else if (RegExp.$1 == "weatherIcon") { - singleInfo = singleInfo.replace(item, getDarkskyWeatherIcon(daily.icon)); - } else if (RegExp.$1 == "weather") { - singleInfo = singleInfo.replace(item, getDarkskyWeatherDesc(daily.icon)); - } else if (RegExp.$1 == "uvDesc") { - singleInfo = singleInfo.replace(item, getUVDesc(daily.uvIndex)); - } else if (RegExp.$1 == "cloudCover") { - singleInfo = singleInfo.replace(item, daily.cloudCover * 100); - } else if (RegExp.$1 == "temperatureHigh") { - singleInfo = singleInfo.replace(item, Math.round(daily.temperatureHigh)); - } else if (RegExp.$1 == "temperatureLow") { - singleInfo = singleInfo.replace(item, Math.round(daily.temperatureLow)); - } else if (RegExp.$1 == "apparentTemperatureMax") { - singleInfo = singleInfo.replace(item, Math.round(daily.apparentTemperatureMax)); - } else if (RegExp.$1 == "apparentTemperatureMin") { - singleInfo = singleInfo.replace(item, Math.round(daily.apparentTemperatureMin)); - } else if (RegExp.$1 && daily[RegExp.$1] != undefined) { - singleInfo = singleInfo.replace(item, daily[RegExp.$1]); - } - } - result.push(singleInfo); - } - config.show.template.detail = config.show.template.detail.replace(regexDaily, result.join(lineBreak)); - } -} - -function execTemplateHourly() { - let regexHourly = /\$\[(hourly\()+([\s\S]+?)(\))+\]/g; - if (provider.darksky.data.hourly.data.length <= 0) { - config.show.template.detail.replace(regexHourly, '') - } - let result = []; - if (regexHourly.test(config.show.template.detail)) { - config.show.template.detail.match(regexHourly); - var rangeTemplate = RegExp.$2; //此处拿到的是要替换的列表显示部分了 - let regex = /\$\[([a-z,A-Z,0-9]*)\]/g; - var template = rangeTemplate.match(regex); - for (hourly of provider.darksky.data.hourly.data) { - var singleInfo = rangeTemplate; - for (item of template) { - item.match(regex); - if (RegExp.$1 == "month") { - singleInfo = singleInfo.replace(item, (`${hourly["time"]}`).toDateTime().Format("MM")); - } else if (RegExp.$1 == "day") { - singleInfo = singleInfo.replace(item, (`${hourly["time"]}`).toDateTime().Format("dd")); - } else if (RegExp.$1 == "hour") { - singleInfo = singleInfo.replace(item, (`${hourly["time"]}`).toDateTime().Format("hh")); - } else if (RegExp.$1 == "weatherIcon") { - singleInfo = singleInfo.replace(item, getDarkskyWeatherIcon(hourly.icon)); - } else if (RegExp.$1 == "weather") { - singleInfo = singleInfo.replace(item, getDarkskyWeatherDesc(hourly.icon)); - } else if (RegExp.$1 == "uvDesc") { - singleInfo = singleInfo.replace(item, getUVDesc(hourly.uvIndex)); - } else if (RegExp.$1 == "cloudCover") { - singleInfo = singleInfo.replace(item, hourly.cloudCover * 100); - } else if (RegExp.$1 == "temperature") { - singleInfo = singleInfo.replace(item, Math.round(hourly.temperature)); - } else if (RegExp.$1 == "apparentTemperature") { - singleInfo = singleInfo.replace(item, Math.round(hourly.apparentTemperature)); - } else if (RegExp.$1 && hourly[RegExp.$1] != undefined) { - singleInfo = singleInfo.replace(item, hourly[RegExp.$1]); - } - } - result.push(singleInfo); - } - config.show.template.detail = config.show.template.detail.replace(regexHourly, result.join(lineBreak)); - } -} - -function record(log) { - if (config.log == 1) { - console.log(log); - } else if (config.log == 2) { - console.log(log.substring(0, 60)); - } -} -// #endregion - -// #region 扩展方法 -Array.prototype.get = function (index, defaultValue = {}) { - if (index >= 0 && this.length > 0 && this.length >= index + 1) { - return this[index]; - } else { - return defaultValue; - } -} -String.prototype.toDateTime = function () { - var time = parseInt(this + '000'); - return new Date(time); -} -Date.prototype.Format = function (fmt) { - var o = { - "M+": this.getMonth() + 1, //月份 - "d+": this.getDate(), //日 - "h+": this.getHours(), //小时 - "m+": this.getMinutes(), //分 - "s+": this.getSeconds(), //秒 - "q+": Math.floor((this.getMonth() + 3) / 3), //季度 - "S": this.getMilliseconds() //毫秒 - }; - if (/(y+)/.test(fmt)) - fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); - for (var k in o) - if (new RegExp("(" + k + ")").test(fmt)) - fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); - return fmt; -} -// #endregion -weather(); \ No newline at end of file From 4c1e1644505c9d09e30d3d2a3ed7a4098fd63bb9 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Fri, 29 Jan 2021 23:05:36 +0800 Subject: [PATCH 461/721] Update Sunert_Task.json --- Task/Sunert_Task.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index ead8e5c1ba..4d5a13288a 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -16,58 +16,58 @@ }, { "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐, img-url=https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/dianxin/qx_rewite.txt, tag=dianxin_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/dianxin/qx_rewite.txt, tag=dianxin_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "30 9 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻, img-url= https://raw.githubusercontent.com/Orz-3/task/master/txnews.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/txnews/qx_rewite.txt, tag=txnews_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/qx_rewite.txt, tag=txnews_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "30 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js, tag=京东到家, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jddj.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/jd/qx_rewite.txt, tag=jd_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/jd/qx_rewite.txt, tag=jd_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "7 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js, tag=谷歌中英互译, img-url= https://raw.githubusercontent.com/Orz-3/task/master/translate.png, enabled=false" }, { "config": "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼, img-url=https://raw.githubusercontent.com/Orz-3/task/master/lkyl.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/jd/qx_rewite.txt, tag=jd_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/jd/qx_rewite.txt, tag=jd_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "0 0 7,22 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家, img-url=https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/dianshijia/qx_rewite.txt, tag=dianshijia_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/dianshijia/qx_rewite.txt, tag=dianshijia_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, tag=快手, img-url=https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/kuaishou/qx_rewite.txt, tag=kuaishou_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/kuaishou/qx_rewite.txt, tag=kuaishou_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=微博&钱包, img-url=https://raw.githubusercontent.com/Orz-3/task/master/weibo.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/sina/qx_rewite.txt, tag=sina_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt, tag=sina_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "10 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js, tag=新浪新闻, img-url=https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/sina/qx_rewite.txt, tag=sina_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt, tag=sina_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "20 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, tag=中青看点极速版, img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青自动阅读, img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "20 5 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js, tag=中青浏览赚, img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家, img-url=https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/digit_home/qx_rewite.txt, tag=mydigit_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/digit_home/qx_rewite.txt, tag=mydigit_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "*/10 */3 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js, tag=聚看点, img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/sunert_scripts/main/task/jukan/qx_rewite.txt, tag=jkd_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/jukan/qx_rewite.txt, tag=jkd_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "*/30 * * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baidu_speed.js, tag=百度极速版, img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed.png, enabled=true" From d9d9d757489d4dc30b61c404174d84895e530b33 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 01:44:13 +0800 Subject: [PATCH 462/721] Update readme.md --- TaskConf/youth/readme.md | 92 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 8b13789179..f9deb5ce33 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1 +1,93 @@ +

中青看点使用说明

+ +[toc] + +### IOS配置教程 + ``` +[MITM] +hostname = *.youth.cn, ios.baertt.com + ``` + **Surge:** + + ``` +[Script] +中青看点 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js,script-update-interval=0 +中青看点 = type=http-request,pattern=https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign),script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/red_packet,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +``` + **Loon:** + + ``` +[Script] +cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 +http-request https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +``` +**Quantumult X:** + +``` +[task_local] +0 9 * * * youth.js +[rewrite_local] +https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body youth.js +https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body youth.js +https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +``` + +### 获取Cookie方法 + * 打开极速版APP,进去个人中心,或者签到一次,提示获取Cookie + - 浏览一篇短文,等待倒计时结束,提示获取阅读请求及阅读时长 + * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) + - 正常提现一次,获取提现请求(可选) + +

[回到顶部](#中青看点使用说明)

+ +### Nodejs 配置密钥 (Github Actions) + +
+ + + + Actions Secrets + + + +| Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | +| :-------: | :------: | :-------: | ------ | ------- | +| YOUTH_HEADER | 中青看点 youth.yml | # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | +| YOUTH_ARTBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | +| YOUTH_REDBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | +| YOUTH_TIME | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/user/app_stay.json",
阅读时长请求体: p=xxx | +| YOUTH_NOTIFY_CONTROL | 同上 | true/false | 可选 | 中青通知开关
默认当转盘次数为50或者100并且余额大于10元时推送通知 | +| | | | - | | +| YOUTH_READ | 中青阅读 youth_read.yml | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | +| YOUTH_START | 中青浏览赚 youth_gain.yml | & | 必须 | 请求地址: "https://ios.baertt.com/v5/task/browse_start.json",
阅读请求体: p=xxx | +| YOUTH_END | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/task/browse_end.json",
阅读请求体: p=xxx | + +
+ +

[回到仓库主页](/Sunert/Scripts)

+ + + +### 注意事项: + > __提现金额需该请求一致,只更改提现金额无效,默认30元__ + + + + + + + + + + From f16aaf44390735776a9a70915cb07493a5e3a386 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 01:54:11 +0800 Subject: [PATCH 463/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index f9deb5ce33..6403839063 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http
-

[回到仓库主页](/Sunert/Scripts)

+

[回到仓库主页](https://github.com/Sunert/Scripts)

From f757b9901c39596caf4f04fb8b9f2fdebe85615c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:04:06 +0800 Subject: [PATCH 464/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 6403839063..1e135df4cc 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http -

[回到仓库主页](https://github.com/Sunert/Scripts)

+ [回到仓库主页](/Sunert/Scripts) From 3e67403d679aa7ca21e3e6145712cfe9f4a41cd4 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:05:02 +0800 Subject: [PATCH 465/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 1e135df4cc..e966268497 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http - [回到仓库主页](/Sunert/Scripts) + [回到仓库主页](/) From a4860d57494dca54dc2ba4cbf2f84778392e3c0b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:07:56 +0800 Subject: [PATCH 466/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index e966268497..45ceae474c 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http - [回到仓库主页](/) + [回到仓库主页](https://github.com/Sunert/Scripts) From abd6aebee2a8357ff89b3daccaeef1c7476989dc Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:09:23 +0800 Subject: [PATCH 467/721] Update readme.md --- TaskConf/youth/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 45ceae474c..32f2f8ed97 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -49,7 +49,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) -

[回到顶部](#中青看点使用说明)

+ >>> [回到顶部](#中青看点使用说明) ### Nodejs 配置密钥 (Github Actions) @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http - [回到仓库主页](https://github.com/Sunert/Scripts) + >> [回到仓库主页](https://github.com/Sunert/Scripts) From c2f3ab2601437687e184c8a6a78be170bfc29e68 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:11:20 +0800 Subject: [PATCH 468/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 32f2f8ed97..eea2922765 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -49,7 +49,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) - >>> [回到顶部](#中青看点使用说明) + >>> [回到顶部](#IOS配置教程) ### Nodejs 配置密钥 (Github Actions) From 318190bee42d73b9b4000cc3a28c974881761606 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:13:08 +0800 Subject: [PATCH 469/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index eea2922765..ba49355e7f 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http - >> [回到仓库主页](https://github.com/Sunert/Scripts) + >> [回到仓库主页](/TaskConf/) From 6bb6f04642e2702ec57a0764f8193f81ae5a7d5e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:14:12 +0800 Subject: [PATCH 470/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index ba49355e7f..dad6598cfe 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http - >> [回到仓库主页](/TaskConf/) + >>> [回到上一页](/TaskConf/) From edbb7856a050ef609107239a927dc9711106ddfc Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:28:05 +0800 Subject: [PATCH 471/721] Update readme.md --- TaskConf/youth/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index dad6598cfe..979a44fe31 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,5 +1,5 @@ -

中青看点使用说明

+ # 中青看点使用说明 [toc] @@ -49,7 +49,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) - >>> [回到顶部](#IOS配置教程) + >>> [回到顶部](#中青看点使用说明) ### Nodejs 配置密钥 (Github Actions) From 94a740d192bc7c78c607a7467d76f31e0f4a03dd Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:28:27 +0800 Subject: [PATCH 472/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 979a44fe31..b09271daa9 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,5 +1,5 @@ - # 中青看点使用说明 + # 中青看点使用说明 [toc] From 79e48e5394a5656c58cb91604aa20376704595b9 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:29:12 +0800 Subject: [PATCH 473/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index b09271daa9..1cf2dbd242 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,5 +1,5 @@ - # 中青看点使用说明 + #
中青看点使用说明
[toc] From d948c5a820ffeaedfced2215c2e1ec5dec2445c8 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:30:24 +0800 Subject: [PATCH 474/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 1cf2dbd242..8ba643014e 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -49,7 +49,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) - >>> [回到顶部](#中青看点使用说明) + >>> [回到顶部](#IOS配置教程) ### Nodejs 配置密钥 (Github Actions) From 88d1099b46b046bd9042ba2d320fdafdd8b51acb Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:31:08 +0800 Subject: [PATCH 475/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 8ba643014e..765a5e21e6 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http - >>> [回到上一页](/TaskConf/) + >>> [回到上一页](/) From e23b9402d4a80b44ecad86dfd6264f255c5fa256 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:31:31 +0800 Subject: [PATCH 476/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 765a5e21e6..deba4d336a 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http - >>> [回到上一页](/) + >>> [回到上一页]() From f38e8ad0cbe6e589aeb66112855f989a2e2efe51 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:32:21 +0800 Subject: [PATCH 477/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index deba4d336a..6089748608 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http - >>> [回到上一页]() + >>> [回到上一页](/TaskConf) From 54b9cf8bce28b1c2f221d0f53c7109f3f2d4ab39 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:32:58 +0800 Subject: [PATCH 478/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 6089748608..a3c6925b34 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http - >>> [回到上一页](/TaskConf) + >>> [回到上一页](..) From 2000b343406b16971094cfa749bc1e1e7244f62f Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:33:29 +0800 Subject: [PATCH 479/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index a3c6925b34..2e272c700a 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http - >>> [回到上一页](..) + >>> [回到上一页](...) From 70b47a0639cff514b1fd99a2daaffa76f118fbb2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:34:36 +0800 Subject: [PATCH 480/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 2e272c700a..a3c6925b34 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -75,7 +75,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http - >>> [回到上一页](...) + >>> [回到上一页](..) From 8408aea7296cac40892eb6f9918e899cf104a36f Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:38:53 +0800 Subject: [PATCH 481/721] Update readme.md --- TaskConf/youth/readme.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index a3c6925b34..9f71eccf82 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,8 +1,7 @@ +[toc] #
中青看点使用说明
-[toc] - ### IOS配置教程 ``` [MITM] From 81312386d409396ad9e8fbc9a72940c26faff801 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 02:44:51 +0800 Subject: [PATCH 482/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 9f71eccf82..0e73ddf507 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,5 +1,5 @@ -[toc] + >> [toc] #
中青看点使用说明
### IOS配置教程 From 692786b9cbee22c0f0e4c9ded3c49257f3c6e57b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 11:28:29 +0800 Subject: [PATCH 483/721] Update readme.md --- TaskConf/youth/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 0e73ddf507..f0a9461998 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -2,6 +2,8 @@ >> [toc] #
中青看点使用说明
+>>> [跳转至Actions配置](#Nodejs 配置密钥) + ### IOS配置教程 ``` [MITM] From 7e308d2e49db3ce4d223178fcd2cdec62a660f14 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 11:29:40 +0800 Subject: [PATCH 484/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index f0a9461998..d32336e4b7 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -2,7 +2,7 @@ >> [toc] #
中青看点使用说明
->>> [跳转至Actions配置](#Nodejs 配置密钥) +>> [跳转至Actions配置](#Nodejs 配置密钥 (Github Actions)) ### IOS配置教程 ``` From d45040d9e1cfc0c4db9f1f1e87ad7358c22797de Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 11:30:24 +0800 Subject: [PATCH 485/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index d32336e4b7..9a91ee2142 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -2,7 +2,7 @@ >> [toc] #
中青看点使用说明
->> [跳转至Actions配置](#Nodejs 配置密钥 (Github Actions)) + [跳转至Actions配置](#Nodejs 配置密钥) ### IOS配置教程 ``` From 4b56c4cff038f34120dfbbe37350951a51843e05 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 11:31:41 +0800 Subject: [PATCH 486/721] Update readme.md --- TaskConf/youth/readme.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 9a91ee2142..9166d4a229 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -2,7 +2,7 @@ >> [toc] #
中青看点使用说明
- [跳转至Actions配置](#Nodejs 配置密钥) +[跳转至Actions配置](#Nodejs 配置密钥) ### IOS配置教程 ``` @@ -78,8 +78,6 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http >>> [回到上一页](..) - - ### 注意事项: > __提现金额需该请求一致,只更改提现金额无效,默认30元__ From e6291fa471c4582a01abfc3799c170cf29c595b1 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 11:36:07 +0800 Subject: [PATCH 487/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 9166d4a229..9c09565cb1 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -2,7 +2,7 @@ >> [toc] #
中青看点使用说明
-[跳转至Actions配置](#Nodejs 配置密钥) +[跳转至底部](#注意事项:) ### IOS配置教程 ``` From 74366c1ed24df647cb33882843d669fa793a0909 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 11:37:11 +0800 Subject: [PATCH 488/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 9c09565cb1..9b918bd1ab 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -2,7 +2,7 @@ >> [toc] #
中青看点使用说明
-[跳转至底部](#注意事项:) + [跳转至底部](#注意事项:) ### IOS配置教程 ``` From 8445d928b91186865dbf6d8ca1b0db1ae032968a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 11:38:16 +0800 Subject: [PATCH 489/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 9b918bd1ab..28bf9ffeeb 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -2,7 +2,7 @@ >> [toc] #
中青看点使用说明
- [跳转至底部](#注意事项:) + [跳转至底部](#注意事项) ### IOS配置教程 ``` From 707c73db015209e71a6e6056f6736e820d0c472b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 11:42:55 +0800 Subject: [PATCH 490/721] Update readme.md --- TaskConf/youth/readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 28bf9ffeeb..b232a20846 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -33,6 +33,10 @@ http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json script-path=htt ``` **Quantumult X:** +``` +[重写配置链接](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) +``` + ``` [task_local] 0 9 * * * youth.js From 1766f8ef0a53089a77ef62b6dc2c015d2de1947c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 11:45:15 +0800 Subject: [PATCH 491/721] Update readme.md --- TaskConf/youth/readme.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index b232a20846..5003d6cfad 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -33,9 +33,12 @@ http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json script-path=htt ``` **Quantumult X:** -``` + [重写配置链接](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) ``` +[rewrite_remote] +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt +``` ``` [task_local] From 80d45b21b9a18bb3a47f04a7235e0b4d7a482816 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 11:53:05 +0800 Subject: [PATCH 492/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 5003d6cfad..db65e98cca 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -34,7 +34,7 @@ http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json script-path=htt **Quantumult X:** -[重写配置链接](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) +> [重写配置链接](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) ``` [rewrite_remote] https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt From 7dad76cccbada74c76816b60065ec178dc99e44c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 12:08:52 +0800 Subject: [PATCH 493/721] Update readme.md --- TaskConf/youth/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index db65e98cca..c903527614 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -34,12 +34,12 @@ http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json script-path=htt **Quantumult X:** -> [重写配置链接](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) +* [重写配置链接](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) ``` [rewrite_remote] https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt ``` - +* 本地重写配置 ``` [task_local] 0 9 * * * youth.js From 2c6e5a2fad603cda21277163c75301c929b8e378 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 12:11:07 +0800 Subject: [PATCH 494/721] Update readme.md --- TaskConf/youth/readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index c903527614..e28351d56c 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -42,7 +42,8 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite. * 本地重写配置 ``` [task_local] -0 9 * * * youth.js +0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/youth.js + [rewrite_local] https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body youth.js From 31f52395f8b3ad82e2d535d7e10f87ff5fc6417e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 12:14:26 +0800 Subject: [PATCH 495/721] Update readme.md --- TaskConf/youth/readme.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index e28351d56c..2ae9a0dab5 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -41,9 +41,6 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite. ``` * 本地重写配置 ``` -[task_local] -0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/youth.js - [rewrite_local] https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body youth.js @@ -51,7 +48,11 @@ https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body http https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body youth.js https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js ``` - +* 本地任务配置 +``` +[task_local] +1 */5 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +``` ### 获取Cookie方法 * 打开极速版APP,进去个人中心,或者签到一次,提示获取Cookie - 浏览一篇短文,等待倒计时结束,提示获取阅读请求及阅读时长 From f504b29d85f0484346cef0f7a6e4c9d17c388f29 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 12:15:14 +0800 Subject: [PATCH 496/721] Update readme.md --- TaskConf/youth/readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 2ae9a0dab5..958315577f 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,5 +1,6 @@ - >> [toc] + [toc] + #
中青看点使用说明
[跳转至底部](#注意事项) From aa3be30b7e25270901dfa12f5470f9000bcde3dc Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 12:16:02 +0800 Subject: [PATCH 497/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 958315577f..04307962e7 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -35,7 +35,7 @@ http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json script-path=htt **Quantumult X:** -* [重写配置链接](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) +* [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) ``` [rewrite_remote] https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt From 8acf3d4f9d3debd847bf86467b54324a4737e9a7 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 12:34:35 +0800 Subject: [PATCH 498/721] Update readme.md --- TaskConf/youth/readme.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 04307962e7..c83cce34d7 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -10,7 +10,7 @@ [MITM] hostname = *.youth.cn, ios.baertt.com ``` - **Surge:** +#### Surge: ``` [Script] @@ -21,7 +21,7 @@ hostname = *.youth.cn, ios.baertt.com 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true ``` - **Loon:** +#### Loon: ``` [Script] @@ -32,15 +32,15 @@ http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=htt http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true ``` -**Quantumult X:** - - -* [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) +#### Quantumult X: + * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) + ``` [rewrite_remote] https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt ``` -* 本地重写配置 + * 本地重写配置 + ``` [rewrite_local] https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js @@ -49,7 +49,8 @@ https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body http https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body youth.js https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js ``` -* 本地任务配置 + * 本地任务配置 + ``` [task_local] 1 */5 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js From 8d4b04e65465c56c5f077894854b82c84399b05c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 13:36:35 +0800 Subject: [PATCH 499/721] Update readme.md --- TaskConf/youth/readme.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index c83cce34d7..5b4ea5cd34 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -21,6 +21,12 @@ hostname = *.youth.cn, ios.baertt.com 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true ``` +#### Shadowrocket(Cron配置): + +``` +[Script] +中青看点 = type=cron,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js,cronexpr="1 */6 * * *",timeout=20,enable=true +``` #### Loon: ``` From cd6faab5acc810da0020fc4b81e77a4dc1d66454 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 14:10:52 +0800 Subject: [PATCH 500/721] Update readme.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [toc] #
中青看点使用说明
[跳转至底部](#四、注意事项) ### 一、IOS配置教程 ``` [MITM] hostname = *.youth.cn, ios.baertt.com ``` #### Surge: ``` [Script] 中青看点 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js,script-update-interval=0 中青看点 = type=http-request,pattern=https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign),script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/red_packet,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true ``` #### Shadowrocket(Cron配置): ``` [Script] 中青看点 = type=cron,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js,cronexpr="1 */6 * * *",timeout=20,enable=true ``` #### Loon: ``` [Script] cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 http-request https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true ``` #### Quantumult X: * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) ``` [rewrite_remote] https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt ``` * 本地重写配置 ``` [rewrite_local] https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body youth.js https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body youth.js https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js ``` * 本地任务配置 ``` [task_local] 1 */5 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js ``` ### 二、获取Cookie方法 * 打开极速版APP,进去个人中心,或者签到一次,提示获取Cookie - 浏览一篇短文,等待倒计时结束,提示获取阅读请求及阅读时长 * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) >>> [回到顶部](#一、IOS配置教程) ### 三、Nodejs 配置密钥
Actions Secrets | Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | | :-------: | :------: | :-------: | ------ | ------- | | YOUTH_HEADER | 中青看点 youth.yml | # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | | YOUTH_ARTBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | | YOUTH_REDBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | | YOUTH_TIME | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/user/app_stay.json",
阅读时长请求体: p=xxx | | YOUTH_NOTIFY_CONTROL | 同上 | true/false | 可选 | 中青通知开关
默认当转盘次数为50或者100并且余额大于10元时推送通知 | | | | | - | | | YOUTH_READ | 中青阅读 youth_read.yml | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | | YOUTH_START | 中青浏览赚 youth_gain.yml | & | 必须 | 请求地址: "https://ios.baertt.com/v5/task/browse_start.json",
阅读请求体: p=xxx | | YOUTH_END | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/task/browse_end.json",
阅读请求体: p=xxx |
>>> [回到上一页](..) ### 四、注意事项 > __提现金额需该请求一致,只更改提现金额无效,默认30元__ --- TaskConf/youth/readme.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 5b4ea5cd34..7d237236ad 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -3,9 +3,9 @@ #
中青看点使用说明
- [跳转至底部](#注意事项) + [跳转至底部](#四、注意事项) -### IOS配置教程 +### 一、IOS配置教程 ``` [MITM] hostname = *.youth.cn, ios.baertt.com @@ -61,15 +61,15 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http [task_local] 1 */5 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js ``` -### 获取Cookie方法 +### 二、获取Cookie方法 * 打开极速版APP,进去个人中心,或者签到一次,提示获取Cookie - 浏览一篇短文,等待倒计时结束,提示获取阅读请求及阅读时长 * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) - >>> [回到顶部](#IOS配置教程) + >>> [回到顶部](#一、IOS配置教程) -### Nodejs 配置密钥 (Github Actions) +### 三、Nodejs 配置密钥
@@ -95,7 +95,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http >>> [回到上一页](..) -### 注意事项: +### 四、注意事项 > __提现金额需该请求一致,只更改提现金额无效,默认30元__ From 8ecd05c7062ad8c271f571b7c9595c45778f0f6b Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 14:11:24 +0800 Subject: [PATCH 501/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 7d237236ad..429ced8efe 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -3,7 +3,7 @@ #
中青看点使用说明
- [跳转至底部](#四、注意事项) + [跳转至底部](#四) ### 一、IOS配置教程 ``` From 66c3ccb77e00126cb2f0bfbf4eb0e1c5613fa256 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 14:11:49 +0800 Subject: [PATCH 502/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 429ced8efe..54c25f7025 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -3,7 +3,7 @@ #
中青看点使用说明
- [跳转至底部](#四) + [跳转至底部](#四、) ### 一、IOS配置教程 ``` From 64b2cc67d72c7a19eb5a9286adf5ce6e65a1135a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 14:12:45 +0800 Subject: [PATCH 503/721] Update readme.md --- TaskConf/youth/readme.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 54c25f7025..5b4ea5cd34 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -3,9 +3,9 @@ #
中青看点使用说明
- [跳转至底部](#四、) + [跳转至底部](#注意事项) -### 一、IOS配置教程 +### IOS配置教程 ``` [MITM] hostname = *.youth.cn, ios.baertt.com @@ -61,15 +61,15 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http [task_local] 1 */5 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js ``` -### 二、获取Cookie方法 +### 获取Cookie方法 * 打开极速版APP,进去个人中心,或者签到一次,提示获取Cookie - 浏览一篇短文,等待倒计时结束,提示获取阅读请求及阅读时长 * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) - >>> [回到顶部](#一、IOS配置教程) + >>> [回到顶部](#IOS配置教程) -### 三、Nodejs 配置密钥 +### Nodejs 配置密钥 (Github Actions)
@@ -95,7 +95,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http >>> [回到上一页](..) -### 四、注意事项 +### 注意事项: > __提现金额需该请求一致,只更改提现金额无效,默认30元__ From 836cbb889efe8558202d2fabc4ca64dd54dbdc55 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 14:14:07 +0800 Subject: [PATCH 504/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 5b4ea5cd34..60f868890b 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -67,7 +67,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) - >>> [回到顶部](#IOS配置教程) + >>> [回到顶部](#中青看点使用说明) ### Nodejs 配置密钥 (Github Actions) From b59754aae2faca977cb29e71dbdd408bf7af8c08 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 14:15:26 +0800 Subject: [PATCH 505/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 60f868890b..12fb30130a 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -67,7 +67,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) - >>> [回到顶部](#中青看点使用说明) + >>> [回到顶部](#
中青看点使用说明
) ### Nodejs 配置密钥 (Github Actions) From 1de42e5e3b5307cf1afc13a8d175750fc524f26c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 14:26:29 +0800 Subject: [PATCH 506/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 12fb30130a..5b4ea5cd34 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -67,7 +67,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) - >>> [回到顶部](#
中青看点使用说明
) + >>> [回到顶部](#IOS配置教程) ### Nodejs 配置密钥 (Github Actions) From c2446ea94bdffaaf1db490601afffe6f32302d98 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 14:37:22 +0800 Subject: [PATCH 507/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 5b4ea5cd34..57acab6d47 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,5 +1,5 @@ - [toc] + [Markdown-toc] #
中青看点使用说明
From 4d8ad69cec08adfc3ef350a1e1d90b2985931257 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 14:37:41 +0800 Subject: [PATCH 508/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 57acab6d47..1f2e3cf604 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,5 +1,5 @@ - [Markdown-toc] + [markdown-toc] #
中青看点使用说明
From b74b6f7f0e97efe6914e6117113f4701d0d517ee Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 15:11:30 +0800 Subject: [PATCH 509/721] Update readme.md --- TaskConf/youth/readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 1f2e3cf604..7180631ab0 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,4 +1,6 @@ - + [markdown-toc] #
中青看点使用说明
From b30d51aeb98c32a634d0ac3de01c00b5ee281ca6 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 15:12:05 +0800 Subject: [PATCH 510/721] Update readme.md --- TaskConf/youth/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 7180631ab0..45f79b2dfe 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,6 +1,7 @@ + [markdown-toc] #
中青看点使用说明
From 08de76f681eb195ed660ec50cf2b729e5be16ebc Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 15:21:22 +0800 Subject: [PATCH 511/721] Update readme.md --- TaskConf/youth/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 45f79b2dfe..0851459cfa 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,8 +1,8 @@ + - [markdown-toc] + [toc] #
中青看点使用说明
@@ -70,7 +70,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) - >>> [回到顶部](#IOS配置教程) + >>> [回到顶部](#
-中青看点使用说明-
) ### Nodejs 配置密钥 (Github Actions) From 79444cbdb4d1d77ecee32872b440e93acdcfcdbf Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 15:22:04 +0800 Subject: [PATCH 512/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 0851459cfa..988ac6a27d 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -4,7 +4,7 @@ [toc] - #
中青看点使用说明
+ #
中青看点使用说明
[跳转至底部](#注意事项) From b6e9827272d76a84e0d312170416abede63ffb8e Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sat, 30 Jan 2021 15:23:31 +0800 Subject: [PATCH 513/721] Update readme.md --- TaskConf/youth/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 988ac6a27d..c82d8c9e55 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -70,7 +70,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body http * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) - 正常提现一次,获取提现请求(可选) - >>> [回到顶部](#
-中青看点使用说明-
) + >>> [回到顶部](#IOS配置教程) ### Nodejs 配置密钥 (Github Actions) From dc80e62bfae6e8a98e45366abdd2a44d4a6f7b5a Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 31 Jan 2021 08:57:51 +0800 Subject: [PATCH 514/721] Update baidu_speed.js --- Task/baidu_speed.js | 108 ++++++++++++++++++++++++++------------------ 1 file changed, 63 insertions(+), 45 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index a754d1bbec..75f91494fe 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -71,8 +71,11 @@ if ($.isNode()) { cookieval = CookieArr[i]; withcash = cashArr[i]; $.index = i + 1; + let username = null, + chargemoney = 0, + availablecoin = 0; await userInfo(); - if (isblack == "true") { + if (isblack == true) { $.msg($.name + " 账号" + username + "已黑号", "您的金币和余额已被冻结,请联系客服处理"); continue; } @@ -119,52 +122,67 @@ function getsign() { } function userInfo() { - return new Promise((resolve, reject) => { - setTimeout(() =>{ - let infourl = { - url: `https://haokan.baidu.com/activity/h5/income?productid=2&from=1005640h&network=1_0&osname=baiduboxapp`, - headers: { - Cookie: cookieval, - 'User-Agent': UA - } - }; - $.get(infourl, async(error, resp, data) => { - try { - if (resp.statusCode == 200) { - username = "null"; - if(data.match(/user_name\":\"([\w+\\]+)/)){ - username = unescape(data.match(/user_name\":\"([\w+\\]+)/)[1].replace(/\\/g, "%")) - } - chargemoney = data.match(/charge_money":"(\d+\.\d+)/)[1], - waitingcoin = data.match(/waiting_coin":(\d+)/)[1], - availablecoin = data.match(/available_coin":(\d+)/)[1], - invitecode = data.match(/invite_code":"(\w+)/)[1], - coinenabled = data.match(/coin_enabled":(\d+)/)[1] - rate = data.match(/exchange_rate":(\d+)/)[1] - isblack = data.match(/is_black":(\w+)/)[1] - if (coinenabled > 100){ - coinnum = parseInt(coinenabled/100)*100 - await coinexChange() + return new Promise((resolve, reject) =>{ + setTimeout(() =>{ + let infourl = { + url: `https://haokan.baidu.com/activity/h5/income?productid=2&from=1005640h&network=1_0&osname=baiduboxapp`, + headers: { + Cookie: cookieval, + 'User-Agent': UA + } + }; + $.get(infourl, async(error, resp, data) =>{ + try { + if (resp.statusCode == 200) { + username = "null"; + json = data.match(/window\.PAGE_DATA = (.+)/)[1]; + //$.log(formatJson(json.comps)) + json = JSON.parse(formatJson(json)); + if (json.isLogin == true) { + isblack = json.is_black + for (users of json.comps) { + if (users.id == "1038") { + username = users.data.user_name ? users.data.user_name: null; + if (username) { + $.setdata(username, "baidu_nick") + }; + userinfo = users.data.user_info; + waitingcoin = userinfo.waiting_coin; + availablecoin = userinfo.available_coin; + coinenabled = userinfo.enabled_coin; + if (coinenabled > 100) { + coinnum = parseInt(coinenabled / 100) * 100; + await coinexChange() } - } - $.sub = " 昵称:"+username+" 现金:"+ chargemoney+"元 金币:"+availablecoin; - $.log("\n********** 昵称:"+username+ " 现金:"+chargemoney+"元 **********\n"); - $.setdata(username,"baidu_nick") - if (Number(chargemoney) >= Number(withcash) && $.time("HH") == "06") { - await withDraw(withcash) - if ($.isNode()) { - await notify.sendNotify($.name+" 成功提现"+withcash+"元\n"+$.sub) + } + if (users.id == "62") { + chargemoney = users.data.charge_money; + exchangemoney = users.data.exchange_money + cointoday = users.data.coin_today } - $.done() - } - } catch(error) { - $.msg($.name, "获取用户信息失败"), - $.log("用户信息详情页错误\n" + error) - } - resolve() - }) - },1000) - }) + } + $.sub = " 昵称:" + username + " 现金:" + chargemoney + "元 金币:" + availablecoin; + $.log("\n********** 昵称:" + username + " 现金:" + chargemoney + "元 **********\n"); + if (Number(chargemoney) >= Number(withcash) && $.time("HH") == "06") { + await withDraw(withcash); + if ($.isNode()) { + await notify.sendNotify($.name + " 成功提现" + withcash + "元\n" + $.sub) + } + $.done() + } + } + } else if(json.isLogin == "false"){ + $.msg($.name,"您的账号未登录,或者Cookie已失效") + } + } catch(error) { + $.msg($.name, "获取用户信息失败",请更换Cookie), + $.log("用户信息详情页错误\n" + error + "\n" + formatJson(data.match(/window\.PAGE_DATA = (.+)/)).replace(new RegExp("\\\\\"", "gm"), "\"")) + } + resolve() + }) + }, + 1000) + }) } function withDraw(cash) { From c9bcd87eb73c801153329a0d579ea4d459d96ac2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 31 Jan 2021 09:54:29 +0800 Subject: [PATCH 515/721] Update baidu_speed.js --- Task/baidu_speed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 75f91494fe..21aca717e1 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -107,7 +107,7 @@ function getsign() { $.post(signurl, async(error, response, data) =>{ let get_sign = JSON.parse(data); if (get_sign.errno == 0) { - $.desc = get_sign.data.tips+` 收益: $ {get_sign.data.bonus.coin}💰\n`; + $.desc = get_sign.data.tips+` 收益: ${get_sign.data.bonus.coin}💰\n`; $.log($.desc+"\n"+data); await invite() } else { @@ -408,7 +408,7 @@ function activeBox() { await get_pkg() } else if (act_box.errno == 1){ $.desc+= "【taskName】"+ act_box.msg; - $.log(act_box.msg+",请检查Cookie是否包含BAIDUID"); + $.log(act_box.msg+",请检查Cookie是否包含BAIDUCUID"); return } else if (typeof act_box.data != "undefined"&&act_box.data.code == "EquipmentComplete") { $.log(" "+ act_box.data.data) From 9cbdbdb320f7af34a926ff6dd06690dff806eac2 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 31 Jan 2021 10:57:34 +0800 Subject: [PATCH 516/721] Update baidu_speed.js --- Task/baidu_speed.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 21aca717e1..992696b53e 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -1,4 +1,5 @@ /* +更新时间:2021-01-31 11:00 百度极速版签到任务,使用脚本有黑号严重,请谨慎使用‼️ 赞赏:百度极速邀请码`RW9ZSW 点击链接立得红包,最高100元!https://dwz.cn/Oilv4CJ1`,农妇山泉 -> 有点咸,万分感谢 @@ -302,19 +303,19 @@ async function getConfigs() { tid = arr.id; taskType = arr.type; if (arr.taskStatus == "1") { - $.log(taskName + " 已完成"); + $.log(taskName + " 已完成\n"); $.desc += taskName + "✅ 已完成\n"; } else if (taskType == 'openApp') { RefererUrl = arr.adLink; - $.log("\n "+taskName+" 类型: "+arr.type_name+" ") + $.log("\n"+taskName+" 类型: "+arr.type_name+" ") if( tid =="815"){ - RefererUrl="https://haokan.baidu.com/activity/goldcoin/?productid=2&pd=2&tab=guide" + RefererUrl="https://eopa.baidu.com/page/pagekey-ASKWNd8W?productid=2&type=1&tid=815" } - await activeBox() + await activeBox() } else if (taskType == 'watch') { tips = arr.tips; count = arr.total_count; - $.log("\n "+taskName + tips + "总计" + count + "次 "); + $.log("\n"+taskName + tips + "总计" + count + "次 "); if (arr.taskStatus == 0) { await $.wait(2000); await get_search("184") @@ -332,7 +333,7 @@ async function getConfigs() { tid = "817" taskName = "【"+tasks[x].data.unOpenHeadBoxDialog.btn[0].btnText+"】" RefererUrl = tasks[x].data.unOpenHeadBoxDialog.btn[0].iosAdUrl - $.log("\n "+taskName+" ") + $.log("\n"+taskName+" ") await activeBox() } if (tasks[x].data.gameheader.coinInfo.coinStatus == 2) { @@ -354,7 +355,7 @@ async function getConfigs() { if (jingangType == 2) { if (tasks[x].data.jingang.countDown[tid].countDown == 0) { await $.wait(1000); - $.log("\n "+taskName+" "); + $.log("\n"+taskName+" "); await activeBox(); } else { $.log("\n"+taskName+ " 请等待" +Number(tasks[x].data.jingang.countDown[tid].countDown / 60).toFixed(2) + "分钟") @@ -384,7 +385,7 @@ function firstbox() { } else if (get_first.err_no == 10079) { $.desc += "【首页宝箱】✅ " + get_first.tip + '\n' } else if (get_first.err_no == 10060) { - $.log("首页宝箱开启失败"+get_first.tip) + $.log("首页宝箱开启失败"+get_first.tip+"\n") } resolve() }) @@ -407,11 +408,11 @@ function activeBox() { if ((tid == 587 || tid == 590) && act_box.errno == 0) { await get_pkg() } else if (act_box.errno == 1){ - $.desc+= "【taskName】"+ act_box.msg; - $.log(act_box.msg+",请检查Cookie是否包含BAIDUCUID"); + $.desc+= "【taskName】"+ act_box.msg+"\n"; + $.log(act_box.msg+",请检查Cookie是否包含BAIDUCUID;\n"); return - } else if (typeof act_box.data != "undefined"&&act_box.data.code == "EquipmentComplete") { - $.log(" "+ act_box.data.data) + } else if (data.indexOf("EquipmentComplete") >-1) { + $.log(act_box.data.data+"\n") } else { //$.log(formatJson(data)) await get_pkg() @@ -425,7 +426,6 @@ function activeBox() { }) } - //视频 function get_pkg() { return new Promise((resolve, reject) =>{ From 1f7329509996d29b40bd7ebc5399c97bc42b42a6 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 31 Jan 2021 11:24:22 +0800 Subject: [PATCH 517/721] Update baidu_speed.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复错误 --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 992696b53e..6c6fa7e8ea 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -337,7 +337,7 @@ async function getConfigs() { await activeBox() } if (tasks[x].data.gameheader.coinInfo.coinStatus == 2) { - $.desc += "【头部宝箱】✅ 总计金币" + tasks[x].data.gameheader.coinInfo.coinCount + "\n"; + $.desc += "\n【头部宝箱】✅ 总计金币" + tasks[x].data.gameheader.coinInfo.coinCount + "\n"; $.log($.desc) } else { for (headerbox of tasks[x].data.gameheader.progressList) { From 1ee48424de8f9c55c721e2ae1497b6691d72a298 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 31 Jan 2021 12:57:25 +0800 Subject: [PATCH 518/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 6c6fa7e8ea..b58dad5556 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -176,7 +176,7 @@ function userInfo() { $.msg($.name,"您的账号未登录,或者Cookie已失效") } } catch(error) { - $.msg($.name, "获取用户信息失败",请更换Cookie), + $.msg($.name, "获取用户信息失败","请更换Cookie") $.log("用户信息详情页错误\n" + error + "\n" + formatJson(data.match(/window\.PAGE_DATA = (.+)/)).replace(new RegExp("\\\\\"", "gm"), "\"")) } resolve() From 7a96c584a385e877d73da69bdd107f5b50f58ad5 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 31 Jan 2021 18:59:33 +0800 Subject: [PATCH 519/721] Update readme.md --- TaskConf/youth/readme.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index c82d8c9e55..152533860d 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -1,6 +1,4 @@ - + [toc] @@ -22,7 +20,7 @@ hostname = *.youth.cn, ios.baertt.com 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/red_packet,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true ``` #### Shadowrocket(Cron配置): @@ -39,24 +37,24 @@ http-request https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) script-path=ht http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true ``` #### Quantumult X: * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) ``` [rewrite_remote] -https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt ``` * 本地重写配置 ``` [rewrite_local] https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body youth.js +https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body youth.js -https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js ``` * 本地任务配置 From 3efb2f350c8d59862361aec8f6d572078aaa2c31 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 31 Jan 2021 19:12:36 +0800 Subject: [PATCH 520/721] Update qx_rewite.txt --- TaskConf/youth/qx_rewite.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/youth/qx_rewite.txt b/TaskConf/youth/qx_rewite.txt index f34c8a8cbb..a749d567da 100644 --- a/TaskConf/youth/qx_rewite.txt +++ b/TaskConf/youth/qx_rewite.txt @@ -10,4 +10,4 @@ https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body htt https:\/\/ios\.baertt\.com\/v5\/task\/browse_(start|end)\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js -https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js From dc16ae04e4d68ac66c12bf2615676712cf747e85 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 31 Jan 2021 19:25:21 +0800 Subject: [PATCH 521/721] Update youth.js --- Task/youth.js | 66 ++------------------------------------------------- 1 file changed, 2 insertions(+), 64 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 14e4e30f23..901f83fa87 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,70 +1,8 @@ /* -更新时间: 2021-01-23 12:00 +更新时间: 2021-01-31 19:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 -获取Cookie方法: -1.将下方[rewrite_local]和[MITM]地址复制的相应的区域 -下,运行时间自行配置 -2. 获取Cookie方法,可随时更新 - ① 进入app,进入任务中心或者签到一次,即可获取Cookie. - ② 阅读一篇文章,获取阅读请求body, - ③ 同时获取阅读时长, - ④ 在阅读文章最下面有个惊喜红包,点击获取惊喜红包请求 - ⑤ 正常提现一次,获取提现请求,提现金额需该请求一致,只更改提现金额无效,默认30元 -3.增加转盘抽奖通知间隔,为了照顾新用户,前三次会有通知,以后默认每50次转盘抽奖通知一次,可自行修改❗️ 转盘完成后通知会一直开启 -4.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 -5.增加每日打卡,打卡时间每日5:00-8:00❗️,请不要忘记设置运行时间,共4条Cookie,请全部获取,获取请注释 -6. 支持Github Actions多账号运行,填写'YOUTH_HEADER'值多账号时用'#'号隔开,其余值均用'&'分割 ‼️,当转盘次数为50或者100并且余额大于10元时推送通知 - -~~~~~~~~~~~~~~~~ -Surge 4.0 : -[Script] -中青看点 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js,script-update-interval=0 - -中青看点 = type=http-request,pattern=https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign),script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js - -中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true - -中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/red_packet,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true - -中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true - -中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true - -~~~~~~~~~~~~~~~~ -Loon 2.1.0+ -[Script] -# 本地脚本 -cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 - -http-request https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true - ------------------ -QX 1.0. 7+ : -[task_local] -0 9 * * * youth.js - -[rewrite_local] -https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) url script-request-header youth.js - -https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body youth.js - -https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body youth.js - -https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body youth.js - -https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\.json url script-request-body youth.js - -~~~~~~~~~~~~~~~~ -[MITM] -hostname = *.youth.cn, ios.baertt.com -~~~~~~~~~~~~~~~~ - */ let s = 1000 //各数据接口延迟 @@ -240,7 +178,7 @@ else if ($request && $request.method != `OPTIONS`&& $request.url.match(/\/articl $.log(`${$.name} 获取惊喜红包: 成功,redpbodyVal: ${redpbodyVal}`) $.msg($.name, `获取惊喜红包请求: 成功🎉`, ``) } -else if ($request && $request.method != `OPTIONS`&& $request.url.match(/\/withdraw\.json/)) { +else if ($request && $request.method != `OPTIONS`&& $request.url.match(/\/withdraw\d?\.json/)) { const withdrawVal = $request.body const withdrawUrl = $request.url if (withdrawVal) $.setdata(withdrawVal, 'cashbody_zq') From 9ac1fd1a3e8964c08882ce64a0b6b6a34c4ecfc9 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Sun, 31 Jan 2021 23:52:36 +0800 Subject: [PATCH 522/721] Update youth.yml --- .github/workflows/youth.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index a1508a8a30..399f2a95f1 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -6,7 +6,7 @@ name: 中青看点 on: workflow_dispatch: schedule: - - cron: '*/15 * * * *' + - cron: '*/7 */2 * * *' watch: types: started From cfb613fa1e50b2d16c23c3cdbd2eb614c2507d17 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 1 Feb 2021 11:37:52 +0800 Subject: [PATCH 523/721] Update trainquery.js --- Task/trainquery.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/trainquery.js b/Task/trainquery.js index 5116e98573..a930ecbc1f 100644 --- a/Task/trainquery.js +++ b/Task/trainquery.js @@ -89,7 +89,7 @@ if (nowDate > leftdate ){ function trainscheck() { return new Promise((resolve, reject) =>{ const myRequest = { - url: `https://kyfw.12306.cn/otn/leftTicket/query?leftTicketDTO.train_date=${leftdate}&leftTicketDTO.from_station=${statno}&leftTicketDTO.to_station=${tostat}&purpose_codes=${purpose}`, + url: `https://kyfw.12306.cn/otn/leftTicket/queryZ?leftTicketDTO.train_date=${leftdate}&leftTicketDTO.from_station=${statno}&leftTicketDTO.to_station=${tostat}&purpose_codes=${purpose}`, method: 'GET', headers: {'Cookie' : 'JSESSIONID=1B1CEADF1B9F831C25E71D7F2D996294'} }; @@ -297,4 +297,4 @@ const subTitle = '始发站: '+startstation+ '--终点站: '+edstation+' ('+purp } -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 356020e5a1bab47883aa97506c6a61f0b9154f3f Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 1 Feb 2021 11:40:43 +0800 Subject: [PATCH 524/721] Update trainquery.js --- Task/trainquery.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Task/trainquery.js b/Task/trainquery.js index a930ecbc1f..0898a933af 100644 --- a/Task/trainquery.js +++ b/Task/trainquery.js @@ -87,12 +87,15 @@ if (nowDate > leftdate ){ // 获取车次列表 function trainscheck() { - return new Promise((resolve, reject) =>{ - const myRequest = { - url: `https://kyfw.12306.cn/otn/leftTicket/queryZ?leftTicketDTO.train_date=${leftdate}&leftTicketDTO.from_station=${statno}&leftTicketDTO.to_station=${tostat}&purpose_codes=${purpose}`, - method: 'GET', - headers: {'Cookie' : 'JSESSIONID=1B1CEADF1B9F831C25E71D7F2D996294'} -}; + + return new Promise((resolve, reject) =>{ + const myRequest = { + url: `https://kyfw.12306.cn/otn/leftTicket/queryZ?leftTicketDTO.train_date=${leftdate}&leftTicketDTO.from_station=${statno}&leftTicketDTO.to_station=${tostat}&purpose_codes=${purpose}`, + headers:{ + Cookie: 'JSESSIONID=E3CCA5C6ECC49AFFE24D4FE48C8A8949;', + 'Referer': 'https://kyfw.12306.cn/otn/leftTicket/init' + } + }; $.get(myRequest, (err, resp, data) => { //console.log('余票信息' + "\n\n" + data); let ress = JSON.parse(data) From 38f103385e6ae7e3dd7840b49c33302c3bd345ed Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 1 Feb 2021 18:44:26 +0800 Subject: [PATCH 525/721] Update trainquery.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化脚本,修复错误 --- Task/trainquery.js | 367 ++++++++++++++++++++------------------------- 1 file changed, 166 insertions(+), 201 deletions(-) diff --git a/Task/trainquery.js b/Task/trainquery.js index 0898a933af..75b82809ed 100644 --- a/Task/trainquery.js +++ b/Task/trainquery.js @@ -5,11 +5,11 @@ 2.K值为列车车次所对应的序号或者车次,请不要填错,详情请看日志 3.部分列车无法查到列车时刻信息,部分列车总计时间有误,以时刻表为准,部分座席可能无票价,第一次运行会报错,请重新运行 4.提供所有席别余票信息,测试阶段,仅供参考 -5.借鉴sazs34大佬的smart脚本 -更新日志: -7月28日: -取消手动座席选择,增加硬卧,软卧,商务座等所有票价信息,优化通知; + 支持boxjs远程自定义配置,增加可自定义车次,车次序号设置过大时可显示经过车次,可根据车次序号进行设置,由于苹果限制,车次可能显示不全 + +如果设置出行日期若已过,则自动修改为明天,可在Boxjs内手动修改出行日期 + 增加点击通知链接跳转详情页 ~~~~~~~~~~~~~~~~ QX 1.0.6+ : @@ -31,34 +31,31 @@ cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/ */ +const $ = new Env('列车时刻查询'); -const leftstat ='北京' //出发地 - - tostat = '上海' //目的地 - - peo = 'ADULT' //乘客类型,'ADULT'是成人,'0X00'是学生 - - lefdate = '2020-08-15' //出发日期 + //出发地 +let leftstation = $.getdata('left')||'北京' - settrain = '1' //车次序号或者列车车次!! +// 目的地 +let tostation = $.getdata('end')||'上海' -const $ = new Env('列车时刻查询') +//乘客类型,'ADULT'是成人,'0X00'是学生 +let purpose = $.getdata('people')||peo - leftstation = $.getdata('left')||leftstat +//出发日期 +let leftdate = $.getdata('leavedate') - tostation = $.getdata('end')||tostat - - purpose = $.getdata('people')||peo - - leftdate = $.getdata('leavedate')||lefdate - -let K = $.getdata('setrain')||settrain +//车次序号或者列车车次!! +let K = $.getdata('setrain')||"1" !(async () => { - await namecheck() - await trainscheck() - await prize() - await traintime() + await namecheck(); + await timecheck(); + await $.wait(800) + await trainscheck(); + await $.wait(800) + await prize(); + //await traintime() })() .catch((e) => $.logErr(e)) .finally(() => $.done()) @@ -66,28 +63,38 @@ let K = $.getdata('setrain')||settrain //站点编码 function namecheck() { - return new Promise((resolve, reject) =>{ -const stationnocheck = { - url: `https://kyfw.12306.cn/otn/resources/js/framework/station_name.js`, - method: 'GET', -}; - $.get(stationnocheck, (err, resp, data) => { - //console.log(response.statusCode + "\n\n" + data); - statno =data.split(`${leftstation}`)[1].split("|")[1] - tostat = data.split(`${tostation}`)[1].split("|")[1] - resolve() - }) - }) + return new Promise((resolve, reject) =>{ + const stationnocheck = { + url: `https://kyfw.12306.cn/otn/resources/js/framework/station_name.js`, + method: 'GET', + }; + $.get(stationnocheck, (err, resp, data) =>{ + //console.log(resp.statusCode + "\n\n" + data); + try { + statno = data.split(`${leftstation}`)[1].split("|")[1]; + tostat = data.split(`${tostation}`)[1].split("|")[1] + } catch(e) { + $.logErr(e, data); + } finally { + resolve() + } + }) + }) } -let nowDate = $.time('yyyy-MM-dd'); -if (nowDate > leftdate ){ - $.msg(`火车查询错误❌`,"日期错误,请检查后重试",'') +function timecheck() { + let nowDate = $.time('yyyy-MM-dd'); + if (nowDate > leftdate) { + lastday = $.time("yyyy-MM") + "-" + new Date($.time("yyyy"), $.time("MM"), 0).getDate(); + if (leftdate < lastday) { + leftdate = $.time("yyyy-MM") + "-" + `${parseInt($.time("dd")) + 1}`.padStart(2, "0") + "(日期已改为明天)"; + $.log("设置出行日期已过,将自动把出行日期改为明天") + } + } } // 获取车次列表 function trainscheck() { - return new Promise((resolve, reject) =>{ const myRequest = { url: `https://kyfw.12306.cn/otn/leftTicket/queryZ?leftTicketDTO.train_date=${leftdate}&leftTicketDTO.from_station=${statno}&leftTicketDTO.to_station=${tostat}&purpose_codes=${purpose}`, @@ -96,136 +103,126 @@ function trainscheck() { 'Referer': 'https://kyfw.12306.cn/otn/leftTicket/init' } }; - $.get(myRequest, (err, resp, data) => { - //console.log('余票信息' + "\n\n" + data); - let ress = JSON.parse(data) -try { - let reg = /^[a-zA-Z][0-9]+$/ - for (i=0;iress.data.result.length){ - var trainlist = "" -for (y=0;y{ + //console.log('余票信息' + "\n\n" + data); + try { + let ress = JSON.parse(data); + let reg = /^[a-zA-Z][0-9]+$/; + for (i = 0; i < ress.data.result.length; i++) { + yupiaoinfo = ress.data.result[i].split("|"); + train = yupiaoinfo[3]; + hours = yupiaoinfo[10].split(":")[0] + if(train&&hours!=99){ + starttime = yupiaoinfo[8], + arrivetime = yupiaoinfo[9], + total = yupiaoinfo[10].split(":")[0] + '小时' + yupiaoinfo[10].split(":")[1] + '分钟', + yingzuo = yupiaoinfo[29]?' 硬座:' + yupiaoinfo[29]:"", + yingwo = yupiaoinfo[28]?" 硬卧:" + yupiaoinfo[28]:"", + ruanwo = yupiaoinfo[23]? " 软卧:" + yupiaoinfo[23]:"", + yideng = yupiaoinfo[31]?' 一等座:' + yupiaoinfo[31]:"", + erdeng = yupiaoinfo[30]?' 二等座:' + yupiaoinfo[30]:"", + wuzuo = yupiaoinfo[26]? ' 无座:' + yupiaoinfo[26]:"" + } + trainlist = '[' + (i + 1) + '] 车次:' + train + " " + starttime + "--" + arrivetime + " 总计时间:" + total + ' ' + yideng + " "+ erdeng + " "+ yingwo + ruanwo +" "+yingzuo +" "+ wuzuo + '\n' + //trainno = ress.data.result[i].split("|")[2] + $.log(trainlist); + if (reg.test(K) && K == ress.data.result[i].split("|")[3]) { + K = i + 1 + } + }; + if (K <= ress.data.result.length) { + info = ress.data.result[K - 1].split("|"); + //console.log(info) + traincode = info[3], + //列车车次 + trainno = info[2], + //列车编码 + fromstationno = info[16], + //发车站序号 + tostationno = info[17], + //目的地序号 + fromstation = info[4], + //始发站编码 + endstation = info[5], + //终点站编码 + leftstationcode = info[6], + //出发站编码 + tostationcode = info[7], + //目的地编码 + seattypes = info[35], + //座席代码 + totaltime = info[10].split(":")[0] + '小时' + info[10].split(":")[1] + '分钟'; + //运行时间 + } else if (!reg.test(K) && K > ress.data.result.length) { + var trainlist = ""; + for (y = 0; y < ress.data.result.length; y++) { + trainlist += (y + 1) + '. ' + ress.data.result[y].split("|")[3] + " " + ress.data.result[y].split("|")[8] + "-" + ress.data.result[y].split("|")[9] + " 历时" + ress.data.result[y].split("|")[10].split(":")[0] + '时' + ress.data.result[y].split("|")[10].split(":")[1] + '分\n' + } + $.msg(`火车查询错误❌`, "共" + ress.data.result.length + "辆列车经过,请检查后重试", trainlist); + return + } + } catch(e) { + $.msg(`火车查询错误❌`, "无此方向列车经过,请检查后重试", e); + return + } finally { + resolve() + } + }) }) } - function prize() { - return new Promise((resolve, reject) =>{ - var timestamp=$.startTime; - const prizeurl = { - url: `https://kyfw.12306.cn/otn/leftTicket/queryTicketPrice?train_no=${trainno}&from_station_no=${fromstationno}&to_station_no=${tostationno}&seat_types=${seattypes}&train_date=${leftdate}`, - method: 'GET', - headers : {'Accept-Encoding' : `gzip, deflate, br`, -'Connection' : `keep-alive`, -'Accept' : `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`, -'Host' : `kyfw.12306.cn`, -'Cookie' : `_uab_collina=159587465195914267490366; JSESSIONID=2D2C3ED0892CE56ADB0576B030CC1344; _jc_save_fromDate=${leftdate}; _jc_save_fromStation=${leftstation}%2C${leftstationcode}; _jc_save_toDate=${leftdate}; _jc_save_toStation=${tostation}%2${tostationcode}; _jc_save_wfdc_flag=dc; BIGipServerotn=250610186.64545.0000; route=9036359bb8a8a461c164a04f8f50b252; RAIL_EXPIRATION=${timestamp}`, -'User-Agent' : `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.3.5 (KHTML, like Gecko) Version/13.0 Safari/604.1`, -'Accept-Language' : `zh-cn` } -} - $.get(prizeurl, (err, resp, data) => { - //console.log('票价信息: 响应码: ' +resp.statusCode+" \n"+ data+'\n'); - if ( data == -1){ - $.msg('列车查询失败‼️', '该'+traincode+'次列车车票暂停发售或者查询失败,请重试', err) - return + return new Promise((resolve, reject) =>{ + const prizeurl = { + url: `https://kyfw.12306.cn/otn/leftTicket/queryTicketPrice?train_no=${trainno}&from_station_no=${fromstationno}&to_station_no=${tostationno}&seat_types=${seattypes}&train_date=${leftdate}` + }; + $.get(prizeurl, async(err, resp, data) => { + //console.log('票价信息: 响应码: ' +resp.statusCode+" \n"+ data+'\n'); + try{ + if (data == -1){ + $.msg('列车查询失败‼️', '该'+traincode+'次列车车票暂停发售或者查询失败,请重试', err); + return } - let result = JSON.parse(data) - if (result.data.M){ - setyideng += `(${result.data.M}) ` - } - if (result.data.O){ - seterdeng += `(${result.data.O}) ` - } - if (result.data.A3){ - setyingwo += `(${result.data.A3}) ` - } - if (result.data.F){ - setdongwo += `(${result.data.F}) ` - } - if (result.data.A1){ - setyingzuo += `(${result.data.A1}) ` - } - if (result.data.A2){ - setruanzuo += `(${result.data.A2}) ` - } - if (result.data.WZ){ - setwuzuo += `(${result.data.WZ}) ` - } - if (result.data.A9){ - setshangwu += `(${result.data.A9}) ` - } - if (result.data.AI){ - setruanwo += `(${result.data.AI}) ` - } - if (result.data.A4){ - setruanwo += `(${result.data.A4}) ` - } - if (result.data.A6){ - setruanwopro += `(${result.data.A6}) ` - } - if (result.data.AJ){ - setyingwo += `(${result.data.AJ}) ` - } - }) -resolve() + let obj = JSON.parse(data).data + var seatinfo = ""; + for ( arr in obj){ + if(obj[arr].indexOf("¥")>-1){ + seatinfo += mapSeat(arr)[0]+": "+(mapSeat(arr)[1]?mapSeat(arr)[1]:"")+"("+obj[arr]+") "; + } + if(seatinfo.split("¥").length%3==0){ + seatinfo += "\n" + } + } + await traintime(seatinfo) + } catch(e) { + $.logErr(e, data); + } finally { + resolve() + } + }) }) } -function traintime() { +function mapSeat(seat) { + const map = { + "M": ["一等座", info[31]], + "O": ["二等座", info[30]], + "A1": ["硬座", info[29]], + "A2": ["软座", info[24]], + "A3": ["硬卧", info[28]], + "AJ": ["硬卧", info[28]], + "A4": ["软卧", info[23]], + "A6": ["豪华软卧", info[21]], + "A9": ["商务座", info[32]], + //"P": ["特等座", info[]], + "F": ["动卧", info[33]], + "WZ": ["无座", info[26]] + } + return map[seat] +} + + +function traintime(seatinfo) { return new Promise((resolve, reject) =>{ const myRequest = { url: `https://kyfw.12306.cn/otn/czxx/queryByTrainNo?train_no=${trainno}&from_station_telecode=${fromstation}&to_station_telecode=${endstation}&depart_date=${leftdate}`, @@ -233,7 +230,7 @@ function traintime() { } $.get(myRequest, (err, resp, data) => { var detail = "" - //console.log(response.statusCode + "\n\n" + data); + //console.log(resp.statusCode + "\n\n" + data); let result = JSON.parse(data) if (result.status == true) { const traincode = result.data.data[0].station_train_code @@ -243,47 +240,14 @@ const arrivetime = result.data.data[0].arrive_time startstation = result.data.data[0].start_station_name edstation = result.data.data[0].end_station_name -if (setyideng){ - detail += '一等座: '+setyideng - } -if (seterdeng){ - detail += ' 二等座: '+seterdeng - } -if (setshangwu){ - detail += '\n商务座: '+setshangwu - } -if (setyingzuo){ - detail += '硬座: '+setyingzuo - } -if (setruanzuo){ - detail += ' 软座: '+setruanzuo - } -if (setwuzuo){ - detail += ' 无座: '+setwuzuo - } -if (setruanwo){ - detail += '\n软卧: '+setruanwo - } -if (setyingwo){ - detail += ' 硬卧: '+setyingwo - } -if (setruanwopro){ - detail += ' 高级软卧: '+setruanwopro - } -if (setdongwo){ - detail += ' 动卧: '+setdongwo - } if (purpose=='0X00'){ - purpose = '学生票 ' + purpose = '学生票' } else { - purpose = '成人票 ' + purpose = '成人票' } - if(detail==""){ - detail += "该列车车票暂停发售或已停运,点击打开详情页查看" - } -else{ - detail +="\n"+leftstation+'到达目的地'+tostation+'历时'+totaltime+'\n'+arrivetime +'--'+starttime+ ' '+stationname +if(seatinfo){ + detail = seatinfo+"\n"+leftstation+'到达目的地'+tostation+'历时'+totaltime+'\n'+arrivetime +'--'+starttime+ ' '+stationname } for (i=1;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 af931742b8a297efb17c625426cc3e4cb0f84ff1 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 1 Feb 2021 18:46:32 +0800 Subject: [PATCH 526/721] Update trainquery.js --- Task/trainquery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/trainquery.js b/Task/trainquery.js index 75b82809ed..1f5839e91f 100644 --- a/Task/trainquery.js +++ b/Task/trainquery.js @@ -214,7 +214,7 @@ function mapSeat(seat) { "A4": ["软卧", info[23]], "A6": ["豪华软卧", info[21]], "A9": ["商务座", info[32]], - //"P": ["特等座", info[]], + "P": ["特等座", info[32]], "F": ["动卧", info[33]], "WZ": ["无座", info[26]] } From 807d1e8790e24a0a8cad8c39affe511aee51564c Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 1 Feb 2021 20:04:36 +0800 Subject: [PATCH 527/721] Update trainquery.js --- Task/trainquery.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Task/trainquery.js b/Task/trainquery.js index 1f5839e91f..3bcac9c0ed 100644 --- a/Task/trainquery.js +++ b/Task/trainquery.js @@ -87,7 +87,7 @@ function timecheck() { if (nowDate > leftdate) { lastday = $.time("yyyy-MM") + "-" + new Date($.time("yyyy"), $.time("MM"), 0).getDate(); if (leftdate < lastday) { - leftdate = $.time("yyyy-MM") + "-" + `${parseInt($.time("dd")) + 1}`.padStart(2, "0") + "(日期已改为明天)"; + leftdate = $.time("yyyy-MM") + "-" + `${parseInt($.time("dd")) + 1}`.padStart(2, "0") ; $.log("设置出行日期已过,将自动把出行日期改为明天") } } @@ -133,8 +133,16 @@ function trainscheck() { if (K <= ress.data.result.length) { info = ress.data.result[K - 1].split("|"); //console.log(info) - traincode = info[3], + + traincode = info[3]; //列车车次 + if( info.indexOf("列车停运")>-1){ + $.msg( $.name, traincode+"车次于"+leftdate+"已停运","请选择其他车次") + $done() + }; + if( info.indexOf("IS_TIME_NOT_BUY")>-1){ + $.log("您选的"+traincode+"车次出行日期不在购买时间段,请选择其他车次或者调整出行日期") + } trainno = info[2], //列车编码 fromstationno = info[16], @@ -174,10 +182,15 @@ function trainscheck() { function prize() { return new Promise((resolve, reject) =>{ const prizeurl = { - url: `https://kyfw.12306.cn/otn/leftTicket/queryTicketPrice?train_no=${trainno}&from_station_no=${fromstationno}&to_station_no=${tostationno}&seat_types=${seattypes}&train_date=${leftdate}` + url: `https://kyfw.12306.cn/otn/leftTicket/queryTicketPrice?train_no=${trainno}&from_station_no=${fromstationno}&to_station_no=${tostationno}&seat_types=${seattypes}&train_date=${leftdate}`, + headers:{ + Cookie: 'JSESSIONID=E3CCA5C6ECC49AFFE24D4FE48C8A8949;', + 'Referer': 'https://kyfw.12306.cn/otn/leftTicket/init' + } }; + $.get(prizeurl, async(err, resp, data) => { - //console.log('票价信息: 响应码: ' +resp.statusCode+" \n"+ data+'\n'); + //console.log('票价信息: 响应码: ' +resp.statusCode+" \n"+ data+'\n'); try{ if (data == -1){ $.msg('列车查询失败‼️', '该'+traincode+'次列车车票暂停发售或者查询失败,请重试', err); @@ -214,7 +227,7 @@ function mapSeat(seat) { "A4": ["软卧", info[23]], "A6": ["豪华软卧", info[21]], "A9": ["商务座", info[32]], - "P": ["特等座", info[32]], + //"P": ["特等座", info[]], "F": ["动卧", info[33]], "WZ": ["无座", info[26]] } From dbec675718086afd59346711d72621905ce35bdb Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 1 Feb 2021 20:05:46 +0800 Subject: [PATCH 528/721] Update trainquery.js --- Task/trainquery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/trainquery.js b/Task/trainquery.js index 3bcac9c0ed..ea5926c3ee 100644 --- a/Task/trainquery.js +++ b/Task/trainquery.js @@ -227,7 +227,7 @@ function mapSeat(seat) { "A4": ["软卧", info[23]], "A6": ["豪华软卧", info[21]], "A9": ["商务座", info[32]], - //"P": ["特等座", info[]], + "P": ["特等座", info[32]], "F": ["动卧", info[33]], "WZ": ["无座", info[26]] } From 6839a52c03ddd668a8816597bbac1a84801ee191 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Mon, 1 Feb 2021 20:36:29 +0800 Subject: [PATCH 529/721] Update trainquery.js --- Task/trainquery.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Task/trainquery.js b/Task/trainquery.js index ea5926c3ee..10dbbf6de0 100644 --- a/Task/trainquery.js +++ b/Task/trainquery.js @@ -190,7 +190,7 @@ function prize() { }; $.get(prizeurl, async(err, resp, data) => { - //console.log('票价信息: 响应码: ' +resp.statusCode+" \n"+ data+'\n'); + console.log('票价信息: 响应码: ' +resp.statusCode+" \n"+ data+'\n'); try{ if (data == -1){ $.msg('列车查询失败‼️', '该'+traincode+'次列车车票暂停发售或者查询失败,请重试', err); @@ -223,8 +223,9 @@ function mapSeat(seat) { "A1": ["硬座", info[29]], "A2": ["软座", info[24]], "A3": ["硬卧", info[28]], - "AJ": ["硬卧", info[28]], + "AJ": ["二等卧", info[28]], "A4": ["软卧", info[23]], + "AI": ["二等卧", info[23]], "A6": ["豪华软卧", info[21]], "A9": ["商务座", info[32]], "P": ["特等座", info[32]], From ff6d1f34615075dee4e6f37a73cc542dd32003a6 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 2 Feb 2021 09:50:19 +0800 Subject: [PATCH 530/721] --- Script/altstore.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Script/altstore.js b/Script/altstore.js index fa20308f64..efccde03d8 100644 --- a/Script/altstore.js +++ b/Script/altstore.js @@ -28,3 +28,4 @@ obj ={ "self":"https://www.patreon.com/api/oauth2/v2/user/30618536" } } + From 929b93f80ab9cfe31890e477ed54d95320f104aa Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 2 Feb 2021 11:03:54 +0800 Subject: [PATCH 531/721] --- Script/115lx.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Script/115lx.js b/Script/115lx.js index b70089bff4..a725412ae7 100644 --- a/Script/115lx.js +++ b/Script/115lx.js @@ -10,7 +10,6 @@ http-response ^https?:\/\/webapi\.115\.com\/user\/check_sign.*$ script-path=http ^http:\/\/115\.com\/\?ct=sign$ http://115.com/lx?taskdg=1 header 4.快速创建下载任务的快捷指令: https://www.icloud.com/shortcuts/31e3a877cec340a48192aa081e25c05e */ - var body = $response.body; if ($request.url.indexOf('/user/check_sign') != -1) { let json = JSON.parse(body); From f7c72ccfea378effecfd43fd61a8dba55ca2b1fa Mon Sep 17 00:00:00 2001 From: Janualy <74232376+Janualy@users.noreply.github.com> Date: Tue, 2 Feb 2021 18:06:56 +0800 Subject: [PATCH 532/721] Update jukan.yml --- .github/workflows/jukan.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/jukan.yml b/.github/workflows/jukan.yml index 9d3150df54..2fd2676c16 100644 --- a/.github/workflows/jukan.yml +++ b/.github/workflows/jukan.yml @@ -1,6 +1,5 @@ # 已禁用阅读任务,其他可行 name: 聚看点 - on: workflow_dispatch: schedule: From feae7dbe49819e732b0546f4fe4259a7e66d4e44 Mon Sep 17 00:00:00 2001 From: Janualy <74232376+Janualy@users.noreply.github.com> Date: Tue, 2 Feb 2021 18:07:29 +0800 Subject: [PATCH 533/721] Update baiduspeed.yml --- .github/workflows/baiduspeed.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/baiduspeed.yml b/.github/workflows/baiduspeed.yml index 10adacfaa4..f255870648 100644 --- a/.github/workflows/baiduspeed.yml +++ b/.github/workflows/baiduspeed.yml @@ -1,5 +1,6 @@ name: 百度极速版 + on: workflow_dispatch: schedule: From f87944af23241e969333e4bf457b273c46451148 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 2 Feb 2021 18:13:56 +0800 Subject: [PATCH 534/721] --- Task/baidu_speed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index b58dad5556..a28ce9da03 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -25,7 +25,7 @@ if ($.isNode()) { else if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('\n') > -1) { BDCookie = process.env.BAIDU_COOKIE.split('\n'); } else { - BDCookie = process.env.BAIDU_COOKIE + BDCookie = process.env.BAIDU_COOKIE.split() }; if (process.env.BAIDU_CASH && process.env.BAIDU_CASH.indexOf('&') > -1) { BDCASH = process.env.BAIDU_CASH.split('&'); @@ -33,7 +33,7 @@ if ($.isNode()) { else if (process.env.BAIDU_CASH && process.env.BAIDU_CASH.indexOf('\n') > -1) { BDCASH = process.env.BAIDU_CASH.split('\n'); } else { - BDCASH = process.env.BAIDU_CASH + BDCASH = process.env.BAIDU_CASH.split() } Object.keys(BDCookie).forEach((item) => { if (BDCookie[item]) { From 2e8b9d1cac2a10f69126bb80dc45539ea0a17445 Mon Sep 17 00:00:00 2001 From: Janualy <74232376+Janualy@users.noreply.github.com> Date: Tue, 2 Feb 2021 18:29:25 +0800 Subject: [PATCH 535/721] Update baidu_speed.js --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index a28ce9da03..544c952e6d 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -137,7 +137,7 @@ function userInfo() { if (resp.statusCode == 200) { username = "null"; json = data.match(/window\.PAGE_DATA = (.+)/)[1]; - //$.log(formatJson(json.comps)) + $.log(formatJson(json.comps)) json = JSON.parse(formatJson(json)); if (json.isLogin == true) { isblack = json.is_black From d6ae3ecbb7c3c62ab25dc28ae7b795f75263fe2b Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 2 Feb 2021 18:35:06 +0800 Subject: [PATCH 536/721] --- .github/workflows/baiduspeed.yml | 1 + Task/baidu_speed.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/baiduspeed.yml b/.github/workflows/baiduspeed.yml index f255870648..cee30f123e 100644 --- a/.github/workflows/baiduspeed.yml +++ b/.github/workflows/baiduspeed.yml @@ -30,6 +30,7 @@ jobs: node Task/baidu_speed.js env: BAIDU_CASH: ${{ secrets.BAIDU_CASH }} + BAIDU_TASK: ${{ secrets.BAIDU_TASK }} PUSH_KEY: ${{ secrets.PUSH_KEY }} BARK_PUSH: ${{ secrets.BARK_PUSH }} TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index a28ce9da03..9165bdab36 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -6,6 +6,8 @@ 本脚本默认使用chavyleung大佬和Nobyda的贴吧ck,获取方法请看大佬仓库说明,内置自动提现,提现金额默认30元,当当前时间为早上6点且达到提现金额时仅运行提现任务,提现金额小于设置金额时继续运行其他任务。 +增加百度任务开关,Actions中Secrets为BAIDU_TASK,值填true或者false + 支持BoxJs多账号,需手动填写,用&或者换行隔开 ~~~~~~~~~~~~~~~~ @@ -34,6 +36,9 @@ if ($.isNode()) { BDCASH = process.env.BAIDU_CASH.split('\n'); } else { BDCASH = process.env.BAIDU_CASH.split() + } + if (process.env.BAIDU_TASK) { + taskON = process.env.BAIDU_TASK; } Object.keys(BDCookie).forEach((item) => { if (BDCookie[item]) { @@ -137,7 +142,7 @@ function userInfo() { if (resp.statusCode == 200) { username = "null"; json = data.match(/window\.PAGE_DATA = (.+)/)[1]; - //$.log(formatJson(json.comps)) + $.log(formatJson(json.comps)) json = JSON.parse(formatJson(json)); if (json.isLogin == true) { isblack = json.is_black From 4b30798098fe5678b6f87dd5095f5d31816e7323 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 2 Feb 2021 18:43:27 +0800 Subject: [PATCH 537/721] --- Task/baidu_speed.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 9165bdab36..26a535eeec 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -37,9 +37,7 @@ if ($.isNode()) { } else { BDCASH = process.env.BAIDU_CASH.split() } - if (process.env.BAIDU_TASK) { - taskON = process.env.BAIDU_TASK; - } + Object.keys(BDCookie).forEach((item) => { if (BDCookie[item]) { CookieArr.push(BDCookie[item]) @@ -50,6 +48,9 @@ if ($.isNode()) { cashArr.push(BDCASH[item]) } }) + if (process.env.BAIDU_TASK) { + taskON = process.env.BAIDU_TASK + } } else if(baiducks && baiducks.indexOf('&')>-1){ BDCookie = baiducks.split("&") Object.keys(BDCookie).forEach((item) => { @@ -86,6 +87,7 @@ if ($.isNode()) { continue; } await $.wait(1000); + if (taskON == "true") { $.desc = ""; await firstbox(); From d0de9bd777818ace2a94ebf20547853bfd9c8c58 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 2 Feb 2021 18:49:33 +0800 Subject: [PATCH 538/721] --- Task/baidu_speed.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 26a535eeec..72884e1dfb 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -48,9 +48,6 @@ if ($.isNode()) { cashArr.push(BDCASH[item]) } }) - if (process.env.BAIDU_TASK) { - taskON = process.env.BAIDU_TASK - } } else if(baiducks && baiducks.indexOf('&')>-1){ BDCookie = baiducks.split("&") Object.keys(BDCookie).forEach((item) => { @@ -87,7 +84,11 @@ if ($.isNode()) { continue; } await $.wait(1000); - + if ($.isNode()) { + if (process.env.BAIDU_TASK) { + taskON = process.env.BAIDU_TASK + } + } if (taskON == "true") { $.desc = ""; await firstbox(); @@ -140,7 +141,6 @@ function userInfo() { } }; $.get(infourl, async(error, resp, data) =>{ - try { if (resp.statusCode == 200) { username = "null"; json = data.match(/window\.PAGE_DATA = (.+)/)[1]; @@ -182,10 +182,6 @@ function userInfo() { } else if(json.isLogin == "false"){ $.msg($.name,"您的账号未登录,或者Cookie已失效") } - } catch(error) { - $.msg($.name, "获取用户信息失败","请更换Cookie") - $.log("用户信息详情页错误\n" + error + "\n" + formatJson(data.match(/window\.PAGE_DATA = (.+)/)).replace(new RegExp("\\\\\"", "gm"), "\"")) - } resolve() }) }, From 73624218967f9149e7021c7f1deed8809379576b Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 2 Feb 2021 18:53:36 +0800 Subject: [PATCH 539/721] --- Task/baidu_speed.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 72884e1dfb..cccfc7d3f6 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -143,12 +143,12 @@ function userInfo() { $.get(infourl, async(error, resp, data) =>{ if (resp.statusCode == 200) { username = "null"; - json = data.match(/window\.PAGE_DATA = (.+)/)[1]; - $.log(formatJson(json.comps)) - json = JSON.parse(formatJson(json)); - if (json.isLogin == true) { + jsons = data.match(/window\.PAGE_DATA = (.+)/)[1]; + $.log(formatJson(jsons.comps)) + jsons = JSON.parse(formatJson(jsons)); + if (jsons.isLogin == true) { isblack = json.is_black - for (users of json.comps) { + for (users of jsons.comps) { if (users.id == "1038") { username = users.data.user_name ? users.data.user_name: null; if (username) { @@ -179,7 +179,7 @@ function userInfo() { $.done() } } - } else if(json.isLogin == "false"){ + } else if(jsons.isLogin == "false"){ $.msg($.name,"您的账号未登录,或者Cookie已失效") } resolve() From f3ce0ceb6bc4c9291bd1d4cd5b4e3e762d817897 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 2 Feb 2021 19:03:15 +0800 Subject: [PATCH 540/721] --- Task/baidu_speed.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index cccfc7d3f6..894a8ba340 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -144,6 +144,7 @@ function userInfo() { if (resp.statusCode == 200) { username = "null"; jsons = data.match(/window\.PAGE_DATA = (.+)/)[1]; + $.log(jsons+"😃") $.log(formatJson(jsons.comps)) jsons = JSON.parse(formatJson(jsons)); if (jsons.isLogin == true) { From 443d2d6d763222f010f7446cc9f72e59589b4fad Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 2 Feb 2021 19:17:32 +0800 Subject: [PATCH 541/721] --- Task/baidu_speed.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 894a8ba340..8b46b5b768 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -141,15 +141,15 @@ function userInfo() { } }; $.get(infourl, async(error, resp, data) =>{ + try { if (resp.statusCode == 200) { username = "null"; - jsons = data.match(/window\.PAGE_DATA = (.+)/)[1]; - $.log(jsons+"😃") - $.log(formatJson(jsons.comps)) - jsons = JSON.parse(formatJson(jsons)); - if (jsons.isLogin == true) { + json = data.match(/window\.PAGE_DATA = (.+)/)[1]; + $.log(JSON.parse(json)) + json = JSON.parse(json); + if (json.isLogin == true) { isblack = json.is_black - for (users of jsons.comps) { + for (users of json.comps) { if (users.id == "1038") { username = users.data.user_name ? users.data.user_name: null; if (username) { @@ -180,9 +180,13 @@ function userInfo() { $.done() } } - } else if(jsons.isLogin == "false"){ + } else if(json.isLogin == "false"){ $.msg($.name,"您的账号未登录,或者Cookie已失效") } + } catch(error) { + $.msg($.name, "获取用户信息失败","请更换Cookie") + $.log("用户信息详情页错误\n" + error + "\n" + formatJson(data.match(/window\.PAGE_DATA = (.+)/)).replace(new RegExp("\\\\\"", "gm"), "\"")) + } resolve() }) }, From d3d902284031db935fcf10b4148d489f7ff9c8fb Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 2 Feb 2021 19:26:08 +0800 Subject: [PATCH 542/721] --- Task/baidu_speed.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 8b46b5b768..8b4ca87961 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -18,7 +18,7 @@ let CookieArr = [],cashArr=[]; let UA = `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 info baiduboxapp/5.1.1.10 (Baidu; P2 14.2)`; const notify = $.isNode() ? require('./sendNotify') : ''; const baiducks = $.getdata(`cookie_baidu`); -const taskON = $.getdata(`task_baidu`)||"true"//除提现和兑换外其他任务开关; +let taskON = $.getdata(`task_baidu`)||"true"//除提现和兑换外其他任务开关; let isblack = "false"; if ($.isNode()) { if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { @@ -86,9 +86,9 @@ if ($.isNode()) { await $.wait(1000); if ($.isNode()) { if (process.env.BAIDU_TASK) { - taskON = process.env.BAIDU_TASK + taskON = process.env.BAIDU_TASK } - } + } if (taskON == "true") { $.desc = ""; await firstbox(); @@ -144,9 +144,9 @@ function userInfo() { try { if (resp.statusCode == 200) { username = "null"; - json = data.match(/window\.PAGE_DATA = (.+)/)[1]; - $.log(JSON.parse(json)) - json = JSON.parse(json); + jsons = data.match(/window\.PAGE_DATA = (.+)/)[1]; + $.log(jsons) + json = JSON.parse(jsons); if (json.isLogin == true) { isblack = json.is_black for (users of json.comps) { From ccab833476b03c588083917c402d740804d43e9e Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 2 Feb 2021 19:50:16 +0800 Subject: [PATCH 543/721] --- Task/baidu_speed.js | 51 ++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 8b4ca87961..f07731304b 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -1,5 +1,5 @@ /* -更新时间:2021-01-31 11:00 +更新时间:2021-02-02 19:50 百度极速版签到任务,使用脚本有黑号严重,请谨慎使用‼️ 赞赏:百度极速邀请码`RW9ZSW 点击链接立得红包,最高100元!https://dwz.cn/Oilv4CJ1`,农妇山泉 -> 有点咸,万分感谢 @@ -141,48 +141,33 @@ function userInfo() { } }; $.get(infourl, async(error, resp, data) =>{ - try { - if (resp.statusCode == 200) { - username = "null"; - jsons = data.match(/window\.PAGE_DATA = (.+)/)[1]; - $.log(jsons) - json = JSON.parse(jsons); - if (json.isLogin == true) { - isblack = json.is_black - for (users of json.comps) { - if (users.id == "1038") { - username = users.data.user_name ? users.data.user_name: null; - if (username) { - $.setdata(username, "baidu_nick") - }; - userinfo = users.data.user_info; - waitingcoin = userinfo.waiting_coin; - availablecoin = userinfo.available_coin; - coinenabled = userinfo.enabled_coin; - if (coinenabled > 100) { + try { + if (resp.statusCode == 200) { + username = "null"; + if(data.match(/user_name\":\"([\w+\\]+)/)){ + username = unescape(data.match(/user_name\":\"([\w+\\]+)/)[1].replace(/\\/g, "%")) + } + chargemoney = data.match(/charge_money":"(\d+\.\d+)/)[1], + waitingcoin = data.match(/waiting_coin":(\d+)/)[1], + availablecoin = data.match(/available_coin":(\d+)/)[1], + invitecode = data.match(/invite_code":"(\w+)/)[1], + coinenabled = data.match(/coin_enabled":(\d+)/)[1] + if (coinenabled > 100) { coinnum = parseInt(coinenabled / 100) * 100; await coinexChange() } - } - if (users.id == "62") { - chargemoney = users.data.charge_money; - exchangemoney = users.data.exchange_money - cointoday = users.data.coin_today - } + //rate = data.match(/exchange_rate":(\d+)/)[1] + isblack = data.match(/is_black":(\w+)/)[1] } $.sub = " 昵称:" + username + " 现金:" + chargemoney + "元 金币:" + availablecoin; $.log("\n********** 昵称:" + username + " 现金:" + chargemoney + "元 **********\n"); - if (Number(chargemoney) >= Number(withcash) && $.time("HH") == "06") { + if (parseInt(chargemoney) >= Number(withcash) && $.time("HH") == "06") { await withDraw(withcash); if ($.isNode()) { await notify.sendNotify($.name + " 成功提现" + withcash + "元\n" + $.sub) } $.done() - } } - } else if(json.isLogin == "false"){ - $.msg($.name,"您的账号未登录,或者Cookie已失效") - } } catch(error) { $.msg($.name, "获取用户信息失败","请更换Cookie") $.log("用户信息详情页错误\n" + error + "\n" + formatJson(data.match(/window\.PAGE_DATA = (.+)/)).replace(new RegExp("\\\\\"", "gm"), "\"")) @@ -516,10 +501,10 @@ function get_search(cmd) { searchname = items.data.title; author = items.data.author if (items.data.mode == "video" || items.data.type == "video") { - $.log(" 观看视频: " + searchname + " —————— " + author); + $.log(" 观看视频: " + searchname + " ------------ " + author); } else if (items.data.mode == "text") { - $.log(" 阅读短文: " + searchname + "\n " + " —————— " + items.data.tag ? items.data.tag: ""); + $.log(" 阅读短文: " + searchname + "\n " + " ------------ " + items.data.tag ? items.data.tag: ""); } else if (items.data.mode == "ad") { $.log(" 打开广告: " + author + ": " + searchname); From f7037d73fa4556e306704e713c61ed2d166d00ce Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 3 Feb 2021 11:35:50 +0800 Subject: [PATCH 544/721] --- Task/baidu_speed.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index f07731304b..8de7785f26 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -148,6 +148,7 @@ function userInfo() { username = unescape(data.match(/user_name\":\"([\w+\\]+)/)[1].replace(/\\/g, "%")) } chargemoney = data.match(/charge_money":"(\d+\.\d+)/)[1], + enabledmoney = data.match(/enabled_money":(\d+)/)[1], waitingcoin = data.match(/waiting_coin":(\d+)/)[1], availablecoin = data.match(/available_coin":(\d+)/)[1], invitecode = data.match(/invite_code":"(\w+)/)[1], @@ -161,7 +162,7 @@ function userInfo() { } $.sub = " 昵称:" + username + " 现金:" + chargemoney + "元 金币:" + availablecoin; $.log("\n********** 昵称:" + username + " 现金:" + chargemoney + "元 **********\n"); - if (parseInt(chargemoney) >= Number(withcash) && $.time("HH") == "06") { + if (enabledmoney>500&&parseInt(enabledmoney/100) >= Number(withcash) && $.time("HH") == "06") { await withDraw(withcash); if ($.isNode()) { await notify.sendNotify($.name + " 成功提现" + withcash + "元\n" + $.sub) From 66acefdeb2bc3274256e0d9d6bad0e20fc7d78a8 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 3 Feb 2021 11:44:02 +0800 Subject: [PATCH 545/721] =?UTF-8?q?=E5=88=A0=E6=8E=89=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Sunert_Task.json | 6 +++--- Task/sunert.boxjs.json | 30 ------------------------------ 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index 4d5a13288a..da3c23b34e 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -14,6 +14,9 @@ { "config": "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js, tag=实时货币换算, img-url=https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png, enabled=false" }, + { + "config": "7 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js, tag=谷歌中英互译, img-url= https://raw.githubusercontent.com/Orz-3/task/master/translate.png, enabled=false" + }, { "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐, img-url=https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/dianxin/qx_rewite.txt, tag=dianxin_rewite, update-interval=-1, opt-parser=false, enabled=true" @@ -26,9 +29,6 @@ "config": "30 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js, tag=京东到家, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jddj.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/jd/qx_rewite.txt, tag=jd_rewite, update-interval=-1, opt-parser=false, enabled=true" }, - { - "config": "7 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js, tag=谷歌中英互译, img-url= https://raw.githubusercontent.com/Orz-3/task/master/translate.png, enabled=false" - }, { "config": "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼, img-url=https://raw.githubusercontent.com/Orz-3/task/master/lkyl.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/jd/qx_rewite.txt, tag=jd_rewite, update-interval=-1, opt-parser=false, enabled=true" diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index a7b8e6cb64..7a63cc5a55 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -156,21 +156,6 @@ "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/sinanews.png" ] }, - { - "author" : "@sunert", - "keys" : [ - "now_qq", - "nowqq_cookie" - ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/NOWLIVE.js", - "id" : "NOWLIVE", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/NOWLIVE.js", - "name" : "NOW直播", - "icons" : [ - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/NOWLIVE_mini.png", - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/NOWLIVE.png" - ] - }, { "author" : "@sunert", "keys" : [ @@ -461,21 +446,6 @@ "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/txnews.png" ] }, - { - "author" : "@sunert", - "keys" : [ - "CookieJD", - "CookieJD2" - ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/jingxi.js", - "id" : "jingxi", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/jingxi.js", - "name" : "京喜", - "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/jingxi.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/jingxi.png" - ] - }, { "author" : "@sunert", "keys" : [ From e43ddc96b6b89f029a0baee91f7889cb47fbb17a Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 3 Feb 2021 19:53:39 +0800 Subject: [PATCH 546/721] --- Task/weibo.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/weibo.js b/Task/weibo.js index 6004d19ef8..0cc4118944 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -172,6 +172,7 @@ function doCard() { let result = JSON.parse(data) if (result.status ==10000){ nickname = "昵称: "+result.data.user.nickname + $.setdata(nickname,'wb_nick') signday = result.data.signin.title.split('<')[0] docard = `【每日打卡】 ✅ `+ signday+'天 积分总计: '+result.data.user.energy } From 6f0defc87ef09217b951c46b64d944ca4410cb96 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 3 Feb 2021 22:20:21 +0800 Subject: [PATCH 547/721] --- Task/baidu_speed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 8de7785f26..7643d882db 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -121,7 +121,7 @@ function getsign() { await invite() } else { $.sub = `签到失败❌`, - $.desc = `说明: ` + get_sign.msg, + $.desc = `说明: ` + get_sign.msg+"\n", $.msg($.name, $.sub, $.desc); //$.done() } @@ -310,7 +310,7 @@ async function getConfigs() { tips = arr.tips; count = arr.total_count; $.log("\n"+taskName + tips + "总计" + count + "次 "); - if (arr.taskStatus == 0) { + if (arr.taskStatus == 0&&signs[z].is_checkin!=0) { await $.wait(2000); await get_search("184") } From 4f30ac4188682c101c4702b50ff3a576f1fadaa3 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 4 Feb 2021 23:43:32 +0800 Subject: [PATCH 548/721] --- .github/workflows/kuaishou.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/kuaishou.yml b/.github/workflows/kuaishou.yml index a2f5157953..f8e8183bbc 100644 --- a/.github/workflows/kuaishou.yml +++ b/.github/workflows/kuaishou.yml @@ -1,4 +1,3 @@ - name: 快手视频签到 on: From b634970e023aa2b5c11e89c61846fca7015a6ca0 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 5 Feb 2021 15:17:04 +0800 Subject: [PATCH 549/721] =?UTF-8?q?fix=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/baidu_speed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 7643d882db..76c81a82ee 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -310,7 +310,7 @@ async function getConfigs() { tips = arr.tips; count = arr.total_count; $.log("\n"+taskName + tips + "总计" + count + "次 "); - if (arr.taskStatus == 0&&signs[z].is_checkin!=0) { + if (arr.taskStatus == 0&&$.desc.indexOf("【签到结果】✅")>-1) { await $.wait(2000); await get_search("184") } From 18d87954f4e761308131cdc7c355506b0b2466e8 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 7 Feb 2021 22:19:05 +0800 Subject: [PATCH 550/721] --- Task/Sunert_Task.json | 8 ++++---- Task/sunert.boxjs.json | 16 ++++++++-------- TaskConf/youth/loon.plugin | 11 +++++++++++ TaskConf/youth/qx_rewite.txt | 4 ++-- TaskConf/youth/readme.md | 31 ++++++++++++++++++++++--------- TaskConf/youth/surge.sgmodule | 17 +++++++++++++++++ 6 files changed, 64 insertions(+), 23 deletions(-) create mode 100644 TaskConf/youth/loon.plugin create mode 100644 TaskConf/youth/surge.sgmodule diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index da3c23b34e..e03a69e81c 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -3,10 +3,10 @@ "description": "https://github.com/Sunert/Scripts", "task": [ { - "config": "0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/ICON/moji.png, enabled=true" + "config": "0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/icon/moji.png, enabled=true" }, { - "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/ICON/tvpreview.png, enabled=true" + "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/icon/tvpreview.png, enabled=true" }, { "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js, tag=12306火车时刻, img-url=https://raw.githubusercontent.com/Orz-3/task/master/12306.png, enabled=false" @@ -66,11 +66,11 @@ "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/digit_home/qx_rewite.txt, tag=mydigit_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "*/10 */3 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js, tag=聚看点, img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/jukan.png, enabled=true", + "config": "*/10 */3 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js, tag=聚看点, img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/icon/jukan.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/jukan/qx_rewite.txt, tag=jkd_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "*/30 * * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baidu_speed.js, tag=百度极速版, img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/baiduspeed.png, enabled=true" + "config": "*/30 * * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baidu_speed.js, tag=百度极速版, img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/icon/baiduspeed.png, enabled=true" } ] } diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 7a63cc5a55..761e94a1d8 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -213,8 +213,8 @@ ], "name" : "电视预告", "icons" : [ - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/tvpreview_mini.png", - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/tvpreview.png" + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/tvpreview_mini.png", + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/tvpreview.png" ] }, { @@ -284,8 +284,8 @@ ], "name" : "墨迹天气", "icons" : [ - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/moji_mini.png", - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/moji.png" + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/moji_mini.png", + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/moji.png" ] }, { @@ -343,8 +343,8 @@ ], "name" : "聚看点", "icons" : [ - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/jukan_mini.png", - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/jukan.png" + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/jukan_mini.png", + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/jukan.png" ] }, { @@ -408,8 +408,8 @@ ], "name" : "百度极速任务", "icons" : [ - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/baiduspeed_mini.png", - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/ICON\/baiduspeed.png" + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/baiduspeed_mini.png", + "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/baiduspeed.png" ] }, { diff --git a/TaskConf/youth/loon.plugin b/TaskConf/youth/loon.plugin new file mode 100644 index 0000000000..3179abe83b --- /dev/null +++ b/TaskConf/youth/loon.plugin @@ -0,0 +1,11 @@ +# 中青看点获取Cookie + +[URL Rewrite] +http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true + +[MITM] +hostname = ios.baertt.com, kd.youth.cn \ No newline at end of file diff --git a/TaskConf/youth/qx_rewite.txt b/TaskConf/youth/qx_rewite.txt index a749d567da..c7f3d623a4 100644 --- a/TaskConf/youth/qx_rewite.txt +++ b/TaskConf/youth/qx_rewite.txt @@ -1,6 +1,6 @@ -hostname = *.youth.cn, ios.baertt.com +hostname = kd.youth.cn, ios.baertt.com -https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 152533860d..3b70007521 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -9,14 +9,20 @@ ### IOS配置教程 ``` [MITM] -hostname = *.youth.cn, ios.baertt.com +hostname = kd.youth.cn, ios.baertt.com ``` #### Surge: +* [模块地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/surge.sgmodule) + + ``` +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/surge.sgmodule + ``` + * 本地重写 ``` [Script] 中青看点 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js,script-update-interval=0 -中青看点 = type=http-request,pattern=https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign),script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +中青看点 = type=http-request,pattern=https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/red_packet,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true @@ -29,11 +35,18 @@ hostname = *.youth.cn, ios.baertt.com 中青看点 = type=cron,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js,cronexpr="1 */6 * * *",timeout=20,enable=true ``` #### Loon: - + +* [插件地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/loon.plugin) + + ``` +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/loon.plugin + ``` +* 本地重写 + ``` [Script] cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 -http-request https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true @@ -50,7 +63,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite ``` [rewrite_local] -https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js @@ -82,10 +95,10 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body h | Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | | :-------: | :------: | :-------: | ------ | ------- | -| YOUTH_HEADER | 中青看点 youth.yml | # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | -| YOUTH_ARTBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | -| YOUTH_REDBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | -| YOUTH_TIME | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/user/app_stay.json",
阅读时长请求体: p=xxx | +| YOUTH_HEADER | 中青看点 youth.yml | #或者换行 | 必须 | 请求地址: "https://kd.youth.cn/WebApi/NewTaskIos/getTaskList",
中青签到请求头引用: uid=xxx&cookie_id=xxx&cookie=xxx | +| YOUTH_ARTBODY | 同上 | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | +| YOUTH_REDBODY | 同上 | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | +| YOUTH_TIME | 同上 | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/user/app_stay.json",
阅读时长请求体: p=xxx | | YOUTH_NOTIFY_CONTROL | 同上 | true/false | 可选 | 中青通知开关
默认当转盘次数为50或者100并且余额大于10元时推送通知 | | | | | - | | | YOUTH_READ | 中青阅读 youth_read.yml | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | diff --git a/TaskConf/youth/surge.sgmodule b/TaskConf/youth/surge.sgmodule new file mode 100644 index 0000000000..696b2a062f --- /dev/null +++ b/TaskConf/youth/surge.sgmodule @@ -0,0 +1,17 @@ +#!name= Youth Rewrite +#!desc= 中青极速版获取Cookie +#!system=ios + +[URL Rewrite] +中青看点 = type=http-request,pattern=https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js + +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true + +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/red_packet,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true + +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true + +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true + +[MITM] +hostname = %APPEND% kd.youth.cn,ios.baertt.com \ No newline at end of file From 61d0993500155efc883e71fbcf1a0341f16a479b Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 7 Feb 2021 22:34:51 +0800 Subject: [PATCH 551/721] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E4=B8=AD=E9=9D=92Coo?= =?UTF-8?q?kie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 705 +++++++++++++++++++++++--------------------------- 1 file changed, 319 insertions(+), 386 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 901f83fa87..b462546e0b 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,136 +1,127 @@ /* -更新时间: 2021-01-31 19:00 +更新时间: 2021-02-07 22:30 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 +食用说明请查看本仓库目录Taskconf/youth/readme.md */ let s = 1000 //各数据接口延迟 const $ = new Env("中青看点") let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖每50次通知一次,如需关闭全部通知请设为0 -const YOUTH_HOST = "https://kd.youth.cn/WebApi/"; const notify = $.isNode() ? require('./sendNotify') : ''; const withdrawcash = $.getdata('zqcash')||30 //提现金额 let withdrawUrl =$.getdata('cashurl_zq') let withdrawBody =$.getdata('cashbody_zq') -let logs = $.getdata('zqlogs')||false, rotaryscore=0,doublerotary=0,signresult; -let cookiesArr = [], signheaderVal = '', +let rotaryscore=0,doublerotary=0; +let cookieArr = [], cookie = '', readArr = [], articlebodyVal ='', timeArr = [], timebodyVal = '', redpArr = [], redpbodyVal = '', detail = ``, subTitle = ``; -let CookieYouth = [], ARTBODYs = [], - REDBODYs = [], READTIME = []; -if ($.isNode()) { - if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('#') > -1) { - CookieYouth = process.env.YOUTH_HEADER.split('#'); - } else { - CookieYouth = process.env.YOUTH_HEADER.split() - }; - - if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('&') > -1) { - ARTBODYs = process.env.YOUTH_ARTBODY.split('&'); - } else { - ARTBODYs = process.env.YOUTH_ARTBODY.split() - }; - - if (process.env.YOUTH_REDBODY && process.env.YOUTH_REDBODY.indexOf('&') > -1) { - REDBODYs = process.env.YOUTH_REDBODY.split('&'); - } else { - REDBODYs = process.env.YOUTH_REDBODY.split() - }; - - if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('&') > -1) { - READTIME = process.env.YOUTH_TIME.split('&'); - }else { - READTIME = process.env.YOUTH_TIME.split() - }; -} - -if ($.isNode()) { - Object.keys(CookieYouth).forEach((item) => { - if (CookieYouth[item]) { - cookiesArr.push(CookieYouth[item]) + if($.isNode()){ + if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('#') > -1) { + cookieYouth = process.env.YOUTH_HEADER.split('#'); + } else if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('\n') > -1) { + cookieYouth = process.env.YOUTH_HEADER.split('\n'); + } else { + cookieYouth = [process.env.YOUTH_HEADER] + }; + if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('&') > -1) { + ARTBODYs = process.env.YOUTH_ARTBODY.split('&'); + } else if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('\n') > -1) { + ARTBODYs = process.env.YOUTH_ARTBODY.split('\n'); + } else { + ARTBODYs = [process.env.YOUTH_ARTBODY] + }; + if (process.env.YOUTH_REDBODY && process.env.YOUTH_REDBODY.indexOf('&') > -1) { + REDBODYs = process.env.YOUTH_REDBODY.split('&'); + } else if (process.env.YOUTH_REDBODY && process.env.YOUTH_REDBODY.indexOf('\n') > -1) { + REDBODYs = process.env.YOUTH_REDBODY.split('\n'); + } else { + REDBODYs = [process.env.YOUTH_REDBODY] + }; + if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('&') > -1) { + READTIME = process.env.YOUTH_TIME.split('&'); + } else if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('\n') > -1) { + READTIME = process.env.YOUTH_TIME.split('\n'); + } else { + READTIME = [process.env.YOUTH_TIME] + }; + + Object.keys(cookieYouth).forEach((item) =>{ + if (cookieYouth[item]) { + cookieArr.push(cookieYouth[item]) } - }) - Object.keys(ARTBODYs).forEach((item) => { + }); + Object.keys(ARTBODYs).forEach((item) =>{ if (ARTBODYs[item]) { - readArr.push(ARTBODYs[item]) + readArr.push(ARTBODYs[item]) } - }) - Object.keys(REDBODYs).forEach((item) => { + }); + Object.keys(REDBODYs).forEach((item) =>{ if (REDBODYs[item]) { - redpArr.push(REDBODYs[item]) + redpArr.push(REDBODYs[item]) } - }) - Object.keys(READTIME).forEach((item) => { + }); + Object.keys(READTIME).forEach((item) =>{ if (READTIME[item]) { - timeArr.push(READTIME[item]) + timeArr.push(READTIME[item]) } - }) - console.log(`============ 共${cookiesArr.length}个中青账号 =============\n`) - console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) - } else { - cookiesArr.push($.getdata('youthheader_zq')); + }); + console.log(` ============您共提供${cookieArr.length}个中青账号 =============\n`); + console.log(` ============脚本执行 - 北京时间 (UTC + 8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`); + $.log(`${cookieArr[0]}`) + } else if(!$.isNode()){ +cookieArr.push($.getdata('youthheader_zq')); redpArr.push($.getdata('red_zq')); readArr.push($.getdata('read_zq')); - timeArr.push($.getdata('readtime_zq')); + timeArr.push($.getdata('readtime_zq')) } - -const firstcheck = $.getdata('signt'); -const runtimes = $.getdata('times'); -const opboxtime = $.getdata('opbox'); - if (isGetCookie = typeof $request !== 'undefined') { GetCookie(); $.done() -} - - !(async () => { - if (!cookiesArr[0]) { +}; +!(async () => { + if (!cookieArr[0]) { $.msg($.name, '【提示】请先获取中青看点一cookie') return; } - for (let i = 0; i < cookiesArr.length; i++) { - if (cookiesArr[i]) { - signheaderVal = cookiesArr[i]; + + for (let i = 0; i < cookieArr.length; i++) { + if (cookieArr[i]) { + cookie = cookieArr[i]; articlebodyVal = readArr[i]; timebodyVal = timeArr[i]; redpbodyVal = redpArr[i]; $.index = i + 1; console.log(`-------------------------\n\n开始【中青看点${$.index}】`) - } - await sign(); - await signInfo(); - await friendsign(); - await comApp(); - await ArticleShare(); - await openbox(); - await getAdVideo(); - await gameVideo(); - await readArticle(); - await Articlered(); - await readTime(); + }; + myuid = cookie.match(/uid=\d+/); + await userInfo(); + await kdHost(); + await friendsign(); + await comApp(); + await TaskCenter() + await openbox(); + await getAdVideo(); + await gameVideo(); + await readArticle(); + await Articlered(); + await readTime(); for (k=0;k<5;k++){ await $.wait(1000); await rotary(); + if (rotaryres.status == 0) { rotarynum = ` 转盘${rotaryres.msg}🎉`; break } else if(rotaryres.status == 1){ - console.log("等待1s进行开始转盘任务") + console.log("等待1s进行开始转盘任务") rotaryscore += rotaryres.data.score - $.log("进行"+Number(100-rotaryres.data.remainTurn)+"次转盘,获得"+rotaryres.data.score+"青豆") rotarytimes = rotaryres.data.remainTurn } - if (rotaryres.status == 1 && rotaryres.data.doubleNum !== 0) { - await TurnDouble(); - if (Doubleres.status == 1) { - doublerotary += Doubleres.data.score - } - } } if (rotaryres.status == 1) { @@ -143,7 +134,7 @@ $.log(`转盘双倍: +${doublerotary}青豆 剩余${rotaryres.data.doubleNum}次 } await earningsInfo(); await showmsg(); - if ($.isNode()&&rotaryres.code !== '10010') + if ($.isNode()&&rotaryres.status !== 0) if( rotarytimes && (100-rotarytimes)%95 == 0 && cash >= 10){ await notify.sendNotify($.name + " " + nick, "您的余额约为"+cash+"元,已可以提现"+'\n'+`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n${detail}`) } @@ -151,86 +142,110 @@ $.log(`转盘双倍: +${doublerotary}青豆 剩余${rotaryres.data.doubleNum}次 })() .catch((e) => $.logErr(e)) .finally(() => $.done()) - - -function GetCookie() { - if ($request && $request.method != `OPTIONS`&& $request.url.match(/\/TaskCenter\/(sign|getSign)/)) { - const signheaderVal = JSON.stringify($request.headers) - if (signheaderVal) $.setdata(signheaderVal,'youthheader_zq') - $.log(`${$.name} 获取Cookie: 成功,signheaderVal: ${signheaderVal}`) - $.msg($.name, `获取Cookie: 成功🎉`, ``) - } -else if ($request && $request.method != `OPTIONS`&& $request.url.match(/\/article\/complete/)) { - const articlebodyVal = $request.body - if (articlebodyVal) $.setdata(articlebodyVal,'read_zq') - $.log(`${$.name} 获取阅读: 成功,articlebodyVal: ${articlebodyVal}`) - $.msg($.name, `获取阅读请求: 成功🎉`, ``) - } -else if ($request && $request.method != `OPTIONS`&& $request.url.match(/\/v5\/user\/app_stay/)) { - const timebodyVal = $request.body - if (timebodyVal) $.setdata(timebodyVal,'readtime_zq') - $.log(`${$.name} 获取阅读: 成功,timebodyVal: ${timebodyVal}`) - $.msg($.name, `获取阅读时长: 成功🎉`, ``) - } -else if ($request && $request.method != `OPTIONS`&& $request.url.match(/\/article\/red_packet/)) { - const redpbodyVal = $request.body - if (redpbodyVal) $.setdata(redpbodyVal, 'red_zq') - $.log(`${$.name} 获取惊喜红包: 成功,redpbodyVal: ${redpbodyVal}`) - $.msg($.name, `获取惊喜红包请求: 成功🎉`, ``) + +function kdHost(api, header, body) { + return { + url: 'https://kd.youth.cn/'+api+`&${myuid}`, + headers:{ + 'Accept': '*/*', + 'Accept-Encoding': 'gzip, deflate, br', + 'Referer': 'https://kd.youth.cn/h5/20190301taskcenter/ios/index.html?'+cookie, + 'Host': 'kd.youth.cn', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', + 'X-Requested-With': 'XMLHttpRequest' + }, + body: body, + //timeout: 1000, } -else if ($request && $request.method != `OPTIONS`&& $request.url.match(/\/withdraw\d?\.json/)) { - const withdrawVal = $request.body - const withdrawUrl = $request.url - if (withdrawVal) $.setdata(withdrawVal, 'cashbody_zq') - if (withdrawUrl) $.setdata(withdrawUrl, 'cashurl_zq') - $.log(`${$.name} 获取提现请求: 成功,withdrawUrl: ${withdrawUrl}`) - $.log(`${$.name} 获取提现请求: 成功,withdrawBody: ${withdrawVal}`) - $.msg($.name, `获取提现请求: 成功🎉`, ``) - } - } -function sign() { - return new Promise((resolve, reject) => { - const signurl = { - url: 'https://kd.youth.cn/TaskCenter/sign', - headers: JSON.parse(signheaderVal), +} +function TaskCenter() { + return new Promise((resolve, reject) =>{ + $.post(kdHost('WebApi/NewTaskIos/getTaskList?'), async(error, resp, data) =>{ + try { + taskres = JSON.parse(data) + //$.log(formatJson(data)) + if (taskres.status == 1) { + for (dailys of taskres.list.daily) { + if (dailys.status == "1" && dailys.action != "") { + $.log(dailys.title + "已完成 ,去领取奖励青豆"); + await $.wait(600); + await getAction(dailys.reward_action) + } else if (dailys.status == "2" && dailys.action != "") { + await $.wait(600); + $.log(dailys.title + "," + dailys.but + ",已领取青豆" + dailys.score) + }; + if (dailys.id == "10" && dailys.status == "0") { + $.log(dailys.title + "未完成,去做任务"); + for (x=0;x<5;x++){ + await $.wait(5000); + await recordAdVideo(dailys.reward_action) + } + if (record.status == 0) { + await getAction(dailys.reward_action); + } + } + } } - $.post(signurl, (error, response, data) => { - signres = JSON.parse(data) + } catch(e) { + $.log("获取任务失败," + e) + } finally { + resolve() + } + }) + }) +} + +function getAction(acttype) { + return new Promise((resolve, reject) =>{ + $.get(kdHost(`WebApi/NewTaskIos/sendTwentyScore?action=${acttype}`), (error, resp, data) =>{ + let actres = JSON.parse(data); + //$.log(formatJson(data)); + if (actres.status == 1) { + $.log("获得青豆" + actres.score) + } else if (actres.status == 0) { + $.log(actres.msg) + } + resolve() + }) + }) +} + +function getsign() { + return new Promise((resolve, reject) =>{ + $.post(kdHost('TaskCenter/sign'), (error, resp, data) =>{ + signres = JSON.parse(data); + //$.log(formatJson(data)); if (signres.status == 2) { - signresult = `签到失败,Cookie已失效‼️`; - $.msg($.name, signresult, ""); + sub = `签到失败,Cookie已失效‼️`; + $.msg($.name, sub, ""); return; } else if (signres.status == 1) { - signresult = `【签到结果】成功 🎉 明日+${signres.nextScore} ` - //detail = `【签到结果】成功 🎉 青豆: +${signres.score},明日青豆: +${signres.nextScore}\n` - } else if (signres.status == 0) { - signresult = `【签到结果】重复`; - detail = ""; - } - resolve() + detail = `【签到结果】成功 🎉 青豆: +${signres.score},明日青豆: +${signres.nextScore}\n` + } + resolve() }) }) } -function signInfo() { +function userInfo() { return new Promise((resolve, reject) => { - const infourl = { - url: 'https://kd.youth.cn/TaskCenter/getSign', - headers: JSON.parse(signheaderVal), - } - $.post(infourl, async(error, response, data) => { + $.post(kdHost('TaskCenter/getSign'), async(error, resp, data) => { signinfo = JSON.parse(data); //$.log(formatJson(data)) if (signinfo.status == 1) { - cash = signinfo.data.user.money - signday = signinfo.data.sign_day + cash = signinfo.data.user.money; + signday = signinfo.data.sign_day; subTitle = `【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元`; - if( parseInt(cash) >= withdrawcash && !withdrawBody == "false"){ - await withDraw() - } nick = `账号: ${signinfo.data.user.nickname}`; $.setdata(nick,"zq_nick") - detail = `${signresult}(今天+${signinfo.data.sign_score}青豆) 已连签${signday}天\n<本次收益>:\n`; + if(parseInt(cash) >= withdrawcash && !withdrawBody == false){ + await withDraw() + }; + if(signinfo.data.is_sign == false){ + await getsign(); + } else if(signinfo.data.is_sign == true){ + detail = `【签到结果】🔁 (今天+${signinfo.data.sign_score}青豆) 已连签${signday}天\n <本次收益>:\n` + }; if(signday==7){ await SevCont(); } @@ -248,7 +263,7 @@ function withDraw() { const url = { url: withdrawUrl, headers: { - 'User-Agent': 'KDApp/1.8.2 (iPhone; iOS 14.2; Scale/3.00)' + 'User-Agent': 'KDApp/2.0.0 (iPhone; iOS 14.5; Scale/3.00)' }, body: withdrawBody, } @@ -258,8 +273,7 @@ function withDraw() { detail += `【自动提现】提现${withdrawcash}元成功\n` }else if(withDrawres.error_code == "10002"){ $.log( `自动提现失败,${withDrawres.homeTime.text}`) - } - else { + } else { $.log( `自动提现失败,${withDrawres.message}`) } resolve() @@ -267,155 +281,78 @@ function withDraw() { }) } - - -//打卡分享 -function Cardshare() { - return new Promise((resolve, reject) => { - const starturl = { - url: `${YOUTH_HOST}PunchCard/shareStart?`, - headers: JSON.parse(signheaderVal), - } - $.post(starturl, (error, response, data) => { - sharestart = JSON.parse(data) - //detail += `【打卡分享】${sharestart.msg}\n` - if (sharestart.code == 1) { - setTimeout(() => { - let endurl = { - url: `${YOUTH_HOST}PunchCard/shareEnd?`, - headers: JSON.parse(signheaderVal) - } - $.post(endurl, (error, response, data) => { - shareres = JSON.parse(data) - if (shareres.code == 1) { - detail += `+${shareres.data.score}青豆\n` - } else { - //detail += `【打卡分享】${shareres.msg}\n` - //$.log(`${shareres.msg}`) - } - resolve() - }) - },s*2); - } - }) - }) -} - function SevCont() { - return new Promise((resolve, reject) => { - setTimeout(() => { - $.post({url: `${YOUTH_HOST}PunchCard/luckdraw?`, - headers: JSON.parse(signheaderVal), - }, async(error, response, data) => { - sevres = JSON.parse(data) - if (sevres.code == 1) { - detail += `【七日签到】+${sevres.data.score}青豆 \n` - }else if (sevres.code == 0){ - //detail += `【七日签到】${sevres.msg}\n` - $.log(`七日签到: ${sevres.msg}`) - } - resolve() - }) - },s) - }) -} - -function ArticleShare() { - return new Promise((resolve, reject) => { - setTimeout(() => { - const url = { - url: `https://focus.youth.cn/article/s?signature=P5zR0VlwdZoWp3N4KmdjzYCBXDRQtZ2Kkl8aMQLb6BeXxq2kEr&uid=46746961&phone_code=c6dcf2a3056a5183edc85313fdbf3e6e&scid=35902988&time=1611338382&app_version=1.8.2&sign=0b8019551761cc3ebf0b4775701fd16e`, - headers: JSON.parse(signheaderVal), + return new Promise((resolve, reject) =>{ + $.post(kdHost('PunchCard/luckdraw?'), async(error, resp, data) =>{ + let sevres = JSON.parse(data); + if (sevres.code == 1) { + detail += `【七日签到】 + ${sevres.data.score}青豆\n` + } else if (sevres.code == 0) { + //detail += `【七日签到】${sevres.msg}\n`; + $.log(`七日签到:${sevres.msg}`) } - $.post(url, async(error, response, data) => { - //boxres = JSON.parse(data) - resolve() - }) - },s) + resolve() + }) }) } //开启时段宝箱 function openbox() { - return new Promise((resolve, reject) => { - setTimeout(() => { - const url = { - url: `${YOUTH_HOST}invite/openHourRed`, - headers: JSON.parse(signheaderVal), - } - $.post(url, async(error, response, data) => { - boxres = JSON.parse(data) - if (boxres.code == 1) { - boxretime = boxres.data.time - $.setdata(boxretime, 'opbox') - detail += `【开启宝箱】+${boxres.data.score}青豆 下次奖励${boxres.data.time / 60}分钟\n` - await boxshare(); - }else{ - //detail += `【开启宝箱】${boxres.msg}\n` - $.log(`开启宝箱 :${boxres.msg}`) - } - resolve() - }) - },s) + return new Promise((resolve, reject) =>{ + $.post(kdHost('WebApi/invite/openHourRed'), async(error, resp, data) =>{ + let boxres = JSON.parse(data); + if (boxres.code == 1) { + boxretime = boxres.data.time; + detail += `【开启宝箱】 + ${boxres.data.score}青豆,${boxres.data.time / 60}分钟后再次奖励\n`; + await boxshare(); + } else { + //detail += `【开启宝箱】${boxres.msg}\n`; + $.log(`开启宝箱: ${boxres.msg}`) + } + resolve() }) + }) } //宝箱分享 function boxshare() { return new Promise((resolve, reject) => { - setTimeout(() => { - const url = { - url: `${YOUTH_HOST}invite/shareEnd`, - headers: JSON.parse(signheaderVal), - } - $.post(url, (error, response, data) => { - - shareres = JSON.parse(data) - if (shareres.code == 1) { + $.post(kdHost('WebApi/invite/shareEnd'), (error, resp, data) => { + let shareres = JSON.parse(data); + if (shareres.code == 1) { detail += `【宝箱分享】+${shareres.data.score}青豆\n` - }else{ - //detail += `【宝箱分享】${shareres.msg}\n` + } else { + //detail += `【宝箱分享】${shareres.msg}\n`; //$.log(`${shareres.msg}`) } resolve() - }) - },s*2); + }) }) } function friendsign() { - return new Promise((resolve, reject) => { - const url = { - url: `https://kd.youth.cn/WebApi/ShareSignNew/getFriendActiveList`, - headers: JSON.parse(signheaderVal) + return new Promise((resolve, reject) =>{ + $.get(kdHost('WebApi/ShareSignNew/getFriendActiveList'), async(error, resp, data) =>{ + let addsign = JSON.parse(data); + if (addsign.error_code == "0" && addsign.data.active_list.length > 0) { + friendsitem = addsign.data.active_list; + for (friends of friendsitem) { + if (friends.button == 1) { + await friendSign(friends.uid) + } } - $.get(url, async(error, response, data) => { - let addsign = JSON.parse(data) - if (addsign.error_code == "0"&& addsign.data.active_list.length>0) { - friendsitem = addsign.data.active_list - for(friends of friendsitem){ - if(friends.button==1){ - await friendSign(friends.uid) - } - } - } - resolve() - }) + } + resolve() }) + }) } - - function friendSign(uid) { return new Promise((resolve, reject) => { - const url = { - url: `https://kd.youth.cn/WebApi/ShareSignNew/sendScoreV2?friend_uid=${uid}`, - headers: JSON.parse(signheaderVal) - } - $.get(url, (error, response, data) => { - friendres = JSON.parse(data) + $.get(kdHost(`WebApi/ShareSignNew/sendScoreV2?friend_uid=${uid}`), (error, response, data) => { + let friendres = JSON.parse(data); if (friendres.error_code == "0") { - detail += `【好友红包】+${friendres.data[0].score}个青豆\n` + detail += `【好友红包】+${friendres.data[0].score}个青豆\n`; console.log(`好友签到,我得红包 +${friendres.data[0].score}个青豆`) } resolve() @@ -423,17 +360,11 @@ function friendSign(uid) { }) } - //看视频奖励 function getAdVideo() { return new Promise((resolve, reject) => { - const url = { - url: `https://kd.youth.cn/taskCenter/getAdVideoReward`, - headers: JSON.parse(signheaderVal), - body: 'type=taskCenter' - } - $.post(url, (error, response, data) => { - adVideores = JSON.parse(data) + $.post(kdHost('taskCenter/getAdVideoReward',"",'type=taskCenter'), (error, resp, data) => { + let adVideores = JSON.parse(data); if (adVideores.status == 1) { detail += `【观看视频】+${adVideores.score}个青豆\n` $.log("观看视频广告"+ adVideores.num +"次 +"+adVideores.score+"青豆") @@ -442,14 +373,36 @@ function getAdVideo() { }) }) } +function recordAdVideo(acttype) { + return new Promise((resolve, reject) =>{ + $.get(kdHost(`WebApi/NewTaskIos/recordNum?action=${acttype}`), async(error, resp, data) =>{ + try { + record = JSON.parse(data); + } catch(e) { + $.log("获取任务失败," + e) + } finally { + resolve() + } + }) + }) +} + +function batHost(api, body) { + return { + url: 'https://ios.baertt.com/v5/'+api, + headers: { + 'User-Agent': 'KDApp/2.0.0 (iPhone; iOS 14.5; Scale/3.00)', + 'Host': 'ios.baertt.com', + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: body + } +} + // 激励视频奖励 function gameVideo() { return new Promise((resolve, reject) => { - const url = { - url: `https://ios.baertt.com/v5/Game/GameVideoReward.json`, - body: articlebodyVal, - } - $.post(url, (error, response, data) => { + $.post(batHost('Game/GameVideoReward.json', articlebodyVal), (error, resp, data) => { gameres = JSON.parse(data) if (gameres.success == true) { detail += `【激励视频】${gameres.items.score}\n` @@ -464,16 +417,10 @@ function gameVideo() { }) }) } + function comApp() { return new Promise((resolve, reject) => { - const url = { - url: `https://ios.baertt.com/v5/mission/msgRed.json`, - headers: { - 'User-Agent': 'KDApp/1.8.0 (iPhone; iOS 14.2; Scale/3.00)' - }, - body: articlebodyVal, - } - $.post(url, (error, response, data) => { + $.post(batHost('mission/msgRed.json',articlebodyVal), (error, response, data) => { redres = JSON.parse(data) if (redres.success == true) { detail += `【回访奖励】+${redres.items.score}个青豆\n` @@ -490,14 +437,7 @@ function comApp() { //阅读奖励 function readArticle() { return new Promise((resolve, reject) => { - const url = { - url: `https://ios.baertt.com/v5/article/complete.json`, - headers: { - 'User-Agent': 'KDApp/1.8.2 (iPhone; iOS 14.2; Scale/3.00)' - }, - body: articlebodyVal, - } - $.post(url, (error, response, data) => { + $.post(batHost('article/complete.json',articlebodyVal), (error, response, data) => { readres = JSON.parse(data); if (typeof readres.items.read_score === 'number'&&readres.items.read_score!=0) { detail += `【阅读奖励】+${readres.items.read_score}个青豆\n`; @@ -514,14 +454,7 @@ function readArticle() { //惊喜红包 function Articlered() { return new Promise((resolve, reject) => { - const url = { - url: `https://ios.baertt.com/v5/article/red_packet.json`, - headers: { - 'User-Agent': 'KDApp/1.8.2 (iPhone; iOS 14.2; Scale/3.00)' - }, - body: redpbodyVal, - } - $.post(url, (error, response, data) => { + $.post(batHost('article/red_packet.json',redpbodyVal), (error, response, data) => { redres = JSON.parse(data) if (redres.success == true) { detail += `【惊喜红包】+${redres.items.score}个青豆\n` @@ -536,14 +469,7 @@ function Articlered() { function readTime() { return new Promise((resolve, reject) => { - const url = { - url: `https://ios.baertt.com/v5/user/stay.json`, - headers: { - 'User-Agent': 'KDApp/1.8.2 (iPhone; iOS 14.2; Scale/3.00)' - }, - body: timebodyVal, - } - $.post(url, (error, response, data) => { + $.post(batHost('user/stay.json',timebodyVal), (error, resp, data) => { let timeres = JSON.parse(data) if (timeres.error_code == 0) { readtimes = timeres.time / 60 @@ -564,36 +490,39 @@ function readTime() { //转盘任务 function rotary() { - const rotarbody = signheaderVal.split("&")[15] + '&' + signheaderVal.split("&")[8] - return new Promise((resolve, reject) => { - setTimeout(() => { - const time = new Date().getTime() - const url = { - url: `${YOUTH_HOST}RotaryTable/turnRotary?_=${time}`, - headers: JSON.parse(signheaderVal), - body: rotarbody - } - $.post(url,async (error, response, data) => { - try{ - rotaryres = JSON.parse(data) - await rotaryCheck() - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - }) - }, s); - }) + return new Promise((resolve, reject) =>{ + const time = new Date().getTime(); + const url = { + url: `https://kd.youth.cn/WebApi/RotaryTable/turnRotary?_=${time}`, + headers: { + 'Referer': 'https://kd.youth.cn/html/rotaryTable/index.html?' + cookie + }, + body: cookie, + } + $.post(url, async(error, resp, data) =>{ + try { + rotaryres = JSON.parse(data); + //$.log(formatJson(data)); + if (rotaryres.status==1){ + $.log("进行"+Number(100-rotaryres.data.remainTurn)+"次转盘,获得"+rotaryres.data.score+"青豆") + if(rotaryres.data.score != 0&&rotaryres.data.doubleNum!=0){ + await $.wait(5000); + await TurnDouble(); + } + await rotaryCheck(); + } + } catch(e) { + $.logErr(e+resp); + } finally { + resolve() + } + }) + }) } //转盘宝箱判断 function rotaryCheck() { return new Promise(async(resolve) => { - if (rotaryres.code == 10010) { - return resolve(); - } - let i = 0; while (i <= 3) { if (100 - rotaryres.data.remainTurn >= rotaryres.data.chestOpen[i].times&&rotaryres.data.chestOpen[i].received==0) { @@ -608,15 +537,18 @@ function rotaryCheck() { //开启宝箱 function runRotary(index) { return new Promise((resolve, reject) => { - const rotarbody = signheaderVal.split("&")[15] + '&' + signheaderVal.split("&")[8] + '&num=' + index; - const time = new Date().getTime(); + const rotarbody = cookie + '&num=' + index; + time = new Date().getTime(); const url = { - url: `${YOUTH_HOST}RotaryTable/chestReward?_=${time}`, - headers: JSON.parse(signheaderVal), + url: `https://kd.youth.cn/WebApi/RotaryTable/chestReward?_=${time}`, + headers:{ + 'Referer':'https://kd.youth.cn/html/rotaryTable/index.html?'+cookie + }, body: rotarbody } - $.post(url, (error, response, data) => { - const rotaryresp = JSON.parse(data); + $.post(url, (error, resp, data) => { + let rotaryresp = JSON.parse(data); + //$.log(formatJson(data)); if (rotaryresp.status == 1) { detail += `【转盘宝箱${index}】+${rotaryresp.data.score}个青豆\n`; }else{ @@ -631,49 +563,48 @@ function runRotary(index) { //转盘双倍奖励 function TurnDouble() { - const rotarbody = signheaderVal.split("&")[15] + '&' + signheaderVal.split("&")[8] - return new Promise((resolve, reject) => { - setTimeout(() => { - let time = (new Date()).getTime() - const url = { - url: `${YOUTH_HOST}RotaryTable/toTurnDouble?_=${time}`,headers: JSON.parse(signheaderVal),body: rotarbody} - $.post(url, (error, response, data) => { - try{ - Doubleres = JSON.parse(data) - } catch (e) { - $.logErr(e, resp); - } finally { - resolve() - } - resolve() - }) - },s) + return new Promise((resolve, reject) =>{ + let time = new Date().getTime(); + const url = { + url: `https://kd.youth.cn/WebApi/RotaryTable/toTurnDouble?_=${time}`, + headers: { + 'Referer': 'https://kd.youth.cn/html/rotaryTable/index.html?' + cookie + }, + body: cookie + } + $.post(url, (error, resp, data) =>{ + try { + let Doubleres = JSON.parse(data); + if (Doubleres.data.is_double == 1) { + $.log("获得双倍青豆+" + Doubleres.data.score1); + doublerotary += Doubleres.data.score + } + } catch(e) { + $.logErr(e, resp); + } finally { + resolve() + } }) + }) } function earningsInfo() { - return new Promise((resolve, reject) => { - setTimeout(() => { - const url = { - url: `https://kd.youth.cn/wap/user/balance?${JSON.parse(signheaderVal)['Referer'].split("?")[1]}`, - headers: JSON.parse(signheaderVal), - } - $.get(url, (error, response, data) => { - infores = JSON.parse(data) - if (infores.status == 0) { - detail += `<收益统计>:\n` - for (i = 0; i < infores.history[0].group.length; i++) { - detail += '【' + infores.history[0].group[i].name + '】' + infores.history[0].group[i].money + '个青豆\n' - } - detail += '<今日合计>: ' + infores.history[0].score + " 青豆" - } - resolve() - }) - },s) + return new Promise((resolve, reject) =>{ + $.get(kdHost(`wap/user/balance?`+cookie), (error, response, data) =>{ + infores = JSON.parse(data); + if (infores.status == 0) { + detail += ` <收益统计> :\n` + for (i = 0; i < infores.history[0].group.length; i++) { + detail += '【' + infores.history[0].group[i].name + '】' + infores.history[0].group[i].money + '个青豆\n' + } + detail += '<今日合计>: ' + infores.history[0].score + " 青豆" + } + resolve() }) + }) } async function showmsg() { if (rotaryres.status == 1 && rotarytimes >= 97) { - $.msg($.name + " " + nick, subTitle, detail) //默认前三次为通知 + $.msg($.name + " " + nick, subTitle, detail) //默认前三次为通知 }else if (rotaryres.status == 1 && rotarytimes % notifyInterval == 0) { $.msg($.name + " " + nick, subTitle, detail) //转盘次数/间隔整除时通知; }else if (rotaryres.code == 10010 && notifyInterval != 0) { @@ -684,7 +615,9 @@ async function showmsg() { console.log(`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n`+ detail) } } -function formatJson(json,options){var reg=null,formatted='',pad=0,PADDING=' ';options=options||{};options.newlineAfterColonIfBeforeBraceOrBracket=(options.newlineAfterColonIfBeforeBraceOrBracket===true)?true:false;options.spaceAfterColon=(options.spaceAfterColon===false)?false:true;if(typeof json!=='string'){json=JSON.stringify(json);}else{json=JSON.parse(json);json=JSON.stringify(json)};json=json.replace(/([\{\}])/g,'\r\n$1\r\n');json=json.replace(/([\[\]])/,'\r\n$1\r\n');json=json.replace(/(\,)/g,'$1\r\n');json=json.replace(/(\r\n\r\n)/g,'\r\n');json=json.replace(/\r\n\,/g,',');if(!options.newlineAfterColonIfBeforeBraceOrBracket){json=json.replace(/\:\r\n\{/g,':{');json=json.replace(/\:\r\n\[/g,':[')};if(options.spaceAfterColon){json=json.replace(/\:/g,':')};(json.split('\r\n')).forEach(function(node,index){var i=0,indent=0,padding='';if(node.match(/\{$/)||node.match(/\[$/)){indent=1}else if(node.match(/\}/)||node.match(/\]/)){if(pad!==0){pad-=1}}else{indent=0};for(i=0;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 1be15ac93eca31e76b43fff1c67430ac0f725c04 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 00:18:35 +0800 Subject: [PATCH 552/721] --- Task/Sunert_Task.json | 4 ++-- Task/youth.js | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index e03a69e81c..d7d08d6279 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -66,11 +66,11 @@ "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/digit_home/qx_rewite.txt, tag=mydigit_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "*/10 */3 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js, tag=聚看点, img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/icon/jukan.png, enabled=true", + "config": "*/10 */3 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js, tag=聚看点, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/icon/jukan.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/jukan/qx_rewite.txt, tag=jkd_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "*/30 * * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baidu_speed.js, tag=百度极速版, img-url=https://github.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/icon/baiduspeed.png, enabled=true" + "config": "*/30 * * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baidu_speed.js, tag=百度极速版, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/icon/baiduspeed.png, enabled=true" } ] } diff --git a/Task/youth.js b/Task/youth.js index b462546e0b..b86fea8bfa 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-07 22:30 +更新时间: 2021-02-08 00:20 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md @@ -9,6 +9,7 @@ let s = 1000 //各数据接口延迟 const $ = new Env("中青看点") let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖每50次通知一次,如需关闭全部通知请设为0 +const YOUTH_HOST = "https://kd.youth.cn/WebApi/"; const notify = $.isNode() ? require('./sendNotify') : ''; const withdrawcash = $.getdata('zqcash')||30 //提现金额 let withdrawUrl =$.getdata('cashurl_zq') @@ -177,6 +178,7 @@ function TaskCenter() { if (dailys.id == "10" && dailys.status == "0") { $.log(dailys.title + "未完成,去做任务"); for (x=0;x<5;x++){ + $.log("等待5s执行第"+(x+1)+"次") await $.wait(5000); await recordAdVideo(dailys.reward_action) } @@ -212,7 +214,7 @@ function getAction(acttype) { function getsign() { return new Promise((resolve, reject) =>{ - $.post(kdHost('TaskCenter/sign'), (error, resp, data) =>{ + $.post(kdHost('WebApi/NewTaskIos/sign'), (error, resp, data) =>{ signres = JSON.parse(data); //$.log(formatJson(data)); if (signres.status == 2) { @@ -229,7 +231,7 @@ function getsign() { function userInfo() { return new Promise((resolve, reject) => { - $.post(kdHost('TaskCenter/getSign'), async(error, resp, data) => { + $.post(kdHost('WebApi/NewTaskIos/getSign'), async(error, resp, data) => { signinfo = JSON.parse(data); //$.log(formatJson(data)) if (signinfo.status == 1) { @@ -304,11 +306,11 @@ function openbox() { let boxres = JSON.parse(data); if (boxres.code == 1) { boxretime = boxres.data.time; - detail += `【开启宝箱】 + ${boxres.data.score}青豆,${boxres.data.time / 60}分钟后再次奖励\n`; + detail += `【时段宝箱】 + ${boxres.data.score}青豆,${boxres.data.time / 60}分钟后再次奖励\n`; await boxshare(); } else { - //detail += `【开启宝箱】${boxres.msg}\n`; - $.log(`开启宝箱: ${boxres.msg}`) + //detail += `【时段宝箱】${boxres.msg}\n`; + $.log(`时段宝箱: ${boxres.msg}`) } resolve() }) @@ -538,9 +540,9 @@ function rotaryCheck() { function runRotary(index) { return new Promise((resolve, reject) => { const rotarbody = cookie + '&num=' + index; - time = new Date().getTime(); + const time = new Date().getTime(); const url = { - url: `https://kd.youth.cn/WebApi/RotaryTable/chestReward?_=${time}`, + url: `${YOUTH_HOST}RotaryTable/chestReward?_=${time}`, headers:{ 'Referer':'https://kd.youth.cn/html/rotaryTable/index.html?'+cookie }, From ebc6282762336d79a4adebc3cbf2a68e96685162 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 08:00:17 +0800 Subject: [PATCH 553/721] --- Task/youth.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index b86fea8bfa..bc5a391bcb 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -618,8 +618,7 @@ async function showmsg() { } } -function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/uid=\d+/)+RefererVal.match(/&cookie=[a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9-]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie:成功,signheaderVal:${signheaderVal}`);$.msg($.name,`获取Cookie:成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){constarticlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读:成功,articlebodyVal:${articlebodyVal}`);$.msg($.name,`获取阅读请求:成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){consttimebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读:成功,timebodyVal:${timebodyVal}`);$.msg($.name,`获取阅读时长:成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){constredpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包:成功,redpbodyVal:${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求:成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){constwithdrawVal=$request.body;constwithdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}获取提现请求:成功,withdrawUrl:${withdrawUrl}`);$.log(`${$.name}获取提现请求:成功,withdrawBody:${withdrawVal}`);$.msg($.name,`获取提现请求:成功🎉`,``)}} - +function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/uid=\d+/)+RefererVal.match(/&cookie=[a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9-]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} function formatJson(json,options){var reg=null,formatted='',pad=0,PADDING=' ';options=options||{};options.newlineAfterColonIfBeforeBraceOrBracket=(options.newlineAfterColonIfBeforeBraceOrBracket===true)?true:false;options.spaceAfterColon=(options.spaceAfterColon===false)?false:true;if(typeof json!=='string'){json=JSON.stringify(json);}else{json=JSON.parse(json);json=JSON.stringify(json)};json=json.replace(/([\{\}])/g,'\r\n$1\r\n');json=json.replace(/([\[\]])/,'\r\n$1\r\n');json=json.replace(/(\,)/g,'$1\r\n');json=json.replace(/(\r\n\r\n)/g,'\r\n');json=json.replace(/\r\n\,/g,',');if(!options.newlineAfterColonIfBeforeBraceOrBracket){json=json.replace(/\:\r\n\{/g,':{');json=json.replace(/\:\r\n\[/g,':[')};if(options.spaceAfterColon){json=json.replace(/\:/g,':')};(json.split('\r\n')).forEach(function(node,index){var i=0,indent=0,padding='';if(node.match(/\{$/)||node.match(/\[$/)){indent=1}else if(node.match(/\}/)||node.match(/\]/)){if(pad!==0){pad-=1}}else{indent=0};for(i=0;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 b770ff8dd1d0ea3b409b2a227fc22038990ed54e Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 08:04:45 +0800 Subject: [PATCH 554/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dck=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index bc5a391bcb..c16b96c362 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -618,7 +618,7 @@ async function showmsg() { } } -function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/uid=\d+/)+RefererVal.match(/&cookie=[a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9-]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} +function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/uid=\d+/)+RefererVal.match(/&cookie=[a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9-]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} function formatJson(json,options){var reg=null,formatted='',pad=0,PADDING=' ';options=options||{};options.newlineAfterColonIfBeforeBraceOrBracket=(options.newlineAfterColonIfBeforeBraceOrBracket===true)?true:false;options.spaceAfterColon=(options.spaceAfterColon===false)?false:true;if(typeof json!=='string'){json=JSON.stringify(json);}else{json=JSON.parse(json);json=JSON.stringify(json)};json=json.replace(/([\{\}])/g,'\r\n$1\r\n');json=json.replace(/([\[\]])/,'\r\n$1\r\n');json=json.replace(/(\,)/g,'$1\r\n');json=json.replace(/(\r\n\r\n)/g,'\r\n');json=json.replace(/\r\n\,/g,',');if(!options.newlineAfterColonIfBeforeBraceOrBracket){json=json.replace(/\:\r\n\{/g,':{');json=json.replace(/\:\r\n\[/g,':[')};if(options.spaceAfterColon){json=json.replace(/\:/g,':')};(json.split('\r\n')).forEach(function(node,index){var i=0,indent=0,padding='';if(node.match(/\{$/)||node.match(/\[$/)){indent=1}else if(node.match(/\}/)||node.match(/\]/)){if(pad!==0){pad-=1}}else{indent=0};for(i=0;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 52a8fde94b22bc51d231948125e2985da7c57ccf Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 08:14:48 +0800 Subject: [PATCH 555/721] --- Task/youth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index c16b96c362..4ba905e562 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-08 00:20 +更新时间: 2021-02-08 08:20 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md @@ -306,7 +306,7 @@ function openbox() { let boxres = JSON.parse(data); if (boxres.code == 1) { boxretime = boxres.data.time; - detail += `【时段宝箱】 + ${boxres.data.score}青豆,${boxres.data.time / 60}分钟后再次奖励\n`; + detail += `【时段宝箱】 +${boxres.data.score}青豆,${boxres.data.time / 60}分钟后再次奖励\n`; await boxshare(); } else { //detail += `【时段宝箱】${boxres.msg}\n`; From 93b3c9974b864ed75a225d93a1cdb4d96a11f3bf Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 09:33:01 +0800 Subject: [PATCH 556/721] --- Task/weibo.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index 0cc4118944..6c8ee73dfd 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -122,8 +122,7 @@ if ($.isNode()) { function GetCookie() { if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/\d\/[a-z]+\/\w+\?gsid/)) { const signurlVal = $request.url - const token = signurlVal.split(`?`)[1] - //const signheaderVal = JSON.stringify($request.headers) + const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(s=\w+)/) $.log(`token:${token}`) if (token) $.setdata(token, 'sy_token_wb') $.msg($.name, `获取微博签到Cookie: 成功`, ``) From c1b7f3134f62674dd397d65f507788e64c84d393 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 09:34:04 +0800 Subject: [PATCH 557/721] --- Task/youth.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 4ba905e562..c670275373 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -73,7 +73,6 @@ let cookieArr = [], cookie = '', }); console.log(` ============您共提供${cookieArr.length}个中青账号 =============\n`); console.log(` ============脚本执行 - 北京时间 (UTC + 8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`); - $.log(`${cookieArr[0]}`) } else if(!$.isNode()){ cookieArr.push($.getdata('youthheader_zq')); redpArr.push($.getdata('red_zq')); From 56861c9474eecac141b0ffd8209855a39b3da97f Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 09:47:49 +0800 Subject: [PATCH 558/721] --- Task/weibo.js | 8 ++++---- TaskConf/sina/qx_rewite.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index 6c8ee73dfd..c5f294414b 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -16,7 +16,7 @@ Surge 4.0 : weibo.js = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js,script-update-interval=0 # 获取微博 Cookie. -weibo.js = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/page\/\w+\?gsid,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +weibo.js = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d/user/show/.+(gsid=),script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js # 微博钱包签到Cookie weibo.js = type=http-request,pattern=https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js @@ -26,7 +26,7 @@ Loon 2.1.0+ # 本地脚本 cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 -http-request https:\/\/api\.weibo\.cn\/\d\/page\/\w+\?gsid script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +http-request https:\/\/api\.weibo\.cn\/\d/user/show/.+(gsid=) script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js http-request https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js @@ -37,7 +37,7 @@ QX 1.0.6+ : 0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js [rewrite_local] -https:\/\/api\.weibo\.cn\/\d\/page\/\w+\?gsid url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +https:\/\/api\.weibo\.cn\/\d/user/show/.+(gsid=) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js # 钱包签到Cookie https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js @@ -122,7 +122,7 @@ if ($.isNode()) { function GetCookie() { if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/\d\/[a-z]+\/\w+\?gsid/)) { const signurlVal = $request.url - const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(s=\w+)/) + const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(s=\w+)$/) $.log(`token:${token}`) if (token) $.setdata(token, 'sy_token_wb') $.msg($.name, `获取微博签到Cookie: 成功`, ``) diff --git a/TaskConf/sina/qx_rewite.txt b/TaskConf/sina/qx_rewite.txt index 27f1fd7ea7..cf081e8f63 100644 --- a/TaskConf/sina/qx_rewite.txt +++ b/TaskConf/sina/qx_rewite.txt @@ -4,7 +4,7 @@ https:\/\/newsapi\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center url https:\/\/newsapi\.sina\.cn\/\?resource=userpoint\/signIn url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js -https:\/\/api\.weibo\.cn\/\d\/page\/\w+\?gsid url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +https:\/\/api\.weibo\.cn\/\d/user/show/.+(gsid=) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js From b89c3a8c36aa175ea417fe50dfddad964d9eb4cb Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 09:59:03 +0800 Subject: [PATCH 559/721] --- Task/weibo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index c5f294414b..a072a4367a 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -122,7 +122,7 @@ if ($.isNode()) { function GetCookie() { if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/\d\/[a-z]+\/\w+\?gsid/)) { const signurlVal = $request.url - const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(s=\w+)$/) + const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(s=\w+$)/) $.log(`token:${token}`) if (token) $.setdata(token, 'sy_token_wb') $.msg($.name, `获取微博签到Cookie: 成功`, ``) From c7ac1c7ad9f3186576e07c76768e35fa80dbf289 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 15:57:16 +0800 Subject: [PATCH 560/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dck=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index c670275373..1dcda1cfe9 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -617,7 +617,7 @@ async function showmsg() { } } -function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/uid=\d+/)+RefererVal.match(/&cookie=[a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9-]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} +function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9-]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} function formatJson(json,options){var reg=null,formatted='',pad=0,PADDING=' ';options=options||{};options.newlineAfterColonIfBeforeBraceOrBracket=(options.newlineAfterColonIfBeforeBraceOrBracket===true)?true:false;options.spaceAfterColon=(options.spaceAfterColon===false)?false:true;if(typeof json!=='string'){json=JSON.stringify(json);}else{json=JSON.parse(json);json=JSON.stringify(json)};json=json.replace(/([\{\}])/g,'\r\n$1\r\n');json=json.replace(/([\[\]])/,'\r\n$1\r\n');json=json.replace(/(\,)/g,'$1\r\n');json=json.replace(/(\r\n\r\n)/g,'\r\n');json=json.replace(/\r\n\,/g,',');if(!options.newlineAfterColonIfBeforeBraceOrBracket){json=json.replace(/\:\r\n\{/g,':{');json=json.replace(/\:\r\n\[/g,':[')};if(options.spaceAfterColon){json=json.replace(/\:/g,':')};(json.split('\r\n')).forEach(function(node,index){var i=0,indent=0,padding='';if(node.match(/\{$/)||node.match(/\[$/)){indent=1}else if(node.match(/\}/)||node.match(/\]/)){if(pad!==0){pad-=1}}else{indent=0};for(i=0;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 7187a9d292b8337856b1da620d44d6a032a73a06 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 16:37:45 +0800 Subject: [PATCH 561/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dck=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 1dcda1cfe9..6bdc70369d 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -617,7 +617,7 @@ async function showmsg() { } } -function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9-]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} +function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} function formatJson(json,options){var reg=null,formatted='',pad=0,PADDING=' ';options=options||{};options.newlineAfterColonIfBeforeBraceOrBracket=(options.newlineAfterColonIfBeforeBraceOrBracket===true)?true:false;options.spaceAfterColon=(options.spaceAfterColon===false)?false:true;if(typeof json!=='string'){json=JSON.stringify(json);}else{json=JSON.parse(json);json=JSON.stringify(json)};json=json.replace(/([\{\}])/g,'\r\n$1\r\n');json=json.replace(/([\[\]])/,'\r\n$1\r\n');json=json.replace(/(\,)/g,'$1\r\n');json=json.replace(/(\r\n\r\n)/g,'\r\n');json=json.replace(/\r\n\,/g,',');if(!options.newlineAfterColonIfBeforeBraceOrBracket){json=json.replace(/\:\r\n\{/g,':{');json=json.replace(/\:\r\n\[/g,':[')};if(options.spaceAfterColon){json=json.replace(/\:/g,':')};(json.split('\r\n')).forEach(function(node,index){var i=0,indent=0,padding='';if(node.match(/\{$/)||node.match(/\[$/)){indent=1}else if(node.match(/\}/)||node.match(/\]/)){if(pad!==0){pad-=1}}else{indent=0};for(i=0;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 95c8aa4bf2660bfa909b8ec85f71ed6e1e1ff510 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 17:59:56 +0800 Subject: [PATCH 562/721] fix --- Task/youth.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 6bdc70369d..cdade6f51d 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -439,8 +439,9 @@ function comApp() { function readArticle() { return new Promise((resolve, reject) => { $.post(batHost('article/complete.json',articlebodyVal), (error, response, data) => { + try{ readres = JSON.parse(data); - if (typeof readres.items.read_score === 'number'&&readres.items.read_score!=0) { + if (data.indexOf('read_score')>-1&&readres.items.read_score!=0) { detail += `【阅读奖励】+${readres.items.read_score}个青豆\n`; $.log(`阅读奖励 +${readres.items.read_score}个青豆\n`) } @@ -448,8 +449,12 @@ function readArticle() { //detail += `【阅读奖励】看太久了,换1篇试试\n`; //$.log(readres.items.max_notice) } - resolve() - }) + } catch(e) { + $.logErr(e+resp); + } finally { + resolve() + } + }) }) } //惊喜红包 From 3fcdd8f2d6f274036f2a928d91244dff8467b6b3 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 18:00:22 +0800 Subject: [PATCH 563/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index cdade6f51d..6b4fd0fb71 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-08 08:20 +更新时间: 2021-02-08 18:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md From 078a1b4d1ebd38bd8be7fe32bf6928176d0ad2d5 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 18:03:19 +0800 Subject: [PATCH 564/721] --- Task/youth.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 6b4fd0fb71..f99e244e02 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -102,7 +102,6 @@ if (isGetCookie = typeof $request !== 'undefined') { await userInfo(); await kdHost(); await friendsign(); - await comApp(); await TaskCenter() await openbox(); await getAdVideo(); @@ -213,7 +212,7 @@ function getAction(acttype) { function getsign() { return new Promise((resolve, reject) =>{ - $.post(kdHost('WebApi/NewTaskIos/sign'), (error, resp, data) =>{ + $.post(kdHost('WebApi/NewTaskIos/sign'), async(error, resp, data) =>{ signres = JSON.parse(data); //$.log(formatJson(data)); if (signres.status == 2) { @@ -221,7 +220,8 @@ function getsign() { $.msg($.name, sub, ""); return; } else if (signres.status == 1) { - detail = `【签到结果】成功 🎉 青豆: +${signres.score},明日青豆: +${signres.nextScore}\n` + detail = `【签到结果】成功 🎉 青豆: +${signres.score},明日青豆: +${signres.nextScore}\n`; + await comApp(); } resolve() }) From 9d28b88f935094e6caef226abfd669f6434b2597 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 18:15:15 +0800 Subject: [PATCH 565/721] --- Task/weibo.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index a072a4367a..2c20e631c6 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -155,7 +155,6 @@ function getsign() { if ($.isNode()) { await notify.sendNotify($.name, wbsign) } - return } resolve() }) From c9e55f30c40c1ce8cea326b0d7cd9c0d0c6f670b Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 18:21:46 +0800 Subject: [PATCH 566/721] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/weibo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index 2c20e631c6..9045e1c644 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -122,7 +122,7 @@ if ($.isNode()) { function GetCookie() { if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/\d\/[a-z]+\/\w+\?gsid/)) { const signurlVal = $request.url - const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(s=\w+$)/) + const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(s=\w+$)/)$1$3 $.log(`token:${token}`) if (token) $.setdata(token, 'sy_token_wb') $.msg($.name, `获取微博签到Cookie: 成功`, ``) From c553f4bb401a0952c038d3e48cf58b0850d66d5c Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 18:37:11 +0800 Subject: [PATCH 567/721] --- Task/weibo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index 9045e1c644..fcf88e673a 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -122,7 +122,7 @@ if ($.isNode()) { function GetCookie() { if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/\d\/[a-z]+\/\w+\?gsid/)) { const signurlVal = $request.url - const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(s=\w+$)/)$1$3 + const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(&s=\w+)/) $.log(`token:${token}`) if (token) $.setdata(token, 'sy_token_wb') $.msg($.name, `获取微博签到Cookie: 成功`, ``) From c6e1386449938a7691cb50e06bdb9c1380d6eae7 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 8 Feb 2021 19:31:52 +0800 Subject: [PATCH 568/721] --- .github/workflows/baiduspeed.yml | 22 +- .github/workflows/dianshijia.yml | 23 +- .github/workflows/txnews.yml | 25 +- .github/workflows/weibo.yml | 22 +- .github/workflows/youth.yml | 22 +- Task/dianshijia.js | 2 +- Task/sendNotify.js | 419 ++++++++++++++++++++++++++----- Task/txnews.js | 2 +- 8 files changed, 439 insertions(+), 98 deletions(-) diff --git a/.github/workflows/baiduspeed.yml b/.github/workflows/baiduspeed.yml index cee30f123e..0862f79337 100644 --- a/.github/workflows/baiduspeed.yml +++ b/.github/workflows/baiduspeed.yml @@ -31,10 +31,18 @@ jobs: env: BAIDU_CASH: ${{ secrets.BAIDU_CASH }} BAIDU_TASK: ${{ secrets.BAIDU_TASK }} - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} + PUSH_KEY: ${{ secrets.PUSH_KEY}} + BARK_PUSH: ${{ secrets.BARK_PUSH}} + BARK_SOUND: ${{ secrets.BARK_SOUND}} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN}} + TG_USER_ID: ${{ secrets.TG_USER_ID}} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN}} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET}} + QYWX_KEY: ${{ secrets.QYWX_KEY}} + IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY}} + QQ_SKEY: ${{ secrets.QQ_SKEY}} + QQ_MODE: ${{ secrets.QQ_MODE}} + PUSH_PLUS_TOKEN: ${{ secrets.PUSH_PLUS_TOKEN}} + PUSH_PLUS_USER: ${{ secrets.PUSH_PLUS_USER}} + TG_PROXY_HOST: ${{ secrets.TG_PROXY_HOST}} + TG_PROXY_PORT: ${{ secrets.TG_PROXY_PORT}} \ No newline at end of file diff --git a/.github/workflows/dianshijia.yml b/.github/workflows/dianshijia.yml index 3e328b1d24..761538a24b 100644 --- a/.github/workflows/dianshijia.yml +++ b/.github/workflows/dianshijia.yml @@ -31,10 +31,19 @@ jobs: node Task/dianshijia.js env: DSJ_NOTIFY_CONTROL: ${{ secrets.DSJ_NOTIFY_CONTROL }} - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} + PUSH_KEY: ${{ secrets.PUSH_KEY}} + BARK_PUSH: ${{ secrets.BARK_PUSH}} + BARK_SOUND: ${{ secrets.BARK_SOUND}} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN}} + TG_USER_ID: ${{ secrets.TG_USER_ID}} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN}} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET}} + QYWX_KEY: ${{ secrets.QYWX_KEY}} + IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY}} + QQ_SKEY: ${{ secrets.QQ_SKEY}} + QQ_MODE: ${{ secrets.QQ_MODE}} + PUSH_PLUS_TOKEN: ${{ secrets.PUSH_PLUS_TOKEN}} + PUSH_PLUS_USER: ${{ secrets.PUSH_PLUS_USER}} + TG_PROXY_HOST: ${{ secrets.TG_PROXY_HOST}} + TG_PROXY_PORT: ${{ secrets.TG_PROXY_PORT}} + \ No newline at end of file diff --git a/.github/workflows/txnews.yml b/.github/workflows/txnews.yml index 4b2e5e6d2a..e6aa4c5d8f 100644 --- a/.github/workflows/txnews.yml +++ b/.github/workflows/txnews.yml @@ -36,12 +36,19 @@ jobs: run: | node Task/txnews.js env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TXNEWS_NOTIFY_CONTROL: ${{ secrets.TXNEWS_NOTIFY_CONTROL }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} - + PUSH_KEY: ${{ secrets.PUSH_KEY}} + BARK_PUSH: ${{ secrets.BARK_PUSH}} + BARK_SOUND: ${{ secrets.BARK_SOUND}} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN}} + TG_USER_ID: ${{ secrets.TG_USER_ID}} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN}} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET}} + QYWX_KEY: ${{ secrets.QYWX_KEY}} + IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY}} + QQ_SKEY: ${{ secrets.QQ_SKEY}} + QQ_MODE: ${{ secrets.QQ_MODE}} + PUSH_PLUS_TOKEN: ${{ secrets.PUSH_PLUS_TOKEN}} + PUSH_PLUS_USER: ${{ secrets.PUSH_PLUS_USER}} + TG_PROXY_HOST: ${{ secrets.TG_PROXY_HOST}} + TG_PROXY_PORT: ${{ secrets.TG_PROXY_PORT}} + \ No newline at end of file diff --git a/.github/workflows/weibo.yml b/.github/workflows/weibo.yml index 5c130b5480..83da3ce202 100644 --- a/.github/workflows/weibo.yml +++ b/.github/workflows/weibo.yml @@ -30,10 +30,18 @@ jobs: run: | node Task/weibo.js env: - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} + PUSH_KEY: ${{ secrets.PUSH_KEY}} + BARK_PUSH: ${{ secrets.BARK_PUSH}} + BARK_SOUND: ${{ secrets.BARK_SOUND}} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN}} + TG_USER_ID: ${{ secrets.TG_USER_ID}} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN}} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET}} + QYWX_KEY: ${{ secrets.QYWX_KEY}} + IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY}} + QQ_SKEY: ${{ secrets.QQ_SKEY}} + QQ_MODE: ${{ secrets.QQ_MODE}} + PUSH_PLUS_TOKEN: ${{ secrets.PUSH_PLUS_TOKEN}} + PUSH_PLUS_USER: ${{ secrets.PUSH_PLUS_USER}} + TG_PROXY_HOST: ${{ secrets.TG_PROXY_HOST}} + TG_PROXY_PORT: ${{ secrets.TG_PROXY_PORT}} \ No newline at end of file diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index 399f2a95f1..a99e4a0514 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -36,12 +36,20 @@ jobs: node Task/youth.js env: YOUTH_NOTIFY_CONTROL: ${{ secrets.YOUTH_NOTIFY_CONTROL }} - PUSH_KEY: ${{ secrets.PUSH_KEY }} - BARK_PUSH: ${{ secrets.BARK_PUSH }} - TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} - TG_USER_ID: ${{ secrets.TG_USER_ID }} - BARK_SOUND: ${{ secrets.BARK_SOUND }} - DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} - DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} + PUSH_KEY: ${{ secrets.PUSH_KEY}} + BARK_PUSH: ${{ secrets.BARK_PUSH}} + BARK_SOUND: ${{ secrets.BARK_SOUND}} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN}} + TG_USER_ID: ${{ secrets.TG_USER_ID}} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN}} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET}} + QYWX_KEY: ${{ secrets.QYWX_KEY}} + IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY}} + QQ_SKEY: ${{ secrets.QQ_SKEY}} + QQ_MODE: ${{ secrets.QQ_MODE}} + PUSH_PLUS_TOKEN: ${{ secrets.PUSH_PLUS_TOKEN}} + PUSH_PLUS_USER: ${{ secrets.PUSH_PLUS_USER}} + TG_PROXY_HOST: ${{ secrets.TG_PROXY_HOST}} + TG_PROXY_PORT: ${{ secrets.TG_PROXY_PORT}} diff --git a/Task/dianshijia.js b/Task/dianshijia.js index dfa094d529..9ee5c660db 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -123,7 +123,7 @@ if (isGetCookie = typeof $request !== 'undefined') { await cash(); // 现金 await cashlist(); // 现金列表 await coinlist(); // 金币列表 - if ($.isNode() && drawalCode == '0') { + if ($.isNode() && process.env.DSJ_NOTIFY_CONTROL&& drawalCode == '0') { await notify.sendNotify($.name, subTitle+'\n'+ detail) } } diff --git a/Task/sendNotify.js b/Task/sendNotify.js index c370c2fc72..c71163a4c3 100644 --- a/Task/sendNotify.js +++ b/Task/sendNotify.js @@ -1,41 +1,83 @@ -// 感谢lxk0301大佬,本代码根据@lxk0301大佬编写的代码及教程修改 - +/* + * @Author: LXK9301 https://github.com/LXK9301 + * @Date: 2020-08-19 16:12:40 + * @Last Modified by: LXK9301 + * @Last Modified time: 2021-1-7 17:52:54 + */ +const querystring = require("querystring"); const $ = new Env(); +// =======================================微信server酱通知设置区域=========================================== //此处填你申请的SCKEY. -//注:此处设置github action用户填写到Settings-Secrets里面(Name输入PUSH_KEY) +//(环境变量名 PUSH_KEY) let SCKEY = ''; -const querystring = require("querystring"); + + +// =======================================QQ酷推通知设置区域=========================================== +//此处填你申请的SKEY(具体详见文档 https://cp.xuthus.cc/) +//(环境变量名 QQ_SKEY) +let QQ_SKEY = ''; +//此处填写私聊或群组推送,默认私聊(send[私聊]、group[群聊]、wx[个微]、ww[企微]、email[邮件]) +let QQ_MODE = 'send'; + +// =======================================Bark App通知设置区域=========================================== //此处填你BarkAPP的信息(IP/设备码,例如:https://api.day.app/XXXXXXXX) -//注:此处设置github action用户填写到Settings-Secrets里面(Name输入BARK_PUSH) let BARK_PUSH = ''; //BARK app推送铃声,铃声列表去APP查看复制填写 -//注:此处设置github action用户填写到Settings-Secrets里面(Name输入BARK_SOUND , Value输入app提供的铃声名称,例如:birdsong) let BARK_SOUND = ''; + +// =======================================telegram机器人通知设置区域=========================================== //此处填你telegram bot 的Token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw -//注:此处设置github action用户填写到Settings-Secrets里面(Name输入TG_BOT_TOKEN) +//(环境变量名 TG_BOT_TOKEN) let TG_BOT_TOKEN = ''; //此处填你接收通知消息的telegram用户的id,例如:129xxx206 -//注:此处设置github action用户填写到Settings-Secrets里面(Name输入TG_USER_ID) +//(环境变量名 TG_USER_ID) let TG_USER_ID = ''; +// =======================================钉钉机器人通知设置区域=========================================== //此处填你钉钉 bot 的webhook,例如:5a544165465465645d0f31dca676e7bd07415asdasd -//注:此处设置github action用户填写到Settings-Secrets里面(Name输入DD_BOT_TOKEN) +//(环境变量名 DD_BOT_TOKEN) let DD_BOT_TOKEN = ''; //密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 let DD_BOT_SECRET = ''; -//以下为脚本运行通知开关,true为不推送,false为推送通知 -let IGOT_PUSH_KEY = ''; -let txnewsNotifyControl = false;//(默认腾讯新闻脚本推送通知) +// =======================================企业微信机器人通知设置区域=========================================== +//此处填你企业微信机器人的 webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa +//(环境变量名 QYWX_KEY) +let QYWX_KEY = ''; -let youthNotifyControl = false;//(默认中青脚本推送通知) +// =======================================企业微信应用消息通知设置区域=========================================== +//此处填你企业微信应用消息的 值(详见文档 https://work.weixin.qq.com/api/doc/90000/90135/90236),依次填上corpid的值,corpsecret的值,touser的值,agentid的值,素材库图片id(见https://github.com/LXK9301/jd_scripts/issues/519) 注意用,号隔开,例如:wwcff56746d9adwers,B-791548lnzXBE6_BWfxdf3kSTMJr9vFEPKAbh6WERQ,mingcheng,1000001,2COXgjH2UIfERF2zxrtUOKgQ9XklUqMdGSWLBoW_lSDAdafat +//corpid的值,corpsecret的值,touser的值,agentid的值,素材库图片id的获取,可查看此教程(http://note.youdao.com/s/HMiudGkb) +//增加一个选择推送消息类型,用图文消息直接填写素材库图片id的值,用卡片消息就填写0(就是数字零) +//(环境变量名 QYWX_AM) +let QYWX_AM = ''; -let dsjNotifyControl = true;//(默认电视家脚本推送不通知) +// =======================================iGot聚合推送通知设置区域=========================================== +//此处填您iGot的信息(推送key,例如:https://push.hellyw.com/XXXXXXXX) +let IGOT_PUSH_KEY = ''; + +// =======================================push+设置区域======================================= +//官方文档:https://pushplus.hxtrip.com/ +//PUSH_PLUS_TOKEN:微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送 +//PUSH_PLUS_USER: 一对多推送的"群组编码"(一对多推送下面->您的群组(如无则新建)->群组编码,如果您是创建群组人。也需点击"查看二维码"扫描绑定,否则不能接受群组消息推送) +let PUSH_PLUS_TOKEN = ''; +let PUSH_PLUS_USER = ''; +//==========================云端环境变量的判断与接收========================= if (process.env.PUSH_KEY) { SCKEY = process.env.PUSH_KEY; } + +if (process.env.QQ_SKEY) { + QQ_SKEY = process.env.QQ_SKEY; +} + +if (process.env.QQ_MODE) { + QQ_MODE = process.env.QQ_MODE; +} + + if (process.env.BARK_PUSH) { if(process.env.BARK_PUSH.indexOf('https') > -1 || process.env.BARK_PUSH.indexOf('http') > -1) { //兼容BARK自建用户 @@ -66,26 +108,45 @@ if (process.env.DD_BOT_TOKEN) { } } +if (process.env.QYWX_KEY) { + QYWX_KEY = process.env.QYWX_KEY; +} + +if (process.env.QYWX_AM) { + QYWX_AM = process.env.QYWX_AM; +} + if (process.env.IGOT_PUSH_KEY) { IGOT_PUSH_KEY = process.env.IGOT_PUSH_KEY } -if (process.env.YOUTH_NOTIFY_CONTROL && process.env.YOUTH_NOTIFY_CONTROL==false) { - youthNotifyControl = process.env.YOUTH_NOTIFY_CONTROL; +if (process.env.PUSH_PLUS_TOKEN) { + PUSH_PLUS_TOKEN = process.env.PUSH_PLUS_TOKEN; } -if (process.env.TXNEWS_NOTIFY_CONTROL && process.env.TXNEWS_NOTIFY_CONTROL==false) { - txnewsNotifyControl = process.env.TXNEWS_NOTIFY_CONTROL; -} -if (process.env.DSJ_NOTIFY_CONTROL && process.env.DSJ_NOTIFY_CONTROL==false) { - dsjNotifyControl = process.env.DSJ_NOTIFY_CONTROL; +if (process.env.PUSH_PLUS_USER) { + PUSH_PLUS_USER = process.env.PUSH_PLUS_USER; } +//==========================云端环境变量的判断与接收========================= + -async function sendNotify(text, desp) { - //提供三种通知 - await serverNotify(text, desp); - await BarkNotify(text, desp); - await tgBotNotify(text, desp); - await ddBotNotify(text, desp) +async function sendNotify(text, desp, params = {}) { + //提供7种通知 + desp += `\n本脚本开源免费使用 By:https://github.com/LXK9301/jd_scripts`; + await Promise.all([ + serverNotify(text, desp),//微信server酱 + pushPlusNotify(text, desp)//pushplus(推送加) + ]) + //由于上述两种微信通知需点击进去才能查看到详情,故text(标题内容)携带了账号序号以及昵称信息,方便不点击也可知道是哪个京东哪个活动 + text = text.match(/.*?(?=\s?-)/g) ? text.match(/.*?(?=\s?-)/g)[0] : text; + await Promise.all([ + BarkNotify(text, desp, params),//iOS Bark APP + tgBotNotify(text, desp),//telegram 机器人 + ddBotNotify(text, desp),//钉钉机器人 + qywxBotNotify(text, desp), //企业微信机器人 + qywxamNotify(text, desp), //企业微信应用消息推送 + iGotNotify(text, desp, params),//iGot + CoolPush(text, desp)//QQ酷推 + ]) } function serverNotify(text, desp, timeout = 2100) { @@ -104,14 +165,15 @@ function serverNotify(text, desp, timeout = 2100) { $.post(options, (err, resp, data) => { try { if (err) { - console.log('\n发送通知调用API失败!!\n') + console.log('发送通知调用API失败!!\n') console.log(err); } else { data = JSON.parse(data); if (data.errno === 0) { - console.log('\nserver酱发送通知消息成功\n') + console.log('server酱发送通知消息成功\n') } else if (data.errno === 1024) { - console.log('\nPUSH_KEY 错误\n') + // 一分钟内发送相同的内容会触发 + console.log(`server酱发送通知消息异常: ${data.errmsg}\n`) } else { console.log(`server酱发送通知消息异常\n${JSON.stringify(data)}`) } @@ -124,12 +186,85 @@ function serverNotify(text, desp, timeout = 2100) { }) }, timeout) } else { - console.log('\n您未提供server酱的SCKEY,取消微信推送消息通知\n'); + console.log('您未提供server酱的SCKEY,取消微信推送消息通知\n'); resolve() } }) } +function CoolPush(text, desp) { + return new Promise(resolve => { + if (QQ_SKEY) { + let options = { + url: `https://push.xuthus.cc/${QQ_MODE}/${QQ_SKEY}`, + headers: { + 'Content-Type': 'application/json' + } + } + + // 已知敏感词 + text = text.replace(/京豆/g, "豆豆"); + desp = desp.replace(/京豆/g, ""); + desp = desp.replace(/🐶/g, ""); + desp = desp.replace(/红包/g, "H包"); + + switch (QQ_MODE) { + case "email": + options.json = { + "t": text, + "c": desp, + }; + break; + default: + options.body = `${text}\n\n${desp}`; + } + + let pushMode = function(t) { + switch (t){ + case "send": + return "个人"; + case "group": + return "QQ群"; + case "wx": + return "微信"; + case "ww": + return "企业微信"; + case "email": + return "邮件"; + default: + return "未知方式" + } + } + + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`发送${pushMode(QQ_MODE)}通知调用API失败!!\n`) + console.log(err); + } else { + data = JSON.parse(data); + if (data.code === 200) { + console.log(`酷推发送${pushMode(QQ_MODE)}通知消息成功\n`) + } else if (data.code === 400) { + console.log(`QQ酷推(Cool Push)发送${pushMode(QQ_MODE)}推送失败:${data.msg}\n`) + } else if (data.code === 503) { + console.log(`QQ酷推出错,${data.message}:${data.data}\n`) + }else{ + console.log(`酷推推送异常: ${JSON.stringify(data)}`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + } else { + console.log('您未提供酷推的SKEY,取消QQ推送消息通知\n'); + resolve() + } + }) +} function BarkNotify(text, desp, params={}) { return new Promise(resolve => { @@ -143,14 +278,14 @@ function BarkNotify(text, desp, params={}) { $.get(options, (err, resp, data) => { try { if (err) { - console.log('\nBark APP发送通知调用API失败!!\n') + console.log('Bark APP发送通知调用API失败!!\n') console.log(err); } else { data = JSON.parse(data); if (data.code === 200) { - console.log('\nBark APP发送通知消息成功\n') + console.log('Bark APP发送通知消息成功\n') } else { - console.log(`\n${data.message}\n`); + console.log(`${data.message}\n`); } } } catch (e) { @@ -160,7 +295,7 @@ function BarkNotify(text, desp, params={}) { } }) } else { - console.log('\n您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知\n'); + console.log('您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知\n'); resolve() } }) @@ -191,16 +326,16 @@ function tgBotNotify(text, desp) { $.post(options, (err, resp, data) => { try { if (err) { - console.log('\ntelegram发送通知消息失败!!\n') + console.log('telegram发送通知消息失败!!\n') console.log(err); } else { data = JSON.parse(data); if (data.ok) { - console.log('\nTelegram发送通知消息完成。\n') + console.log('Telegram发送通知消息完成。\n') } else if (data.error_code === 400) { - console.log('\n请主动给bot发送一条消息并检查接收用户ID是否正确。\n') + console.log('请主动给bot发送一条消息并检查接收用户ID是否正确。\n') } else if (data.error_code === 401){ - console.log('\nTelegram bot token 填写错误。\n') + console.log('Telegram bot token 填写错误。\n') } } } catch (e) { @@ -210,12 +345,11 @@ function tgBotNotify(text, desp) { } }) } else { - console.log('\n您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知\n'); + console.log('您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知\n'); resolve() } }) } - function ddBotNotify(text, desp) { return new Promise(resolve => { const options = { @@ -240,14 +374,14 @@ function ddBotNotify(text, desp) { $.post(options, (err, resp, data) => { try { if (err) { - console.log('\n钉钉发送通知消息失败!!\n') + console.log('钉钉发送通知消息失败!!\n') console.log(err); } else { data = JSON.parse(data); if (data.errcode === 0) { - console.log('\n钉钉发送通知消息完成。\n') + console.log('钉钉发送通知消息完成。\n') } else { - console.log(`\n${data.errmsg}\n`) + console.log(`${data.errmsg}\n`) } } } catch (e) { @@ -260,14 +394,14 @@ function ddBotNotify(text, desp) { $.post(options, (err, resp, data) => { try { if (err) { - console.log('\n钉钉发送通知消息失败!!\n') + console.log('钉钉发送通知消息失败!!\n') console.log(err); } else { data = JSON.parse(data); if (data.errcode === 0) { - console.log('\n钉钉发送通知消息完成。\n') + console.log('钉钉发送通知消息完成。\n') } else { - console.log(`\n${data.errmsg}\n`) + console.log(`${data.errmsg}\n`) } } } catch (e) { @@ -277,19 +411,147 @@ function ddBotNotify(text, desp) { } }) } else { - console.log('\n您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n'); + console.log('您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n'); resolve() } }) } +function qywxBotNotify(text, desp) { + return new Promise(resolve => { + const options = { + url: `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${QYWX_KEY}`, + json: { + msgtype: 'text', + text: { + content: ` ${text}\n\n${desp}`, + }, + }, + headers: { + 'Content-Type': 'application/json', + }, + }; + if (QYWX_KEY) { + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('企业微信发送通知消息失败!!\n'); + console.log(err); + } else { + data = JSON.parse(data); + if (data.errcode === 0) { + console.log('企业微信发送通知消息完成。\n'); + } else { + console.log(`${data.errmsg}\n`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }); + } else { + console.log('您未提供企业微信机器人推送所需的QYWX_KEY,取消企业微信推送消息通知\n'); + resolve(); + } + }); +} + +function qywxamNotify(text, desp) { + return new Promise(resolve => { + if (QYWX_AM) { + var QYWX_AM_AY = QYWX_AM.split(','); + const options_accesstoken = { + url: `https://qyapi.weixin.qq.com/cgi-bin/gettoken`, + json: { + corpid:`${QYWX_AM_AY[0]}`, + corpsecret:`${QYWX_AM_AY[1]}`, + }, + headers: { + 'Content-Type': 'application/json', + }, + }; + $.post(options_accesstoken, (err, resp, data) => { + html=desp.replace(/\n/g,"
") + var json = JSON.parse(data); + accesstoken = json.access_token; + const options_textcard = { + url: `https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${accesstoken}`, + json: { + touser:`${QYWX_AM_AY[2]}`, + agentid:`${QYWX_AM_AY[3]}`, + msgtype: 'textcard', + textcard: { + title: `${text}`, + description: `${desp}`, + url: '127.0.0.1', + btntxt: '更多' + }, + safe:'0', + }, + headers: { + 'Content-Type': 'application/json', + }, + }; + const options_mpnews = { + url: `https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${accesstoken}`, + json: { + touser:`${QYWX_AM_AY[2]}`, + agentid:`${QYWX_AM_AY[3]}`, + msgtype: 'mpnews', + mpnews: { + articles: [ + { + title: `${text}`, + thumb_media_id: `${QYWX_AM_AY[4]}`, + author : `智能助手` , + content_source_url: ``, + content : `${html}`, + digest: `${desp}` + } + ] + }, + safe:'0', + }, + headers: { + 'Content-Type': 'application/json', + }, + }; + $.post((QYWX_AM_AY[4]==0)?options_textcard:options_mpnews, (err, resp, data) => { + try { + if (err) { + console.log('企业微信应用消息发送通知消息失败!!\n'); + console.log(err); + } else { + data = JSON.parse(data); + if (data.errcode === 0) { + console.log('企业微信应用消息发送通知消息完成。\n'); + } else { + console.log(`${data.errmsg}\n`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }); + }); + } else { + console.log('您未提供企业微信应用消息推送所需的QYWX_AM,取消企业微信应用消息推送消息通知\n'); + resolve(); + } + }); +} + function iGotNotify(text, desp, params={}){ return new Promise(resolve => { if (IGOT_PUSH_KEY) { // 校验传入的IGOT_PUSH_KEY是否有效 const IGOT_PUSH_KEY_REGX = new RegExp("^[a-zA-Z0-9]{24}$") if(!IGOT_PUSH_KEY_REGX.test(IGOT_PUSH_KEY)) { - console.log('\n您所提供的IGOT_PUSH_KEY无效\n') + console.log('您所提供的IGOT_PUSH_KEY无效\n') resolve() return } @@ -303,14 +565,14 @@ function iGotNotify(text, desp, params={}){ $.post(options, (err, resp, data) => { try { if (err) { - console.log('\n发送通知调用API失败!!\n') + console.log('发送通知调用API失败!!\n') console.log(err); } else { if(typeof data === 'string') data = JSON.parse(data); if (data.ret === 0) { - console.log('\niGot发送通知消息成功\n') + console.log('iGot发送通知消息成功\n') } else { - console.log(`\niGot发送通知消息失败:${data.errMsg}\n`) + console.log(`iGot发送通知消息失败:${data.errMsg}\n`) } } } catch (e) { @@ -320,19 +582,58 @@ function iGotNotify(text, desp, params={}){ } }) } else { - console.log('\n您未提供iGot的推送IGOT_PUSH_KEY,取消iGot推送消息通知\n'); + console.log('您未提供iGot的推送IGOT_PUSH_KEY,取消iGot推送消息通知\n'); resolve() } }) } + +function pushPlusNotify(text, desp) { + return new Promise(resolve => { + if (PUSH_PLUS_TOKEN) { + desp = desp.replace(/[\n\r]/g, '
'); // 默认为html, 不支持plaintext + const body = { + token: `${PUSH_PLUS_TOKEN}`, + title: `${text}`, + content:`${desp}`, + topic: `${PUSH_PLUS_USER}` + }; + const options = { + url: `https://pushplus.hxtrip.com/send`, + body: JSON.stringify(body), + headers: { + 'Content-Type': ' application/json' + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`push+发送${PUSH_PLUS_USER ? '一对多' : '一对一'}通知消息失败!!\n`) + console.log(err); + } else { + data = JSON.parse(data); + if (data.code === 200) { + console.log(`push+发送${PUSH_PLUS_USER ? '一对多' : '一对一'}通知消息完成。\n`) + } else { + console.log(`push+发送${PUSH_PLUS_USER ? '一对多' : '一对一'}通知消息失败:${data.msg}\n`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + } else { + console.log('您未提供push+推送所需的PUSH_PLUS_TOKEN,取消push+推送消息通知\n'); + resolve() + } + }) +} + module.exports = { sendNotify, - SCKEY, - BARK_PUSH, - TG_BOT_TOKEN, - TG_USER_ID, - DD_BOT_TOKEN, - IGOT_PUSH_KEY + BARK_PUSH } // prettier-ignore function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),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}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{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=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"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 e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;$.isMute||(this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o))),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} diff --git a/Task/txnews.js b/Task/txnews.js index b5d06411b4..8691797c6e 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -120,7 +120,7 @@ if (isGetCookie) { await getTotal(); await StepsTotal(); await showmsg(); - if ($.isNode()){ + if ($.isNode()&&process.env.TXNEWS_NOTIFY_CONTROL){ if (readnum%notifyInterval==0&&cashtotal > 2){ await notify.sendNotify($.name,subTile+'\n'+detail) } From 1b1187d0c17510c0cd87a03977b0b2e26f82ca2b Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 9 Feb 2021 09:50:24 +0800 Subject: [PATCH 569/721] --- Task/weibo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index fcf88e673a..6cefc3e160 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -120,7 +120,7 @@ if ($.isNode()) { function GetCookie() { -if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/\d\/[a-z]+\/\w+\?gsid/)) { +if ($request && $request.method != 'OPTIONS' && $request.url.match(/\d/user/show/.+(gsid=)/)) { const signurlVal = $request.url const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(&s=\w+)/) $.log(`token:${token}`) From bdfb098b04eff3db70c166487be02420d8d389f6 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 9 Feb 2021 10:11:54 +0800 Subject: [PATCH 570/721] --- Task/sendNotify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/sendNotify.js b/Task/sendNotify.js index c71163a4c3..1541580783 100644 --- a/Task/sendNotify.js +++ b/Task/sendNotify.js @@ -131,7 +131,7 @@ if (process.env.PUSH_PLUS_USER) { async function sendNotify(text, desp, params = {}) { //提供7种通知 - desp += `\n本脚本开源免费使用 By:https://github.com/LXK9301/jd_scripts`; + //desp += `\n本脚本开源免费使用 By:https://github.com/LXK9301/jd_scripts`; await Promise.all([ serverNotify(text, desp),//微信server酱 pushPlusNotify(text, desp)//pushplus(推送加) From fa8e5f59ef7d46d45cca6f8d0295b88da054ba77 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 9 Feb 2021 14:53:41 +0800 Subject: [PATCH 571/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index f99e244e02..86ba5327fb 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -284,7 +284,7 @@ function withDraw() { function SevCont() { return new Promise((resolve, reject) =>{ - $.post(kdHost('PunchCard/luckdraw?'), async(error, resp, data) =>{ + $.post(kdHost('WebApi/PunchCard/luckdraw?'), async(error, resp, data) =>{ let sevres = JSON.parse(data); if (sevres.code == 1) { detail += `【七日签到】 + ${sevres.data.score}青豆\n` From ede74d4fe433ef45a1c21c1cc96564844db46a7a Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 9 Feb 2021 18:53:11 +0800 Subject: [PATCH 572/721] --- README.md | 2 + Surge_Task/Sunert_Cookie.sgmodule | 64 +++++++++++++++++++++++++++ Surge_Task/Sunert_Task.sgmodule | 57 ++++++++++++++++++++++++ TaskConf/README.md | 72 +++++++++++++++++++++++++++++++ TaskConf/youth/readme.md | 2 +- 5 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 Surge_Task/Sunert_Cookie.sgmodule create mode 100644 Surge_Task/Sunert_Task.sgmodule create mode 100644 TaskConf/README.md diff --git a/README.md b/README.md index 444000db6d..90b08aa099 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@
+[跳转到任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf) --- [跳转到脚本列表](https://github.com/Sunert/Scripts/tree/master/Task) + *** ## 免责声明: diff --git a/Surge_Task/Sunert_Cookie.sgmodule b/Surge_Task/Sunert_Cookie.sgmodule new file mode 100644 index 0000000000..78c94f0675 --- /dev/null +++ b/Surge_Task/Sunert_Cookie.sgmodule @@ -0,0 +1,64 @@ +#!name=Task Cookie - By Sunert +#!desc=该模块适用于获取任务Cookie,仅集成Sunert签到任务Cookie。您可以在使用后手动将其禁用,以免产生不必要的MITM.。 +#!system=ios + +# GitHub主页(https://github.com/Sunert/Scripts) +# TG聊天群 (https://t.me/EveryLucky) +# 定时脚本 + +[Script] +# 定时脚本Cookie + +# 数码之家 Cookie. +数码之家 = type=http-request,pattern=https:\/\/www\.mydigit\.cn\/plugin\.php\?id=k_misign:sign&operation=qiandao,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js + +# 中青看点 +中青看点 = type=http-request,pattern=https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js + +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true + +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/red_packet,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true + +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true + + +# 腾讯新闻 +腾讯新闻 = type=http-request,pattern=https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, requires-body=true + +# 新浪新闻 +新浪新闻 = type=http-request,pattern=https:\/\/newsapi\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js + +新浪新闻 = type=http-request,pattern=https:\/\/newsapi\.sina\.cn\/\?resource=userpoint\/signIn,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js + +# 新浪微博 +微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/page\/\w+\?gsid,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js + +# 微博钱包签到 +钱包签到 = type=http-request,pattern=https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js + +# 快手极速版 +快手极速版 = type=http-request,pattern=https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js + +# 来客有礼 +来客有礼 = type=http-request,pattern=https:\/\/draw\.jdfcloud\.com\/\/api\/bean\/square\/silverBean\/task\/get\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js + +# 电视家 +电视家签到 = type=http-request,pattern=http:\/\/act\.gaoqingdianshi\.com\/\/api\/v4\/sign\/signin,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js + +电视家兑换 = type=http-request,pattern=http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js + +# 电信套餐查询 +电信套餐查询 = script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js,type=http-request,pattern=https?:\/\/e\.189\.cn\/store\/user\/package_detail\.do + +# 聚看点 +中青看点 = type=https:\/\/www\.xiaodouzhuan\.cn\/jkd\/newMobileMenu\/infoMe\.action,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js, requires-body=true + + +[MITM] +hostname = %APPEND% www.mydigit.cn, kd.youth.cn, ios.baertt.com, api.inews.qq.com, newsapi.sina.cn, api.weibo.cn, pay.sc.weibo.com, nebula.kuaishou.com, draw.jdfcloud.com, e.189.cn, www.xiaodouzhuan.cn + + + + + + diff --git a/Surge_Task/Sunert_Task.sgmodule b/Surge_Task/Sunert_Task.sgmodule new file mode 100644 index 0000000000..1b251143e3 --- /dev/null +++ b/Surge_Task/Sunert_Task.sgmodule @@ -0,0 +1,57 @@ +#!name=Task - By Sunert +#!desc=该模块适用于定时签到:集成Sunert签到脚本。建议本地安装以便自定义修改签到时间。 +#!system=ios + +# GitHub主页(https://github.com/Sunert/Scripts) +# TG聊天群 (https://t.me/EveryLucky) +# 定时脚本 + +[Script] +# 定时脚本 + +# > 电视节目预告 +电视节目预告 = type=cron,cronexp=0 0 8 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js,script-update-interval=0 + +# > 12306余票及列车时刻表查询 +12306 = type=cron,cronexp=0 0 8 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js + +# > 实时货币换算 +实时汇率 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js,script-update-interval=0 + +# > 中国电信套餐 +中国电信套餐 = type=cron,cronexp=50 4 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js,script-update-interval=0 + +# > 腾讯新闻 +腾讯新闻 = type=cron,cronexp=35 */7 */2 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js,script-update-interval=0 + +# > 京东到家 +京东到家 = type=cron,cronexp=25 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js,script-update-interval=0 + +# > 微信小程序-来客有礼 +# 来客有礼 = type=cron,cronexp=30 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js,script-update-interval=0 + +# > 电视家 +电视家 = type=cron,cronexp=0 0 7,12,22 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js,script-update-interval=0 + +# > 快手极速版 +快手极速版 = type=cron,cronexp=40 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js,script-update-interval=0 + +# > 微博签到 & 微博钱包 +微博(钱包) = type=cron,cronexp=35 2 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js,script-update-interval=0 + +# > 新浪新闻 +新浪新闻 = type=cron,cronexp=0 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js + +# > 中青看点极速版 +中青看点极速版 = type=cron,cronexp=35 */5 */3 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js,script-update-interval=0 + +# > 数码之家 +数码之家 = type=cron,cronexp=0 7 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js,script-update-interval=0 + +# > 聚看点 +聚看点 = type=cron,cronexp=0 */30 * * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js,script-update-interval=0 + +# > 谷歌翻译 +谷歌翻译 = type=cron,cronexp=0 5 10 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js,script-update-interval=0 + + diff --git a/TaskConf/README.md b/TaskConf/README.md new file mode 100644 index 0000000000..7ce27e514d --- /dev/null +++ b/TaskConf/README.md @@ -0,0 +1,72 @@ +#目录导航 + +本目录为快捷直达所需配置地址页,点击蓝色字体即可 +相关配置还在完善中,敬请等待 + +> [回到主页](https://github.com/Sunert/Scripts) + +### 一、本仓库重写配置集 + * Surge + * [Cookie]() + * [任务模块]() +

+ * Loon + * [Cookie]() + * [任务模块]() +

+ * Quantumult X + * [Cookie]() + * [任务仓库](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Sunert_Task.json) + +### 二、[Boxjs订阅](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sunert.boxjs.json) + + ``` +https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sunert.boxjs.json + ``` + +### 三、任务配置目录 + + * 中青看点 + * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/youth) + * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js) +

+ * 腾讯新闻 + * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/txnews) + * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js) +

+ * 百度极速 + * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/baidu) + * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baiduspeed.js) +

+ * 聚看点 + * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/jukan) + * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jkd.js) +

+ * 电视家 + * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/dianshijia) + * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js) +

+ * 电信套餐查询 + * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/dianxin) + * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js) +

+ * 快手视频签到 + * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/kuaishou) + * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js) +

+ * 数码之家 + * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/digital_home) + * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js) +

+ * 京东系 + * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/jd) + * 脚本地址 + * [京东到家](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddk.js) + * [来客有礼](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js) +

+ * 新浪系 + * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/sina) + * 脚本地址 + * [微博](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js) + * [新浪新闻](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js) + \ No newline at end of file diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 3b70007521..64d401c99b 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -4,7 +4,7 @@ #
中青看点使用说明
- [跳转至底部](#注意事项) + [跳转至底部](#注意事项) ---- [回到主页](https://github.com/Sunert/Scripts) ### IOS配置教程 ``` From 311e563fea08651c3f3482dfa05c321d452824b8 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 9 Feb 2021 18:56:16 +0800 Subject: [PATCH 573/721] Update README.md --- TaskConf/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TaskConf/README.md b/TaskConf/README.md index 7ce27e514d..466cda0b67 100644 --- a/TaskConf/README.md +++ b/TaskConf/README.md @@ -1,4 +1,4 @@ -#目录导航 +# 目录导航 本目录为快捷直达所需配置地址页,点击蓝色字体即可 相关配置还在完善中,敬请等待 @@ -69,4 +69,4 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sunert.boxjs.json * 脚本地址 * [微博](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js) * [新浪新闻](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js) - \ No newline at end of file + From 990ab7a385ac9ddf4701c5261aceea1c51e177f6 Mon Sep 17 00:00:00 2001 From: Best <47924389+Sunert@users.noreply.github.com> Date: Tue, 9 Feb 2021 18:56:23 +0800 Subject: [PATCH 574/721] Create README.md From 158cd9537ad588c009027f9cfe0cdd7b1b5a82be Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 9 Feb 2021 20:49:00 +0800 Subject: [PATCH 575/721] --- Task/youth.js | 5 +++-- weather.js | 30 ------------------------------ 2 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 weather.js diff --git a/Task/youth.js b/Task/youth.js index 86ba5327fb..f9068fa1c7 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -236,7 +236,8 @@ function userInfo() { if (signinfo.status == 1) { cash = signinfo.data.user.money; signday = signinfo.data.sign_day; - subTitle = `【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元`; + totalscore = signinfo.data.user.score + subTitle = `【收益总计】${totalscore}青豆 现金约${cash}元`; nick = `账号: ${signinfo.data.user.nickname}`; $.setdata(nick,"zq_nick") if(parseInt(cash) >= withdrawcash && !withdrawBody == false){ @@ -618,7 +619,7 @@ async function showmsg() { $.msg($.name+" "+nick+" "+rotarynum,subTitle,detail)//任务全部完成且通知间隔不为0时通知; } else { - console.log(`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n`+ detail) + console.log(`【收益总计】${totalscore}青豆 现金约${cash}元\n`+ detail) } } diff --git a/weather.js b/weather.js deleted file mode 100644 index 9a36346219..0000000000 --- a/weather.js +++ /dev/null @@ -1,30 +0,0 @@ -var appid="47273245"; -var appsecret="BCK1QTW5"; - -var wurl = { - url: "https://www.tianqiapi.com/api/?version=v6&appid=" + appid + "&appsecret=" + appsecret, -}; - -$task.fetch(wurl).then(response => { - var obj = JSON.parse(response.body); - var city = obj.city; - var noweather = obj.wea; - var wind_dir = obj.win; - var wind_sc = obj.win_speed; - var hum = obj.humidity; - var lowtmp = obj.tem2; - var hightmp = obj.tem1; - var air = obj.air_pm25; - var airlevel =obj.air_level; - var airtips = obj.air_tips; - var updatetime = obj.date + " " + obj.update_time; - - var title = city + "天气: "+ noweather +", " + "气温: " + lowtmp +" °C " + "~" + hightmp +" °C " - var mation = "风向: " + wind_dir + "·" + wind_sc + " | " + "湿度: " + hum + " | " + "PM2.5: " + air + " " + airlevel - var tips = "建议: " + airtips - var update = "更新于: " + updatetime - $notify(title, mation, tips, update); - -}, reason => { - $notify("错误", "", reason.error); -}); \ No newline at end of file From 813c3df7be198478ad429289d145105d361c225b Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 9 Feb 2021 22:31:53 +0800 Subject: [PATCH 576/721] --- Surge_Task/Sunert_Task.sgmodule | 2 + Task/dianshijia.js | 35 -------- Task/txnews.js | 44 +--------- TaskConf/dianshijia/loon.plugin | 8 ++ TaskConf/dianshijia/readme.md | 125 +++++++++++++++++++++++------ TaskConf/dianshijia/surge.sgmodule | 10 +++ TaskConf/txnews/loon.plugin | 8 ++ TaskConf/txnews/readme.md | 108 +++++++++++++++++++++++++ TaskConf/txnews/surge.sgmodule | 11 +++ TaskConf/youth/loon.plugin | 13 +-- TaskConf/youth/readme.md | 12 +-- TaskConf/youth/surge.sgmodule | 8 +- 12 files changed, 268 insertions(+), 116 deletions(-) create mode 100644 TaskConf/dianshijia/loon.plugin create mode 100644 TaskConf/dianshijia/surge.sgmodule create mode 100644 TaskConf/txnews/loon.plugin create mode 100644 TaskConf/txnews/surge.sgmodule diff --git a/Surge_Task/Sunert_Task.sgmodule b/Surge_Task/Sunert_Task.sgmodule index 1b251143e3..2ea3b4d4d5 100644 --- a/Surge_Task/Sunert_Task.sgmodule +++ b/Surge_Task/Sunert_Task.sgmodule @@ -54,4 +54,6 @@ # > 谷歌翻译 谷歌翻译 = type=cron,cronexp=0 5 10 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js,script-update-interval=0 +# > 墨迹天气 +墨迹天气 = type=cron,cronexp=0 5 10 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js,script-update-interval=0 diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 9ee5c660db..fed7241061 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -3,41 +3,6 @@ 更新时间: 2020-11-16 09:40 赞赏:电视家邀请码`893988`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于电视家签到,支持Actions多账号运行,请用'#'或者换行隔开‼️ -获取Cookie方法: -1.将下方[rewrite_local]和[Task]地址复制的相应的区域,无需添加 hostname,每日7点、12点、20点各运行一次,其他随意 -2.APP登陆账号后,点击菜单栏'领现金',即可获取Cookie,进入提现页面,点击随机金额,可获取提现地址!! -3.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 -By Facsuny -感谢 chavyleung 等 -~~~~~~~~~~~~~~~~~~~~ -loon 2.10+ : -[Script] -cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家 - -http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, timeout=10, tag=电视家 - -http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, timeout=10, tag=电视家 -~~~~~~~~~~~~~~~~~~~~~ -# 获取电视家 Cookie. -Surge 4.0 -[Script] -电视家 = type=cron,cronexp=0 8 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js,script-update-interval=0 - -电视家 = type=http-request,pattern=http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js - -电视家 = type=http-request,pattern=http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js -~~~~~~~~~~~~~~~~~~ - -QX 1.0.6+ : -[task_local] -0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js - -[rewrite_local] -http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js - -http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js -~~~~~~~~~~~~~~~~~ - */ const walkstep = '20000';//每日步数设置,可设置0-20000 const gametimes = "1999"; //游戏时长 diff --git a/Task/txnews.js b/Task/txnews.js index 8691797c6e..b60749e0d1 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -2,47 +2,7 @@ /* 更新时间: 2021-1-23 09:50 -腾讯新闻签到修改版,可以自动阅读文章获取红包,该活动为瓜分百万现金挑战赛,针对幸运用户参与 - -获取Cookie方法: -1.把以下配置复制到响应配置下 -2.打开腾讯新闻app,阅读几篇文章,倒计时结束后即可获取阅读Cookie; -3.看一次推荐视频获取视频地址 -4.可能腾讯有某些限制,有些号码无法领取红包,手动阅读几篇,能领取红包,一般情况下都是正常的, -5.此脚本根据阅读篇数开启通知,默认阅读50篇通知一次,此版本和另一版本相同 -版本更新日志: -1.01 修复无法自动获取视频红包,修改通知为阅读篇数间隔,即阅读篇数除以间隔余0时通知,或者自定义常开或常关, -1.02 支持boxjs配置,增加通知跳转链接https://news.qq.com/FERD/cjRedDown.htm,需手动领取此红包 ---------------------- -Surge 4.0 -[Script] -腾讯新闻 = type=cron,cronexp=0 8 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js,script-update-interval=0 - -腾讯新闻 = type=http-request,pattern=https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, requires-body=true - -~~~~~~~~~~~~~~~~~~~~~ -Loon 2.1.0+ -[Script] -# 本地脚本 -cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, enabled=true, tag=腾讯新闻 - -http-request https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, requires-body=true - ------------------ - -QX 1.0.7+ : - [task_local] -0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻 - [rewrite_local] -https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js - -~~~~~~~~~~~~~~~~~~ - [MITM] -hostname = api.inews.qq.com - ---------------------------- - -Cookie获取后,请注释掉Cookie地址。 +腾讯新闻签到修改版,可以自动阅读文章获取红包,该活动为瓜分百万现金挑战赛,针对幸运用户参与,本脚本已不能自动打开红包,需每天要打开腾讯新闻app一次,请须知 */ const $ = new Env('腾讯新闻'); @@ -143,7 +103,7 @@ function GetCookie() { $.msg($.name, `获取Cookie: 成功🎉`, ``) } if ($request &&$request.body.indexOf("video_read")> -1) { - const videoVal = $request.url + const videoVal = $request.url $.log(`videoVal:${videoVal}`) if (videoVal) $.setdata(videoVal, 'video_txnews') $.msg($.name, `获取视频地址: 成功🎉`, ``) diff --git a/TaskConf/dianshijia/loon.plugin b/TaskConf/dianshijia/loon.plugin new file mode 100644 index 0000000000..c57c3fff5c --- /dev/null +++ b/TaskConf/dianshijia/loon.plugin @@ -0,0 +1,8 @@ +# 电视家重写配置 + +[Script] +cron "1 7,12,20 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家 + +http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, timeout=10, tag=电视家 + +http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, timeout=10, tag=电视家 \ No newline at end of file diff --git a/TaskConf/dianshijia/readme.md b/TaskConf/dianshijia/readme.md index 25acc87cc5..741f85c444 100644 --- a/TaskConf/dianshijia/readme.md +++ b/TaskConf/dianshijia/readme.md @@ -1,37 +1,114 @@ -更新时间: 2020-11-16 09:40 -赞赏:电视家邀请码`893988`,农妇山泉 -> 有点咸,万分感谢 -本脚本仅适用于电视家签到,支持Actions多账号运行,请用'#'或者换行隔开‼️ -获取Cookie方法: -1.将下方[rewrite_local]和[Task]地址复制的相应的区域,无需添加 hostname,每日7点、12点、20点各运行一次,其他随意 -2.APP登陆账号后,点击菜单栏'领现金',即可获取Cookie,进入提现页面,点击随机金额,可获取提现地址!! -3.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 -By Facsuny -感谢 chavyleung 等 -~~~~~~~~~~~~~~~~~~~~ -loon 2.10+ : -[Script] -cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家 -http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, timeout=10, tag=电视家 -http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, timeout=10, tag=电视家 -~~~~~~~~~~~~~~~~~~~~~ -# 获取电视家 Cookie. -Surge 4.0 + [toc] + + #
电视家使用说明
+ + [跳转至底部](#注意事项) ---- [回到主页](https://github.com/Sunert/Scripts) + +### IOS配置教程 + +#### Surge: +* [模块地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/dianshijia/surge.sgmodule) + + ``` +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/dianshijia/surge.sgmodule + ``` + * 本地重写 + + ``` [Script] -电视家 = type=cron,cronexp=0 8 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js,script-update-interval=0 + +电视家 = type=cron,cronexp=1 7,12,20 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js,script-update-interval=0 电视家 = type=http-request,pattern=http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js 电视家 = type=http-request,pattern=http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js -~~~~~~~~~~~~~~~~~~ +``` +#### Shadowrocket(Cron配置): -QX 1.0.6+ : -[task_local] -0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js +``` +[Script] +电视家 = type=cron,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js,cronexpr="1 7,12,20 * * *",timeout=20,enable=true +``` +#### Loon: + +* [插件地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/dianshijia/loon.plugin) + + ``` +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/dianshijia/loon.plugin + ``` +* 本地重写 + + ``` +[Script] +cron "1 7,12,20 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家 + +http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, timeout=10, tag=电视家 +http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, timeout=10, tag=电视家 +``` +#### Quantumult X: + * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/dianshijia/qx_rewite.txt) + +``` +[rewrite_remote] +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/dianshijia/qx_rewite.txt +``` + * 本地重写配置 + +``` [rewrite_local] http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js -~~~~~~~~~~~~~~~~~ +``` + * 本地任务配置 + +``` +[task_local] +1 7,12,20 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js +``` +### 获取Cookie方法 + +赞赏:电视家邀请码`893988`,农妇山泉 -> 有点咸,万分感谢 + + 1. APP登陆账号后,点击菜单栏'领现金',即可获取Cookie + 2. 进入提现页面,点击随机金额,可获取提现地址!! + 3. 无需添加 hostname,每日7点、12点、20点各运行一次,其他随意 + + + >>> [回到顶部](#IOS配置教程) + +### Nodejs 配置密钥 (Github Actions) + +
+ + + + Actions Secrets + + + +| Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | +| :-------: | :------: | :-------: | ------ | ------- | +| DSJ_HEADERS | 电视家dianshijia.yml | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/sign/signin",
签到请求头: { xxx } | +| DSJ_DRAWAL | 同上 | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/cash/withdrawal",
即提现请求地址 | +| DSJ_NOTIFY_CONTROL | 同上 | true/false | 可选 | 电视家通知开关
默认不推送 | + +
+ + >>> [回到上一页](..) + +### 注意事项: + > + + + + + + + + + + diff --git a/TaskConf/dianshijia/surge.sgmodule b/TaskConf/dianshijia/surge.sgmodule new file mode 100644 index 0000000000..4855b4125e --- /dev/null +++ b/TaskConf/dianshijia/surge.sgmodule @@ -0,0 +1,10 @@ +#!name= dianshijia Rewrite +#!desc= 电视家重写配置 +#!system=ios + +[Script] +电视家 = type=cron,cronexp=1 7,12,20 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js,script-update-interval=0 + +电视家 = type=http-request,pattern=http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js + +电视家 = type=http-request,pattern=http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js \ No newline at end of file diff --git a/TaskConf/txnews/loon.plugin b/TaskConf/txnews/loon.plugin new file mode 100644 index 0000000000..4d89c3cb5d --- /dev/null +++ b/TaskConf/txnews/loon.plugin @@ -0,0 +1,8 @@ +[Script] + +cron ”04 00 * * *“ script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, enabled=true, tag=腾讯新闻 + +http-request https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, requires-body=true, enabled=true, tag=腾讯新闻 + +[MITM] +hostname = api.inews.qq.com \ No newline at end of file diff --git a/TaskConf/txnews/readme.md b/TaskConf/txnews/readme.md index 8b13789179..edd10e9b71 100644 --- a/TaskConf/txnews/readme.md +++ b/TaskConf/txnews/readme.md @@ -1 +1,109 @@ + + [toc] + + #
腾讯新闻使用说明
+ + [跳转至底部](#注意事项) ---- [回到主页](https://github.com/Sunert/Scripts) + +### IOS配置教程 + ``` +[MITM] +hostname = api.inews.qq.com + ``` +#### Surge: +* [模块地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/surge.sgmodule) + + ``` +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/surge.sgmodule + ``` + * 本地重写 + + ``` +[Script] +腾讯新闻 = type=cron,cronexp=0 8 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js,script-update-interval=0 + +腾讯新闻 = type=http-request,pattern=https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, requires-body=true +``` +#### Shadowrocket(Cron配置): + +``` +[Script] +腾讯新闻 = type=cron,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js,cronexpr="1 */6 * * *",timeout=20,enable=true +``` +#### Loon: + +* [插件地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/loon.plugin) + + ``` +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/loon.plugin + ``` +* 本地重写 + + ``` +[Script] +cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, enabled=true, tag=腾讯新闻 +http-request https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, requires-body=true, enabled=true, tag=腾讯新闻 +``` +#### Quantumult X: + * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/qx_rewite.txt) + +``` +[rewrite_remote] +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/qx_rewite.txt +``` + * 本地重写配置 + +``` +[rewrite_local] +https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js +``` + * 本地任务配置 + +``` +[task_local] +1 */5 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻 +``` +### 获取Cookie方法 + + 1. 打开腾讯新闻app,阅读几篇文章,倒计时结束后即可获取阅读Cookie + + 2. 看一次推荐视频,获取视频地址 + + >>> [回到顶部](#IOS配置教程) + +### Nodejs 配置密钥 (Github Actions) + +
+ + + + Actions Secrets + + + +| Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | +| :-------: | :------: | :-------: | ------ | ------- | +| TXNEWS_COOKIE | 腾讯新闻 txnews.yml | & | 必须 | 请求地址: "https://api.inews.qq.com/event/v1/user/event/report?",
腾讯新闻 Cookie: openxx=xxx | +| TXNEWS_SIGN | 同上 | # | 必须 | 请求地址同上, 阅读请求地址链接 | +| TXNEWS_VIDEO | 同上 | # | 必须 | 请求地址同上, 视频请求地址链接 | +| TXNEWS_NOTIFY_CONTROL | 同上 | true/false | 可选 | 腾讯新闻通知开关
默认当余额大于2元且通知间隔为50时推送通知 | + +
+ + >>> [回到上一页](..) + +### 注意事项: + 1. 可能腾讯有某些限制,有些号码无法领取红包,手动阅读几篇,能领取红包,一般情况下都是正常的 + 2. 此脚本根据阅读篇数开启通知,默认阅读50篇通知一次 + 3. 支持boxjs配置,增加通知跳转链接https://news.qq.com/FERD/cjRedDown.htm,需手动领取此红包 + + + + + + + + + + diff --git a/TaskConf/txnews/surge.sgmodule b/TaskConf/txnews/surge.sgmodule new file mode 100644 index 0000000000..20ad01b199 --- /dev/null +++ b/TaskConf/txnews/surge.sgmodule @@ -0,0 +1,11 @@ +#!name= txnews Rewrite +#!desc= 腾讯新闻重写配置 +#!system=ios + +[Script] +腾讯新闻 = type=cron,cronexp=0 8 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js,script-update-interval=0 + +腾讯新闻 = type=http-request,pattern=https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, requires-body=true + +[MITM] +hostname = api.inews.qq.com \ No newline at end of file diff --git a/TaskConf/youth/loon.plugin b/TaskConf/youth/loon.plugin index 3179abe83b..c116983048 100644 --- a/TaskConf/youth/loon.plugin +++ b/TaskConf/youth/loon.plugin @@ -1,11 +1,12 @@ # 中青看点获取Cookie -[URL Rewrite] -http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +[Script] +cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 +http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 [MITM] hostname = ios.baertt.com, kd.youth.cn \ No newline at end of file diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 64d401c99b..5df53baca9 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -46,11 +46,11 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/loon.plug ``` [Script] cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 -http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 ``` #### Quantumult X: * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt) @@ -73,7 +73,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body h ``` [task_local] -1 */5 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +1 */5 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 ``` ### 获取Cookie方法 * 打开极速版APP,进去个人中心,或者签到一次,提示获取Cookie diff --git a/TaskConf/youth/surge.sgmodule b/TaskConf/youth/surge.sgmodule index 696b2a062f..bc0eccd0a6 100644 --- a/TaskConf/youth/surge.sgmodule +++ b/TaskConf/youth/surge.sgmodule @@ -1,8 +1,10 @@ #!name= Youth Rewrite -#!desc= 中青极速版获取Cookie +#!desc= 中青极速版重写配置 #!system=ios -[URL Rewrite] +[Script] +中青看点 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js,script-update-interval=0 + 中青看点 = type=http-request,pattern=https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true @@ -14,4 +16,4 @@ 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true [MITM] -hostname = %APPEND% kd.youth.cn,ios.baertt.com \ No newline at end of file +hostname = %APPEND% kd.youth.cn, ios.baertt.com \ No newline at end of file From 49d81f59baa089ced1a2cad4c824447d4958cb18 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 10 Feb 2021 11:55:03 +0800 Subject: [PATCH 577/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BE=AE=E5=8D=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/weibo.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index 6cefc3e160..67caba53c8 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -16,7 +16,7 @@ Surge 4.0 : weibo.js = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js,script-update-interval=0 # 获取微博 Cookie. -weibo.js = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d/user/show/.+(gsid=),script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +weibo.js = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/user\/show\/,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js # 微博钱包签到Cookie weibo.js = type=http-request,pattern=https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js @@ -26,7 +26,7 @@ Loon 2.1.0+ # 本地脚本 cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 -http-request https:\/\/api\.weibo\.cn\/\d/user/show/.+(gsid=) script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +http-request https:\/\/api\.weibo\.cn\/\d\/user\/show\/ script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js http-request https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js @@ -37,7 +37,7 @@ QX 1.0.6+ : 0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js [rewrite_local] -https:\/\/api\.weibo\.cn\/\d/user/show/.+(gsid=) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +https:\/\/api\.weibo\.cn\/\d\/user\/show\/ url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js # 钱包签到Cookie https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js @@ -120,7 +120,7 @@ if ($.isNode()) { function GetCookie() { -if ($request && $request.method != 'OPTIONS' && $request.url.match(/\d/user/show/.+(gsid=)/)) { +if ($request && $request.method != 'OPTIONS' && $request.url.indexOf("gsid=")>-1) { const signurlVal = $request.url const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(&s=\w+)/) $.log(`token:${token}`) From 0a1b2d9c31314b0ff36e66264fc43eaaad46c359 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 10 Feb 2021 14:48:44 +0800 Subject: [PATCH 578/721] --- Task/GithubActions.md | 1 - Task/weibo.js | 57 +++--------------- TaskConf/sina/loon.plugin | 11 ++++ TaskConf/sina/qx_rewite.txt | 2 +- TaskConf/sina/readme.md | 112 +++++++++++++++++++++++++++++++++++ TaskConf/sina/surge.sgmodule | 15 +++++ 6 files changed, 146 insertions(+), 52 deletions(-) create mode 100644 TaskConf/sina/loon.plugin create mode 100644 TaskConf/sina/surge.sgmodule diff --git a/Task/GithubActions.md b/Task/GithubActions.md index 8ced19204a..c18cc95cd9 100644 --- a/Task/GithubActions.md +++ b/Task/GithubActions.md @@ -24,7 +24,6 @@ | WB_TOKEN | 微博 | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: gsid=xxx | | WB_PAY | 同上 | #或换行 | 必须 | 请求地址:"https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do",
提现请求头 | | | | | - | | -| JD_COOKIE | 京喜 jingxi.yml | &或换行| 必须 | 京东cookie,多个账号的cookie使用`&`隔开或者换行。具体获取参考[浏览器获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie.md) 或者 [插件获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie2.md) |
diff --git a/Task/weibo.js b/Task/weibo.js index 67caba53c8..12176a94f3 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -1,51 +1,8 @@ /* -更新时间: 2020-10-13 21:25 +更新时间: 2021-02-10 14:25 本脚本仅适用于微博每日签到,支持Actions多账号运行 -获取Cookie方法: -1.将下方[rewrite_local]和[MITM]地址复制的相应的区域下 -2.打开微博App,刷微博视频,获取Cookie,获取后请注释或禁用Cookie -3.打开微博钱包点击签到,获取Cookie, -4.钱包签到时获取Cookie,已经签到无法获取 -5.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 -by Macsuny -~~~~~~~~~~~~~~~~ -Surge 4.0 : -[Script] -weibo.js = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js,script-update-interval=0 - -# 获取微博 Cookie. -weibo.js = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/user\/show\/,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js -# 微博钱包签到Cookie -weibo.js = type=http-request,pattern=https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js - -~~~~~~~~~~~~~~~~ -Loon 2.1.0+ -[Script] -# 本地脚本 -cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 - -http-request https:\/\/api\.weibo\.cn\/\d\/user\/show\/ script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js - -http-request https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js - ------------------ - -QX 1.0.6+ : -[task_local] -0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js - -[rewrite_local] -https:\/\/api\.weibo\.cn\/\d\/user\/show\/ url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js - -# 钱包签到Cookie -https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js - -~~~~~~~~~~~~~~~~ -[MITM] -hostname = api.weibo.cn, pay.sc.weibo.com -~~~~~~~~~~~~~~~~ */ const $ = new Env('新浪微博') @@ -122,7 +79,7 @@ if ($.isNode()) { function GetCookie() { if ($request && $request.method != 'OPTIONS' && $request.url.indexOf("gsid=")>-1) { const signurlVal = $request.url - const token = signurlVal.match(/(gsid=[_a-zA-Z0-9-]+).+(&s=\w+)/) + const token = signurlVal.replace(/(.+)(gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)/,'$2$4') $.log(`token:${token}`) if (token) $.setdata(token, 'sy_token_wb') $.msg($.name, `获取微博签到Cookie: 成功`, ``) @@ -136,9 +93,9 @@ if ($request && $request.method != 'OPTIONS' && $request.url.indexOf("gsid=")>-1 function getsign() { return new Promise((resolve, reject) =>{ let signurl = { - url: `https://api.weibo.cn/2/checkin/add?${token}`, + url: `https://api.weibo.cn/2/checkin/add?from=10B2093010&c=iphone&${token}`, headers: {"User-Agent": `Weibo/46902 (iPhone; iOS 14; Scale/3.00)`}} - $.post(signurl, async(error, response, data) => { + $.post(signurl, async(error, resp, data) => { let result = JSON.parse(data) if (result.status == 10000){ wbsign = `【微博签到】✅ 连续签到${result.data.continuous}天,收益: ${result.data.desc}💰\n` @@ -164,9 +121,9 @@ function getsign() { function doCard() { return new Promise((resolve, reject) =>{ let doCardurl = { - url: `https://api.weibo.cn/2/!/ug/king_act_home?${token}`, + url: `https://api.weibo.cn/2/!/ug/king_act_home?from=10B2093010&c=iphone&${token}`, headers: {"User-Agent": `Weibo/46902 (iPhone; iOS 14; Scale/3.00)`}} - $.get(doCardurl, (error, response, data) => { + $.get(doCardurl, (error, resp, data) => { let result = JSON.parse(data) if (result.status ==10000){ nickname = "昵称: "+result.data.user.nickname @@ -186,7 +143,7 @@ function doCard() { function paysign() { return new Promise((resolve, reject) =>{ $.post({url: `https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do?_=${$.startTime+10}`,headers: JSON.parse(payheaderVal) - }, (error, response, data) => { + }, (error, resp, data) => { let result = JSON.parse(data) if (result.status == 1){ paybag = `【微博钱包】 ✅ +`+ result.score+' 分\n' diff --git a/TaskConf/sina/loon.plugin b/TaskConf/sina/loon.plugin new file mode 100644 index 0000000000..a1fad213ac --- /dev/null +++ b/TaskConf/sina/loon.plugin @@ -0,0 +1,11 @@ +# 仅新浪微博配置,不包含新浪新闻 + +[Script] +cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 + +http-request https:\/\/api\.weibo\.cn\/\d\/user\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 + +http-request https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 + +[MITM] +hostname = api.weibo.cn, pay.sc.weibo.com \ No newline at end of file diff --git a/TaskConf/sina/qx_rewite.txt b/TaskConf/sina/qx_rewite.txt index cf081e8f63..bbda5b6d1f 100644 --- a/TaskConf/sina/qx_rewite.txt +++ b/TaskConf/sina/qx_rewite.txt @@ -4,7 +4,7 @@ https:\/\/newsapi\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center url https:\/\/newsapi\.sina\.cn\/\?resource=userpoint\/signIn url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js -https:\/\/api\.weibo\.cn\/\d/user/show/.+(gsid=) url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +https:\/\/api\.weibo\.cn\/\d\/user\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js diff --git a/TaskConf/sina/readme.md b/TaskConf/sina/readme.md index 8b13789179..e5c05bfc74 100644 --- a/TaskConf/sina/readme.md +++ b/TaskConf/sina/readme.md @@ -1 +1,113 @@ + [toc] + + #
新浪微博使用说明
+ + [跳转至底部](#注意事项) ---- [回到主页](https://github.com/Sunert/Scripts) + +### IOS配置教程 + ``` +[MITM] +hostname = api.weibo.cn, pay.sc.weibo.com + ``` +#### Surge: +* [模块地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/surge.sgmodule) + + ``` +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/surge.sgmodule + ``` + * 本地重写 + + ``` +[Script] +微博&钱包签到 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js,script-update-interval=0 + +# 获取微博 Cookie. +微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/user\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js + +# 微博钱包签到Cookie +微博钱包签到 = type=http-request,pattern=https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +``` +#### Shadowrocket(Cron配置): + +``` +[Script] +新浪微博 = type=cron,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js,cronexpr="35 5 0 * * *",timeout=20,enable=true +``` +#### Loon: + +* [插件地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/loon.plugin) + + ``` +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/loon.plugin + ``` +* 本地重写 + + ``` +[Script] +cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 + +http-request https:\/\/api\.weibo\.cn\/\d\/user\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 + +http-request https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 +``` +#### Quantumult X: + * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/qx_rewite.txt) + +``` +[rewrite_remote] +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt +``` + * 本地重写配置 + +``` +[rewrite_local] +https:\/\/api\.weibo\.cn\/\d\/user\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js + +# 钱包签到Cookie +https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +``` + * 本地任务配置 + +``` +[task_local] +1 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=新浪微博 +``` +### 获取Cookie方法 + 1. 打开微博App,获取Cookie,获取后请注释或禁用Cookie + 2. 打开微博钱包点击签到,获取Cookie, + 3. 钱包签到时获取Cookie,已经签到无法获取 + + >>> [回到顶部](#IOS配置教程) + +### Nodejs 配置密钥 (Github Actions) + +
+ + + + Actions Secrets + + + +| Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | +| :-------: | :------: | :-------: | ------ | ------- | +| WB_TOKEN | 微博 | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: gsid=xxx | +| WB_PAY | 同上 | #或换行 | 必须 | 请求地址:"https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do",
提现请求头 | + +
+ + >>> [回到上一页](..) + +### 注意事项: + + + + + + + + + + + diff --git a/TaskConf/sina/surge.sgmodule b/TaskConf/sina/surge.sgmodule new file mode 100644 index 0000000000..c9a976bb74 --- /dev/null +++ b/TaskConf/sina/surge.sgmodule @@ -0,0 +1,15 @@ +#!name= weibo Rewrite +#!desc= 新浪微博重写配置 +#!system=ios + +[Script] +微博&钱包签到 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js,script-update-interval=0 + +# 获取微博 Cookie. +微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/user\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js + +# 微博钱包签到Cookie +微博钱包签到 = type=http-request,pattern=https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js + +[MITM] +hostname = %APPEND% api.weibo.cn, pay.sc.weibo.com \ No newline at end of file From 7cadf90ccca5256bc5627d5c7579a64bae15c1b5 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 10 Feb 2021 18:51:09 +0800 Subject: [PATCH 579/721] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=BE=AE=E5=8D=9A?= =?UTF-8?q?=E9=92=B1=E5=8C=85ck=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/youth_read.yml | 6 +- Task/Youth_Read.js | 29 ++++++++++ Task/weibo.js | 99 +++++++++++++++++--------------- 3 files changed, 87 insertions(+), 47 deletions(-) diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index bafac02f81..2fae4671dd 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -6,7 +6,7 @@ name: 中青自动阅读 on: workflow_dispatch: schedule: - - cron: '6 1-12/2 * * *' + - cron: '*/15 1-12/2 * * *' watch: types: started jobs: @@ -35,6 +35,7 @@ jobs: node Task/Youth_Read.js env: YOUTH_READ: ${{ secrets.YOUTH_READ }} + YOUTH_TIME: ${{ secrets.YOUTH_TIME }} - name: '运行 【中青看点自动阅读二】' if: env.YOUTH_READ2 @@ -42,6 +43,7 @@ jobs: node Task/Youth_Read.js env: YOUTH_READ: ${{ secrets.YOUTH_READ2 }} + YOUTH_TIME: ${{ secrets.YOUTH_TIME2 }} - name: '运行 【中青看点自动阅读三】' if: env.YOUTH_READ3 @@ -49,6 +51,7 @@ jobs: node Task/Youth_Read.js env: YOUTH_READ: ${{ secrets.YOUTH_READ3 }} + YOUTH_TIME: ${{ secrets.YOUTH_TIME3 }} - name: '运行 【中青看点自动阅读四】' if: env.YOUTH_READ4 @@ -56,3 +59,4 @@ jobs: node Task/Youth_Read.js env: YOUTH_READ: ${{ secrets.YOUTH_READ4 }} + YOUTH_TIME: ${{ secrets.YOUTH_TIME4 }} diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 1fb9c3c951..4fa32eef9b 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -41,6 +41,10 @@ let ReadArr = [], YouthBody = "",readscore = 0; console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`) } await AutoRead(); + if (process.env.YOUTH_TIME){ + timebodyVal = process.env.YOUTH_TIME; + await readTime() + }; } console.log(`-------------------------\n\n中青看点共完成${$.index}次阅读,共计获得${readscore}个青豆,阅读请求全部结束`) })() @@ -80,4 +84,29 @@ function AutoRead() { }) } +function batHost(api, body) { + return { + url: 'https://ios.baertt.com/v5/'+api, + headers: { + 'User-Agent': 'KDApp/2.0.0 (iPhone; iOS 14.5; Scale/3.00)', + 'Host': 'ios.baertt.com', + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: body + } +} + +function readTime() { + return new Promise((resolve, reject) => { + $.post(batHost('user/stay.json',timebodyVal), (error, resp, data) => { + let timeres = JSON.parse(data) + if (timeres.error_code == 0) { + readtimes = timeres.time / 60 + $.log(`阅读时长共计` + Math.floor(readtimes) + `分钟`) + } + resolve() + }) + }) +} + 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 diff --git a/Task/weibo.js b/Task/weibo.js index 12176a94f3..5b53ca4802 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -1,18 +1,25 @@ /* 更新时间: 2021-02-10 14:25 -本脚本仅适用于微博每日签到,支持Actions多账号运行 +本脚本仅适用于微博每日签到,支持多账号运行 + +获取ck: https:\/\/api\.weibo\.cn\/\d\/users\/show url script-request-header weibo.js */ const $ = new Env('新浪微博') const notify = $.isNode() ? require('./sendNotify') : ''; -let tokenArr = [],payArr = [],paybag; +let tokenArr = []; +let wbtoken = $.getdata('sy_token_wb') if (isGetCookie = typeof $request !==`undefined`) { GetCookie(); $.done() } + +if(!$.isNode()&&wbtoken.indexOf("#")==-1){ + tokenArr.push(wbtoken) +} else { if ($.isNode()) { if (process.env.WB_TOKEN && process.env.WB_TOKEN.indexOf('#') > -1) { wbtoken = process.env.WB_TOKEN.split('#'); @@ -22,33 +29,18 @@ if ($.isNode()) { wbtoken = process.env.WB_TOKEN.split('\n'); console.log(`您选择的是用换行隔开\n`) } else { - wbtoken = process.env.WB_TOKEN.split() - }; - if (process.env.WB_PAY && process.env.WB_PAY.indexOf('#') > -1) { - wbPay = process.env.WB_PAY.split('#'); - } - else if (process.env.WB_PAY && process.env.WB_PAY.split('\n').length > 0) { - wbPay = process.env.WB_PAY.split('\n'); - } else { - wbPay = process.env.WB_PAY.split() + wbtoken = [process.env.WB_TOKEN] }; + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) +} else if (!$.isNode()&&wbtoken.indexOf("#")>-1) { + wbtoken = wbtoken.split("#") +} Object.keys(wbtoken).forEach((item) => { if (wbtoken[item]) { tokenArr.push(wbtoken[item]) } }); - Object.keys(wbPay).forEach((item) => { - if (wbPay[item]) { - payArr.push(wbPay[item]) - } - }); - console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) - } else { - tokenArr.push($.getdata('sy_token_wb')) - payArr.push($.getdata('sy_payheader_wb')) } - !(async () => { if (!tokenArr[0]) { $.msg($.name, '【提示】请先获取新浪微博一cookie') @@ -58,17 +50,12 @@ if ($.isNode()) { for (let i = 0; i < tokenArr.length; i++) { if (tokenArr[i]) { token = tokenArr[i]; - payheaderVal = payArr[i]; $.index = i + 1; console.log(`\n开始【微博签到${$.index}】`) await getsign(); await doCard(); - if (payheaderVal !== undefined){ await paysign() - } else { - paybag = `【钱包签到】❌ 未获取Cooiekie` - }; - await showmsg() + await showmsg() } } })() @@ -77,25 +64,32 @@ if ($.isNode()) { function GetCookie() { -if ($request && $request.method != 'OPTIONS' && $request.url.indexOf("gsid=")>-1) { - const signurlVal = $request.url - const token = signurlVal.replace(/(.+)(gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)/,'$2$4') - $.log(`token:${token}`) - if (token) $.setdata(token, 'sy_token_wb') - $.msg($.name, `获取微博签到Cookie: 成功`, ``) -} else if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/home\/welfare\/signin\/do\?_=[1-9]+/)) { - const payheaderVal = JSON.stringify($request.headers) - if (payheaderVal) $.setdata(payheaderVal, 'sy_payheader_wb') - $.msg($.name, `获取微博钱包Cookie: 成功`, ``)} + if ($request && $request.method != 'OPTIONS' && $request.url.indexOf("gsid=") > -1) { + const signurlVal = $request.url; + let token = signurlVal.replace(/(.+)(uid=\d+)(.+)(&gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)/,'$2$4$6'), + uid = token.match(/uid=\d+/); + if (wbtoken) { + if (wbtoken.indexOf(uid) > -1) { + $.log("此账号Cookie已存在,本次跳过") + } else if (wbtoken.indexOf(uid) == -1) { + tokens = wbtoken + "#" + token; + $.setdata(tokens, 'sy_token_wb'); + $.log(`tokens: ${tokens}`) + } + } else { + $.setdata(token, 'sy_token_wb'); + $.log(`tokens: ${token}`) + } + $.msg($.name, `获取微博签到Cookie: 成功`, ``) + } } - //微博签到 function getsign() { return new Promise((resolve, reject) =>{ let signurl = { - url: `https://api.weibo.cn/2/checkin/add?from=10B2093010&c=iphone&${token}`, - headers: {"User-Agent": `Weibo/46902 (iPhone; iOS 14; Scale/3.00)`}} - $.post(signurl, async(error, resp, data) => { + url: `https://api.weibo.cn/2/checkin/add?from=10B2193010&c=iphone&${token}`, + headers: {"User-Agent": `Weibo/52021 (iPhone; iOS 14.5; Scale/3.00)`}} + $.get(signurl, async(error, resp, data) => { let result = JSON.parse(data) if (result.status == 10000){ wbsign = `【微博签到】✅ 连续签到${result.data.continuous}天,收益: ${result.data.desc}💰\n` @@ -121,13 +115,18 @@ function getsign() { function doCard() { return new Promise((resolve, reject) =>{ let doCardurl = { - url: `https://api.weibo.cn/2/!/ug/king_act_home?from=10B2093010&c=iphone&${token}`, - headers: {"User-Agent": `Weibo/46902 (iPhone; iOS 14; Scale/3.00)`}} + url: `https://api.weibo.cn/2/!/ug/king_act_home?from=10B2193010&c=iphone&${token}`, + headers: {"User-Agent": `Weibo/52021 (iPhone; iOS 14.5; Scale/3.00)`}} $.get(doCardurl, (error, resp, data) => { +//$.log(data) let result = JSON.parse(data) if (result.status ==10000){ nickname = "昵称: "+result.data.user.nickname + if(tokenArr.length==1){ $.setdata(nickname,'wb_nick') + } else { + $.setdata(tokenArr.length+"合一(多账号)",'wb_nick') + } signday = result.data.signin.title.split('<')[0] docard = `【每日打卡】 ✅ `+ signday+'天 积分总计: '+result.data.user.energy } @@ -142,7 +141,15 @@ function doCard() { // 钱包签到 function paysign() { return new Promise((resolve, reject) =>{ - $.post({url: `https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do?_=${$.startTime+10}`,headers: JSON.parse(payheaderVal) + $.post({ + url: `https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do?_=${$.startTime+10}&${token}`, + headers:{ + 'Accept-Encoding': 'gzip, deflate', + 'Connection': 'keep-alive', + 'Content-Type': 'application/x-www-form-urlencoded', + 'Host': 'pay.sc.weibo.com', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Weibo (iPhone10,1__weibo__11.2.1__iphone__os14.5)' + } }, (error, resp, data) => { let result = JSON.parse(data) if (result.status == 1){ @@ -152,7 +159,7 @@ function paysign() { paybag = `【微博钱包】 🔁\n` } else { - paybag = `【钱包签到】❌ Cookie失效`+'\n' + paybag = `【钱包签到】❌ Cookie失效`+'\n' } resolve() }) From 76ab230d139368a5321aa907319fdb207a354a05 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 10 Feb 2021 22:30:54 +0800 Subject: [PATCH 580/721] --- Task/baidu_speed.js | 188 ++++++++++++++++++-------------------------- 1 file changed, 77 insertions(+), 111 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 76c81a82ee..82ac306579 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -15,11 +15,11 @@ */ const $ = new Env('百度极速版') let CookieArr = [],cashArr=[]; -let UA = `Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 info baiduboxapp/5.1.1.10 (Baidu; P2 14.2)`; const notify = $.isNode() ? require('./sendNotify') : ''; const baiducks = $.getdata(`cookie_baidu`); let taskON = $.getdata(`task_baidu`)||"true"//除提现和兑换外其他任务开关; let isblack = "false"; +let UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 matrixstyle/0 info baiduboxapp/5.1.6.10 (Baidu; P2 14.2)' if ($.isNode()) { if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { BDCookie = process.env.BAIDU_COOKIE.split('&'); @@ -48,6 +48,9 @@ if ($.isNode()) { cashArr.push(BDCASH[item]) } }) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`); + console.log(`您共提供${CookieArr.length}个百度账号 Cookie`) + } else if(baiducks && baiducks.indexOf('&')>-1){ BDCookie = baiducks.split("&") Object.keys(BDCookie).forEach((item) => { @@ -56,15 +59,10 @@ if ($.isNode()) { } }) } else { - CookieArr.push($.getdata(`chavy_cookie_tieba`) || $.getdata(`CookieTB`)); +CookieArr.push($.getdata(`chavy_cookie_tieba`) || $.getdata(`CookieTB`)); cashArr.push($.getdata("cash_baidu")||30) } -if ($.isNode()) { - //console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) - console.log(`您共提供${CookieArr.length}个百度账号 Cookie`) -} !(async() =>{ if (!CookieArr[0]) { console.log($.name, '【提示】请把百度Cookie填入Github 的 Secrets 中,请以&或者换行隔开'); @@ -75,14 +73,7 @@ if ($.isNode()) { cookieval = CookieArr[i]; withcash = cashArr[i]; $.index = i + 1; - let username = null, - chargemoney = 0, - availablecoin = 0; await userInfo(); - if (isblack == true) { - $.msg($.name + " 账号" + username + "已黑号", "您的金币和余额已被冻结,请联系客服处理"); - continue; - } await $.wait(1000); if ($.isNode()) { if (process.env.BAIDU_TASK) { @@ -92,28 +83,29 @@ if ($.isNode()) { if (taskON == "true") { $.desc = ""; await firstbox(); - await TaskCenter() + await TaskCenter(); } - //await showmsg() - //await drawPrize(); } } })() .catch((e) => $.logErr(e)) .finally(() => $.done()) - + +function confApi(api, body, RefererUrl) { + return { + url: 'https://haokan.baidu.com/activity/'+api, + headers:{ + 'Cookie': cookieval, + 'User-Agent': UA, + 'Referer': RefererUrl + }, + body:body + } +} //签到 function getsign() { return new Promise((resolve, reject) =>{ - let signurl = { - url: `https://haokan.baidu.com/activity/acusercheckin/update`, - headers: { - Cookie: cookieval, - 'User-Agent': UA - }, - body: 'productid=2&ugus=9766888061' - } - $.post(signurl, async(error, response, data) =>{ + $.post(confApi('acusercheckin/update','productid=2&ugus=9766888061'), async(error, resp, data) =>{ let get_sign = JSON.parse(data); if (get_sign.errno == 0) { $.desc = get_sign.data.tips+` 收益: ${get_sign.data.bonus.coin}💰\n`; @@ -130,77 +122,23 @@ function getsign() { }) } -function userInfo() { - return new Promise((resolve, reject) =>{ - setTimeout(() =>{ - let infourl = { - url: `https://haokan.baidu.com/activity/h5/income?productid=2&from=1005640h&network=1_0&osname=baiduboxapp`, - headers: { - Cookie: cookieval, - 'User-Agent': UA - } - }; - $.get(infourl, async(error, resp, data) =>{ - try { - if (resp.statusCode == 200) { - username = "null"; - if(data.match(/user_name\":\"([\w+\\]+)/)){ - username = unescape(data.match(/user_name\":\"([\w+\\]+)/)[1].replace(/\\/g, "%")) - } - chargemoney = data.match(/charge_money":"(\d+\.\d+)/)[1], - enabledmoney = data.match(/enabled_money":(\d+)/)[1], - waitingcoin = data.match(/waiting_coin":(\d+)/)[1], - availablecoin = data.match(/available_coin":(\d+)/)[1], - invitecode = data.match(/invite_code":"(\w+)/)[1], - coinenabled = data.match(/coin_enabled":(\d+)/)[1] - if (coinenabled > 100) { - coinnum = parseInt(coinenabled / 100) * 100; - await coinexChange() - } - //rate = data.match(/exchange_rate":(\d+)/)[1] - isblack = data.match(/is_black":(\w+)/)[1] - } - $.sub = " 昵称:" + username + " 现金:" + chargemoney + "元 金币:" + availablecoin; - $.log("\n********** 昵称:" + username + " 现金:" + chargemoney + "元 **********\n"); - if (enabledmoney>500&&parseInt(enabledmoney/100) >= Number(withcash) && $.time("HH") == "06") { - await withDraw(withcash); - if ($.isNode()) { - await notify.sendNotify($.name + " 成功提现" + withcash + "元\n" + $.sub) - } - $.done() - } - } catch(error) { - $.msg($.name, "获取用户信息失败","请更换Cookie") - $.log("用户信息详情页错误\n" + error + "\n" + formatJson(data.match(/window\.PAGE_DATA = (.+)/)).replace(new RegExp("\\\\\"", "gm"), "\"")) - } - resolve() - }) - }, - 1000) - }) -} - function withDraw(cash) { - return new Promise((resolve, reject) =>{ - let cashurl = { - url: `https://haokan.baidu.com/activity/acuserwithdraw/confirm?productid=2&amount=${cash*100}&trade_type=1`, - headers: { - Cookie: cookieval, - 'User-Agent': UA - } + return new Promise((resolve, reject) =>{ + $.get(confApi(`acuserwithdraw/confirm?productid=2&amount=${cash*100}&trade_type=1`), async(error, resp, data) =>{ + let get_cash = JSON.parse(data); + if (get_cash.errno == 0) { + $.sub = ' 提现成功: 到账 ' + get_cash.data.money + "元 "; + $.msg($.name, $.sub); + if ($.isNode()) { + await notify.sendNotify($.name + " 成功提现" + withcash + "元\n" + $.sub) } - $.get(cashurl, (error, response, data) =>{ - let get_cash = JSON.parse(data); - if (get_cash.errno == 0) { - $.sub = ' 提现成功: 到账 ' + get_cash.data.money + "元 ", - $.msg($.name, $.sub) - } else { - $.log(data + "\n " + get_cash.msg), - $.msg($.name, get_cash.msg) - } - resolve() - }) + } else { + $.log(data + "\n " + get_cash.msg); + $.msg($.name, get_cash.msg) + } + resolve() }) + }) } @@ -221,16 +159,41 @@ function invite() { }) } +function userInfo() { + return new Promise((resolve, reject) =>{ + $.post(confApi('api/tenure/osname=baiduboxapp','sign=a329b14e561e5f42d466d568623cd972&time=1612958577&productid=2'), async(error, resp, data) =>{ + try { + let get_pay = JSON.parse(data); + //$.log("获取收益信息:"+data +'\n') + if (get_pay.errno == 0) { + availablecoin = get_pay.data.available_coin, + enabledcoin = get_pay.data.enabled_coin, + enabledmoney = get_pay.data.enabled_money, + yesterdaycoin = get_pay.data.yesterday_coin, + username = $.getdata('baidu_nick') ? $.getdata('baidu_nick') : null; + $.sub = " 昵称:" + username + " 现金:" + enabledmoney + "元 金币:" + availablecoin; + $.log("\n********** 昵称:" + username + " 现金:" + enabledmoney + "元 **********\n"); + if (parseInt(enabledmoney) >= Number(withcash) && $.time("HH") == "06") { + await withDraw(withcash); + $.done() + }; + if (enabledcoin > 100) { + coinnum = parseInt(enabledcoin / 100) * 100; + await coinexChange() + } + } + } catch(e) { + $.log("获取用户信息失败" + e) + } finally { + resolve() + } + }) + }) +} + function coinexChange() { return new Promise((resolve, reject) =>{ - let Changeurl = { - url: `https://haokan.baidu.com/activity/api/coinexchange?coinnum=${coinnum}&autolock=1&productid=2&ugVersion=5.1.1.10`, - headers: { - Cookie: cookieval, - 'User-Agent': UA - } - } - $.get(Changeurl, (error, resp, data) =>{ + $.get(confApi(`api/coinexchange?coinnum=${coinnum}&autolock=1&productid=2&ugVersion=5.1.6.10`), (error, resp, data) =>{ let exchange = JSON.parse(data) //$.log(data) if (exchange.errno == 0) { @@ -244,20 +207,23 @@ function coinexChange() { function TaskCenter() { return new Promise((resolve, reject) =>{ - let rewurl = { - url: `https://haokan.baidu.com/activity/h5/vaultnew?productid=2&fromcsr=1&system=ios&_format=json`, - headers: { - Cookie: cookieval, - 'User-Agent': UA - } - } - $.get(rewurl, async(error, resp, data) =>{ + $.get(confApi('h5/vaultnew?productid=2&fromcsr=1&system=ios&_format=json'), async(error, resp, data) =>{ //console.log(formatJson(data)) try { let get_tasks = JSON.parse(data); + if(get_tasks.data.uname!=""){ + username = get_tasks.data.uname; + $.setdata(username,'baidu_nick') + } + isblack = get_tasks.data.is_black + $.log(" 🛎 ========== 任务开始 ========== 🛎 "); tasks = get_tasks.data.comps; for (x in tasks) { + if (isblack == true) { + $.msg($.name + " 账号" + username + "已黑号", "您的金币和余额已被冻结,请联系客服处理"); + break; + } taskid = tasks[x].taskId; id = tasks[x].id; if (tasks[x].name == "signIn") { From cd979eb10550174ba37d31449f12f78c8e9362ff Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 11 Feb 2021 02:20:19 +0800 Subject: [PATCH 581/721] --- Script/CheckIP.js | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/Script/CheckIP.js b/Script/CheckIP.js index 8b5fa427bd..06a9046b85 100644 --- a/Script/CheckIP.js +++ b/Script/CheckIP.js @@ -26,6 +26,22 @@ } } */ +function ENWORD(par) { + par = par.replace(/[\.\_\-\d]+/g," ") + let myRequest = { + url: "http://translate.google.cn/translate_a/single?client=gtx&sl=auto&tl=zh-CN&dt=t&q=" + encodeURI(par), + method: "GET" + }; +$task.fetch(myRequest).then(response => { + //console.log($response.body) + data = response.body + par = data.split(/[\"]+/g)[1]; + console.log(par); + return par; + }, reason =>{ + return par; + }) +} function ISP_ValidCheck(para) { if(para=="Microsoft Azure Cloud (eastasia)"){ return "微软云服务" @@ -77,13 +93,13 @@ return "中西部" } else if(regionName=="臺灣省 or 台灣省"){ - return city0 + return "台湾省" } else if(regionName=="Moscow"){ return "莫斯科" } else if(regionName=="新加坡"){ - return city0 + return "新加坡" } else if(regionName=="Tuen Mun"){ return "屯门" @@ -116,12 +132,24 @@ { return "东京" } + else if(regionName=="Taichung") + { + return "台中" + } else { return regionName } } function Org_ValidCheck(para) { + if(para.indexOf("Networks Limited")>-1){ + para = para.replace("Networks Limited","网络技术有限公司") + return para + } + if(para.indexOf("AWS")>-1){ + para = para.replace("AWS","亚马逊云服务") + return para + } if(para=="Microsoft Azure Cloud (eastasia)"){ return "微软云服务" } @@ -194,4 +222,4 @@ var subtitle =flags.get(obj['countryCode'])+City_ValidCheck(obj['city'])+'📀'+Org_ValidCheck(obj['org'])+'🌍'+obj['continent']; var ip = obj['query']; var description = '服务商:'+ISP_ValidCheck(obj['isp']) +'\n'+'DNS:'+ obj['reverse'] +'\n'+'地区:' +City_ValidCheck(obj['regionName'])+obj['district']+'\n' +'洲际:'+obj['continent'] +'\n'+'IP:'+obj['query'] +'\n' +'托管:'+ obj['hosting']; -$done({title, subtitle, ip, description}); \ No newline at end of file +$done({title, subtitle, ip, description}); From b91a3e141fc5350a5ecee1600097317515d09f42 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 11 Feb 2021 11:24:09 +0800 Subject: [PATCH 582/721] --- Task/baidu_speed.js | 3 --- Task/youth.js | 1 - 2 files changed, 4 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 82ac306579..92e8235ec1 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -208,7 +208,6 @@ function coinexChange() { function TaskCenter() { return new Promise((resolve, reject) =>{ $.get(confApi('h5/vaultnew?productid=2&fromcsr=1&system=ios&_format=json'), async(error, resp, data) =>{ - //console.log(formatJson(data)) try { let get_tasks = JSON.parse(data); if(get_tasks.data.uname!=""){ @@ -374,7 +373,6 @@ function activeBox() { } else if (data.indexOf("EquipmentComplete") >-1) { $.log(act_box.data.data+"\n") } else { - //$.log(formatJson(data)) await get_pkg() } } catch(e) { @@ -619,6 +617,5 @@ function showmsg() { } -function formatJson(json,options){var reg=null,formatted='',pad=0,PADDING=' ';options=options||{};options.newlineAfterColonIfBeforeBraceOrBracket=(options.newlineAfterColonIfBeforeBraceOrBracket===true)?true:false;options.spaceAfterColon=(options.spaceAfterColon===false)?false:true;if(typeof json!=='string'){json=JSON.stringify(json);}else{json=JSON.parse(json);json=JSON.stringify(json)};json=json.replace(/([\{\}])/g,'\r\n$1\r\n');json=json.replace(/([\[\]])/,'\r\n$1\r\n');json=json.replace(/(\,)/g,'$1\r\n');json=json.replace(/(\r\n\r\n)/g,'\r\n');json=json.replace(/\r\n\,/g,',');if(!options.newlineAfterColonIfBeforeBraceOrBracket){json=json.replace(/\:\r\n\{/g,':{');json=json.replace(/\:\r\n\[/g,':[')};if(options.spaceAfterColon){json=json.replace(/\:/g,':')};(json.split('\r\n')).forEach(function(node,index){var i=0,indent=0,padding='';if(node.match(/\{$/)||node.match(/\[$/)){indent=1}else if(node.match(/\}/)||node.match(/\]/)){if(pad!==0){pad-=1}}else{indent=0};for(i=0;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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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)} diff --git a/Task/youth.js b/Task/youth.js index f9068fa1c7..8a68e35b54 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -624,6 +624,5 @@ async function showmsg() { } function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} -function formatJson(json,options){var reg=null,formatted='',pad=0,PADDING=' ';options=options||{};options.newlineAfterColonIfBeforeBraceOrBracket=(options.newlineAfterColonIfBeforeBraceOrBracket===true)?true:false;options.spaceAfterColon=(options.spaceAfterColon===false)?false:true;if(typeof json!=='string'){json=JSON.stringify(json);}else{json=JSON.parse(json);json=JSON.stringify(json)};json=json.replace(/([\{\}])/g,'\r\n$1\r\n');json=json.replace(/([\[\]])/,'\r\n$1\r\n');json=json.replace(/(\,)/g,'$1\r\n');json=json.replace(/(\r\n\r\n)/g,'\r\n');json=json.replace(/\r\n\,/g,',');if(!options.newlineAfterColonIfBeforeBraceOrBracket){json=json.replace(/\:\r\n\{/g,':{');json=json.replace(/\:\r\n\[/g,':[')};if(options.spaceAfterColon){json=json.replace(/\:/g,':')};(json.split('\r\n')).forEach(function(node,index){var i=0,indent=0,padding='';if(node.match(/\{$/)||node.match(/\[$/)){indent=1}else if(node.match(/\}/)||node.match(/\]/)){if(pad!==0){pad-=1}}else{indent=0};for(i=0;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 168456229a66d5bde24c6aa4fd488efd9d4d5696 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 11 Feb 2021 21:27:50 +0800 Subject: [PATCH 583/721] --- Task/Sunert_Task.json | 8 +-- Task/moji.js | 2 +- Task/sunert.boxjs.json | 146 ++++++++++++++++++++--------------------- 3 files changed, 78 insertions(+), 78 deletions(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index d7d08d6279..6b37d74094 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -3,10 +3,10 @@ "description": "https://github.com/Sunert/Scripts", "task": [ { - "config": "0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/icon/moji.png, enabled=true" + "config": "0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气, img-url=https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/moji.png, enabled=true" }, { - "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/icon/tvpreview.png, enabled=true" + "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告, img-url=https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/tvpreview.png, enabled=true" }, { "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js, tag=12306火车时刻, img-url=https://raw.githubusercontent.com/Orz-3/task/master/12306.png, enabled=false" @@ -66,11 +66,11 @@ "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/digit_home/qx_rewite.txt, tag=mydigit_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "*/10 */3 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js, tag=聚看点, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/icon/jukan.png, enabled=true", + "config": "*/10 */3 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js, tag=聚看点, img-url=https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/jukan.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/jukan/qx_rewite.txt, tag=jkd_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "*/30 * * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baidu_speed.js, tag=百度极速版, img-url=https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/icon/baiduspeed.png, enabled=true" + "config": "*/30 * * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baidu_speed.js, tag=百度极速版, img-url=https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/baiduspeed.png, enabled=true" } ] } diff --git a/Task/moji.js b/Task/moji.js index 4fa65c8bef..697b4fce04 100644 --- a/Task/moji.js +++ b/Task/moji.js @@ -171,7 +171,7 @@ function mapSkycon(skycon) { ], "雨夹雪": [ "🌨雨夹雪", - "https://raw.githubusercontent.com/Sunert/ProxyConfig/master/QuantumultX/Rules/Images/ICON/RAIN_SNOW.png", + "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/RAIN_SNOW.png", ], //FOG: ["🌫️ 雾"], //DUST: ["💨 浮尘"], diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 761e94a1d8..d1cad6e8a1 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -1,9 +1,9 @@ { "id" : "sunert.app.sub", "author" : "@Sunert", - "icon" : "https:\/\/avatars2.githubusercontent.com\/u\/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", + "icon" : "https://avatars2.githubusercontent.com/u/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", "name" : "Sunert 签到应用订阅", - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/tree\/master", + "repo" : "https://github.com/Sunert/Scripts/tree/master", "apps" : [ { "author" : "@sunert", @@ -12,13 +12,13 @@ "sy_token_wb", "wb_nick" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/weibo.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", "id" : "weibo", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/weibo.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js", "name" : "新浪微博", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/weibo.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/weibo.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", + "https://raw.githubusercontent.com/Orz-3/task/master/weibo.png" ] }, { @@ -33,16 +33,16 @@ "cashbody_zq", "zqcash" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/youth.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", "id" : "youth", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/youth.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js", "settings" : [ { "id" : "notifytimes", "val" : "", "name" : "通知频率 (点击查看设置说明)", "type" : "number", - "desc" : "设定通知频率,前三次为全部通知,之后转盘次数\/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" + "desc" : "设定通知频率,前三次为全部通知,之后转盘次数/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" }, { "id" : "zqcash", @@ -68,8 +68,8 @@ ], "name" : "中青看点", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/youth.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/youth.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", + "https://raw.githubusercontent.com/Orz-3/task/master/youth.png" ] }, { @@ -78,13 +78,13 @@ "youth_start", "youth_end" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/youth_gain.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", "id" : "youthGain", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/youth_gain.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js", "name" : "中青浏览赚", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/youth.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/youth.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", + "https://raw.githubusercontent.com/Orz-3/task/master/youth.png" ] }, { @@ -93,9 +93,9 @@ "sy_signheader_dsj", "drawal_dsj" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/dianshijia.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", "id" : "dianshijia", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/dianshijia.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js", "settings" : [ { "items" : [ @@ -121,8 +121,8 @@ ], "name" : "电视家", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/dianshijia.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/dianshijia.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", + "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png" ] }, { @@ -130,13 +130,13 @@ "keys" : [ "cookie_ks" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/kuaishou.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", "id" : "kuaishou", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/kuaishou.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js", "name" : "快手极速版", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/kuaishou.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/kuaishou.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", + "https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png" ] }, { @@ -147,13 +147,13 @@ "sy_ck_snews", "sy_infoheader_snews" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/sinanews.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", "id" : "sinanews", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/sinanews.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js", "name" : "新浪新闻", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/sinanews.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/sinanews.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", + "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png" ] }, { @@ -162,9 +162,9 @@ "china_telecom_authToken_10000", "china_telecom_cookie" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/telecomInfinity.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", "id" : "chinatelecomEnquiry", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/telecomInfinity.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js", "settings" : [ { "id" : "Mon", @@ -176,8 +176,8 @@ ], "name" : "电信套餐查询", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/telecominfinty.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/telecominfinty.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", + "https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png" ] }, { @@ -185,13 +185,13 @@ "keys" : [ "sy_cookie_dj" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/jddj.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/jddj.js", "id" : "jddj", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/jddj.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js", "name" : "京东到家", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/jddj.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/jddj.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", + "https://raw.githubusercontent.com/Orz-3/task/master/jddj.png" ] }, { @@ -199,9 +199,9 @@ "keys" : [ "c" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/tvpreview.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", "id" : "TVlist", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/tvpreview.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js", "settings" : [ { "id" : "c", @@ -213,8 +213,8 @@ ], "name" : "电视预告", "icons" : [ - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/tvpreview_mini.png", - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/tvpreview.png" + "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/tvpreview_mini.png", + "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/tvpreview.png" ] }, { @@ -227,9 +227,9 @@ "hour_desc", "index_desc" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/moji.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", "id" : "moji", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/moji.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js", "settings" : [ { "id" : "city", @@ -284,8 +284,8 @@ ], "name" : "墨迹天气", "icons" : [ - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/moji_mini.png", - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/moji.png" + "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/moji_mini.png", + "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/moji.png" ] }, { @@ -294,9 +294,9 @@ "jukan_body", "jukan_name" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/jukan.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", "id" : "jukan", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/jukan.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js", "settings" : [ { "id" : "jukan_out", @@ -317,7 +317,7 @@ }, { "key" : "10", - "label" : "10元(阅读\/邀请)" + "label" : "10元(阅读/邀请)" }, { "key" : "30", @@ -343,8 +343,8 @@ ], "name" : "聚看点", "icons" : [ - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/jukan_mini.png", - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/jukan.png" + "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/jukan_mini.png", + "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/jukan.png" ] }, { @@ -352,13 +352,13 @@ "keys" : [ "sign_mydigit" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/mydigit.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", "id" : "mydigit", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/mydigit.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js", "name" : "数码之家", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/mydigit.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/mydigit.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", + "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png" ] }, { @@ -369,9 +369,9 @@ "CookieTB", "cash_baidu" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/baiduspeed.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/baiduspeed.js", "id" : "baidu", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/baiduspeed.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baiduspeed.js", "settings" : [ { "items" : [ @@ -408,8 +408,8 @@ ], "name" : "百度极速任务", "icons" : [ - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/baiduspeed_mini.png", - "https:\/\/github.com\/Sunert\/ProxyConfig\/raw\/master\/QuantumultX\/Rules\/Images\/icon\/baiduspeed.png" + "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/baiduspeed_mini.png", + "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/baiduspeed.png" ] }, { @@ -419,9 +419,9 @@ "sy_cookie_txnews", "video_txnews" ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/txnews.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", "id" : "txnews", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/txnews.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js", "settings" : [ { "id" : "notifynum", @@ -442,8 +442,8 @@ ], "name" : "腾讯新闻", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/txnews.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/txnews.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", + "https://raw.githubusercontent.com/Orz-3/task/master/txnews.png" ] }, { @@ -451,9 +451,9 @@ "keys" : [ ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/tvpreview.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", "id" : "translate", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/translate.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js", "settings" : [ { "id" : "word", @@ -466,8 +466,8 @@ ], "name" : "谷歌翻译", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/translate.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/translate.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", + "https://raw.githubusercontent.com/Orz-3/task/master/translate.png" ] }, { @@ -475,9 +475,9 @@ "keys" : [ ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/exchangeRate.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", "id" : "exchange rate", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/exchangeRate.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js", "settings" : [ { "id" : "froma", @@ -503,8 +503,8 @@ ], "name" : "汇率换算", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/exchangerate.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/exchangerate.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", + "https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png" ] }, { @@ -512,9 +512,9 @@ "keys" : [ ], - "repo" : "https:\/\/github.com\/Sunert\/Scripts\/blob\/master\/Task\/trainquery.js", + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", "id" : "trainquery", - "script" : "https:\/\/raw.githubusercontent.com\/Sunert\/Scripts\/master\/Task\/trainquery.js", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js", "settings" : [ { "items" : [ @@ -531,7 +531,7 @@ "val" : "ADULT", "name" : "乘客类型", "type" : "radios", - "desc" : "成人\/学生" + "desc" : "成人/学生" }, { "id" : "left", @@ -564,8 +564,8 @@ ], "name" : "列车时刻", "icons" : [ - "https:\/\/raw.githubusercontent.com\/Orz-3\/mini\/master\/12306.png", - "https:\/\/raw.githubusercontent.com\/Orz-3\/task\/master\/12306.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", + "https://raw.githubusercontent.com/Orz-3/task/master/12306.png" ] } ] From d01f7d5f9010a5c85f5c74c18ef02d78c00b093e Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 01:02:39 +0800 Subject: [PATCH 584/721] --- Task/Sunert_Task.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index 6b37d74094..4577750574 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -15,7 +15,7 @@ "config": "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js, tag=实时货币换算, img-url=https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png, enabled=false" }, { - "config": "7 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js, tag=谷歌中英互译, img-url= https://raw.githubusercontent.com/Orz-3/task/master/translate.png, enabled=false" + "config": "7 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js, tag=谷歌中英互译, img-url=https://raw.githubusercontent.com/Orz-3/task/master/translate.png, enabled=false" }, { "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐, img-url=https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png, enabled=true", From ca7a25869b4bd795cc2b578c047907bad6339f35 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 10:03:50 +0800 Subject: [PATCH 585/721] --- .github/workflows/weibo.yml | 1 - Task/GithubActions.md | 5 ++--- Task/sunert.boxjs.json | 1 - TaskConf/sina/loon.plugin | 3 +-- TaskConf/sina/qx_rewite.txt | 4 +--- TaskConf/sina/readme.md | 16 +++------------- TaskConf/sina/surge.sgmodule | 4 +--- 7 files changed, 8 insertions(+), 26 deletions(-) diff --git a/.github/workflows/weibo.yml b/.github/workflows/weibo.yml index 83da3ce202..6583d58b88 100644 --- a/.github/workflows/weibo.yml +++ b/.github/workflows/weibo.yml @@ -13,7 +13,6 @@ jobs: if: github.event.repository.owner.id == github.event.sender.id env: WB_TOKEN: ${{ secrets.WB_TOKEN }} - WB_PAY: ${{ secrets.WB_PAY }} steps: - name: Checkout uses: actions/checkout@v2 diff --git a/Task/GithubActions.md b/Task/GithubActions.md index c18cc95cd9..3596f7a82a 100644 --- a/Task/GithubActions.md +++ b/Task/GithubActions.md @@ -2,7 +2,7 @@ | Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | | :-------: | :------: | :-------: | ------ | ------- | -| YOUTH_HEADER | 中青看点 youth.yml | # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | +| YOUTH_HEADER | 中青看点 youth.yml | # | 必须 | 请求地址: "https://kd.youth.cn/WebApi/NewTaskIos/getTaskList",
中青签到请求头引用: uid=xxx&cookie_id=xxx&cookie=xxx| | YOUTH_ARTBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | | YOUTH_REDBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | | YOUTH_TIME | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/user/app_stay.json",
阅读时长请求体: p=xxx | @@ -21,8 +21,7 @@ | DSJ_DRAWAL | 同上 | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/cash/withdrawal",
即提现请求地址 | | DSJ_NOTIFY_CONTROL | 同上 | true/false | 可选 | 电视家通知开关
默认不推送 | | | | | - | | -| WB_TOKEN | 微博 | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: gsid=xxx | -| WB_PAY | 同上 | #或换行 | 必须 | 请求地址:"https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do",
提现请求头 | +| WB_TOKEN | 微博 | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: uid=xxx&gsid=xxx&s=xxx | | | | | - | |
diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index d1cad6e8a1..68c17f89ca 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -8,7 +8,6 @@ { "author" : "@sunert", "keys" : [ - "sy_payheader_wb", "sy_token_wb", "wb_nick" ], diff --git a/TaskConf/sina/loon.plugin b/TaskConf/sina/loon.plugin index a1fad213ac..284f8862f0 100644 --- a/TaskConf/sina/loon.plugin +++ b/TaskConf/sina/loon.plugin @@ -5,7 +5,6 @@ cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/ma http-request https:\/\/api\.weibo\.cn\/\d\/user\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 -http-request https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 [MITM] -hostname = api.weibo.cn, pay.sc.weibo.com \ No newline at end of file +hostname = api.weibo.cn \ No newline at end of file diff --git a/TaskConf/sina/qx_rewite.txt b/TaskConf/sina/qx_rewite.txt index bbda5b6d1f..dd82269e1a 100644 --- a/TaskConf/sina/qx_rewite.txt +++ b/TaskConf/sina/qx_rewite.txt @@ -1,4 +1,4 @@ -hostname = newsapi.sina.cn, api.weibo.cn, pay.sc.weibo.com, lite.sina.cn +hostname = newsapi.sina.cn, api.weibo.cn, lite.sina.cn https:\/\/newsapi\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js @@ -6,8 +6,6 @@ https:\/\/newsapi\.sina\.cn\/\?resource=userpoint\/signIn url script-request-hea https:\/\/api\.weibo\.cn\/\d\/user\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js -https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js - https?:\/\/lite\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center - script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js https?:\/\/lite\.sina\.cn\/\?resource=userpoint\/signIn - script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js diff --git a/TaskConf/sina/readme.md b/TaskConf/sina/readme.md index e5c05bfc74..8ad8913d62 100644 --- a/TaskConf/sina/readme.md +++ b/TaskConf/sina/readme.md @@ -8,7 +8,7 @@ ### IOS配置教程 ``` [MITM] -hostname = api.weibo.cn, pay.sc.weibo.com +hostname = api.weibo.cn ``` #### Surge: * [模块地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/surge.sgmodule) @@ -24,9 +24,6 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/surge.sgmo # 获取微博 Cookie. 微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/user\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js - -# 微博钱包签到Cookie -微博钱包签到 = type=http-request,pattern=https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js ``` #### Shadowrocket(Cron配置): @@ -48,8 +45,6 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/loon.plugi cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 http-request https:\/\/api\.weibo\.cn\/\d\/user\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 - -http-request https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 ``` #### Quantumult X: * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/qx_rewite.txt) @@ -63,9 +58,6 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite. ``` [rewrite_local] https:\/\/api\.weibo\.cn\/\d\/user\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js - -# 钱包签到Cookie -https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js ``` * 本地任务配置 @@ -75,8 +67,7 @@ https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url scrip ``` ### 获取Cookie方法 1. 打开微博App,获取Cookie,获取后请注释或禁用Cookie - 2. 打开微博钱包点击签到,获取Cookie, - 3. 钱包签到时获取Cookie,已经签到无法获取 + 2. 已取消获取获取钱包Cookie >>> [回到顶部](#IOS配置教程) @@ -92,8 +83,7 @@ https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url scrip | Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | | :-------: | :------: | :-------: | ------ | ------- | -| WB_TOKEN | 微博 | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: gsid=xxx | -| WB_PAY | 同上 | #或换行 | 必须 | 请求地址:"https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do",
提现请求头 | +| WB_TOKEN | 微博 | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/2/user/show",
签到token: uid=xxx&gsid=xxx&s=xxx |
diff --git a/TaskConf/sina/surge.sgmodule b/TaskConf/sina/surge.sgmodule index c9a976bb74..efc8843ff1 100644 --- a/TaskConf/sina/surge.sgmodule +++ b/TaskConf/sina/surge.sgmodule @@ -8,8 +8,6 @@ # 获取微博 Cookie. 微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/user\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js -# 微博钱包签到Cookie -微博钱包签到 = type=http-request,pattern=https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js [MITM] -hostname = %APPEND% api.weibo.cn, pay.sc.weibo.com \ No newline at end of file +hostname = %APPEND% api.weibo.cn \ No newline at end of file From d6560719f368c9fa0d05ca43c11570642ecd242a Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 15:07:54 +0800 Subject: [PATCH 586/721] =?UTF-8?q?1.=20=E5=88=A0=E9=99=A4=E5=BE=AE?= =?UTF-8?q?=E5=8D=9A=E9=92=B1=E5=8C=85ck=EF=BC=8C=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=89=93=E5=BC=80app=EF=BC=8C=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=BE=AE=E5=8D=9A=E7=AD=BE=E5=88=B0ck=202.=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E4=B8=AD=E9=9D=92=E9=98=85=E8=AF=BB=E6=97=B6=E9=95=BF?= =?UTF-8?q?=E9=87=8D=E5=86=99=EF=BC=8C=E9=87=8D=E6=96=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Youth_Read.js | 9 +-------- TaskConf/youth/loon.plugin | 2 +- TaskConf/youth/qx_rewite.txt | 2 +- TaskConf/youth/readme.md | 11 ++++++----- TaskConf/youth/surge.sgmodule | 2 +- 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 4fa32eef9b..8187b4c73c 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -54,14 +54,7 @@ let ReadArr = [], YouthBody = "",readscore = 0; function AutoRead() { return new Promise((resolve, reject) => { - let url = { - url: `https://ios.baertt.com/v5/article/complete.json`, - headers: { - 'User-Agent': 'KDApp/1.7.8 (iPhone; iOS 14.0; Scale/3.00)' - }, - body: articlebody - }; - $.post(url, async(error, response, data) => { + $.post(batHost('article/complete.json',articlebody), async(error, response, data) => { let readres = JSON.parse(data); //console.log(data) if (readres.error_code == '0' && typeof readres.items.read_score === 'number') { diff --git a/TaskConf/youth/loon.plugin b/TaskConf/youth/loon.plugin index c116983048..966592c275 100644 --- a/TaskConf/youth/loon.plugin +++ b/TaskConf/youth/loon.plugin @@ -5,7 +5,7 @@ cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/ http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 -http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 [MITM] diff --git a/TaskConf/youth/qx_rewite.txt b/TaskConf/youth/qx_rewite.txt index c7f3d623a4..e0b1dfc201 100644 --- a/TaskConf/youth/qx_rewite.txt +++ b/TaskConf/youth/qx_rewite.txt @@ -6,7 +6,7 @@ https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/task\/browse_(start|end)\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 5df53baca9..414950682f 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -25,7 +25,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/surge.sgm 中青看点 = type=http-request,pattern=https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/red_packet,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true ``` #### Shadowrocket(Cron配置): @@ -49,7 +49,7 @@ cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/ http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 -http-request https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 ``` #### Quantumult X: @@ -66,7 +66,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js ``` * 本地任务配置 @@ -77,8 +77,9 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body h ``` ### 获取Cookie方法 * 打开极速版APP,进去个人中心,或者签到一次,提示获取Cookie - - 浏览一篇短文,等待倒计时结束,提示获取阅读请求及阅读时长 + - 浏览一篇短文,等待倒计时结束,提示获取阅读请求 * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) + * 多阅读几篇短文,随机获取阅读时长请求 - 正常提现一次,获取提现请求(可选) >>> [回到顶部](#IOS配置教程) @@ -98,7 +99,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body h | YOUTH_HEADER | 中青看点 youth.yml | #或者换行 | 必须 | 请求地址: "https://kd.youth.cn/WebApi/NewTaskIos/getTaskList",
中青签到请求头引用: uid=xxx&cookie_id=xxx&cookie=xxx | | YOUTH_ARTBODY | 同上 | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | | YOUTH_REDBODY | 同上 | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | -| YOUTH_TIME | 同上 | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/user/app_stay.json",
阅读时长请求体: p=xxx | +| YOUTH_TIME | 同上 | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/user/stay.json",
阅读时长请求体: p=xxx | | YOUTH_NOTIFY_CONTROL | 同上 | true/false | 可选 | 中青通知开关
默认当转盘次数为50或者100并且余额大于10元时推送通知 | | | | | - | | | YOUTH_READ | 中青阅读 youth_read.yml | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | diff --git a/TaskConf/youth/surge.sgmodule b/TaskConf/youth/surge.sgmodule index bc0eccd0a6..cc6cdda7a7 100644 --- a/TaskConf/youth/surge.sgmodule +++ b/TaskConf/youth/surge.sgmodule @@ -11,7 +11,7 @@ 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/red_packet,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/app_stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true From c6efa45133a908d2da525490c7d7c046bf2b1716 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 16:00:26 +0800 Subject: [PATCH 587/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=AD=E9=9D=92?= =?UTF-8?q?=E6=89=93=E5=8D=A1=E5=BC=80=E5=85=B3=EF=BC=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=85=B3=E9=97=AD=EF=BC=8C=E6=9A=82=E4=B8=8D=E6=94=AF=E6=8C=81?= =?UTF-8?q?AC=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/youth.yml | 2 +- .github/workflows/youth_read.yml | 2 +- Task/sunert.boxjs.json | 10 +++- Task/youth.js | 98 +++++++++++++++++++++++++++----- 4 files changed, 94 insertions(+), 18 deletions(-) diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index a99e4a0514..232a9747b2 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -6,7 +6,7 @@ name: 中青看点 on: workflow_dispatch: schedule: - - cron: '*/7 */2 * * *' + - cron: '*/7 */3 * * *' watch: types: started diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index 2fae4671dd..3c881f9cea 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -6,7 +6,7 @@ name: 中青自动阅读 on: workflow_dispatch: schedule: - - cron: '*/15 1-12/2 * * *' + - cron: '8 1-12/2 * * *' watch: types: started jobs: diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 68c17f89ca..6fb651678f 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -30,12 +30,20 @@ "readtime_zq", "cashurl_zq", "cashbody_zq", - "zqcash" + "zqcash", + "zqcard" ], "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", "id" : "youth", "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js", "settings" : [ + { + "id" : "zqcard", + "val" : "false", + "name" : "打卡赚钱", + "type" : "boolean", + "desc" : "每日打卡报名及早起打卡" + }, { "id" : "notifytimes", "val" : "", diff --git a/Task/youth.js b/Task/youth.js index 8a68e35b54..a19d5b6060 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-08 18:00 +更新时间: 2021-02-12 16:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md @@ -9,12 +9,11 @@ let s = 1000 //各数据接口延迟 const $ = new Env("中青看点") let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖每50次通知一次,如需关闭全部通知请设为0 -const YOUTH_HOST = "https://kd.youth.cn/WebApi/"; const notify = $.isNode() ? require('./sendNotify') : ''; +const ONCard = $.getdata('zqcard')||"false" //早起打卡开关 const withdrawcash = $.getdata('zqcash')||30 //提现金额 let withdrawUrl =$.getdata('cashurl_zq') let withdrawBody =$.getdata('cashbody_zq') - let rotaryscore=0,doublerotary=0; let cookieArr = [], cookie = '', readArr = [], articlebodyVal ='', @@ -161,8 +160,9 @@ function TaskCenter() { return new Promise((resolve, reject) =>{ $.post(kdHost('WebApi/NewTaskIos/getTaskList?'), async(error, resp, data) =>{ try { - taskres = JSON.parse(data) - //$.log(formatJson(data)) + taskres = JSON.parse(data); + //$.log(JSON.stringify(taskres,null,2)) + //return if (taskres.status == 1) { for (dailys of taskres.list.daily) { if (dailys.status == "1" && dailys.action != "") { @@ -170,19 +170,25 @@ function TaskCenter() { await $.wait(600); await getAction(dailys.reward_action) } else if (dailys.status == "2" && dailys.action != "") { - await $.wait(600); $.log(dailys.title + "," + dailys.but + ",已领取青豆" + dailys.score) }; - if (dailys.id == "10" && dailys.status == "0") { + if (dailys.title == "打卡赚钱" && ONCard == "true") { + if (dailys.status == "0") { + await punchCard() + } else if (dailys.status == "1" && $.time("HH") == "05") { + await endCard() + } + } + if (dailys.id == "10" && dailys.status == "0") { $.log(dailys.title + "未完成,去做任务"); - for (x=0;x<5;x++){ - $.log("等待5s执行第"+(x+1)+"次") - await $.wait(5000); - await recordAdVideo(dailys.reward_action) - } + for (x = 0; x < 5; x++) { + $.log("等待5s执行第" + (x + 1) + "次"); + await $.wait(5000); + await recordAdVideo(dailys.reward_action) + } if (record.status == 0) { - await getAction(dailys.reward_action); - } + await getAction(dailys.reward_action); + } } } } @@ -283,6 +289,68 @@ function withDraw() { }) } + +function punchCard() { + return new Promise((resolve, reject) => { + $.post(kdHost('WebApi/PunchCard/signUp'), (error, response, data) => { + punchcardstart = JSON.parse(data); + if (punchcardstart.code == 1) { + detail += `【打卡报名】打卡报名${punchcardstart.msg} ✅ \n`; + $.log("每日报名打卡成功,报名时间:"+`${$.time('MM-dd HH:mm')}`) + } + else { + //detail += `【打卡报名】${punchcardstart.msg}\n` + // $.log(punchcardstart.msg) + } + resolve(); + }) + }) +} + +//结束打卡 +function endCard() { + return new Promise((resolve, reject) => { + setTimeout(() => { + $.post(kdHost('WebApi/PunchCard/doCard?'),async(error, response, data) => { + punchcardend = JSON.parse(data) + if (punchcardend.code == 1) { + detail += `【早起打卡】${punchcardend.data.card_time}${punchcardend.msg}✅\n`; + $.log("早起打卡成功,打卡时间:"+`${punchcardend.data.card_time}`); + await $.wait(1000); + await Cardshare(); + } else if (punchcardend.code == 0) { + // TODO .不在打卡时间范围内 + //detail += `【早起打卡】${punchcardend.msg}\n` + // $.log("不在打卡时间范围内") + } + resolve() + }) + },s) + }) +} +//打卡分享 +function Cardshare() { + return new Promise((resolve, reject) =>{ + $.post(kdHost('WebApi/PunchCard/shareStart?'), (error, response, data) =>{ + sharestart = JSON.parse(data); + //detail += `【打卡分享】${sharestart.msg}\n` + if (sharestart.code == 1) { + $.post(kdHost('WebApi/PunchCard/shareEnd?'), (error, response, data) =>{ + shareres = JSON.parse(data); + if (shareres.code == 1) { + detail += ` + ${shareres.data.score}青豆\n` + } else { + //detail += `【打卡分享】${shareres.msg}\n` + //$.log(`${shareres.msg}`) + } + resolve() + }) + } + }) + }) +} + + function SevCont() { return new Promise((resolve, reject) =>{ $.post(kdHost('WebApi/PunchCard/luckdraw?'), async(error, resp, data) =>{ @@ -547,7 +615,7 @@ function runRotary(index) { const rotarbody = cookie + '&num=' + index; const time = new Date().getTime(); const url = { - url: `${YOUTH_HOST}RotaryTable/chestReward?_=${time}`, + url: `https://kd.youth.cn/WebApi/RotaryTable/chestReward?_=${time}`, headers:{ 'Referer':'https://kd.youth.cn/html/rotaryTable/index.html?'+cookie }, From caef5a764640e3767b63dd76726ff370e36ef2ae Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 16:03:46 +0800 Subject: [PATCH 588/721] =?UTF-8?q?=E5=87=8F=E5=B0=8F=E4=B8=AD=E9=9D=92?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/youth.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index 232a9747b2..8f76e7a9ec 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -6,7 +6,7 @@ name: 中青看点 on: workflow_dispatch: schedule: - - cron: '*/7 */3 * * *' + - cron: '1-25/7 */5 * * *' watch: types: started From f166bd356a67fbdb5ee415115adad9421bf70c67 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 18:07:46 +0800 Subject: [PATCH 589/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index a19d5b6060..3dc1391c78 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -691,6 +691,6 @@ async function showmsg() { } } -function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} +function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} 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 dd44102ad37c95253e57dd911640c88bae617962 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 18:23:39 +0800 Subject: [PATCH 590/721] --- Task/Youth_Read.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 8187b4c73c..836a224743 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -38,9 +38,9 @@ let ReadArr = [], YouthBody = "",readscore = 0; if (ReadArr[i]) { articlebody = ReadArr[i]; $.index = i + 1; - console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`) - } + console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`); await AutoRead(); + }; if (process.env.YOUTH_TIME){ timebodyVal = process.env.YOUTH_TIME; await readTime() From ba602303a632300b2402bfac92026eaec716a6f6 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 18:44:57 +0800 Subject: [PATCH 591/721] --- Task/Youth_Read.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 836a224743..6704a91903 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -43,7 +43,9 @@ let ReadArr = [], YouthBody = "",readscore = 0; }; if (process.env.YOUTH_TIME){ timebodyVal = process.env.YOUTH_TIME; + if((new Date().getTime()-$.startTime)&60000==0){ await readTime() + } }; } console.log(`-------------------------\n\n中青看点共完成${$.index}次阅读,共计获得${readscore}个青豆,阅读请求全部结束`) From bf7d00788c5d1a69870cc8ad65fbfbbbb40ae3a8 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 19:03:04 +0800 Subject: [PATCH 592/721] --- Task/Youth_Read.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 6704a91903..c8edc01c42 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -12,6 +12,7 @@ Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk030 const $ = new Env("中青看点") //const notify = $.isNode() ? require('./sendNotify') : ''; let ReadArr = [], YouthBody = "",readscore = 0; +var lastClick = Date.now()-60000; if (process.env.YOUTH_READ && process.env.YOUTH_READ.indexOf('&') > -1) { YouthBody = process.env.YOUTH_READ.split('&'); console.log(`您选择的是用"&"隔开\n`) @@ -43,7 +44,7 @@ let ReadArr = [], YouthBody = "",readscore = 0; }; if (process.env.YOUTH_TIME){ timebodyVal = process.env.YOUTH_TIME; - if((new Date().getTime()-$.startTime)&60000==0){ + if(Date.now() - lastClick >=60000){ await readTime() } }; From d1612bdd35599d37c5fbed6582269dc12a207e81 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 19:31:21 +0800 Subject: [PATCH 593/721] --- TaskConf/sina/loon.plugin | 2 +- TaskConf/sina/qx_rewite.txt | 2 +- TaskConf/sina/readme.md | 8 ++++---- TaskConf/sina/surge.sgmodule | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/TaskConf/sina/loon.plugin b/TaskConf/sina/loon.plugin index 284f8862f0..cf03ff1141 100644 --- a/TaskConf/sina/loon.plugin +++ b/TaskConf/sina/loon.plugin @@ -3,7 +3,7 @@ [Script] cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 -http-request https:\/\/api\.weibo\.cn\/\d\/user\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 +http-request https:\/\/api\.weibo\.cn\/\d\/users\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 [MITM] diff --git a/TaskConf/sina/qx_rewite.txt b/TaskConf/sina/qx_rewite.txt index dd82269e1a..f4864ed9b1 100644 --- a/TaskConf/sina/qx_rewite.txt +++ b/TaskConf/sina/qx_rewite.txt @@ -4,7 +4,7 @@ https:\/\/newsapi\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center url https:\/\/newsapi\.sina\.cn\/\?resource=userpoint\/signIn url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js -https:\/\/api\.weibo\.cn\/\d\/user\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +https:\/\/api\.weibo\.cn\/\d\/users\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js https?:\/\/lite\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center - script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js diff --git a/TaskConf/sina/readme.md b/TaskConf/sina/readme.md index 8ad8913d62..e21677aedc 100644 --- a/TaskConf/sina/readme.md +++ b/TaskConf/sina/readme.md @@ -23,7 +23,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/surge.sgmo 微博&钱包签到 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js,script-update-interval=0 # 获取微博 Cookie. -微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/user\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/users\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js ``` #### Shadowrocket(Cron配置): @@ -44,7 +44,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/loon.plugi [Script] cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 -http-request https:\/\/api\.weibo\.cn\/\d\/user\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 +http-request https:\/\/api\.weibo\.cn\/\d\/users\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 ``` #### Quantumult X: * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/qx_rewite.txt) @@ -57,7 +57,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite. ``` [rewrite_local] -https:\/\/api\.weibo\.cn\/\d\/user\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +https:\/\/api\.weibo\.cn\/\d\/users\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js ``` * 本地任务配置 @@ -83,7 +83,7 @@ https:\/\/api\.weibo\.cn\/\d\/user\/show url script-request-header https://raw.g | Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | | :-------: | :------: | :-------: | ------ | ------- | -| WB_TOKEN | 微博 | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/2/user/show",
签到token: uid=xxx&gsid=xxx&s=xxx | +| WB_TOKEN | 微博 | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/2/users/show",
签到token: uid=xxx&gsid=xxx&s=xxx |
diff --git a/TaskConf/sina/surge.sgmodule b/TaskConf/sina/surge.sgmodule index efc8843ff1..0f3d6c9622 100644 --- a/TaskConf/sina/surge.sgmodule +++ b/TaskConf/sina/surge.sgmodule @@ -6,7 +6,7 @@ 微博&钱包签到 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js,script-update-interval=0 # 获取微博 Cookie. -微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/user\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/users\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js [MITM] From 82804b9f9ee50940d9cca552f2384b3bc065e09c Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 22:54:01 +0800 Subject: [PATCH 594/721] --- Task/baidu_speed.js | 116 +++++++++----------------------------------- 1 file changed, 24 insertions(+), 92 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index 92e8235ec1..bb97c20212 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -1,5 +1,5 @@ /* -更新时间:2021-02-02 19:50 +更新时间:2021-02-12 22:50 百度极速版签到任务,使用脚本有黑号严重,请谨慎使用‼️ 赞赏:百度极速邀请码`RW9ZSW 点击链接立得红包,最高100元!https://dwz.cn/Oilv4CJ1`,农妇山泉 -> 有点咸,万分感谢 @@ -16,10 +16,18 @@ const $ = new Env('百度极速版') let CookieArr = [],cashArr=[]; const notify = $.isNode() ? require('./sendNotify') : ''; -const baiducks = $.getdata(`cookie_baidu`); +const baiducks = $.getdata(`chavy_cookie_tieba`) || $.getdata(`CookieTB`); +let baiducash = $.getdata(`cash_baidu`); + let taskON = $.getdata(`task_baidu`)||"true"//除提现和兑换外其他任务开关; let isblack = "false"; let UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.24.0 matrixstyle/0 info baiduboxapp/5.1.6.10 (Baidu; P2 14.2)' + + +if(!$.isNode()&&baiducks && baiducks.indexOf('&')==-1){ + CookieArr.push(baiducks); + cashArr.push($.getdata("cash_baidu")||30) +} else { if ($.isNode()) { if (process.env.BAIDU_COOKIE && process.env.BAIDU_COOKIE.indexOf('&') > -1) { BDCookie = process.env.BAIDU_COOKIE.split('&'); @@ -35,8 +43,13 @@ if ($.isNode()) { else if (process.env.BAIDU_CASH && process.env.BAIDU_CASH.indexOf('\n') > -1) { BDCASH = process.env.BAIDU_CASH.split('\n'); } else { - BDCASH = process.env.BAIDU_CASH.split() + BDCASH = [process.env.BAIDU_CASH] } + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`); +} else if (!$.isNode()&&baiducks && baiducks.indexOf('&')>-1){ + BDCookie = baiducks.split("&") + BDCASH = [baiducash] +} Object.keys(BDCookie).forEach((item) => { if (BDCookie[item]) { @@ -48,20 +61,8 @@ if ($.isNode()) { cashArr.push(BDCASH[item]) } }) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`); - console.log(`您共提供${CookieArr.length}个百度账号 Cookie`) - -} else if(baiducks && baiducks.indexOf('&')>-1){ - BDCookie = baiducks.split("&") - Object.keys(BDCookie).forEach((item) => { - if (BDCookie[item]) { - CookieArr.push(BDCookie[item]) - } - }) -} else { -CookieArr.push($.getdata(`chavy_cookie_tieba`) || $.getdata(`CookieTB`)); - cashArr.push($.getdata("cash_baidu")||30) -} + console.log(`您共提供${CookieArr.length}个百度账号 Cookie`) + } !(async() =>{ if (!CookieArr[0]) { @@ -169,8 +170,12 @@ function userInfo() { availablecoin = get_pay.data.available_coin, enabledcoin = get_pay.data.enabled_coin, enabledmoney = get_pay.data.enabled_money, - yesterdaycoin = get_pay.data.yesterday_coin, + yesterdaycoin = get_pay.data.yesterday_coin; + if(CookieArr.length==1){ username = $.getdata('baidu_nick') ? $.getdata('baidu_nick') : null; + } else { + username = "账号"+ $.index + } $.sub = " 昵称:" + username + " 现金:" + enabledmoney + "元 金币:" + availablecoin; $.log("\n********** 昵称:" + username + " 现金:" + enabledmoney + "元 **********\n"); if (parseInt(enabledmoney) >= Number(withcash) && $.time("HH") == "06") { @@ -210,7 +215,7 @@ function TaskCenter() { $.get(confApi('h5/vaultnew?productid=2&fromcsr=1&system=ios&_format=json'), async(error, resp, data) =>{ try { let get_tasks = JSON.parse(data); - if(get_tasks.data.uname!=""){ + if(get_tasks.data.uname!=""&&CookieArr.length==1){ username = get_tasks.data.uname; $.setdata(username,'baidu_nick') } @@ -537,79 +542,6 @@ function searchBox(id) { }) }) } -//缩减开宝箱时间 -function chestTime() { - return new Promise((resolve, reject) =>{ - let timeurl = { - url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestTime&rewardVideoPkg=${Pkg}`, - headers: { - Cookie: cookieval, - 'User-Agent': UA, - Referer: RefererUrl - } - } - $.get(timeurl, (error, resp, data) =>{ - //$.log(data) - try { - let get_chest = JSON.parse(data); - if (get_chest.errno == 11006) { - $.log("开宝箱任务" + get_chest.errmsg) - } else if (get_chest.errno == 0) { - $.log("开宝箱时间缩减" + get_chest.data.awardTime / 60 + "分钟") - } else if (get_chest.errno == 19001 && get_chest.data.originData.errno == 10074) { - //$.desc += get_chest.data.originData.msg - $.log("开宝箱任务ID:" + taskid + get_chest.data.originData.msg) - } - } catch(e) { - $.logErr(e + data); - } finally { - resolve() - } - }) - }) -} - -//头部宝箱 -function headerBox() { - return new Promise((resolve, reject) =>{ - let headerboxurl = { - url: `https://haokan.baidu.com/activity/acuserchest/openheader?productid=2&fromcsr=1`, - headers: { - Cookie: cookieval, - 'User-Agent': UA - } - } - $.get(headerboxurl, async(error, response, data) =>{ - let hed_box = JSON.parse(data) - //$.log('headerbox: ' + data) - if (hed_box.errno == 0) { - $.desc += '【头部宝箱】: 总计金币' + hed_box.data.gameheader.coinInfo.coinCount - } else { - $.log('【头部宝箱】❎'+hed_box.msg) - } - resolve() - }) - }) -} -function doubleBox() { - return new Promise((resolve, reject) =>{ - let douboxurl = { - url: `https://eopa.baidu.com/api/task/1/task/${taskid}/complete?rewardType=chestDouble&rewardVideoPkg=${Pkg}`, - headers: { - Cookie: cookieval, - 'User-Agent': UA, - Referer: RefererUrl - } - } - $.get(douboxurl, (error, response, data) =>{ - let get_doubox = JSON.parse(data); - if (get_doubox.errno == 0) { - $.desc += '开宝箱获得双倍收益: +' + get_doubox.data.awardCoin - } - resolve() - }) - }) -} function showmsg() { From 7c75a5670a920a2a8ccdfdefa035992d01164810 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 12 Feb 2021 23:17:05 +0800 Subject: [PATCH 595/721] --- Task/baidu_speed.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index bb97c20212..a4eb103cf8 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -250,6 +250,7 @@ function TaskCenter() { $.logErr(e, data); } finally { $.msg($.name, $.sub, $.desc) + resolve() } }) }) From 156b6cb48a0816beb1ec6eabac83989c81d19156 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 13 Feb 2021 15:22:44 +0800 Subject: [PATCH 596/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 3dc1391c78..afc874a69e 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -175,7 +175,7 @@ function TaskCenter() { if (dailys.title == "打卡赚钱" && ONCard == "true") { if (dailys.status == "0") { await punchCard() - } else if (dailys.status == "1" && $.time("HH") == "05") { + } else if (dailys.status == "1" && $.time("HH") == "05"||$.time("HH") == "13") { await endCard() } } From bed56ae9f6313c91a91c43a58e7d3a8c33ae7c9f Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 13 Feb 2021 20:24:38 +0800 Subject: [PATCH 597/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 127 ++++++++++++++++++++++++-------------------------- 1 file changed, 62 insertions(+), 65 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index afc874a69e..aeb64a6065 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-12 16:00 +更新时间: 2021-02-13 20:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md @@ -15,6 +15,7 @@ const withdrawcash = $.getdata('zqcash')||30 //提现金额 let withdrawUrl =$.getdata('cashurl_zq') let withdrawBody =$.getdata('cashbody_zq') let rotaryscore=0,doublerotary=0; + let cookieArr = [], cookie = '', readArr = [], articlebodyVal ='', timeArr = [], timebodyVal = '', @@ -107,7 +108,6 @@ if (isGetCookie = typeof $request !== 'undefined') { await gameVideo(); await readArticle(); await Articlered(); - await readTime(); for (k=0;k<5;k++){ await $.wait(1000); await rotary(); @@ -141,7 +141,7 @@ $.log(`转盘双倍: +${doublerotary}青豆 剩余${rotaryres.data.doubleNum}次 .catch((e) => $.logErr(e)) .finally(() => $.done()) -function kdHost(api, header, body) { +function kdHost(api,body) { return { url: 'https://kd.youth.cn/'+api+`&${myuid}`, headers:{ @@ -171,14 +171,17 @@ function TaskCenter() { await getAction(dailys.reward_action) } else if (dailys.status == "2" && dailys.action != "") { $.log(dailys.title + "," + dailys.but + ",已领取青豆" + dailys.score) + detail += `【${dailys.title}】✅ ${dailys.score}青豆\n` }; if (dailys.title == "打卡赚钱" && ONCard == "true") { - if (dailys.status == "0") { - await punchCard() - } else if (dailys.status == "1" && $.time("HH") == "05"||$.time("HH") == "13") { - await endCard() - } + //$.log(JSON.stringify(dailys)) + if (dailys.status == "0"&&$.time("HH") > "17") { + await CardStatus() + } } + if (dailys.id == "7" && dailys.status == "0") { + await readTime(); + } if (dailys.id == "10" && dailys.status == "0") { $.log(dailys.title + "未完成,去做任务"); for (x = 0; x < 5; x++) { @@ -290,6 +293,25 @@ function withDraw() { } + +function CardStatus() { + return new Promise((resolve, reject) => { + $.get(kdHost('WebApi/PunchCard/getMainData?&'+cookie), async(error, response, data) => { + punchcard = JSON.parse(data); + if (punchcard.code == 1&&punchcard.data.user.status ==0) { + await punchCard() + } else if(punchcard.code == 1&&punchcard.data.user.status ==1){ + $.log("每日打卡已报名,请设置早晨5点运行打卡") + detail += `【打卡报名】🔔 已报名 待明早5点打卡\n` + if($.time("HH")=="05"){ + await endCard() + } + } + resolve(); + }) + }) +} + function punchCard() { return new Promise((resolve, reject) => { $.post(kdHost('WebApi/PunchCard/signUp'), (error, response, data) => { @@ -299,7 +321,7 @@ function punchCard() { $.log("每日报名打卡成功,报名时间:"+`${$.time('MM-dd HH:mm')}`) } else { - //detail += `【打卡报名】${punchcardstart.msg}\n` + detail += `【打卡报名】🔔${punchcardstart.msg}\n` // $.log(punchcardstart.msg) } resolve(); @@ -309,24 +331,24 @@ function punchCard() { //结束打卡 function endCard() { - return new Promise((resolve, reject) => { - setTimeout(() => { - $.post(kdHost('WebApi/PunchCard/doCard?'),async(error, response, data) => { - punchcardend = JSON.parse(data) - if (punchcardend.code == 1) { - detail += `【早起打卡】${punchcardend.data.card_time}${punchcardend.msg}✅\n`; - $.log("早起打卡成功,打卡时间:"+`${punchcardend.data.card_time}`); - await $.wait(1000); - await Cardshare(); - } else if (punchcardend.code == 0) { - // TODO .不在打卡时间范围内 - //detail += `【早起打卡】${punchcardend.msg}\n` - // $.log("不在打卡时间范围内") - } - resolve() - }) - },s) - }) + return new Promise((resolve, reject) =>{ + setTimeout(() =>{ + $.post(kdHost('WebApi/PunchCard/doCard?'), async(error, response, data) =>{ + punchcardend = JSON.parse(data); + if (punchcardend.code == 1) { + detail += `【早起打卡】${punchcardend.data.card_time}${punchcardend.msg}✅\n`; + $.log("早起打卡成功,打卡时间:" + `${punchcardend.data.card_time}`); + await $.wait(1000); + await Cardshare(); + } else if (punchcardend.code == 0) { + // TODO .不在打卡时间范围内 + detail += `【早起打卡】${punchcardend.msg}\n`; + // $.log("不在打卡时间范围内") + } + resolve() + }) + },s) + }) } //打卡分享 function Cardshare() { @@ -432,16 +454,16 @@ function friendSign(uid) { //看视频奖励 function getAdVideo() { - return new Promise((resolve, reject) => { - $.post(kdHost('taskCenter/getAdVideoReward',"",'type=taskCenter'), (error, resp, data) => { - let adVideores = JSON.parse(data); - if (adVideores.status == 1) { - detail += `【观看视频】+${adVideores.score}个青豆\n` - $.log("观看视频广告"+ adVideores.num +"次 +"+adVideores.score+"青豆") - } - resolve() - }) + return new Promise((resolve, reject) =>{ + $.post(kdHost('taskCenter/getAdVideoReward','type=taskCenter'), (error, resp, data) =>{ + let adVideores = JSON.parse(data); + if (adVideores.status == 1) { + detail += `【观看视频】 + ${adVideores.score}个青豆\n`; + $.log("观看视频广告" + adVideores.num + "次 +" + adVideores.score + "青豆") + } + resolve() }) + }) } function recordAdVideo(acttype) { return new Promise((resolve, reject) =>{ @@ -566,18 +588,9 @@ function readTime() { //转盘任务 function rotary() { return new Promise((resolve, reject) =>{ - const time = new Date().getTime(); - const url = { - url: `https://kd.youth.cn/WebApi/RotaryTable/turnRotary?_=${time}`, - headers: { - 'Referer': 'https://kd.youth.cn/html/rotaryTable/index.html?' + cookie - }, - body: cookie, - } - $.post(url, async(error, resp, data) =>{ + $.post(kdHost(`WebApi/RotaryTable/turnRotary?_=${Date.now()}&`,cookie), async(error, resp, data) =>{ try { rotaryres = JSON.parse(data); - //$.log(formatJson(data)); if (rotaryres.status==1){ $.log("进行"+Number(100-rotaryres.data.remainTurn)+"次转盘,获得"+rotaryres.data.score+"青豆") if(rotaryres.data.score != 0&&rotaryres.data.doubleNum!=0){ @@ -613,15 +626,7 @@ function rotaryCheck() { function runRotary(index) { return new Promise((resolve, reject) => { const rotarbody = cookie + '&num=' + index; - const time = new Date().getTime(); - const url = { - url: `https://kd.youth.cn/WebApi/RotaryTable/chestReward?_=${time}`, - headers:{ - 'Referer':'https://kd.youth.cn/html/rotaryTable/index.html?'+cookie - }, - body: rotarbody - } - $.post(url, (error, resp, data) => { + $.post(kdHost(`WebApi/RotaryTable/chestReward?_=${Date.now()}&`,rotarbody), (error, resp, data) => { let rotaryresp = JSON.parse(data); //$.log(formatJson(data)); if (rotaryresp.status == 1) { @@ -639,15 +644,7 @@ function runRotary(index) { //转盘双倍奖励 function TurnDouble() { return new Promise((resolve, reject) =>{ - let time = new Date().getTime(); - const url = { - url: `https://kd.youth.cn/WebApi/RotaryTable/toTurnDouble?_=${time}`, - headers: { - 'Referer': 'https://kd.youth.cn/html/rotaryTable/index.html?' + cookie - }, - body: cookie - } - $.post(url, (error, resp, data) =>{ + $.post(kdHost(`WebApi/RotaryTable/toTurnDouble?_=${Date.now()}&`,cookie), (error, resp, data) =>{ try { let Doubleres = JSON.parse(data); if (Doubleres.data.is_double == 1) { @@ -691,6 +688,6 @@ async function showmsg() { } } -function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} +function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} 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 5b86cf3213136aeb48253ca65532bd8e581098a2 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 13 Feb 2021 22:16:46 +0800 Subject: [PATCH 598/721] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=AD=E9=9D=92?= =?UTF-8?q?=E6=83=8A=E5=96=9C=E7=BA=A2=E5=8C=85=E8=AF=B7=E6=B1=82=EF=BC=8C?= =?UTF-8?q?IOS=E7=89=88=E5=B7=B2=E4=B8=8B=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/youth.yml | 1 - Task/sunert.boxjs.json | 3 +-- Task/youth.js | 42 +++++------------------------------ TaskConf/youth/loon.plugin | 1 - TaskConf/youth/qx_rewite.txt | 2 -- TaskConf/youth/readme.md | 5 ----- TaskConf/youth/surge.sgmodule | 2 -- 7 files changed, 7 insertions(+), 49 deletions(-) diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index 8f76e7a9ec..ad0cd2a316 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -17,7 +17,6 @@ jobs: env: YOUTH_HEADER: ${{ secrets.YOUTH_HEADER }} YOUTH_ARTBODY: ${{ secrets.YOUTH_ARTBODY }} - YOUTH_REDBODY: ${{ secrets.YOUTH_REDBODY }} YOUTH_TIME: ${{ secrets.YOUTH_TIME }} steps: - name: Checkout diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 6fb651678f..effadd1f93 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -23,10 +23,9 @@ { "author" : "@sunert", "keys" : [ - "zq_nick", + "zq_nick", "youthheader_zq", "read_zq", - "red_zq", "readtime_zq", "cashurl_zq", "cashbody_zq", diff --git a/Task/youth.js b/Task/youth.js index aeb64a6065..52d923bee1 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,8 +1,8 @@ /* -更新时间: 2021-02-13 20:00 +更新时间: 2021-02-13 22:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 -食用说明请查看本仓库目录Taskconf/youth/readme.md +食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行 */ @@ -19,7 +19,6 @@ let rotaryscore=0,doublerotary=0; let cookieArr = [], cookie = '', readArr = [], articlebodyVal ='', timeArr = [], timebodyVal = '', - redpArr = [], redpbodyVal = '', detail = ``, subTitle = ``; if($.isNode()){ if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('#') > -1) { @@ -36,13 +35,6 @@ let cookieArr = [], cookie = '', } else { ARTBODYs = [process.env.YOUTH_ARTBODY] }; - if (process.env.YOUTH_REDBODY && process.env.YOUTH_REDBODY.indexOf('&') > -1) { - REDBODYs = process.env.YOUTH_REDBODY.split('&'); - } else if (process.env.YOUTH_REDBODY && process.env.YOUTH_REDBODY.indexOf('\n') > -1) { - REDBODYs = process.env.YOUTH_REDBODY.split('\n'); - } else { - REDBODYs = [process.env.YOUTH_REDBODY] - }; if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('&') > -1) { READTIME = process.env.YOUTH_TIME.split('&'); } else if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('\n') > -1) { @@ -61,11 +53,6 @@ let cookieArr = [], cookie = '', readArr.push(ARTBODYs[item]) } }); - Object.keys(REDBODYs).forEach((item) =>{ - if (REDBODYs[item]) { - redpArr.push(REDBODYs[item]) - } - }); Object.keys(READTIME).forEach((item) =>{ if (READTIME[item]) { timeArr.push(READTIME[item]) @@ -75,7 +62,6 @@ let cookieArr = [], cookie = '', console.log(` ============脚本执行 - 北京时间 (UTC + 8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`); } else if(!$.isNode()){ cookieArr.push($.getdata('youthheader_zq')); - redpArr.push($.getdata('red_zq')); readArr.push($.getdata('read_zq')); timeArr.push($.getdata('readtime_zq')) } @@ -94,7 +80,6 @@ if (isGetCookie = typeof $request !== 'undefined') { cookie = cookieArr[i]; articlebodyVal = readArr[i]; timebodyVal = timeArr[i]; - redpbodyVal = redpArr[i]; $.index = i + 1; console.log(`-------------------------\n\n开始【中青看点${$.index}】`) }; @@ -107,7 +92,6 @@ if (isGetCookie = typeof $request !== 'undefined') { await getAdVideo(); await gameVideo(); await readArticle(); - await Articlered(); for (k=0;k<5;k++){ await $.wait(1000); await rotary(); @@ -165,6 +149,7 @@ function TaskCenter() { //return if (taskres.status == 1) { for (dailys of taskres.list.daily) { + await $.wait(500); if (dailys.status == "1" && dailys.action != "") { $.log(dailys.title + "已完成 ,去领取奖励青豆"); await $.wait(600); @@ -175,7 +160,7 @@ function TaskCenter() { }; if (dailys.title == "打卡赚钱" && ONCard == "true") { //$.log(JSON.stringify(dailys)) - if (dailys.status == "0"&&$.time("HH") > "17") { + if (dailys.status == "0"&&$.time("HH") > "22") { await CardStatus() } } @@ -502,7 +487,7 @@ function gameVideo() { }else{ if(gameres.error_code == "10003"){ //detail += `【激励视频】${gameres.message}\n` - $.log("激励视频 "+gameres.message) + //$.log("激励视频 "+gameres.message) } } resolve() @@ -548,21 +533,6 @@ function readArticle() { }) }) } -//惊喜红包 -function Articlered() { - return new Promise((resolve, reject) => { - $.post(batHost('article/red_packet.json',redpbodyVal), (error, response, data) => { - redres = JSON.parse(data) - if (redres.success == true) { - detail += `【惊喜红包】+${redres.items.score}个青豆\n` - $.log(`惊喜红包 +${redres.items.score}个青豆,`+ redres.items.alert) - }else if(redres.error_code == "100001"){ - //detail += `【惊喜红包】${redres.message}\n` - } - resolve() - }) - }) -} function readTime() { return new Promise((resolve, reject) => { @@ -688,6 +658,6 @@ async function showmsg() { } } -function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/red_packet/)){const redpbodyVal=$request.body;if(redpbodyVal)$.setdata(redpbodyVal,'red_zq');$.log(`${$.name}获取惊喜红包: 成功, redpbodyVal: ${redpbodyVal}`);$.msg($.name,`获取惊喜红包请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} +function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} 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)} diff --git a/TaskConf/youth/loon.plugin b/TaskConf/youth/loon.plugin index 966592c275..b2830c70e6 100644 --- a/TaskConf/youth/loon.plugin +++ b/TaskConf/youth/loon.plugin @@ -4,7 +4,6 @@ cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 -http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 diff --git a/TaskConf/youth/qx_rewite.txt b/TaskConf/youth/qx_rewite.txt index e0b1dfc201..123099ee66 100644 --- a/TaskConf/youth/qx_rewite.txt +++ b/TaskConf/youth/qx_rewite.txt @@ -4,8 +4,6 @@ https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList url script-request-head https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js - https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/task\/browse_(start|end)\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 414950682f..0431c0d717 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -24,7 +24,6 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/surge.sgm 中青看点 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js,script-update-interval=0 中青看点 = type=http-request,pattern=https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/red_packet,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true ``` @@ -48,7 +47,6 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/loon.plug cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 -http-request https:\/\/ios\.baertt\.com\/v5\/article\/red_packet script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 ``` @@ -65,7 +63,6 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite [rewrite_local] https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -https:\/\/ios\.baertt\.com\/v5\/article\/red_packet url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js ``` @@ -78,7 +75,6 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body h ### 获取Cookie方法 * 打开极速版APP,进去个人中心,或者签到一次,提示获取Cookie - 浏览一篇短文,等待倒计时结束,提示获取阅读请求 - * 向下滑动,文末有惊喜红包,点击惊喜红包,获取惊喜红包请求(不必选) * 多阅读几篇短文,随机获取阅读时长请求 - 正常提现一次,获取提现请求(可选) @@ -98,7 +94,6 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body h | :-------: | :------: | :-------: | ------ | ------- | | YOUTH_HEADER | 中青看点 youth.yml | #或者换行 | 必须 | 请求地址: "https://kd.youth.cn/WebApi/NewTaskIos/getTaskList",
中青签到请求头引用: uid=xxx&cookie_id=xxx&cookie=xxx | | YOUTH_ARTBODY | 同上 | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | -| YOUTH_REDBODY | 同上 | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | | YOUTH_TIME | 同上 | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/user/stay.json",
阅读时长请求体: p=xxx | | YOUTH_NOTIFY_CONTROL | 同上 | true/false | 可选 | 中青通知开关
默认当转盘次数为50或者100并且余额大于10元时推送通知 | | | | | - | | diff --git a/TaskConf/youth/surge.sgmodule b/TaskConf/youth/surge.sgmodule index cc6cdda7a7..b868c668b0 100644 --- a/TaskConf/youth/surge.sgmodule +++ b/TaskConf/youth/surge.sgmodule @@ -9,8 +9,6 @@ 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true -中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/red_packet,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true - 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true From 6f1da9fcbd996228bef726c032b1ad9f5d2075b2 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 08:25:43 +0800 Subject: [PATCH 599/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 85 ++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 52d923bee1..9c889fa18a 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-13 22:00 +更新时间: 2021-02-14 08:25 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行 @@ -158,11 +158,8 @@ function TaskCenter() { $.log(dailys.title + "," + dailys.but + ",已领取青豆" + dailys.score) detail += `【${dailys.title}】✅ ${dailys.score}青豆\n` }; - if (dailys.title == "打卡赚钱" && ONCard == "true") { - //$.log(JSON.stringify(dailys)) - if (dailys.status == "0"&&$.time("HH") > "22") { - await CardStatus() - } + if (dailys.title=="打卡赚钱"&&dailys.status == "0"&&ONCard == "true") { + await CardStatus() } if (dailys.id == "7" && dailys.status == "0") { await readTime(); @@ -193,7 +190,6 @@ function getAction(acttype) { return new Promise((resolve, reject) =>{ $.get(kdHost(`WebApi/NewTaskIos/sendTwentyScore?action=${acttype}`), (error, resp, data) =>{ let actres = JSON.parse(data); - //$.log(formatJson(data)); if (actres.status == 1) { $.log("获得青豆" + actres.score) } else if (actres.status == 0) { @@ -208,7 +204,6 @@ function getsign() { return new Promise((resolve, reject) =>{ $.post(kdHost('WebApi/NewTaskIos/sign'), async(error, resp, data) =>{ signres = JSON.parse(data); - //$.log(formatJson(data)); if (signres.status == 2) { sub = `签到失败,Cookie已失效‼️`; $.msg($.name, sub, ""); @@ -226,7 +221,6 @@ function userInfo() { return new Promise((resolve, reject) => { $.post(kdHost('WebApi/NewTaskIos/getSign'), async(error, resp, data) => { signinfo = JSON.parse(data); - //$.log(formatJson(data)) if (signinfo.status == 1) { cash = signinfo.data.user.money; signday = signinfo.data.sign_day; @@ -263,7 +257,7 @@ function withDraw() { }, body: withdrawBody, } - $.post(url, (error, response, data) => { + $.post(url, (error, resp, data) => { withDrawres = JSON.parse(data) if (withDrawres.error_code == 0) { detail += `【自动提现】提现${withdrawcash}元成功\n` @@ -277,48 +271,48 @@ function withDraw() { }) } - - function CardStatus() { - return new Promise((resolve, reject) => { - $.get(kdHost('WebApi/PunchCard/getMainData?&'+cookie), async(error, response, data) => { - punchcard = JSON.parse(data); - if (punchcard.code == 1&&punchcard.data.user.status ==0) { - await punchCard() - } else if(punchcard.code == 1&&punchcard.data.user.status ==1){ - $.log("每日打卡已报名,请设置早晨5点运行打卡") - detail += `【打卡报名】🔔 已报名 待明早5点打卡\n` - if($.time("HH")=="05"){ - await endCard() - } - } - resolve(); - }) + return new Promise((resolve, reject) =>{ + $.get(kdHost('WebApi/PunchCard/getMainData?&' + cookie), async(error, resp, data) =>{ + punchcard = JSON.parse(data); + if (punchcard.code == 1) { + if (punchcard.data.user.status == 0 && $.time("HH") > "22") { + await punchCard() + } else if (punchcard.data.user.status == 1) { + $.log("每日打卡已报名,请设置早晨5点运行打卡"); + detail += `【打卡报名】🔔已报名待明早5点打卡\n` + } else if (punchcard.data.user.status == 3) { + $.log("打卡时间已到,去打卡"); + await endCard() + } + } else if (punchcard.code == 0) { + $.log("打卡申请失败" + data) + } + resolve(); }) + }) } function punchCard() { - return new Promise((resolve, reject) => { - $.post(kdHost('WebApi/PunchCard/signUp'), (error, response, data) => { - punchcardstart = JSON.parse(data); - if (punchcardstart.code == 1) { - detail += `【打卡报名】打卡报名${punchcardstart.msg} ✅ \n`; - $.log("每日报名打卡成功,报名时间:"+`${$.time('MM-dd HH:mm')}`) - } - else { - detail += `【打卡报名】🔔${punchcardstart.msg}\n` - // $.log(punchcardstart.msg) - } - resolve(); - }) + return new Promise((resolve, reject) =>{ + $.post(kdHost('WebApi/PunchCard/signUp'), (error, response, data) =>{ + punchcardstart = JSON.parse(data); + if (punchcardstart.code == 1) { + detail += `【打卡报名】打卡报名${punchcardstart.msg}✅\n`; + $.log("每日报名打卡成功,报名时间:" + `${$.time('MM-dd HH:mm')}`) + } else { + detail += `【打卡报名】🔔${punchcardstart.msg}\n` + // $.log(punchcardstart.msg) + } + resolve(); }) + }) } //结束打卡 function endCard() { return new Promise((resolve, reject) =>{ - setTimeout(() =>{ - $.post(kdHost('WebApi/PunchCard/doCard?'), async(error, response, data) =>{ + $.post(kdHost('WebApi/PunchCard/doCard?'), async(error, resp, data) =>{ punchcardend = JSON.parse(data); if (punchcardend.code == 1) { detail += `【早起打卡】${punchcardend.data.card_time}${punchcardend.msg}✅\n`; @@ -332,20 +326,21 @@ function endCard() { } resolve() }) - },s) }) } //打卡分享 function Cardshare() { return new Promise((resolve, reject) =>{ - $.post(kdHost('WebApi/PunchCard/shareStart?'), (error, response, data) =>{ + $.post(kdHost('WebApi/PunchCard/shareStart?'), async(error, resp, data) =>{ sharestart = JSON.parse(data); //detail += `【打卡分享】${sharestart.msg}\n` if (sharestart.code == 1) { + $.log("等待2s,去打卡分享") + await $.wait(2000); $.post(kdHost('WebApi/PunchCard/shareEnd?'), (error, response, data) =>{ shareres = JSON.parse(data); if (shareres.code == 1) { - detail += ` + ${shareres.data.score}青豆\n` + detail += ` +${shareres.data.score}青豆\n` } else { //detail += `【打卡分享】${shareres.msg}\n` //$.log(`${shareres.msg}`) @@ -443,7 +438,7 @@ function getAdVideo() { $.post(kdHost('taskCenter/getAdVideoReward','type=taskCenter'), (error, resp, data) =>{ let adVideores = JSON.parse(data); if (adVideores.status == 1) { - detail += `【观看视频】 + ${adVideores.score}个青豆\n`; + detail += `【观看视频】 +${adVideores.score}个青豆\n`; $.log("观看视频广告" + adVideores.num + "次 +" + adVideores.score + "青豆") } resolve() From 43cb5c2651698897814e9c943daf41fe2dc99f43 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 09:21:19 +0800 Subject: [PATCH 600/721] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=A4=9A=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 9c889fa18a..4b2673bcb7 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-14 08:25 +更新时间: 2021-02-14 09:20 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行 @@ -12,14 +12,22 @@ let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖 const notify = $.isNode() ? require('./sendNotify') : ''; const ONCard = $.getdata('zqcard')||"false" //早起打卡开关 const withdrawcash = $.getdata('zqcash')||30 //提现金额 -let withdrawUrl =$.getdata('cashurl_zq') -let withdrawBody =$.getdata('cashbody_zq') +let withdrawUrl = $.getdata('cashurl_zq'); +let withdrawBody = $.getdata('cashbody_zq'); +let cookieYouth = $.getdata('youthheader_zq'); +let ARTBODYs = $.getdata('read_zq'); +let READTIME = $.getdata('readtime_zq'); let rotaryscore=0,doublerotary=0; let cookieArr = [], cookie = '', readArr = [], articlebodyVal ='', timeArr = [], timebodyVal = '', detail = ``, subTitle = ``; +if(!$.isNode()&&cookieYouth.indexOf("#") ==-1){ + cookieArr.push($.getdata('youthheader_zq')); + readArr.push($.getdata('read_zq')); + timeArr.push($.getdata('readtime_zq')) +} else { if($.isNode()){ if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('#') > -1) { cookieYouth = process.env.YOUTH_HEADER.split('#'); @@ -41,8 +49,13 @@ let cookieArr = [], cookie = '', READTIME = process.env.YOUTH_TIME.split('\n'); } else { READTIME = [process.env.YOUTH_TIME] - }; - + } + console.log(` ============脚本执行 - 北京时间 (UTC + 8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`); + } else if(!$.isNode()&&cookieYouth.indexOf("#")>-1){ + cookieYouth = cookieYouth.split("#") + ARTBODYs = ARTBODYs.split("&") + READTIME = READTIME.split("&") +}; Object.keys(cookieYouth).forEach((item) =>{ if (cookieYouth[item]) { cookieArr.push(cookieYouth[item]) @@ -58,12 +71,7 @@ let cookieArr = [], cookie = '', timeArr.push(READTIME[item]) } }); - console.log(` ============您共提供${cookieArr.length}个中青账号 =============\n`); - console.log(` ============脚本执行 - 北京时间 (UTC + 8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`); - } else if(!$.isNode()){ -cookieArr.push($.getdata('youthheader_zq')); - readArr.push($.getdata('read_zq')); - timeArr.push($.getdata('readtime_zq')) + console.log(` ============= 您共提供${cookieArr.length}个中青账号 =============`); } if (isGetCookie = typeof $request !== 'undefined') { GetCookie(); @@ -81,10 +89,10 @@ if (isGetCookie = typeof $request !== 'undefined') { articlebodyVal = readArr[i]; timebodyVal = timeArr[i]; $.index = i + 1; - console.log(`-------------------------\n\n开始【中青看点${$.index}】`) }; myuid = cookie.match(/uid=\d+/); await userInfo(); + $.log(`\n********** ${nick} 现金收益: ${cash}元 ********\n`); await kdHost(); await friendsign(); await TaskCenter() @@ -227,7 +235,11 @@ function userInfo() { totalscore = signinfo.data.user.score subTitle = `【收益总计】${totalscore}青豆 现金约${cash}元`; nick = `账号: ${signinfo.data.user.nickname}`; + if(cookieArr.length ==1){ $.setdata(nick,"zq_nick") + } else { + $.setdata("账号"+cookieArr.length+"合一","zq_nick") + } if(parseInt(cash) >= withdrawcash && !withdrawBody == false){ await withDraw() }; @@ -514,7 +526,7 @@ function readArticle() { readres = JSON.parse(data); if (data.indexOf('read_score')>-1&&readres.items.read_score!=0) { detail += `【阅读奖励】+${readres.items.read_score}个青豆\n`; - $.log(`阅读奖励 +${readres.items.read_score}个青豆\n`) + $.log(`阅读奖励 +${readres.items.read_score}个青豆`) } else if (readres.items.max_notice == '看太久了,换1篇试试') { //detail += `【阅读奖励】看太久了,换1篇试试\n`; From 2c3e3f7916bbee4129d1c86f477c3f2f8e2fa8ce Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 11:28:29 +0800 Subject: [PATCH 601/721] --- Task/Youth_Read.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index c8edc01c42..07b191bd08 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -38,13 +38,13 @@ var lastClick = Date.now()-60000; for (let i = 0; i < ReadArr.length; i++) { if (ReadArr[i]) { articlebody = ReadArr[i]; - $.index = i + 1; - console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`); + $.index = i + 1; + console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`); await AutoRead(); }; if (process.env.YOUTH_TIME){ timebodyVal = process.env.YOUTH_TIME; - if(Date.now() - lastClick >=60000){ + if($.index%2==0){ await readTime() } }; From 7f2ec480c8625f88f1db063c2cdbdcd7a48c93b3 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 11:28:52 +0800 Subject: [PATCH 602/721] --- Task/Youth_Read.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 07b191bd08..7681fe7199 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -28,7 +28,6 @@ var lastClick = Date.now()-60000; ReadArr.push(YouthBody[item]) } }) - console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) !(async () => { if (!ReadArr[0]) { From ba1bf4c05102551e68eb75ee242a424e790c80b3 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 13:55:48 +0800 Subject: [PATCH 603/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=98=85=E8=AF=BB=E6=97=B6=E9=95=BF=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/youth_read.yml | 2 +- Task/youth.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index 3c881f9cea..c7ec738e0d 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -1,5 +1,5 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 每日早9点到晚8点每2小时运行一次 name: 中青自动阅读 diff --git a/Task/youth.js b/Task/youth.js index 4b2673bcb7..32afe59111 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -665,6 +665,6 @@ async function showmsg() { } } -function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/app_stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} +function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} 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 38ab9b509cfcbdba95538563bf2e80c4c54ad7c0 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 13:56:31 +0800 Subject: [PATCH 604/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 32afe59111..98053f5632 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-14 09:20 +更新时间: 2021-02-14 14:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行 From f494dc98bf54593fcc61ad54a6f6224b3d4990fc Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 14:14:25 +0800 Subject: [PATCH 605/721] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E9=9D=92?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TaskConf/youth/readme.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 0431c0d717..12c8a1279e 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -73,10 +73,10 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body h 1 */5 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 ``` ### 获取Cookie方法 - * 打开极速版APP,进去个人中心,或者签到一次,提示获取Cookie + * 打开极速版APP,进去个人中心,提示获取Cookie - 浏览一篇短文,等待倒计时结束,提示获取阅读请求 - * 多阅读几篇短文,随机获取阅读时长请求 - - 正常提现一次,获取提现请求(可选) + * 多阅读几篇短文,随机获取阅读时长请求(至少1分钟左右) + - 正常提现一次,获取提现请求(可选,AC无添加) >>> [回到顶部](#IOS配置教程) @@ -106,8 +106,9 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body h >>> [回到上一页](..) ### 注意事项: - > __提现金额需该请求一致,只更改提现金额无效,默认30元__ - + - __提现金额需该请求一致,只更改提现金额无效,默认30元__ + + * __惊喜红包已下架,现所有请求均采用IOS新版APP任务__ From 5c1b6517b5444789a8fbadac7dde84f628c390b6 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 16:30:17 +0800 Subject: [PATCH 606/721] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=98=85=E8=AF=BB?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A7=BB=E5=8A=A8=E7=AB=AF=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=98=85=E8=AF=BB=E8=AF=B7=E6=B1=82=EF=BC=8C?= =?UTF-8?q?=E9=87=8D=E5=86=99=E9=85=8D=E7=BD=AE=E5=92=8C=E4=B8=AD=E9=9D=92?= =?UTF-8?q?=E7=9C=8B=E7=82=B9=E7=AD=BE=E5=88=B0=E8=84=9A=E6=9C=AC=E6=9C=89?= =?UTF-8?q?=E5=86=B2=E7=AA=81=EF=BC=8C=E8=AF=B7=E7=A6=81=E7=94=A8=E5=85=B6?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Sunert_Task.json | 2 +- Task/Youth_Read.js | 110 ++++++++++++++++++++++++-------- Task/sunert.boxjs.json | 22 +++++++ TaskConf/youth/qx_youthread.txt | 5 ++ 4 files changed, 113 insertions(+), 26 deletions(-) create mode 100644 TaskConf/youth/qx_youthread.txt diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index 4577750574..8c41e0f211 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -55,7 +55,7 @@ }, { "config": "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青自动阅读, img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png, enabled=true", - "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" + "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_youthread.txt, tag=youth_auto, update-interval=-1, opt-parser=false, enabled=true" }, { "config": "20 5 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js, tag=中青浏览赚, img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png, enabled=true", diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 7681fe7199..3c2cf9603d 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -1,5 +1,5 @@ /* -更新时间: 2020-09-26 8:46 +更新时间: 2021-02-14 15:59 Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 请自行抓包,阅读文章和看视频,倒计时转一圈显示青豆到账即可,多看几篇文章和视频,获得更多包数据,抓包地址为"https://ios.baertt.com/v5/article/complete.json",在Github Actions中的Secrets新建name为'YOUTH_READ'的一个值,拷贝抓包的请求体到下面Value的文本框中,添加的请求体越多,获得青豆次数越多,本脚本不包含任何推送通知 @@ -8,27 +8,44 @@ Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk030 */ -//let s = 30000 //等待延迟30s -const $ = new Env("中青看点") +const $ = new Env("中青看点阅读") //const notify = $.isNode() ? require('./sendNotify') : ''; -let ReadArr = [], YouthBody = "",readscore = 0; -var lastClick = Date.now()-60000; - if (process.env.YOUTH_READ && process.env.YOUTH_READ.indexOf('&') > -1) { - YouthBody = process.env.YOUTH_READ.split('&'); - console.log(`您选择的是用"&"隔开\n`) - } - else if (process.env.YOUTH_READ && process.env.YOUTH_READ.indexOf('\n') > -1) { - YouthBody = process.env.YOUTH_READ.split('\n'); - console.log(`您选择的是用换行隔开\n`) - } else { - YouthBody = process.env.YOUTH_READ.split() +let ReadArr = [], readscore = 0; +let YouthBody = $.getdata('youth_autoread'); + +if (isGetbody = typeof $request !==`undefined`) { + Getbody(); + $done() +} +if(!$.isNode()&&!YouthBody==true){ + $.log("您未获取阅读请求,请求阅读后获取") + $.msg($.name, "您未获取阅读请求,请求阅读后获取","",{'open-url':"https://kandian.youth.cn/u/8S9DO"}) + return + } else if (!$.isNode() && YouthBody.indexOf("&") == -1) { + ReadArr.push(YouthBody) + } else { + if ($.isNode()) { + if (process.env.YOUTH_READ && process.env.YOUTH_READ.indexOf('&') > -1) { + YouthBody = process.env.YOUTH_READ.split('&'); + console.log(`您选择的是用"&"隔开\n`) + } else if (process.env.YOUTH_READ && process.env.YOUTH_READ.indexOf('\n') > -1) { + YouthBody = process.env.YOUTH_READ.split('\n'); + console.log(`您选择的是用换行隔开\n`) + } else { + YouthBody = [process.env.YOUTH_READ] + } + console.log(` ============ 脚本执行 - 北京时间 (UTC + 8):${new Date(Data.now() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + + } else if (!$.isNode() && YouthBody.indexOf("&") > -1) { + YouthBody = YouthBody.split("&") } - Object.keys(YouthBody).forEach((item) => { - if (YouthBody[item]) { - ReadArr.push(YouthBody[item]) - } - }) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + Object.keys(YouthBody).forEach((item) =>{ + if (YouthBody[item]) { + ReadArr.push(YouthBody[item]) + } + }) +} + !(async () => { if (!ReadArr[0]) { console.log($.name, '【提示】请把抓包的请求体填入Github 的 Secrets 中,请以&隔开') @@ -41,11 +58,13 @@ var lastClick = Date.now()-60000; console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`); await AutoRead(); }; - if (process.env.YOUTH_TIME){ - timebodyVal = process.env.YOUTH_TIME; - if($.index%2==0){ - await readTime() + if($.index%2==0){ + if ($.isNode()&&process.env.YOUTH_ATIME){ + timebodyVal = process.env.YOUTH_ATIME; + } else { + timebodyVal = $.getdata('autotime_zq'); } + await readTime() }; } console.log(`-------------------------\n\n中青看点共完成${$.index}次阅读,共计获得${readscore}个青豆,阅读请求全部结束`) @@ -104,4 +123,45 @@ function readTime() { }) } -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 Getbody() { + if ($request && $request.method != `OPTIONS` && $request.url.match(/\/article\/complete/)) { + bodyVal = $request.body; + if (YouthBody) { + if (YouthBody.indexOf(bodyVal) > -1) { + $.log("此阅读请求已存在,本次跳过") + } else if (YouthBody.indexOf(bodyVal) == -1) { + YouthBodys = YouthBody + "&" + bodyVal; + $.setdata(YouthBodys, 'youth_autoread'); + $.log(`${$.name}获取阅读: 成功, YouthBodys: ${bodyVal}`); + } + } else { + $.setdata(bodyVal, 'youth_autoread'); + $.log(`${$.name}获取阅读: 成功, YouthBodys: ${bodyVal}`); + } + $.msg($.name, `获取自动阅读请求: 成功🎉`, ``) + } + if ($request && $request.method != `OPTIONS` && $request.url.match(/\/article\/complete/)) { + bodyVal = $request.body; + if (YouthBody) { + if (YouthBody.indexOf(bodyVal) > -1) { + $.log("此阅读请求已存在,本次跳过") + } else if (YouthBody.indexOf(bodyVal) == -1) { + YouthBodys = YouthBody + "&" + bodyVal; + $.setdata(YouthBodys, 'youth_autoread'); + $.log(`${$.name}获取阅读: 成功, YouthBodys: ${bodyVal}`); + } + } else { + $.setdata(bodyVal, 'youth_autoread'); + $.log(`${$.name}获取阅读: 成功, YouthBodys: ${bodyVal}`); + } + $.msg($.name, `获取自动阅读请求: 成功🎉`, ``) + } else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/stay/)){ + const timebodyVal=$request.body; + if(timebodyVal) $.setdata(timebodyVal,'autotime_zq'); + $.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`); + $.msg($.name,`获取阅读时长: 成功🎉`,``) + } +} + + +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)} diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index effadd1f93..a7f25324dd 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -43,6 +43,13 @@ "type" : "boolean", "desc" : "每日打卡报名及早起打卡" }, + { + "id" : "zqtime", + "val" : "05", + "name" : "打卡时间", + "type" : "number", + "desc" : "每日早起打卡时间" + }, { "id" : "notifytimes", "val" : "", @@ -93,6 +100,21 @@ "https://raw.githubusercontent.com/Orz-3/task/master/youth.png" ] }, + { + "author" : "@sunert", + "keys" : [ + "youth_autoread", + "autotime_zq" + ], + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/Youth_Read.js", + "id" : "youthRead", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js", + "name" : "中青自动阅读", + "icons" : [ + "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", + "https://raw.githubusercontent.com/Orz-3/task/master/youth.png" + ] + }, { "author" : "@sunert", "keys" : [ diff --git a/TaskConf/youth/qx_youthread.txt b/TaskConf/youth/qx_youthread.txt new file mode 100644 index 0000000000..d39036e034 --- /dev/null +++ b/TaskConf/youth/qx_youthread.txt @@ -0,0 +1,5 @@ +hostname = ios.baertt.com + +https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js + +https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js \ No newline at end of file From d4b7151fa1ef770d6931f9728876ff7a81565075 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 16:47:03 +0800 Subject: [PATCH 607/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=AD=E9=9D=92?= =?UTF-8?q?=E6=89=93=E5=8D=A1=E6=97=B6=E9=97=B4=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 98053f5632..1e52199cb6 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-14 14:00 +更新时间: 2021-02-14 16:50 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行 @@ -17,6 +17,7 @@ let withdrawBody = $.getdata('cashbody_zq'); let cookieYouth = $.getdata('youthheader_zq'); let ARTBODYs = $.getdata('read_zq'); let READTIME = $.getdata('readtime_zq'); +let cardTime = $.getdata('zqtime')||"05";//打卡时间 let rotaryscore=0,doublerotary=0; let cookieArr = [], cookie = '', @@ -291,9 +292,9 @@ function CardStatus() { if (punchcard.data.user.status == 0 && $.time("HH") > "22") { await punchCard() } else if (punchcard.data.user.status == 1) { - $.log("每日打卡已报名,请设置早晨5点运行打卡"); - detail += `【打卡报名】🔔已报名待明早5点打卡\n` - } else if (punchcard.data.user.status == 3) { + $.log("每日打卡已报名,请每天早晨"+cardTime+"点运行打卡"); + detail += `【打卡报名】🔔 待明早${cardTime}点打卡\n` + } else if (punchcard.data.user.status == 3&&$.time("HH")==cardTime) { $.log("打卡时间已到,去打卡"); await endCard() } From a19641e75dbecc86f5df2a5b84a5e42bc507ecc2 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 17:28:29 +0800 Subject: [PATCH 608/721] --- Task/translate.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/translate.js b/Task/translate.js index 2b36cdf121..2e4c95bf9a 100644 --- a/Task/translate.js +++ b/Task/translate.js @@ -31,12 +31,12 @@ const cnToenUrl = {url: "http://translate.google.cn/translate_a/single?client=gt const enTocnUrl = {url: "http://translate.google.cn/translate_a/single?client=gtx&sl=auto&tl=zh-CN&dt=t&q="+setword}; !(async() => { -if (/[^a-zA-Z.,]+$/.test(ENword)){ +if (/[a-zA-Z.,]+$/.test(ENword)){ await ENWORD() } -if (/[^\u4e00-\u9fa5]+$/.test(ENword)) +if (/[\u4e00-\u9fa5]+$/.test(ENword)) { - await ENWORD() + await CNWORD() } })() .catch((e) => $.logErr(e)) From 998a811059066f95df9995bec0291cc2437ae3ae Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 18:58:03 +0800 Subject: [PATCH 609/721] =?UTF-8?q?=E5=AE=8C=E5=96=84readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TaskConf/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/TaskConf/README.md b/TaskConf/README.md index 466cda0b67..62ac3b2ed3 100644 --- a/TaskConf/README.md +++ b/TaskConf/README.md @@ -7,15 +7,15 @@ ### 一、本仓库重写配置集 * Surge - * [Cookie]() - * [任务模块]() + * [Cookie](https://raw.githubusercontent.com/Sunert/Profiles/master/Surge/Modules/Sunert_Cookie.sgmodule) + * [任务模块](https://raw.githubusercontent.com/Sunert/Profiles/master/Surge/Modules/Sunert_Task.sgmodule)

* Loon - * [Cookie]() - * [任务模块]() + * [Cookie](https://raw.githubusercontent.com/Sunert/Profiles/master/Loon/Sunet_Cookie.plugin) + * [任务插件](https://raw.githubusercontent.com/Sunert/Profiles/master/Loon/Sunert_Task.plugin)

* Quantumult X - * [Cookie]() + * [Cookie](https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rewrite/Sunert_Cookie.conf) * [任务仓库](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Sunert_Task.json) ### 二、[Boxjs订阅](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sunert.boxjs.json) @@ -36,11 +36,11 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sunert.boxjs.json

* 百度极速 * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/baidu) - * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baiduspeed.js) + * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baidu_speed.js)

* 聚看点 * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/jukan) - * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jkd.js) + * [脚本地址](https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js)

* 电视家 * [任务配置](https://github.com/Sunert/Scripts/tree/master/TaskConf/dianshijia) From b0759aa155ab7b8686db56ce91a05899212dc442 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 19:11:20 +0800 Subject: [PATCH 610/721] --- Task/baidu_speed.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index a4eb103cf8..a77694df3a 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -1,5 +1,5 @@ /* -更新时间:2021-02-12 22:50 +更新时间:2021-02-14 19:10 百度极速版签到任务,使用脚本有黑号严重,请谨慎使用‼️ 赞赏:百度极速邀请码`RW9ZSW 点击链接立得红包,最高100元!https://dwz.cn/Oilv4CJ1`,农妇山泉 -> 有点咸,万分感谢 @@ -213,9 +213,12 @@ function coinexChange() { function TaskCenter() { return new Promise((resolve, reject) =>{ $.get(confApi('h5/vaultnew?productid=2&fromcsr=1&system=ios&_format=json'), async(error, resp, data) =>{ - try { + try { let get_tasks = JSON.parse(data); - if(get_tasks.data.uname!=""&&CookieArr.length==1){ + if(get_tasks.errno==7){ + $.msg($.name, get_tasks.msg, "请更换Cookie后,重试"); + return + } else if(get_tasks.data.uname!=""&&CookieArr.length==1){ username = get_tasks.data.uname; $.setdata(username,'baidu_nick') } From 53465e817e5be6d5913427ef8adeb4318337d0ef Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 14 Feb 2021 20:20:43 +0800 Subject: [PATCH 611/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dipad=E7=AD=BE?= =?UTF-8?q?=E5=88=B0=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E6=9B=B4=E6=96=B0ck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/weibo.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index 5b53ca4802..5bab6dbb43 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-10 14:25 +更新时间: 2021-02-14 20:20 本脚本仅适用于微博每日签到,支持多账号运行 @@ -52,6 +52,9 @@ if ($.isNode()) { token = tokenArr[i]; $.index = i + 1; console.log(`\n开始【微博签到${$.index}】`) + if(token.indexOf("from")==-1){ + token += "from=10B2193010&" + } await getsign(); await doCard(); await paysign() @@ -66,7 +69,7 @@ if ($.isNode()) { function GetCookie() { if ($request && $request.method != 'OPTIONS' && $request.url.indexOf("gsid=") > -1) { const signurlVal = $request.url; - let token = signurlVal.replace(/(.+)(uid=\d+)(.+)(&gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)/,'$2$4$6'), + let token = signurlVal.replace(/(.+)(from=\w+)(.+)(&uid=\d+)(.+)(&gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)/,'$2$4$6$8'), uid = token.match(/uid=\d+/); if (wbtoken) { if (wbtoken.indexOf(uid) > -1) { @@ -87,7 +90,7 @@ function GetCookie() { function getsign() { return new Promise((resolve, reject) =>{ let signurl = { - url: `https://api.weibo.cn/2/checkin/add?from=10B2193010&c=iphone&${token}`, + url: `https://api.weibo.cn/2/checkin/add?c=iphone&${token}`, headers: {"User-Agent": `Weibo/52021 (iPhone; iOS 14.5; Scale/3.00)`}} $.get(signurl, async(error, resp, data) => { let result = JSON.parse(data) @@ -115,7 +118,7 @@ function getsign() { function doCard() { return new Promise((resolve, reject) =>{ let doCardurl = { - url: `https://api.weibo.cn/2/!/ug/king_act_home?from=10B2193010&c=iphone&${token}`, + url: `https://api.weibo.cn/2/!/ug/king_act_home?c=iphone&${token}`, headers: {"User-Agent": `Weibo/52021 (iPhone; iOS 14.5; Scale/3.00)`}} $.get(doCardurl, (error, resp, data) => { //$.log(data) From 8703cdf7e9401c1a966d699d8e9380b241c78be7 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 00:12:35 +0800 Subject: [PATCH 612/721] --- Task/weibo.js | 104 +++++++++++++++++++++++++++++------ TaskConf/sina/loon.plugin | 4 +- TaskConf/sina/qx_rewite.txt | 4 +- TaskConf/sina/readme.md | 5 +- TaskConf/sina/surge.sgmodule | 3 +- 5 files changed, 98 insertions(+), 22 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index 5bab6dbb43..7041c161c9 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -10,7 +10,9 @@ const $ = new Env('新浪微博') const notify = $.isNode() ? require('./sendNotify') : ''; let tokenArr = []; -let wbtoken = $.getdata('sy_token_wb') +let wbtoken = $.getdata('sy_token_wb'); +let cookies = $.getdata('wb_cookie'); +let signcash = "", cookieArr=[]; if (isGetCookie = typeof $request !==`undefined`) { GetCookie(); @@ -18,7 +20,8 @@ if (isGetCookie = typeof $request !==`undefined`) { } if(!$.isNode()&&wbtoken.indexOf("#")==-1){ - tokenArr.push(wbtoken) + tokenArr.push(wbtoken); + cookieArr.push(cookies) } else { if ($.isNode()) { if (process.env.WB_TOKEN && process.env.WB_TOKEN.indexOf('#') > -1) { @@ -33,13 +36,19 @@ if ($.isNode()) { }; console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) } else if (!$.isNode()&&wbtoken.indexOf("#")>-1) { - wbtoken = wbtoken.split("#") + wbtoken = wbtoken.split("#"); + cookies = cookies.split("#") } Object.keys(wbtoken).forEach((item) => { if (wbtoken[item]) { tokenArr.push(wbtoken[item]) } }); + Object.keys(cookies).forEach((item) => { + if (cookies[item]) { + cookieArr.push(cookies[item]) + } + }); } !(async () => { if (!tokenArr[0]) { @@ -50,6 +59,7 @@ if ($.isNode()) { for (let i = 0; i < tokenArr.length; i++) { if (tokenArr[i]) { token = tokenArr[i]; + cookie = cookieArr[i] $.index = i + 1; console.log(`\n开始【微博签到${$.index}】`) if(token.indexOf("from")==-1){ @@ -85,6 +95,23 @@ function GetCookie() { } $.msg($.name, `获取微博签到Cookie: 成功`, ``) } +else if ($request && $request.method != 'OPTIONS' && $request.headers.Cookie.indexOf("SUB=") > -1) { + const cookieval = $request.url; + if (cookies) { + if (cookies.indexOf(cookieval) > -1) { + $.log("此账号Cookie已存在,本次跳过") + } else if (cookies.indexOf(cookieval) == -1) { + tokens = cookies + "#" + cookieval; + $.setdata(tokens, 'wb_cookie'); + $.log(`cookie: ${tokens}`); + $.msg($.name, `获取微博用户Cookie: 成功`, ``) + } + } else { + $.setdata(cookieval, 'wb_cookie'); + $.log(`cookies: ${cookieval}`); + $.msg($.name, `获取微博用户Cookie: 成功`, ``) + } + } } //微博签到 function getsign() { @@ -98,12 +125,14 @@ function getsign() { wbsign = `【微博签到】✅ 连续签到${result.data.continuous}天,收益: ${result.data.desc}💰\n` } else if (result.errno == 30000){ - wbsign = `【每日签到】 🔁 ` + wbsign = `【每日签到】 🔁 已签到\n` + if(cookie){ + await getcash() + } } else if (result.status == 90005){ wbsign = `【每日签到】‼️`+ result.msg + '\n' - } - else { + } else { wbsign = `【每日签到】 ❌ 签到失败`+result.errmsg $.msg($.name, wbsign, ``) if ($.isNode()) { @@ -115,6 +144,25 @@ function getsign() { }) } +function getcash() { + return new Promise((resolve, reject) =>{ + let url = { + url: `https://m.weibo.cn/c/checkin/getcashdetail`, + headers: {"User-Agent": `Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Weibo (iPhone10,2__weibo__11.2.1__iphone__os14.5)`, + Cookie: cookie + } + } + $.get(url, async(error, resp, data) => { + let cashres = JSON.parse(data) + if(cashres.apiCode==10000){ + signcash = " " + cashres.data.header[0].title+cashres.data.header[0].value+"元" + } + resolve() + }) + }) +} + + function doCard() { return new Promise((resolve, reject) =>{ let doCardurl = { @@ -144,33 +192,53 @@ function doCard() { // 钱包签到 function paysign() { return new Promise((resolve, reject) =>{ - $.post({ - url: `https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do?_=${$.startTime+10}&${token}`, - headers:{ - 'Accept-Encoding': 'gzip, deflate', - 'Connection': 'keep-alive', - 'Content-Type': 'application/x-www-form-urlencoded', - 'Host': 'pay.sc.weibo.com', - 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Weibo (iPhone10,1__weibo__11.2.1__iphone__os14.5)' - } - }, (error, resp, data) => { + $.post(payApi('aj/mobile/home/welfare/signin/do?_='+$.startTime+10), async(error, resp, data) => { let result = JSON.parse(data) if (result.status == 1){ paybag = `【微博钱包】 ✅ +`+ result.score+' 分\n' } else if (result.status == '2'){ - paybag = `【微博钱包】 🔁\n` + paybag = `【微博钱包】 🔁 ` + await payinfo() } else { paybag = `【钱包签到】❌ Cookie失效`+'\n' } resolve() + }) }) } + +function payApi(api) { + return { + url: 'https://pay.sc.weibo.com/'+api, + headers:{ + 'Accept-Encoding': 'gzip, deflate', + 'Connection': 'keep-alive', + 'Content-Type': 'application/x-www-form-urlencoded', + 'Host': 'pay.sc.weibo.com', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Weibo (iPhone10,1__weibo__11.2.1__iphone__os14.5)' + }, + body: token+'&lang=zh_CN&wm=3333_2001' + } +} + +function payinfo() { + return new Promise((resolve, reject) =>{ + $.post(payApi('api/client/sdk/app/balance'), (error, resp, data) => { + let paynum = JSON.parse(data) + if (paynum.code == 100000){ + paybag += '现金:'+ paynum.data.balance+' 元\n' + } + resolve() + }) + }) +} + async function showmsg() { if (paybag) { - $.msg($.name, nickname, wbsign+paybag+docard); + $.msg($.name, nickname+(signcash?signcash:""), wbsign+paybag+docard); if ($.isNode()) { await notify.sendNotify($.name, nickname+'\n'+ wbsign+paybag+docard) } diff --git a/TaskConf/sina/loon.plugin b/TaskConf/sina/loon.plugin index cf03ff1141..291424065f 100644 --- a/TaskConf/sina/loon.plugin +++ b/TaskConf/sina/loon.plugin @@ -5,6 +5,8 @@ cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/ma http-request https:\/\/api\.weibo\.cn\/\d\/users\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 +http-request https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 + [MITM] -hostname = api.weibo.cn \ No newline at end of file +hostname = api.weibo.cn, m.weibo.cn \ No newline at end of file diff --git a/TaskConf/sina/qx_rewite.txt b/TaskConf/sina/qx_rewite.txt index f4864ed9b1..038ddf1548 100644 --- a/TaskConf/sina/qx_rewite.txt +++ b/TaskConf/sina/qx_rewite.txt @@ -1,4 +1,4 @@ -hostname = newsapi.sina.cn, api.weibo.cn, lite.sina.cn +hostname = newsapi.sina.cn, api.weibo.cn, lite.sina.cn, m.weibo.cn https:\/\/newsapi\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js @@ -6,6 +6,8 @@ https:\/\/newsapi\.sina\.cn\/\?resource=userpoint\/signIn url script-request-hea https:\/\/api\.weibo\.cn\/\d\/users\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js + https?:\/\/lite\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center - script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js https?:\/\/lite\.sina\.cn\/\?resource=userpoint\/signIn - script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js diff --git a/TaskConf/sina/readme.md b/TaskConf/sina/readme.md index e21677aedc..7cf46b5999 100644 --- a/TaskConf/sina/readme.md +++ b/TaskConf/sina/readme.md @@ -8,7 +8,7 @@ ### IOS配置教程 ``` [MITM] -hostname = api.weibo.cn +hostname = api.weibo.cn, m.weibo.cn ``` #### Surge: * [模块地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/surge.sgmodule) @@ -24,6 +24,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/surge.sgmo # 获取微博 Cookie. 微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/users\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +微博签到 = type=http-request,pattern=https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js ``` #### Shadowrocket(Cron配置): @@ -45,6 +46,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/loon.plugi cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 http-request https:\/\/api\.weibo\.cn\/\d\/users\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 +http-request https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 ``` #### Quantumult X: * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/qx_rewite.txt) @@ -58,6 +60,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite. ``` [rewrite_local] https:\/\/api\.weibo\.cn\/\d\/users\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js ``` * 本地任务配置 diff --git a/TaskConf/sina/surge.sgmodule b/TaskConf/sina/surge.sgmodule index 0f3d6c9622..4c7fefcc13 100644 --- a/TaskConf/sina/surge.sgmodule +++ b/TaskConf/sina/surge.sgmodule @@ -8,6 +8,7 @@ # 获取微博 Cookie. 微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/users\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +微博签到 = type=http-request,pattern=https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js [MITM] -hostname = %APPEND% api.weibo.cn \ No newline at end of file +hostname = %APPEND% api.weibo.cn, m.weibo.cn \ No newline at end of file From 3d200d6ea219f0f6c36da415faaa49ee2bcf2f4f Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 00:14:14 +0800 Subject: [PATCH 613/721] --- Task/sunert.boxjs.json | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index a7f25324dd..e706711fc3 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -9,6 +9,7 @@ "author" : "@sunert", "keys" : [ "sy_token_wb", + "wb_cookie", "wb_nick" ], "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", From fc0d40b324667f96960b377ac890cd508faf47be Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 00:22:20 +0800 Subject: [PATCH 614/721] --- Task/weibo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index 7041c161c9..952ec6687a 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -96,7 +96,7 @@ function GetCookie() { $.msg($.name, `获取微博签到Cookie: 成功`, ``) } else if ($request && $request.method != 'OPTIONS' && $request.headers.Cookie.indexOf("SUB=") > -1) { - const cookieval = $request.url; + const cookieval = $$request.headers.Cookie.match(/SUB=[\w\-]+/); if (cookies) { if (cookies.indexOf(cookieval) > -1) { $.log("此账号Cookie已存在,本次跳过") From 8d5cecc0e18b0f585d3ab26c6c3be353efee6b36 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 00:25:09 +0800 Subject: [PATCH 615/721] --- Task/weibo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index 952ec6687a..0da09e8182 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -96,7 +96,7 @@ function GetCookie() { $.msg($.name, `获取微博签到Cookie: 成功`, ``) } else if ($request && $request.method != 'OPTIONS' && $request.headers.Cookie.indexOf("SUB=") > -1) { - const cookieval = $$request.headers.Cookie.match(/SUB=[\w\-]+/); + const cookieval = $request.headers.Cookie.match(/SUB=[\w\-]+/); if (cookies) { if (cookies.indexOf(cookieval) > -1) { $.log("此账号Cookie已存在,本次跳过") From 8b4c68aba4d40b66d7d8d585c6c32f4939077ef6 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 00:29:38 +0800 Subject: [PATCH 616/721] --- Task/weibo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index 0da09e8182..2bbe58f6fe 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-14 20:20 +更新时间: 2021-02-15 00:20 本脚本仅适用于微博每日签到,支持多账号运行 From 4cd5d21eb88d7b00eb68ffa4af5c5bedfbbbda26 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 00:45:56 +0800 Subject: [PATCH 617/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BE=AE=E5=8D=9A?= =?UTF-8?q?=E7=94=A8=E6=88=B7ck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/weibo.js | 3 ++- TaskConf/sina/loon.plugin | 2 +- TaskConf/sina/qx_rewite.txt | 2 +- TaskConf/sina/readme.md | 8 ++++---- TaskConf/sina/surge.sgmodule | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index 2bbe58f6fe..df33d9d718 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -88,12 +88,13 @@ function GetCookie() { tokens = wbtoken + "#" + token; $.setdata(tokens, 'sy_token_wb'); $.log(`tokens: ${tokens}`) + $.msg($.name, `获取微博签到Cookie: 成功`, ``) } } else { $.setdata(token, 'sy_token_wb'); $.log(`tokens: ${token}`) + $.msg($.name, `获取微博签到Cookie: 成功`, ``) } - $.msg($.name, `获取微博签到Cookie: 成功`, ``) } else if ($request && $request.method != 'OPTIONS' && $request.headers.Cookie.indexOf("SUB=") > -1) { const cookieval = $request.headers.Cookie.match(/SUB=[\w\-]+/); diff --git a/TaskConf/sina/loon.plugin b/TaskConf/sina/loon.plugin index 291424065f..d12291382e 100644 --- a/TaskConf/sina/loon.plugin +++ b/TaskConf/sina/loon.plugin @@ -5,7 +5,7 @@ cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/ma http-request https:\/\/api\.weibo\.cn\/\d\/users\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 -http-request https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 +http-request https:\/\/m\.weibo\.cn\/c\/checkin\/ug\/v2\/signin\/module\?module script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 [MITM] diff --git a/TaskConf/sina/qx_rewite.txt b/TaskConf/sina/qx_rewite.txt index 038ddf1548..764fab18ec 100644 --- a/TaskConf/sina/qx_rewite.txt +++ b/TaskConf/sina/qx_rewite.txt @@ -6,7 +6,7 @@ https:\/\/newsapi\.sina\.cn\/\?resource=userpoint\/signIn url script-request-hea https:\/\/api\.weibo\.cn\/\d\/users\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js -https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +https:\/\/m\.weibo\.cn\/c\/checkin\/ug\/v2\/signin\/module\?module url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js https?:\/\/lite\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center - script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js diff --git a/TaskConf/sina/readme.md b/TaskConf/sina/readme.md index 7cf46b5999..69cd1f70d1 100644 --- a/TaskConf/sina/readme.md +++ b/TaskConf/sina/readme.md @@ -24,7 +24,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/surge.sgmo # 获取微博 Cookie. 微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/users\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js -微博签到 = type=http-request,pattern=https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +微博签到 = type=http-request,pattern=https:\/\/m\.weibo\.cn\/c\/checkin\/ug\/v2\/signin\/module\?module,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js ``` #### Shadowrocket(Cron配置): @@ -46,7 +46,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/loon.plugi cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 http-request https:\/\/api\.weibo\.cn\/\d\/users\/show script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 -http-request https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 +http-request https:\/\/m\.weibo\.cn\/c\/checkin\/ug\/v2\/signin\/module\?module script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 ``` #### Quantumult X: * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/qx_rewite.txt) @@ -60,7 +60,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite. ``` [rewrite_local] https:\/\/api\.weibo\.cn\/\d\/users\/show url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js -https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +https:\/\/m\.weibo\.cn\/c\/checkin\/ug\/v2\/signin\/module\?module url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js ``` * 本地任务配置 @@ -70,7 +70,7 @@ https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail url script-request-header http ``` ### 获取Cookie方法 1. 打开微博App,获取Cookie,获取后请注释或禁用Cookie - 2. 已取消获取获取钱包Cookie + 2. 进入"用户任务中心",获取用户信息Cookie(可选,增加显示个人任务红包余额) >>> [回到顶部](#IOS配置教程) diff --git a/TaskConf/sina/surge.sgmodule b/TaskConf/sina/surge.sgmodule index 4c7fefcc13..1828e419d2 100644 --- a/TaskConf/sina/surge.sgmodule +++ b/TaskConf/sina/surge.sgmodule @@ -8,7 +8,7 @@ # 获取微博 Cookie. 微博签到 = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/users\/show,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js -微博签到 = type=http-request,pattern=https:\/\/m\.weibo\.cn\/c\/checkin\/getcashdetail,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +微博签到 = type=http-request,pattern=https:\/\/m\.weibo\.cn\/c\/checkin\/ug\/v2\/signin\/module\?module,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js [MITM] hostname = %APPEND% api.weibo.cn, m.weibo.cn \ No newline at end of file From 82951a3da823ddaf58a1769149de210d0eed9f07 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 09:49:05 +0800 Subject: [PATCH 618/721] --- Task/Youth_Read.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 3c2cf9603d..c3fc8fbbcf 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -34,7 +34,7 @@ if(!$.isNode()&&!YouthBody==true){ } else { YouthBody = [process.env.YOUTH_READ] } - console.log(` ============ 脚本执行 - 北京时间 (UTC + 8):${new Date(Data.now() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + console.log(` ============ 脚本执行 - 北京时间 (UTC + 8):${new Date(Date.now() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) } else if (!$.isNode() && YouthBody.indexOf("&") > -1) { YouthBody = YouthBody.split("&") From 810d51b82d700044d38018769aae0d160b000d8a Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 09:58:13 +0800 Subject: [PATCH 619/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Youth_Read.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index c3fc8fbbcf..c66d5d99d0 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -78,14 +78,14 @@ function AutoRead() { $.post(batHost('article/complete.json',articlebody), async(error, response, data) => { let readres = JSON.parse(data); //console.log(data) - if (readres.error_code == '0' && typeof readres.items.read_score === 'number') { + if (readres.error_code == '0' && data.indexOf("read_score")>-1 && readres.items.read_score > 0) { console.log(`\n本次阅读获得${readres.items.read_score}个青豆,请等待30s后执行下一次阅读\n`); readscore += readres.items.read_score; await $.wait(30000); } - else if (readres.error_code == '0' && typeof readres.items.score === 'number') { + else if(readres.error_code == '0' && data.indexOf("read_score")>-1 && readres.items.read_score == 0) { console.log(`\n本次阅读获得${readres.items.score}个青豆,即将开始下次阅读\n`) - readscore += readres.items.score + await $.wait(5000); } else if (readres.success == false){ console.log(`第${$.index}次阅读请求有误,请删除此请求`) From ef59ad8bb96ba796ef600d52cc9fee348ad6ecfe Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 10:30:23 +0800 Subject: [PATCH 620/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AD=E9=9D=92?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E8=BF=87=E5=BF=AB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Youth_Read.js | 57 ++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index c66d5d99d0..be00d6ae5d 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-14 15:59 +更新时间: 2021-02-15 10:29 Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 请自行抓包,阅读文章和看视频,倒计时转一圈显示青豆到账即可,多看几篇文章和视频,获得更多包数据,抓包地址为"https://ios.baertt.com/v5/article/complete.json",在Github Actions中的Secrets新建name为'YOUTH_READ'的一个值,拷贝抓包的请求体到下面Value的文本框中,添加的请求体越多,获得青豆次数越多,本脚本不包含任何推送通知 @@ -58,14 +58,6 @@ if(!$.isNode()&&!YouthBody==true){ console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`); await AutoRead(); }; - if($.index%2==0){ - if ($.isNode()&&process.env.YOUTH_ATIME){ - timebodyVal = process.env.YOUTH_ATIME; - } else { - timebodyVal = $.getdata('autotime_zq'); - } - await readTime() - }; } console.log(`-------------------------\n\n中青看点共完成${$.index}次阅读,共计获得${readscore}个青豆,阅读请求全部结束`) })() @@ -74,28 +66,33 @@ if(!$.isNode()&&!YouthBody==true){ function AutoRead() { - return new Promise((resolve, reject) => { - $.post(batHost('article/complete.json',articlebody), async(error, response, data) => { - let readres = JSON.parse(data); - //console.log(data) - if (readres.error_code == '0' && data.indexOf("read_score")>-1 && readres.items.read_score > 0) { - console.log(`\n本次阅读获得${readres.items.read_score}个青豆,请等待30s后执行下一次阅读\n`); - readscore += readres.items.read_score; - await $.wait(30000); - } - else if(readres.error_code == '0' && data.indexOf("read_score")>-1 && readres.items.read_score == 0) { - console.log(`\n本次阅读获得${readres.items.score}个青豆,即将开始下次阅读\n`) - await $.wait(5000); - } - else if (readres.success == false){ - console.log(`第${$.index}次阅读请求有误,请删除此请求`) - } - else if (readres.items.max_notice == '\u770b\u592a\u4e45\u4e86\uff0c\u63621\u7bc7\u8bd5\u8bd5') { - console.log(readres.items.max_notice) - } - resolve() - }) + return new Promise((resolve, reject) =>{ + $.post(batHost('article/complete.json', articlebody), async(error, response, data) =>{ + let readres = JSON.parse(data); + //console.log(data) + if (readres.error_code == '0' && data.indexOf("read_score") > -1 && readres.items.read_score > 0) { + console.log(`\n本次阅读获得${readres.items.read_score}个青豆,请等待30s后执行下一次阅读\n`); + readscore += readres.items.read_score; + if ($.index % 2 == 0) { + if ($.isNode() && process.env.YOUTH_ATIME) { + timebodyVal = process.env.YOUTH_ATIME; + } else { + timebodyVal = $.getdata('autotime_zq'); + } + await readTime() + }; + await $.wait(30000); + } else if (readres.error_code == '0' && data.indexOf("read_score") > -1 && readres.items.read_score == 0) { + console.log(`\n本次阅读获得0个青豆,等待2s即将开始下次阅读\n`); + await $.wait(2000); + } else if (readres.success == false) { + console.log(`第${$.index}次阅读请求有误,请删除此请求`) + } else if (readres.items.max_notice == '\u770b\u592a\u4e45\u4e86\uff0c\u63621\u7bc7\u8bd5\u8bd5') { + console.log(readres.items.max_notice) + } + resolve() }) + }) } function batHost(api, body) { From c6ef4b6e7a86a8131b29f4d8504f4abe4bf591d3 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 10:44:18 +0800 Subject: [PATCH 621/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Youth_Read.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index be00d6ae5d..3dacbfd7e3 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -82,13 +82,14 @@ function AutoRead() { await readTime() }; await $.wait(30000); - } else if (readres.error_code == '0' && data.indexOf("read_score") > -1 && readres.items.read_score == 0) { + } else if (readres.error_code == '0' && data.indexOf('"score":0') > -1 && readres.items.score == 0) { console.log(`\n本次阅读获得0个青豆,等待2s即将开始下次阅读\n`); await $.wait(2000); } else if (readres.success == false) { console.log(`第${$.index}次阅读请求有误,请删除此请求`) } else if (readres.items.max_notice == '\u770b\u592a\u4e45\u4e86\uff0c\u63621\u7bc7\u8bd5\u8bd5') { console.log(readres.items.max_notice) + await $.wait(2000); } resolve() }) From faf23be0860c7d88d98937ea9e98473a30dfc3c0 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 11:04:01 +0800 Subject: [PATCH 622/721] --- Task/Youth_Read.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 3dacbfd7e3..b251359a2d 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -44,6 +44,7 @@ if(!$.isNode()&&!YouthBody==true){ ReadArr.push(YouthBody[item]) } }) + $.log("\n 共"+ReadArr.length+"次阅读请求\n") } !(async () => { From a78121f6a9ca030faca115a14cb7c9e295538d02 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 11:11:46 +0800 Subject: [PATCH 623/721] --- Task/Youth_Read.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index b251359a2d..0e46f5980b 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -82,7 +82,11 @@ function AutoRead() { } await readTime() }; + if($.index==ReadArr.length){ + $.log($.index+"任务已全部完成,即将结束") + } else { await $.wait(30000); + } } else if (readres.error_code == '0' && data.indexOf('"score":0') > -1 && readres.items.score == 0) { console.log(`\n本次阅读获得0个青豆,等待2s即将开始下次阅读\n`); await $.wait(2000); From f7c999aebb0fb251e052e29a65cc443e6844ab2f Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 11:20:40 +0800 Subject: [PATCH 624/721] =?UTF-8?q?=E4=B8=AD=E9=9D=92=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=98=85=E8=AF=BB=E4=B8=BA=E5=8C=BA=E5=88=86=E7=AD=BE=E5=88=B0?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=8C=E8=87=AA=E5=8A=A8=E9=98=85=E8=AF=BB?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E8=84=9A=E6=9C=AC=E4=B8=AD=E5=B7=B2=E5=B0=86?= =?UTF-8?q?YOUTH=5FTIME=E4=BF=AE=E6=94=B9=E4=B8=BAYOUTH=5FATIME=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E8=87=AA=E8=A1=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=EF=BC=8C=E5=8F=82=E6=95=B0=E5=8F=AA=E8=83=BD=E5=A1=AB=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=EF=BC=8C=E5=A4=9A=E8=B4=A6=E5=8F=B7=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E6=8B=A9=20=E5=A4=9A=E6=AD=A5=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/youth_read.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index c7ec738e0d..136427288e 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -35,7 +35,7 @@ jobs: node Task/Youth_Read.js env: YOUTH_READ: ${{ secrets.YOUTH_READ }} - YOUTH_TIME: ${{ secrets.YOUTH_TIME }} + YOUTH_ATIME: ${{ secrets.YOUTH_ATIME }} - name: '运行 【中青看点自动阅读二】' if: env.YOUTH_READ2 @@ -43,7 +43,7 @@ jobs: node Task/Youth_Read.js env: YOUTH_READ: ${{ secrets.YOUTH_READ2 }} - YOUTH_TIME: ${{ secrets.YOUTH_TIME2 }} + YOUTH_ATIME: ${{ secrets.YOUTH_ATIME2 }} - name: '运行 【中青看点自动阅读三】' if: env.YOUTH_READ3 @@ -51,12 +51,12 @@ jobs: node Task/Youth_Read.js env: YOUTH_READ: ${{ secrets.YOUTH_READ3 }} - YOUTH_TIME: ${{ secrets.YOUTH_TIME3 }} + YOUTH_ATIME: ${{ secrets.YOUTH_ATIME3 }} - name: '运行 【中青看点自动阅读四】' if: env.YOUTH_READ4 run: | node Task/Youth_Read.js env: - YOUTH_READ: ${{ secrets.YOUTH_READ4 }} - YOUTH_TIME: ${{ secrets.YOUTH_TIME4 }} + YOUTH_READ: ${{ secrets.YOUTH_AREAD4 }} + YOUTH_TIME: ${{ secrets.YOUTH_ATIME4 }} From c2eb088c3c605b681900cd3c953e2eddccc419c3 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 12:33:40 +0800 Subject: [PATCH 625/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=98=85=E8=AF=BB?= =?UTF-8?q?=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Youth_Read.js | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 0e46f5980b..0d26a57935 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-15 10:29 +更新时间: 2021-02-15 12:29 Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 请自行抓包,阅读文章和看视频,倒计时转一圈显示青豆到账即可,多看几篇文章和视频,获得更多包数据,抓包地址为"https://ios.baertt.com/v5/article/complete.json",在Github Actions中的Secrets新建name为'YOUTH_READ'的一个值,拷贝抓包的请求体到下面Value的文本框中,添加的请求体越多,获得青豆次数越多,本脚本不包含任何推送通知 @@ -44,7 +44,7 @@ if(!$.isNode()&&!YouthBody==true){ ReadArr.push(YouthBody[item]) } }) - $.log("\n 共"+ReadArr.length+"次阅读请求\n") + $.log("\n 您共获取"+ReadArr.length+"次阅读请求,任务开始\n") } !(async () => { @@ -70,7 +70,7 @@ function AutoRead() { return new Promise((resolve, reject) =>{ $.post(batHost('article/complete.json', articlebody), async(error, response, data) =>{ let readres = JSON.parse(data); - //console.log(data) + console.log(JSON.stringify(readres,null,2)) if (readres.error_code == '0' && data.indexOf("read_score") > -1 && readres.items.read_score > 0) { console.log(`\n本次阅读获得${readres.items.read_score}个青豆,请等待30s后执行下一次阅读\n`); readscore += readres.items.read_score; @@ -83,7 +83,7 @@ function AutoRead() { await readTime() }; if($.index==ReadArr.length){ - $.log($.index+"任务已全部完成,即将结束") + $.log($.index+"次任务已全部完成,即将结束") } else { await $.wait(30000); } @@ -136,28 +136,14 @@ function Getbody() { YouthBodys = YouthBody + "&" + bodyVal; $.setdata(YouthBodys, 'youth_autoread'); $.log(`${$.name}获取阅读: 成功, YouthBodys: ${bodyVal}`); + bodys = YouthBodys.split("&") + $.msg($.name, "获取第"+bodys.length+"个阅读请求: 成功🎉", ``) } } else { $.setdata(bodyVal, 'youth_autoread'); $.log(`${$.name}获取阅读: 成功, YouthBodys: ${bodyVal}`); + $.msg($.name, `获取第一个阅读请求: 成功🎉`, ``) } - $.msg($.name, `获取自动阅读请求: 成功🎉`, ``) - } - if ($request && $request.method != `OPTIONS` && $request.url.match(/\/article\/complete/)) { - bodyVal = $request.body; - if (YouthBody) { - if (YouthBody.indexOf(bodyVal) > -1) { - $.log("此阅读请求已存在,本次跳过") - } else if (YouthBody.indexOf(bodyVal) == -1) { - YouthBodys = YouthBody + "&" + bodyVal; - $.setdata(YouthBodys, 'youth_autoread'); - $.log(`${$.name}获取阅读: 成功, YouthBodys: ${bodyVal}`); - } - } else { - $.setdata(bodyVal, 'youth_autoread'); - $.log(`${$.name}获取阅读: 成功, YouthBodys: ${bodyVal}`); - } - $.msg($.name, `获取自动阅读请求: 成功🎉`, ``) } else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/stay/)){ const timebodyVal=$request.body; if(timebodyVal) $.setdata(timebodyVal,'autotime_zq'); From f26a017cd7d17d0bc61b31926ebd99a86f7393ac Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 15:25:59 +0800 Subject: [PATCH 626/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=98=85=E8=AF=BB?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Youth_Read.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 0d26a57935..e4d7c63d7d 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -10,9 +10,10 @@ Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk030 const $ = new Env("中青看点阅读") //const notify = $.isNode() ? require('./sendNotify') : ''; -let ReadArr = [], readscore = 0; +let ReadArr = [], timebodyVal =""; let YouthBody = $.getdata('youth_autoread'); - +let artsnum = 0, videosnum = 0; +let videoscore = 0,readscore = 0; if (isGetbody = typeof $request !==`undefined`) { Getbody(); $done() @@ -60,7 +61,8 @@ if(!$.isNode()&&!YouthBody==true){ await AutoRead(); }; } - console.log(`-------------------------\n\n中青看点共完成${$.index}次阅读,共计获得${readscore}个青豆,阅读请求全部结束`) + $.log("本次共阅读"+artsnum+"次资讯,共获得"+readscore+"青豆\n观看"+videosnum+"次视频,获得"+videoscore+"青豆(不含0青豆次数)\n") + console.log(`-------------------------\n\n中青看点共完成${$.index}次阅读,共计获得${readscore+videoscore}个青豆,阅读请求全部结束`) })() .catch((e) => $.logErr(e)) .finally(() => $.done()) @@ -73,7 +75,15 @@ function AutoRead() { console.log(JSON.stringify(readres,null,2)) if (readres.error_code == '0' && data.indexOf("read_score") > -1 && readres.items.read_score > 0) { console.log(`\n本次阅读获得${readres.items.read_score}个青豆,请等待30s后执行下一次阅读\n`); - readscore += readres.items.read_score; + if(data.indexOf("ctype")>-1){ + if(readres.items.ctype==0){ + artsnum += 1 + readscore += readres.items.read_score; + } else if(readres.items.ctype==3){ + videosnum += 1 + videoscore += readres.items.read_score; + } + } if ($.index % 2 == 0) { if ($.isNode() && process.env.YOUTH_ATIME) { timebodyVal = process.env.YOUTH_ATIME; From c542706677d8491fb5e6e074d86b501285780d99 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 15:35:28 +0800 Subject: [PATCH 627/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0WB=5FCOOKIE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/weibo.yml | 1 + Task/weibo.js | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/weibo.yml b/.github/workflows/weibo.yml index 6583d58b88..4e0c29f365 100644 --- a/.github/workflows/weibo.yml +++ b/.github/workflows/weibo.yml @@ -13,6 +13,7 @@ jobs: if: github.event.repository.owner.id == github.event.sender.id env: WB_TOKEN: ${{ secrets.WB_TOKEN }} + WB_COOKIE: ${{ secrets.WB_COOKIE }} steps: - name: Checkout uses: actions/checkout@v2 diff --git a/Task/weibo.js b/Task/weibo.js index df33d9d718..7a1a2a421d 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -33,6 +33,16 @@ if ($.isNode()) { console.log(`您选择的是用换行隔开\n`) } else { wbtoken = [process.env.WB_TOKEN] + }; + if (process.env.WB_COOKIE && process.env.WB_COOKIE.indexOf('#') > -1) { + cookies = process.env.WB_COOKIE.split('#'); + console.log(`您选择的是用"#"隔开\n`) + } + else if (process.env.WB_COOKIE && process.env.WB_COOKIE.indexOf('\n') > -1) { + cookies = process.env.WB_COOKIE.split('\n'); + console.log(`您选择的是用换行隔开\n`) + } else { + cookies = [process.env.COOKIE] }; console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) } else if (!$.isNode()&&wbtoken.indexOf("#")>-1) { From b70914a66e0548047103907b8a7be8893c58546a Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 15:40:15 +0800 Subject: [PATCH 628/721] --- Task/weibo.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/weibo.js b/Task/weibo.js index 7a1a2a421d..54beb578fc 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -24,6 +24,7 @@ if(!$.isNode()&&wbtoken.indexOf("#")==-1){ cookieArr.push(cookies) } else { if ($.isNode()) { + let cookies = []; if (process.env.WB_TOKEN && process.env.WB_TOKEN.indexOf('#') > -1) { wbtoken = process.env.WB_TOKEN.split('#'); console.log(`您选择的是用"#"隔开\n`) From f58af612a82781b3125ea79c63ca55416c34fbc8 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 15:45:09 +0800 Subject: [PATCH 629/721] --- Task/weibo.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index 54beb578fc..7a1a2a421d 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -24,7 +24,6 @@ if(!$.isNode()&&wbtoken.indexOf("#")==-1){ cookieArr.push(cookies) } else { if ($.isNode()) { - let cookies = []; if (process.env.WB_TOKEN && process.env.WB_TOKEN.indexOf('#') > -1) { wbtoken = process.env.WB_TOKEN.split('#'); console.log(`您选择的是用"#"隔开\n`) From 412da43441cb707709e30db93e86c35b11b12124 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 15:56:07 +0800 Subject: [PATCH 630/721] --- Task/weibo.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index 7a1a2a421d..1c85e0bbb7 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -26,23 +26,23 @@ if(!$.isNode()&&wbtoken.indexOf("#")==-1){ if ($.isNode()) { if (process.env.WB_TOKEN && process.env.WB_TOKEN.indexOf('#') > -1) { wbtoken = process.env.WB_TOKEN.split('#'); - console.log(`您选择的是用"#"隔开\n`) + console.log(`WB_TOKEN您选择的是用"#"隔开\n`) } else if (process.env.WB_TOKEN && process.env.WB_TOKEN.indexOf('\n') > -1) { wbtoken = process.env.WB_TOKEN.split('\n'); - console.log(`您选择的是用换行隔开\n`) + console.log(`WB_TOKEN您选择的是用换行隔开\n`) } else { wbtoken = [process.env.WB_TOKEN] }; if (process.env.WB_COOKIE && process.env.WB_COOKIE.indexOf('#') > -1) { cookies = process.env.WB_COOKIE.split('#'); - console.log(`您选择的是用"#"隔开\n`) + console.log(`WB_COOKIE您选择的是用"#"隔开\n`) } else if (process.env.WB_COOKIE && process.env.WB_COOKIE.indexOf('\n') > -1) { cookies = process.env.WB_COOKIE.split('\n'); - console.log(`您选择的是用换行隔开\n`) + console.log(`WB_COOKIE您选择的是用换行隔开\n`) } else { - cookies = [process.env.COOKIE] + cookies = [process.env.WB_COOKIE] }; console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) } else if (!$.isNode()&&wbtoken.indexOf("#")>-1) { From 82f60427f67082b71fe3ededdc7da5df4916deeb Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 16:05:16 +0800 Subject: [PATCH 631/721] =?UTF-8?q?=E9=9C=80=E8=A6=81=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/sendNotify.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Task/sendNotify.js b/Task/sendNotify.js index 1541580783..7b2e668b00 100644 --- a/Task/sendNotify.js +++ b/Task/sendNotify.js @@ -1,4 +1,6 @@ /* +本仓库借用Lxk0301大佬发送通知脚本,感谢@lxk0301 +已注释所有未提供KEY的日志,如有需要自行添加 * @Author: LXK9301 https://github.com/LXK9301 * @Date: 2020-08-19 16:12:40 * @Last Modified by: LXK9301 @@ -186,7 +188,7 @@ function serverNotify(text, desp, timeout = 2100) { }) }, timeout) } else { - console.log('您未提供server酱的SCKEY,取消微信推送消息通知\n'); + //console.log('您未提供server酱的SCKEY,取消微信推送消息通知\n'); resolve() } }) @@ -260,7 +262,7 @@ function CoolPush(text, desp) { } }) } else { - console.log('您未提供酷推的SKEY,取消QQ推送消息通知\n'); + //console.log('您未提供酷推的SKEY,取消QQ推送消息通知\n'); resolve() } }) @@ -295,7 +297,7 @@ function BarkNotify(text, desp, params={}) { } }) } else { - console.log('您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知\n'); + //console.log('您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知\n'); resolve() } }) @@ -345,7 +347,7 @@ function tgBotNotify(text, desp) { } }) } else { - console.log('您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知\n'); + //console.log('您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知\n'); resolve() } }) @@ -411,7 +413,7 @@ function ddBotNotify(text, desp) { } }) } else { - console.log('您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n'); + //console.log('您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n'); resolve() } }) @@ -452,7 +454,7 @@ function qywxBotNotify(text, desp) { } }); } else { - console.log('您未提供企业微信机器人推送所需的QYWX_KEY,取消企业微信推送消息通知\n'); + //console.log('您未提供企业微信机器人推送所需的QYWX_KEY,取消企业微信推送消息通知\n'); resolve(); } }); @@ -539,7 +541,7 @@ function qywxamNotify(text, desp) { }); }); } else { - console.log('您未提供企业微信应用消息推送所需的QYWX_AM,取消企业微信应用消息推送消息通知\n'); + //console.log('您未提供企业微信应用消息推送所需的QYWX_AM,取消企业微信应用消息推送消息通知\n'); resolve(); } }); @@ -582,7 +584,7 @@ function iGotNotify(text, desp, params={}){ } }) } else { - console.log('您未提供iGot的推送IGOT_PUSH_KEY,取消iGot推送消息通知\n'); + //console.log('您未提供iGot的推送IGOT_PUSH_KEY,取消iGot推送消息通知\n'); resolve() } }) @@ -625,7 +627,7 @@ function pushPlusNotify(text, desp) { } }) } else { - console.log('您未提供push+推送所需的PUSH_PLUS_TOKEN,取消push+推送消息通知\n'); + //console.log('您未提供push+推送所需的PUSH_PLUS_TOKEN,取消push+推送消息通知\n'); resolve() } }) From 3703d8bcaafae047fe34adb6d659fbb533f3c336 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 16:13:03 +0800 Subject: [PATCH 632/721] --- Task/weibo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index 1c85e0bbb7..a5dca0c2b5 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -251,7 +251,7 @@ async function showmsg() { if (paybag) { $.msg($.name, nickname+(signcash?signcash:""), wbsign+paybag+docard); if ($.isNode()) { - await notify.sendNotify($.name, nickname+'\n'+ wbsign+paybag+docard) + await notify.sendNotify($.name, nickname+(signcash?signcash:"")+'\n'+ wbsign+paybag+docard) } } } From 130896be62f85bc2dccd6a1abafcde3badeb44d5 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 16:22:37 +0800 Subject: [PATCH 633/721] --- Task/weibo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index a5dca0c2b5..609d21a5ed 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -144,8 +144,8 @@ function getsign() { else if (result.status == 90005){ wbsign = `【每日签到】‼️`+ result.msg + '\n' } else { - wbsign = `【每日签到】 ❌ 签到失败`+result.errmsg - $.msg($.name, wbsign, ``) + wbsign = `【每日签到】 ❌ 签到失败 `+result.errmsg; + $.msg($.name, wbsign, `请检查微博Token`) if ($.isNode()) { await notify.sendNotify($.name, wbsign) } From d5ad0d09255e6bf1ac8785d375a8bc11c4eb6aa2 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 16:31:12 +0800 Subject: [PATCH 634/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=94=AF=E6=8C=81son?= =?UTF-8?q?gyangzz=E5=A4=A7=E4=BD=AC=E7=9A=84=E9=98=85=E8=AF=BB=E8=AF=B7?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Youth_Read.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index e4d7c63d7d..657e90ff06 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-15 12:29 +更新时间: 2021-02-15 16:29 Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 请自行抓包,阅读文章和看视频,倒计时转一圈显示青豆到账即可,多看几篇文章和视频,获得更多包数据,抓包地址为"https://ios.baertt.com/v5/article/complete.json",在Github Actions中的Secrets新建name为'YOUTH_READ'的一个值,拷贝抓包的请求体到下面Value的文本框中,添加的请求体越多,获得青豆次数越多,本脚本不包含任何推送通知 @@ -39,7 +39,9 @@ if(!$.isNode()&&!YouthBody==true){ } else if (!$.isNode() && YouthBody.indexOf("&") > -1) { YouthBody = YouthBody.split("&") - } + } else if (!$.isNode() && $.getdata("zqgetbody_body").indexOf("&") > -1) { + YouthBody = $.getdata("zqgetbody_body").split("&") + }; Object.keys(YouthBody).forEach((item) =>{ if (YouthBody[item]) { ReadArr.push(YouthBody[item]) From a30ec9b6b78a1b365f44da07b1be8fd5a0e47a6b Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 16:39:42 +0800 Subject: [PATCH 635/721] --- Task/Youth_Read.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 657e90ff06..7c75daa4ba 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-15 16:29 +更新时间: 2021-02-15 16:40 Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 请自行抓包,阅读文章和看视频,倒计时转一圈显示青豆到账即可,多看几篇文章和视频,获得更多包数据,抓包地址为"https://ios.baertt.com/v5/article/complete.json",在Github Actions中的Secrets新建name为'YOUTH_READ'的一个值,拷贝抓包的请求体到下面Value的文本框中,添加的请求体越多,获得青豆次数越多,本脚本不包含任何推送通知 @@ -11,7 +11,7 @@ Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk030 const $ = new Env("中青看点阅读") //const notify = $.isNode() ? require('./sendNotify') : ''; let ReadArr = [], timebodyVal =""; -let YouthBody = $.getdata('youth_autoread'); +let YouthBody = $.getdata('youth_autoread')||$.getdata("zqgetbody_body"); let artsnum = 0, videosnum = 0; let videoscore = 0,readscore = 0; if (isGetbody = typeof $request !==`undefined`) { @@ -39,8 +39,6 @@ if(!$.isNode()&&!YouthBody==true){ } else if (!$.isNode() && YouthBody.indexOf("&") > -1) { YouthBody = YouthBody.split("&") - } else if (!$.isNode() && $.getdata("zqgetbody_body").indexOf("&") > -1) { - YouthBody = $.getdata("zqgetbody_body").split("&") }; Object.keys(YouthBody).forEach((item) =>{ if (YouthBody[item]) { From 6a1559fbea579a62034879a858710f02dc5e695f Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 19:41:49 +0800 Subject: [PATCH 636/721] =?UTF-8?q?=E4=B8=AD=E9=9D=92=E7=9C=8B=E7=82=B9?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=A1=E6=97=B6=E5=A5=96=E5=8A=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 1e52199cb6..04462a00fc 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-14 16:50 +更新时间: 2021-02-15 19:50 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行 @@ -96,6 +96,7 @@ if (isGetCookie = typeof $request !== 'undefined') { $.log(`\n********** ${nick} 现金收益: ${cash}元 ********\n`); await kdHost(); await friendsign(); + await ExtraList(); await TaskCenter() await openbox(); await getAdVideo(); @@ -563,6 +564,40 @@ function readTime() { }) } +function ExtraList() { + return new Promise((resolve, reject) =>{ + $.post(kdHost('WebApi/ShareNew/bereadExtraList'), async(error, resp, data) =>{ + extrares = JSON.parse(data); + if (extrares.status == 2) { + $.log("参数错误" + JSON.stringify(extrares)); + } else if (extrares.status == 1 && extrares.data.taskList[0].status == 1) { + timestatus = extrares.data.taskList[0].status; + timetitle = extrares.data.taskList[0].name; + $.log(timetitle + "可领取,去领青豆"); + await TimePacket(); + } + resolve() + }) + }) +} + +function TimePacket() { + return new Promise((resolve, reject) =>{ + $.post(kdHost('WebApi/TimePacket/getReward', cookie), (error, resp, data) =>{ + let timeres = JSON.parse(data); + if (timeres.code == 1) { + $.log("获得" + timeres.data.score + "青豆"); + detail += "【" + timetitle + "】获得" + timeres.data.score + "青豆\n" + } else if (timeres.code == 0) { + $.log(timeres.msg) + } + resolve() + }) + }) +} + + + //转盘任务 function rotary() { return new Promise((resolve, reject) =>{ From 1d2cf68cbb94e262ccbc0658a39c065908518fca Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 19:44:59 +0800 Subject: [PATCH 637/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/youth_read.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index 136427288e..2fa62e1b2c 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -59,4 +59,4 @@ jobs: node Task/Youth_Read.js env: YOUTH_READ: ${{ secrets.YOUTH_AREAD4 }} - YOUTH_TIME: ${{ secrets.YOUTH_ATIME4 }} + YOUTH_ATIME: ${{ secrets.YOUTH_ATIME4 }} From c19a157299bff931eae415132c23408c9e11c9da Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 15 Feb 2021 19:46:29 +0800 Subject: [PATCH 638/721] --- .github/workflows/youth_read.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index 2fa62e1b2c..86de482cb3 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -58,5 +58,5 @@ jobs: run: | node Task/Youth_Read.js env: - YOUTH_READ: ${{ secrets.YOUTH_AREAD4 }} + YOUTH_READ: ${{ secrets.YOUTH_READ4 }} YOUTH_ATIME: ${{ secrets.YOUTH_ATIME4 }} From 6ebdfa8485a596314b5cfae687bb769b8e506eb4 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 16 Feb 2021 00:20:22 +0800 Subject: [PATCH 639/721] =?UTF-8?q?=E9=83=A8=E5=88=86=E7=94=B5=E8=A7=86?= =?UTF-8?q?=E5=8F=B0=E7=9B=B4=E6=92=AD=E7=BD=91=E9=A1=B5=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/tvpreview.js | 103 ++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 59 deletions(-) diff --git a/Task/tvpreview.js b/Task/tvpreview.js index b8aca9019f..3f2abb30b6 100644 --- a/Task/tvpreview.js +++ b/Task/tvpreview.js @@ -36,66 +36,51 @@ const $ = new Env("电视预告") const tvnum = $.getdata("c")||tv -const d = new Date(); - weekday = new Array(7); - weekday[0]="星期日"; - weekday[1]="星期一"; - weekday[2]="星期二"; - weekday[3]="星期三"; - weekday[4]="星期四"; - weekday[5]="星期五"; - weekday[6]="星期六"; - n = weekday[d.getDay()] +const weekday = new Array('星期日','星期一','星期二','星期三','星期四','星期五','星期六') + week = weekday[new Date().getDay()] - !(async () => { - await playTV(); - //await showmsg() -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) -function playTV(){ -return new Promise((resolve) => { -const wurl = { - url: "http://api.cntv.cn/epg/epginfo?serviceId=cbox&c="+tvnum, - headers: {'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'}, -} - $.get(wurl, (error, resp, data) => { - try { - let result = JSON.parse(data) - //console.log(result) - $.title = `${result[`${tvnum}`].channelName}频道节目 ` + $.time('MM月dd日') + $.time('H:m')+n - nowplay = `正在播出: ${result[`${tvnum}`].isLive}` - let playlist = "" - let playtime = "" - for (i = 0; i < result[`${tvnum}`].program.length; i++) - { - playdata = result[`${tvnum}`].program[i] - playtime = "\n"+playdata.showTime - duration = " 时长:"+Math.trunc(playdata.duration/60)+"分钟" - playitem = playdata.t - playlist += playtime+" "+playitem - } - $.detail = nowplay + playlist - let l = result[`${tvnum}`].program.length - for (i = 1; i < l && result[`${tvnum}`].program[i].showTime.split(':')[0] < result[`${tvnum}`].program[l-1].showTime.split(':')[0]; i++) - { - if (result[`${tvnum}`].liveSt == result[`${tvnum}`].program[i].st) - { - duration = " 时长: "+Math.trunc(result[`${tvnum}`].program[i+1].duration/60)+"分钟" - $.subTitle = `即将播出: ${result[`${tvnum}`].program[i+1].t}` +duration - } - } - $.msg($.title, $.subTitle, $.detail,{'media-url':`http://cdn.dianshihome.com/static/channel/poster/${tvnum}.jpg`}) - resolve() - } - catch(err) { - $.msg("无此频道节目信息或者台号错误❌", "请检查后重试", err) + +playTV(); + +function playTV() { + return new Promise((resolve) =>{ + const wurl = { + url: "http://api.cntv.cn/epg/epginfo?serviceId=cbox&c=" + tvnum, + headers: { + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + }, + } + $.get(wurl, (error, resp, data) =>{ + try { + let result = JSON.parse(data)[tvnum]; + //$.log(JSON.stringify(result,null,2)) + $.title = result.channelName + "频道节目 " + $.time('MM月dd日HH:mm ') + week; + $.sub = "正在播出: " + result.isLive; + liveUrl = result.lvUrl; + let playlist = ""; + for (i = 0; i < result.program.length; i++) { + playdata = result.program[i]; + playtime = "\n " + playdata.showTime, + duration = " 时长:" + Math.trunc(playdata.duration / 60) + "分钟", + playitem = playdata.t, + playlist += playtime + " " + playitem, + endTime = playdata.et - parseInt(Date.now() / 1000); + if (playdata.st == result.liveSt) { + $.sub += " 剩余" + parseInt(endTime / 60) + "分钟" + } + if (i + 1 < result.program.length) { + nextplay = "即将播出: " + result.program[i + 1].t + duration + } + } + $.desc = nextplay + playlist; + $.msg($.title, $.sub, $.desc, {'media-url': `http://cdn.dianshihome.com/static/channel/poster/${tvnum}.jpg`,'open-url':liveUrl}) + } catch(err) { + $.msg("无此频道节目信息或者台号错误❌", "请检查后重试", err) + } finally { + $.done() } - }) - }) + }) + }) } - - //console.log(playlist) - -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 580ee06e7718dfd2c0b9224aa7e510b09024b9b9 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 16 Feb 2021 00:54:42 +0800 Subject: [PATCH 640/721] --- Task/Youth_Read.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 7c75daa4ba..2db3e4f4c3 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -72,7 +72,7 @@ function AutoRead() { return new Promise((resolve, reject) =>{ $.post(batHost('article/complete.json', articlebody), async(error, response, data) =>{ let readres = JSON.parse(data); - console.log(JSON.stringify(readres,null,2)) + // $.log(JSON.stringify(readres,null,2)) if (readres.error_code == '0' && data.indexOf("read_score") > -1 && readres.items.read_score > 0) { console.log(`\n本次阅读获得${readres.items.read_score}个青豆,请等待30s后执行下一次阅读\n`); if(data.indexOf("ctype")>-1){ From b50a4705e11c8f055dc45057871fe86c2647357a Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 16 Feb 2021 12:27:27 +0800 Subject: [PATCH 641/721] --- Task/youth.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 04462a00fc..2b9894bc02 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -117,8 +117,8 @@ if (rotaryres.status == 0) { } if (rotaryres.status == 1) { - detail += `【转盘抽奖】+${rotaryscore}个青豆 剩余${rotaryres.data.remainTurn}次\n` -$.log(`转盘抽奖: 共计+${rotaryscore}个青豆 剩余${rotaryres.data.remainTurn}次\n`) + detail += `【转盘抽奖】+${rotaryscore}个青豆 剩余${rotaryres.data.remainTurn}次\n`; + $.log(`转盘抽奖: 共计+${rotaryscore}个青豆 剩余${rotaryres.data.remainTurn}次`) } if (rotaryres.status !== 0&&rotaryres.data.doubleNum !== 0){ detail += `【转盘双倍】+${doublerotary}青豆 剩余${rotaryres.data.doubleNum}次\n` @@ -641,7 +641,6 @@ function runRotary(index) { const rotarbody = cookie + '&num=' + index; $.post(kdHost(`WebApi/RotaryTable/chestReward?_=${Date.now()}&`,rotarbody), (error, resp, data) => { let rotaryresp = JSON.parse(data); - //$.log(formatJson(data)); if (rotaryresp.status == 1) { detail += `【转盘宝箱${index}】+${rotaryresp.data.score}个青豆\n`; }else{ From 1fb015d5876047911bf2d2a07df0d4c32d866b2d Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 16 Feb 2021 15:04:06 +0800 Subject: [PATCH 642/721] =?UTF-8?q?=E5=80=9F=E7=94=A8songyangzz=E5=A4=A7?= =?UTF-8?q?=E4=BD=AC=E7=9A=84=E4=B8=AD=E6=96=AD=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Youth_Read.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 2db3e4f4c3..64f2b80f59 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-15 16:40 +更新时间: 2021-02-16 15:00 Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 请自行抓包,阅读文章和看视频,倒计时转一圈显示青豆到账即可,多看几篇文章和视频,获得更多包数据,抓包地址为"https://ios.baertt.com/v5/article/complete.json",在Github Actions中的Secrets新建name为'YOUTH_READ'的一个值,拷贝抓包的请求体到下面Value的文本框中,添加的请求体越多,获得青豆次数越多,本脚本不包含任何推送通知 @@ -18,6 +18,7 @@ if (isGetbody = typeof $request !==`undefined`) { Getbody(); $done() } +let lastIndex = $.getdata('zq_lastbody') if(!$.isNode()&&!YouthBody==true){ $.log("您未获取阅读请求,请求阅读后获取") $.msg($.name, "您未获取阅读请求,请求阅读后获取","",{'open-url':"https://kandian.youth.cn/u/8S9DO"}) @@ -53,11 +54,16 @@ if(!$.isNode()&&!YouthBody==true){ console.log($.name, '【提示】请把抓包的请求体填入Github 的 Secrets 中,请以&隔开') return; } - for (let i = 0; i < ReadArr.length; i++) { + +let indexLast = $.getdata('zqbody_index'); + $.begin = indexLast ? parseInt(indexLast,10) : 1; + $.index = 0; + for ( var i = indexLast ? indexLast:0; i < ReadArr.length; i++) { if (ReadArr[i]) { articlebody = ReadArr[i]; - $.index = i + 1; + $.index = $.index + 1; console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`); + await $.wait(1000); await AutoRead(); }; } @@ -73,6 +79,9 @@ function AutoRead() { $.post(batHost('article/complete.json', articlebody), async(error, response, data) =>{ let readres = JSON.parse(data); // $.log(JSON.stringify(readres,null,2)) + $.begin=$.begin+1; + let res=$.begin%ReadArr.length + $.setdata(res+"", 'zqbody_index'); if (readres.error_code == '0' && data.indexOf("read_score") > -1 && readres.items.read_score > 0) { console.log(`\n本次阅读获得${readres.items.read_score}个青豆,请等待30s后执行下一次阅读\n`); if(data.indexOf("ctype")>-1){ @@ -95,16 +104,14 @@ function AutoRead() { if($.index==ReadArr.length){ $.log($.index+"次任务已全部完成,即将结束") } else { - await $.wait(30000); + await $.wait(28000); } } else if (readres.error_code == '0' && data.indexOf('"score":0') > -1 && readres.items.score == 0) { - console.log(`\n本次阅读获得0个青豆,等待2s即将开始下次阅读\n`); - await $.wait(2000); + console.log(`\n本次阅读获得0个青豆,等待1s即将开始下次阅读\n`); } else if (readres.success == false) { console.log(`第${$.index}次阅读请求有误,请删除此请求`) } else if (readres.items.max_notice == '\u770b\u592a\u4e45\u4e86\uff0c\u63621\u7bc7\u8bd5\u8bd5') { console.log(readres.items.max_notice) - await $.wait(2000); } resolve() }) From 8f76cc7abf709a1d94985e0c8d1f42d264009054 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 16 Feb 2021 17:37:42 +0800 Subject: [PATCH 643/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0boxjs=E9=83=A8?= =?UTF-8?q?=E5=88=86=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/sunert.boxjs.json | 10 ++++++++++ Task/youth.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index e706711fc3..d69b74ec0b 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -7,6 +7,11 @@ "apps" : [ { "author" : "@sunert", + "descs_html": [ + "

获取Cookie以及脚本配置请查看配置说明

", + "
", + "

其中"wb_nick"为账号昵称,无需另外获取,脚本运行可自动生成,"wb_cookie"为任务红包余额,获取后方可显示,可选,"sy_token_wb"为微博签到token,必选

" + ], "keys" : [ "sy_token_wb", "wb_cookie", @@ -23,6 +28,11 @@ }, { "author" : "@sunert", + "descs_html": [ + "

获取Cookie以及脚本配置请查看配置说明

", + "
", + "

其中"zq_nick"、"zqcash"和"zqcard"为昵称、提现金额和早起打卡开关,无需另外获取,相关项设置后自动生成,"cashurl_zq"和 "cashbody_zq"为提现请求,获取后方可自动提现,可选

" + ], "keys" : [ "zq_nick", "youthheader_zq", diff --git a/Task/youth.js b/Task/youth.js index 2b9894bc02..d463ed70e3 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -676,7 +676,7 @@ function earningsInfo() { $.get(kdHost(`wap/user/balance?`+cookie), (error, response, data) =>{ infores = JSON.parse(data); if (infores.status == 0) { - detail += ` <收益统计> :\n` + detail += ` <收益统计>:\n` for (i = 0; i < infores.history[0].group.length; i++) { detail += '【' + infores.history[0].group[i].name + '】' + infores.history[0].group[i].money + '个青豆\n' } From 33a74a811a9337a655a0f12b0bcdede3d1536f61 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 16 Feb 2021 17:40:34 +0800 Subject: [PATCH 644/721] --- Task/sunert.boxjs.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index d69b74ec0b..0f512e5357 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -10,7 +10,7 @@ "descs_html": [ "

获取Cookie以及脚本配置请查看配置说明

", "
", - "

其中"wb_nick"为账号昵称,无需另外获取,脚本运行可自动生成,"wb_cookie"为任务红包余额,获取后方可显示,可选,"sy_token_wb"为微博签到token,必选

" + "

其中wb_nick为账号昵称,无需另外获取,脚本运行可自动生成,wb_cookie为任务红包余额,获取后方可显示,可选,sy_token_wb为微博签到token,必选

" ], "keys" : [ "sy_token_wb", @@ -31,7 +31,7 @@ "descs_html": [ "

获取Cookie以及脚本配置请查看配置说明

", "
", - "

其中"zq_nick"、"zqcash"和"zqcard"为昵称、提现金额和早起打卡开关,无需另外获取,相关项设置后自动生成,"cashurl_zq"和 "cashbody_zq"为提现请求,获取后方可自动提现,可选

" + "

其中zq_nick、zqcash和zqcard为昵称、提现金额和早起打卡开关,无需另外获取,相关项设置后自动生成,cashurl_zq和cashbody_zq为提现请求,获取后方可自动提现,可选

" ], "keys" : [ "zq_nick", From 4f6520315e617809509f4ebe1373ed3bba86334b Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 16 Feb 2021 20:20:28 +0800 Subject: [PATCH 645/721] --- Task/txnews.js | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/Task/txnews.js b/Task/txnews.js index b60749e0d1..ac72c7c2cf 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -8,7 +8,7 @@ const $ = new Env('腾讯新闻'); const notify = $.isNode() ? require('./sendNotify') : ''; let notifyInterval =$.getdata('notifynum')||50; //阅读篇数间隔通知开为1,常关为0; -const TX_HOST = 'https://api.inews.qq.com/activity/v1/' + let SignArr = [],SignUrl = ""; cookiesArr = [],CookieTxnews = ""; VideoArr = [],SignUrl = "",order = "", @@ -110,6 +110,22 @@ function GetCookie() { } } +function Host(api, body) { + return { + url: 'https://api.inews.qq.com/activity/v1/'+api, + headers:{ + 'Accept': '*/*', + 'Accept-Encoding': 'gzip, deflate, br', + 'Accept-Language': 'zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8', + 'Connection': 'keep-alive', + 'Cookie': cookieVal, + 'Host': 'api.inews.qq.com', + 'Referer': 'http://inews.qq.com/inews/iphone/', + 'User-Agent': 'QQNews/6.4.10 (iPhone; iOS 14.2; Scale/3.00)' + }, + body: body + } +} //签到 function getsign() { @@ -136,7 +152,7 @@ function getsign() { function activity() { return new Promise((resolve, reject) => { - $.get({url:`${TX_HOST}user/activity/get?isJailbreak=0&${ID}`, headers: {Cookie:cookieVal}}, (error,response, data) =>{ + $.get(Host('user/activity/get?isJailbreak=0&'+ID), (error,resp, data) =>{ try{ let obj = JSON.parse(data) actid = obj.data.activity.id @@ -175,11 +191,7 @@ function toRead(urlVal,body) { //阅读文章统计 function StepsTotal() { return new Promise((resolve, reject) => { - const StepsUrl = { - url: `${TX_HOST}activity/info/get?activity_id=${actid}&${ID}`, - headers: {Cookie: cookieVal} - } - $.get(StepsUrl, async(error, response, data) => { + $.get(Host('activity/info/get?activity_id='+actid+'&'+ID), async(error, resp, data) => { totalred = JSON.parse(data) totalcion = totalred.data.extends.today_total_coin if (totalred.ret == 0){ @@ -236,8 +248,8 @@ function StepsTotal() { function Redpack(red_body) { return new Promise((resolve, reject) => { const cashUrl = { - url: `${TX_HOST}activity/redpack/get?isJailbreak=0&mac=${token}`, - headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded","User-Agent": "QQNews/6.3.91 (iPhone; iOS 14.2; Scale/3.00)","Referer": "http://inews.qq.com/inews/iphone/"}, + url: `${TX_HOST}activity/redpack/get?isJailbreak=0&mac${token}`, + headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded","User-Agent": "QQNews/6.4.10 (iPhone; iOS 14.2; Scale/3.00)","Referer": "http://inews.qq.com/inews/iphone/"}, body: `redpack_type=${red_body}&activity_id=${actid}` } $.post(cashUrl, (error, response, data) => { @@ -270,10 +282,7 @@ function Redpack(red_body) { //收益总计 function getTotal() { return new Promise((resolve, reject) => { - const totalUrl = { - url: `${TX_HOST}usercenter/activity/list?isJailbreak=0`, - headers: {Cookie: cookieVal}}; - $.post(totalUrl, function(error,response, data) { + $.post(Host('usercenter/activity/list?isJailbreak=0'), function(error,response, data) { if (error) { $.msg("获取收益信息失败‼️", "", error) } else { From a2091c6374296db021a57f5bb3648b0b72fecf7a Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 00:26:15 +0800 Subject: [PATCH 646/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index d463ed70e3..dd89ce6a68 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -80,7 +80,7 @@ if (isGetCookie = typeof $request !== 'undefined') { }; !(async () => { if (!cookieArr[0]) { - $.msg($.name, '【提示】请先获取中青看点一cookie') + $.msg($.name, '【提示】请先获取中青看点一cookie',"",{'open-url': "https://kandian.youth.cn/u/mhkjN"}) return; } From eff2adfe278955f424c44f86a1e8c6d6294d2b95 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 00:55:50 +0800 Subject: [PATCH 647/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/txnews.js | 271 +++++++++++++++++++++++++++---------------------- 1 file changed, 152 insertions(+), 119 deletions(-) diff --git a/Task/txnews.js b/Task/txnews.js index ac72c7c2cf..038b1ebf1a 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -1,6 +1,6 @@ /* -更新时间: 2021-1-23 09:50 +更新时间: 2021-02-17 00:50 腾讯新闻签到修改版,可以自动阅读文章获取红包,该活动为瓜分百万现金挑战赛,针对幸运用户参与,本脚本已不能自动打开红包,需每天要打开腾讯新闻app一次,请须知 @@ -73,11 +73,12 @@ if (isGetCookie) { $.index = i + 1; console.log(`-------------------------\n\n开始【腾讯新闻账号${$.index}】`) ID = signurlVal.match(/devid=[a-zA-Z0-9_-]+/g)[0] - token = signurlVal.split("mac")[1] + await getsign(); await activity(); await getTotal(); + await $.wait(1000); await StepsTotal(); await showmsg(); if ($.isNode()&&process.env.TXNEWS_NOTIFY_CONTROL){ @@ -112,7 +113,7 @@ function GetCookie() { function Host(api, body) { return { - url: 'https://api.inews.qq.com/activity/v1/'+api, + url: 'https://api.inews.qq.com/activity/v1/'+api+'&isJailbreak=0&'+ID, headers:{ 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, br', @@ -131,17 +132,18 @@ function Host(api, body) { function getsign() { return new Promise((resolve, reject) => { const signUrl = { - url: `https://api.inews.qq.com/task/v1/user/signin/add?`,headers:{Cookie: cookieVal} + url: `https://api.inews.qq.com/task/v1/user/signin/add?`,headers: Host().headers }; - $.post(signUrl, (error, response, data) => { + $.post(signUrl, (error, resp, data) => { let obj = JSON.parse(data) +// $.log(JSON.stringify(obj,null,2)) if (obj.info=="success"){ next = obj.data.next_points tip = obj.data.tip_soup||obj.data.share_tip imgurl= obj.data.share_img - Dictum = tip.replace(/[\<|\.|\>|br]/g,"")+""+obj.data.author.replace(/[\<|\.|\>|br|图|腾讯网友]/g,"") + Dictum = tip.replace(/
/g,"")+" "+obj.data.author signinfo = '【签到信息】连续签到' + obj.data.signin_days+'天 '+'明日+'+ next +'金币 成功🎉\n'} else { - $.msg('签到失败,🉐登录腾讯新闻app获取cookie', "", "") + $.msg($.name, '签到失败,🉐登录腾讯新闻app获取cookie', "") console.log('签到失败,🉐登录腾讯新闻app获取cookie'+data) return } @@ -151,144 +153,177 @@ function getsign() { } function activity() { - return new Promise((resolve, reject) => { - $.get(Host('user/activity/get?isJailbreak=0&'+ID), (error,resp, data) =>{ - try{ - let obj = JSON.parse(data) - actid = obj.data.activity.id - console.log(`\n您的活动ID为: `+actid+"\n🍻开始阅读任务\n") - } catch(error){ - $.msg($.name, "获取活动ID失败,详情请看日志","","") - console.log("活动ID日志:"+ data) - return + return new Promise((resolve, reject) =>{ + $.get(Host('user/task/list?'), async(error, resp, data) =>{ + try { + let taskres = JSON.parse(data); + //$.log(JSON.stringify(obj,null,2)) + if (taskres.ret == 0) { + actid = taskres.data.award_notice.activity_id; + $.log(`\n您的活动ID为: ` + actid + "\n\n********* 开始阅读任务 ********\n"); + for (tasks of taskres.data.list) { + taskname = tasks.task_title, + tasktype = tasks.task_type, + taskstatus = tasks.task_status, + ratepack = tasks.rate, + totalpack = tasks.quota; + eventnum = tasks.task_desc + $.log("去" + taskname + "\n"); + if (taskstatus == 3) { + $.desc += "【" + taskname + "】✅ 已完成\n"; + $.log(taskname + "已完成") + } else { + if (tasktype == "article") { + readnum = eventnum.match(/>(\d+)(.+)<\/span>分钟/)[1] + $.desc += "【" + taskname + "】 已领" + ratepack + "个红包 已看"+videonum+"分钟\n"; + await $.wait(5000); + await toRead(videoVal, 'event=video_read') + } else if(tasktype == "cooperation") { + await openapp(tasks.task_id) + } + } } - resolve() - }) + } + } catch(error) { + $.msg($.name, "获取活动ID失败,详情请看日志", "", ""); + console.log("活动ID日志:" + data); + return + } + resolve() + }) }) } //阅读阶梯 -function toRead(urlVal,body) { - return new Promise((resolve, reject) => { - $.post({url: urlVal, headers: {Cookie:cookieVal}, body: body},(error, resp, data)=> { - try{ - let obj = JSON.parse(data) - if(obj.ret == 0){ - console.log("本次阅读成功,获取收益" +obj.data.countdown_timer.countdown_tips+"\n") - } else if(body.indexOf("article")>-1){console.log("本次阅读文章失败," +obj.info+"\n") - }else if(body.indexOf("video")>-1){console.log("本次观看视频失败," +obj.info+"\n") - } - } catch(error){ - console.log("本次阅读失败"+data+"\n") - } - resolve() - }) +function toRead(urlVal, body) { + return new Promise((resolve, reject) =>{ + $.post({ + url: urlVal, + headers: Host().headers, + body: body + }, + (error, resp, data) =>{ + try { + let obj = JSON.parse(data) + //$.log(JSON.stringify(obj,null,2)) + if (obj.ret == 0) { + console.log("本次阅读成功,获取收益" + obj.data.countdown_timer.countdown_tips + "\n"); + } else if (body.indexOf("article") > -1) { + console.log("本次阅读文章失败," + obj.info + "\n"); + } else if (body.indexOf("video") > -1) { + console.log("本次观看视频失败," + obj.info + "\n"); + } + } catch(error) { + console.log("本次阅读失败" + data + "\n") + } + resolve() }) + }) } +function openapp(taskid) { + return new Promise((resolve, reject) =>{ + $.get(Host('activity/do?activity_id='+taskid+'&'+ token), async(error, resp, data) =>{ + try { + let obj = JSON.parse(data) + $.log(JSON.stringify(obj,null,2)) + if (obj.ret == 0) { + $.log(taskname+"成功") + } else{ + $.log(taskname+"失败," + obj.info + "\n"); + } + } catch(error) { + console.log("本次任务失败" + data + "\n") + } + resolve() + }) + }) +} //阅读文章统计 function StepsTotal() { - return new Promise((resolve, reject) => { - $.get(Host('activity/info/get?activity_id='+actid+'&'+ID), async(error, resp, data) => { - totalred = JSON.parse(data) - totalcion = totalred.data.extends.today_total_coin - if (totalred.ret == 0){ - for (awards of totalred.data.award){ - taskType = awards.type - tasktitle = awards.title - red_get = awards.can_get - redtotal = awards.total - red_opened = awards.opened - task_num = awards.event_num - over_red = Number(redtotal-red_opened) - if(taskType=="article"){ - if(over_red !=0){ - readnum = task_num - await $.wait(3000) - await toRead(signurlVal,'event=article_read') - } else if(over_red ==0){ - read_finish = "今日阅读任务已完成" - console.log(read_finish) - } - read_res = over_red - if(awards.openable !== 0){ - $.log("可以打开"+awards.openable+"个阅读红包,去打开红包") - await Redpack(taskType) - } - $.log("已阅读文章"+task_num+"篇,阅读红包已打开"+red_opened+"个红包\n "+tasktitle+"\n") - read_info = "【阅读文章】已阅"+task_num+"篇,已开"+red_opened+"红包,总计"+redtotal+"个红包" + return new Promise((resolve, reject) =>{ + $.get(Host('activity/info/get?activity_id=' + actid), async(error, resp, data) =>{ + totalred = JSON.parse(data); + //$.log(JSON.stringify(totalred,null,2)) + totalcion = totalred.data.extends.today_total_coin; + if (totalred.ret == 0) { + for (awards of totalred.data.award) { + taskType = awards.type, + red_get = awards.can_get, + redtotal = awards.total, + red_opened = awards.opened, + task_num = awards.event_num, + over_red = Number(redtotal - red_opened); + if (taskType == "article") { + readnum = awards.event_num, + read_res = over_red; + if (awards.openable !== 0) { + $.log("可以打开" + awards.openable + "个阅读红包,去打开红包"); + await $.wait(1000); + await Redpack(taskType) + } } - if(taskType=="video"){ - if(over_red !=0){ - await $.wait(5000) - await toRead(videoVal,'event=video_read') - }else if(over_red ==0){ - video_finish = "今日视频任务已完成" - console.log(video_finish) - } - video_res = over_red - if(awards.openable !== 0){ - $.log("可以打开"+awards.openable+"个视频红包,去打开红包") - await Redpack(taskType) - } - $.log("已观看视频"+task_num+"分钟,视频红包已打开"+red_opened+"个红包\n "+tasktitle+"\n") - video_info = "【观看视频】已看"+task_num+"分钟,已开"+red_opened+"红包,总计"+redtotal+"个红包" + if (taskType == "video") { + video_res = over_red; + videonum = awards.event_num; + if (awards.openable !== 0) { + $.log("可以打开" + awards.openable + "个视频红包,去打开红包"); + await $.wait(1000); + await Redpack(taskType) + } } } } - resolve() - }) + resolve() + }) }) } //阶梯红包到账 function Redpack(red_body) { - return new Promise((resolve, reject) => { - const cashUrl = { - url: `${TX_HOST}activity/redpack/get?isJailbreak=0&mac${token}`, - headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded","User-Agent": "QQNews/6.4.10 (iPhone; iOS 14.2; Scale/3.00)","Referer": "http://inews.qq.com/inews/iphone/"}, - body: `redpack_type=${red_body}&activity_id=${actid}` - } - $.post(cashUrl, (error, response, data) => { - let rcash = JSON.parse(data) - $.log(data) - try{ - if(rcash.data.award.length == 1){ - redpacks = rcash.data.award.num/100 - if (rcash.ret == 0&&redpacks>0&&red_body=="article"){ - redpackres = `【阅读红包】到账`+redpacks+`元 🌷\n` - $.log("阅读红包到账"+redpacks+"元\n") - } - else if (rcash.ret == 0&& redpacks >0&&red_body=="video"){ - redpackres = `【视频红包】到账`+redpacks+`元 🌷\n` - $.log("视频红包到账"+redpacks+"元\n") + return new Promise((resolve, reject) =>{ + $.post(Host('activity/redpack/get?mac' + token, `redpack_type=${red_body}&activity_id=${actid}`), (error, resp, data) =>{ + let rcash = JSON.parse(data); + try { + if (rcash.data.award.length == 1) { + redpacks = rcash.data.award.num / 100; + if (rcash.ret == 0 && redpacks > 0 && red_body == "article") { + redpackres = `【阅读红包】到账` + redpacks + `元🌷\n`; + $.log("阅读红包到账" + redpacks + "元\n") + } else if (rcash.ret == 0 && redpacks > 0 && red_body == "video") { + redpackres = `【视频红包】到账` + redpacks + `元🌷\n`; + $.log("视频红包到账" + redpacks + "元\n") } - } else { - $.log(rcash.data.award.length+"个红包到账\n") - } + } else { + $.log(rcash.data.award.length + "个红包到账\n") } - catch(error){ - console.log("打开红包失败,响应数据: "+ data) - $.msg($.name, "开红包失败,详情请看日志 ❌", error) - }; - resolve() - }) + } catch(error) { + console.log("打开红包失败,响应数据: " + data); + $.msg($.name, "开红包失败,详情请看日志 ❌", error) + }; + resolve() + }) }) } //收益总计 function getTotal() { return new Promise((resolve, reject) => { - $.post(Host('usercenter/activity/list?isJailbreak=0'), function(error,response, data) { + $.post(Host('usercenter/activity/list?'), (error, resp, data) =>{ if (error) { $.msg("获取收益信息失败‼️", "", error) } else { const Total_Earn = JSON.parse(data) - cashtotal =Total_Earn.data.wealth[1].title - subTile = '【收益总计】'+ Total_Earn.data.wealth[0].title +'金币 '+"钱包: " + cashtotal+'元' + cashtotal = Total_Earn.data.wealth[1].title + $.sub = '【收益总计】'+ Total_Earn.data.wealth[0].title +'金币 '+"钱包: " + cashtotal+'元' // $.log("钱包收益共计"+obj.data.wealth[1].title+"元") } resolve() @@ -298,16 +333,14 @@ function getTotal() { function showmsg() { return new Promise((resolve, reject) => { - if(read_info||video_info){ - detail = signinfo +read_info +"\n"+video_info+`\n【每日一句】`+Dictum - } + $.desc += '【每日一句】'+Dictum if (readnum&&readnum%notifyInterval==0){ - $.msg($.name,subTile,detail,{ 'open-url': "https://news.qq.com/FERD/cjRedDown.htm", 'media-url': imgurl } ) - } else if (video_finish&&read_finish){ - $.msg($.name+` 今日任务已完成✅`,subTile,detail,{ 'open-url': "https://news.qq.com/FERD/cjRedDown.htm", 'media-url': imgurl } ) + $.msg($.name, $.sub, $.desc,{ 'open-url': "https://news.qq.com/FERD/cjRedDown.htm", 'media-url': imgurl } ) + } else if (read_res==0&&video_res==0){ + $.msg($.name+` 今日任务已完成✅`,$.sub, $.desc,{ 'open-url': "https://news.qq.com/FERD/cjRedDown.htm", 'media-url': imgurl } ) } else { - console.log($.name+'\n'+subTile+'\n'+ detail) -} + console.log($.sub+'\n'+ $.desc) + } resolve() }) } From 05aa7a741508785882a6a8f078d833339d1a0d0f Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 01:26:49 +0800 Subject: [PATCH 648/721] --- Task/youth.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index dd89ce6a68..c95eee6c83 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -103,14 +103,14 @@ if (isGetCookie = typeof $request !== 'undefined') { await gameVideo(); await readArticle(); for (k=0;k<5;k++){ - await $.wait(1000); + await $.wait(2000); await rotary(); if (rotaryres.status == 0) { rotarynum = ` 转盘${rotaryres.msg}🎉`; break } else if(rotaryres.status == 1){ - console.log("等待1s进行开始转盘任务") + console.log("等待2s进行开始转盘任务") rotaryscore += rotaryres.data.score rotarytimes = rotaryres.data.remainTurn } @@ -596,8 +596,6 @@ function TimePacket() { }) } - - //转盘任务 function rotary() { return new Promise((resolve, reject) =>{ @@ -696,7 +694,7 @@ async function showmsg() { $.msg($.name+" "+nick+" "+rotarynum,subTitle,detail)//任务全部完成且通知间隔不为0时通知; } else { - console.log(`【收益总计】${totalscore}青豆 现金约${cash}元\n`+ detail) + console.log(`\n【收益总计】${totalscore}青豆 现金约${cash}元\n`+ detail) } } From 54f8dce6d2b83e7e9654b0ced49f538acc63ba19 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 02:52:29 +0800 Subject: [PATCH 649/721] --- Task/youth.js | 51 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index c95eee6c83..758905f591 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,8 +1,9 @@ /* -更新时间: 2021-02-15 19:50 +更新时间: 2021-02-17 02:50 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 -食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行 +食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行, +转发文章获得青豆不实,请无视 */ @@ -94,7 +95,6 @@ if (isGetCookie = typeof $request !== 'undefined') { myuid = cookie.match(/uid=\d+/); await userInfo(); $.log(`\n********** ${nick} 现金收益: ${cash}元 ********\n`); - await kdHost(); await friendsign(); await ExtraList(); await TaskCenter() @@ -167,14 +167,17 @@ function TaskCenter() { } else if (dailys.status == "2" && dailys.action != "") { $.log(dailys.title + "," + dailys.but + ",已领取青豆" + dailys.score) detail += `【${dailys.title}】✅ ${dailys.score}青豆\n` - }; - if (dailys.title=="打卡赚钱"&&dailys.status == "0"&&ONCard == "true") { + } + else if (dailys.title=="打卡赚钱"&&dailys.status == "0"&&ONCard == "true") { await CardStatus() } - if (dailys.id == "7" && dailys.status == "0") { + else if (dailys.id == "7" && dailys.status == "0") { await readTime(); } - if (dailys.id == "10" && dailys.status == "0") { + else if (dailys.id == "4" && dailys.status == "0") { + await getArt(); + } + else if (dailys.id == "10" && dailys.status == "0") { $.log(dailys.title + "未完成,去做任务"); for (x = 0; x < 5; x++) { $.log("等待5s执行第" + (x + 1) + "次"); @@ -227,6 +230,40 @@ function getsign() { }) } +function getArt() { + return new Promise((resolve, reject) =>{ + $.post(kdHost('WebApi/ArticleTop/listsNewTag'), async(error, resp, data) =>{ + artres = JSON.parse(data); + if (artres.status == 1) { + for (arts of artres.data.items) { + titlename = arts.title; + account = arts.account_id; + if (arts.status == "1") { + $.log("去转发文章"); + $.log(titlename + " ----- " + arts.account_name); + await artshare(arts.id); + break; + //await $.wait(500) + } + } + } + resolve() + }) + }) +} + +function artshare(artsid) { + return new Promise((resolve, reject) =>{ + $.post(kdHost('WebApi/ShareNew/getShareArticleReward', cookie + "&" + "article_id=" + artsid), async(error, resp, data) =>{ + shareres = JSON.parse(data); + if (shareres.status == 1) { + $.log("转发成功,共计转发" + shareres.data.items.share_num + "篇文章,获得青豆" + shareres.data.score) + } + resolve() + }) + }) +} + function userInfo() { return new Promise((resolve, reject) => { $.post(kdHost('WebApi/NewTaskIos/getSign'), async(error, resp, data) => { From 8ef0f4e1068654b7e655c918f7781b767bc9afa3 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 08:28:49 +0800 Subject: [PATCH 650/721] --- Task/youth.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 758905f591..6fbc2725bf 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-17 02:50 +更新时间: 2021-02-17 08:30 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行, @@ -335,6 +335,8 @@ function CardStatus() { } else if (punchcard.data.user.status == 3&&$.time("HH")==cardTime) { $.log("打卡时间已到,去打卡"); await endCard() + } else if (punchcard.data.user.status == 0) { + $.log("今日您未报名早起打卡"); } } else if (punchcard.code == 0) { $.log("打卡申请失败" + data) From c23fd9f83b15f9636ba83d101614e4ea1390e201 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 08:31:14 +0800 Subject: [PATCH 651/721] --- .github/workflows/youth.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index ad0cd2a316..9f831526a0 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -6,7 +6,7 @@ name: 中青看点 on: workflow_dispatch: schedule: - - cron: '1-25/7 */5 * * *' + - cron: '*/7 */5 * * *' watch: types: started From f9de3ff00ef1f597fdaa5fbda29d57c24de2088b Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 09:33:40 +0800 Subject: [PATCH 652/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=AD=E9=9D=92?= =?UTF-8?q?=E8=BD=AC=E7=9B=98=E6=8A=BD=E5=A5=96=E6=97=B6=E9=97=B4=E9=97=B4?= =?UTF-8?q?=E9=9A=94=EF=BC=8C=E9=BB=98=E8=AE=A410s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/sunert.boxjs.json | 7 +++++++ Task/youth.js | 13 ++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 0f512e5357..5191951cb2 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -61,6 +61,13 @@ "type" : "number", "desc" : "每日早起打卡时间" }, + { + "id" : "delay_rotary_zq", + "val" : "10", + "name" : "转盘时间间隔", + "type" : "number", + "desc" : "间隔时间设置,如1秒填1即可" + }, { "id" : "notifytimes", "val" : "", diff --git a/Task/youth.js b/Task/youth.js index 6fbc2725bf..a5a95d5cf4 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-17 08:30 +更新时间: 2021-02-17 09:30 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行, @@ -7,9 +7,10 @@ */ -let s = 1000 //各数据接口延迟 + const $ = new Env("中青看点") let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖每50次通知一次,如需关闭全部通知请设为0 +let s = $.getdata('delay_rotary_zq')||"10" //转盘延迟时间 const notify = $.isNode() ? require('./sendNotify') : ''; const ONCard = $.getdata('zqcard')||"false" //早起打卡开关 const withdrawcash = $.getdata('zqcash')||30 //提现金额 @@ -102,15 +103,16 @@ if (isGetCookie = typeof $request !== 'undefined') { await getAdVideo(); await gameVideo(); await readArticle(); + $.log("开始转盘抽奖任务") for (k=0;k<5;k++){ - await $.wait(2000); + await $.wait(s*1000); await rotary(); if (rotaryres.status == 0) { rotarynum = ` 转盘${rotaryres.msg}🎉`; break } else if(rotaryres.status == 1){ - console.log("等待2s进行开始转盘任务") + console.log("等待"+s+"秒进行开始转盘任务") rotaryscore += rotaryres.data.score rotarytimes = rotaryres.data.remainTurn } @@ -644,7 +646,8 @@ function rotary() { if (rotaryres.status==1){ $.log("进行"+Number(100-rotaryres.data.remainTurn)+"次转盘,获得"+rotaryres.data.score+"青豆") if(rotaryres.data.score != 0&&rotaryres.data.doubleNum!=0){ - await $.wait(5000); + $.log("等待10s,获得双倍青豆") + await $.wait(10000); await TurnDouble(); } await rotaryCheck(); From b192b6aa897e9bafc0c806dbae0c95602c308faa Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 20:56:19 +0800 Subject: [PATCH 653/721] --- .github/workflows/txnews.yml | 1 + .github/workflows/youth.yml | 1 + .github/workflows/youth_read.yml | 1 + Task/youth.js | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/txnews.yml b/.github/workflows/txnews.yml index e6aa4c5d8f..5776b9ab18 100644 --- a/.github/workflows/txnews.yml +++ b/.github/workflows/txnews.yml @@ -36,6 +36,7 @@ jobs: run: | node Task/txnews.js env: + TZ: Asia/shanghai PUSH_KEY: ${{ secrets.PUSH_KEY}} BARK_PUSH: ${{ secrets.BARK_PUSH}} BARK_SOUND: ${{ secrets.BARK_SOUND}} diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index 9f831526a0..11837ceb43 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -35,6 +35,7 @@ jobs: node Task/youth.js env: YOUTH_NOTIFY_CONTROL: ${{ secrets.YOUTH_NOTIFY_CONTROL }} + TZ: Asia/shanghai PUSH_KEY: ${{ secrets.PUSH_KEY}} BARK_PUSH: ${{ secrets.BARK_PUSH}} BARK_SOUND: ${{ secrets.BARK_SOUND}} diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index 86de482cb3..cfdca6d629 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -18,6 +18,7 @@ jobs: YOUTH_READ2: ${{ secrets.YOUTH_READ2 }} YOUTH_READ3: ${{ secrets.YOUTH_READ3 }} YOUTH_READ4: ${{ secrets.YOUTH_READ4 }} + TZ: Asia/shanghai steps: - name: Checkout uses: actions/checkout@v1 diff --git a/Task/youth.js b/Task/youth.js index a5a95d5cf4..0ac6a64741 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -96,6 +96,7 @@ if (isGetCookie = typeof $request !== 'undefined') { myuid = cookie.match(/uid=\d+/); await userInfo(); $.log(`\n********** ${nick} 现金收益: ${cash}元 ********\n`); + $.log($.time("YYYY-MM-dd HH:mm")) await friendsign(); await ExtraList(); await TaskCenter() From 01d7adb077e69c2e94a8427fbcc3f7e79c27ccb0 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 22:25:29 +0800 Subject: [PATCH 654/721] --- Task/Env.js | 22 ++++++++++++---------- Task/youth.js | 5 ++++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Task/Env.js b/Task/Env.js index b23d708ca3..d33f3ea678 100644 --- a/Task/Env.js +++ b/Task/Env.js @@ -367,20 +367,22 @@ function Env(name, opts) { * :$.time('yyyyMMddHHmmssS') * y:年 M:月 d:日 q:季 H:时 m:分 s:秒 S:毫秒 * 其中y可选0-4位占位符、S可选0-1位占位符,其余可选0-2位占位符 - * @param {*} fmt 格式化参数 + * @param {string} fmt 格式化参数 + * @param {number} 可选: 根据指定时间戳返回格式化日期 * */ - time(fmt) { + time(fmt, ts = null) { + const date = ts ? new Date(ts) : new Date() let o = { - '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() + 'M+': date.getMonth() + 1, + 'd+': date.getDate(), + 'H+': date.getHours(), + 'm+': date.getMinutes(), + 's+': date.getSeconds(), + 'q+': Math.floor((date.getMonth() + 3) / 3), + 'S': date.getMilliseconds() } - if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (new Date().getFullYear() + '').substr(4 - RegExp.$1.length)) + if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)) for (let k in o) if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)) diff --git a/Task/youth.js b/Task/youth.js index 0ac6a64741..ce7f8db900 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -53,7 +53,10 @@ if(!$.isNode()&&cookieYouth.indexOf("#") ==-1){ } else { READTIME = [process.env.YOUTH_TIME] } - console.log(` ============脚本执行 - 北京时间 (UTC + 8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`); + timeZone = new Date().getTimezoneOffset() / 60; + timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000 + bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); + console.log(` ============脚本执行 bjTime =============\n`); } else if(!$.isNode()&&cookieYouth.indexOf("#")>-1){ cookieYouth = cookieYouth.split("#") ARTBODYs = ARTBODYs.split("&") From 404c16aa22c3c562bb7dd4cbe15e86514acdb783 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 22:28:26 +0800 Subject: [PATCH 655/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index ce7f8db900..4fea143c9c 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -56,7 +56,7 @@ if(!$.isNode()&&cookieYouth.indexOf("#") ==-1){ timeZone = new Date().getTimezoneOffset() / 60; timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000 bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); - console.log(` ============脚本执行 bjTime =============\n`); + console.log(` ============ 脚本执行 ${bjTime} =============\n`); } else if(!$.isNode()&&cookieYouth.indexOf("#")>-1){ cookieYouth = cookieYouth.split("#") ARTBODYs = ARTBODYs.split("&") From d7275fa3035d6899e16fa1dace81e5d8a526cb46 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 22:32:04 +0800 Subject: [PATCH 656/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 4fea143c9c..3ca11a2bb6 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -99,7 +99,7 @@ if (isGetCookie = typeof $request !== 'undefined') { myuid = cookie.match(/uid=\d+/); await userInfo(); $.log(`\n********** ${nick} 现金收益: ${cash}元 ********\n`); - $.log($.time("YYYY-MM-dd HH:mm")) + $.log($.time("yyyy-MM-dd (HH+8):mm")) await friendsign(); await ExtraList(); await TaskCenter() From 2292c6fd4a2cd49d6b37f32218863c11470abaa1 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 22:54:00 +0800 Subject: [PATCH 657/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=97=B6=E9=97=B4=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Youth_Read.js | 6 ++++-- Task/baidu_speed.js | 5 ++++- Task/dianshijia.js | 8 +++++--- Task/txnews.js | 6 ++++-- Task/weibo.js | 7 +++++-- Task/youth.js | 15 +++++++-------- Task/youth_gain.js | 6 ++++-- 7 files changed, 33 insertions(+), 20 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 64f2b80f59..4c01eb1ed1 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -36,8 +36,6 @@ if(!$.isNode()&&!YouthBody==true){ } else { YouthBody = [process.env.YOUTH_READ] } - console.log(` ============ 脚本执行 - 北京时间 (UTC + 8):${new Date(Date.now() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) - } else if (!$.isNode() && YouthBody.indexOf("&") > -1) { YouthBody = YouthBody.split("&") }; @@ -46,6 +44,10 @@ if(!$.isNode()&&!YouthBody==true){ ReadArr.push(YouthBody[item]) } }) + timeZone = new Date().getTimezoneOffset() / 60; + timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000; + bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); + console.log(`\n === 脚本执行 ${bjTime} ===\n`); $.log("\n 您共获取"+ReadArr.length+"次阅读请求,任务开始\n") } diff --git a/Task/baidu_speed.js b/Task/baidu_speed.js index a77694df3a..f55e4a5e97 100644 --- a/Task/baidu_speed.js +++ b/Task/baidu_speed.js @@ -45,7 +45,6 @@ if ($.isNode()) { } else { BDCASH = [process.env.BAIDU_CASH] } - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`); } else if (!$.isNode()&&baiducks && baiducks.indexOf('&')>-1){ BDCookie = baiducks.split("&") BDCASH = [baiducash] @@ -69,6 +68,10 @@ if ($.isNode()) { console.log($.name, '【提示】请把百度Cookie填入Github 的 Secrets 中,请以&或者换行隔开'); return }; + timeZone = new Date().getTimezoneOffset() / 60; + timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000; + bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); + console.log(`\n === 脚本执行 ${bjTime} ===\n`); for (let i = 0; i < CookieArr.length; i++) { if (CookieArr[i]) { cookieval = CookieArr[i]; diff --git a/Task/dianshijia.js b/Task/dianshijia.js index fed7241061..d067693f14 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -43,8 +43,6 @@ if ($.isNode()) { DrawalArr.push(Drawals[item]) } }); - console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) } else { tokenArr.push($.getdata('sy_signheader_dsj')) DrawalArr.push($.getdata('drawal_dsj')) @@ -60,7 +58,11 @@ if (isGetCookie = typeof $request !== 'undefined') { $.msg($.name, '【提示】请先获取电视家一cookie') return; } - console.log(`------------- 共${tokenArr.length}个账号`) + timeZone = new Date().getTimezoneOffset() / 60; + timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000; + bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); + console.log(`\n === 脚本执行 ${bjTime} ===\n`); + console.log(`------------- 共${tokenArr.length}个账号`); if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')<'16'){ time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-28800 console.log(time) diff --git a/Task/txnews.js b/Task/txnews.js index 038b1ebf1a..0d46dfa62b 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -62,8 +62,10 @@ if (isGetCookie) { return } if ($.isNode()){ - console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()}=============\n`) + timeZone = new Date().getTimezoneOffset() / 60; + timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000; + bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); + console.log(`\n === 脚本执行 ${bjTime} ===\n`); } for (let i = 0; i < cookiesArr.length; i++) { if (cookiesArr[i]) { diff --git a/Task/weibo.js b/Task/weibo.js index 609d21a5ed..ff7bc0eef2 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -44,7 +44,6 @@ if ($.isNode()) { } else { cookies = [process.env.WB_COOKIE] }; - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) } else if (!$.isNode()&&wbtoken.indexOf("#")>-1) { wbtoken = wbtoken.split("#"); cookies = cookies.split("#") @@ -65,7 +64,11 @@ if ($.isNode()) { $.msg($.name, '【提示】请先获取新浪微博一cookie') return; } - console.log(`------------- 共${tokenArr.length}个账号\n`) + timeZone = new Date().getTimezoneOffset() / 60; + timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000; + bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); + console.log(`\n === 脚本执行 ${bjTime} ===\n`); + console.log(`------------- 共${tokenArr.length}个账号\n`) for (let i = 0; i < tokenArr.length; i++) { if (tokenArr[i]) { token = tokenArr[i]; diff --git a/Task/youth.js b/Task/youth.js index 3ca11a2bb6..0801770745 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-17 09:30 +更新时间: 2021-02-17 22:50 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行, @@ -7,7 +7,6 @@ */ - const $ = new Env("中青看点") let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖每50次通知一次,如需关闭全部通知请设为0 let s = $.getdata('delay_rotary_zq')||"10" //转盘延迟时间 @@ -53,10 +52,6 @@ if(!$.isNode()&&cookieYouth.indexOf("#") ==-1){ } else { READTIME = [process.env.YOUTH_TIME] } - timeZone = new Date().getTimezoneOffset() / 60; - timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000 - bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); - console.log(` ============ 脚本执行 ${bjTime} =============\n`); } else if(!$.isNode()&&cookieYouth.indexOf("#")>-1){ cookieYouth = cookieYouth.split("#") ARTBODYs = ARTBODYs.split("&") @@ -77,8 +72,13 @@ if(!$.isNode()&&cookieYouth.indexOf("#") ==-1){ timeArr.push(READTIME[item]) } }); - console.log(` ============= 您共提供${cookieArr.length}个中青账号 =============`); + timeZone = new Date().getTimezoneOffset() / 60; + timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000; + bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); + console.log(`\n === 脚本执行 ${bjTime} ===\n`); + console.log(` =========== 您共提供${cookieArr.length}个中青账号 ==========`); } +return if (isGetCookie = typeof $request !== 'undefined') { GetCookie(); $.done() @@ -99,7 +99,6 @@ if (isGetCookie = typeof $request !== 'undefined') { myuid = cookie.match(/uid=\d+/); await userInfo(); $.log(`\n********** ${nick} 现金收益: ${cash}元 ********\n`); - $.log($.time("yyyy-MM-dd (HH+8):mm")) await friendsign(); await ExtraList(); await TaskCenter() diff --git a/Task/youth_gain.js b/Task/youth_gain.js index 1da51903ac..adf4b054b9 100644 --- a/Task/youth_gain.js +++ b/Task/youth_gain.js @@ -50,8 +50,10 @@ if ($.isNode()) { } }) if ($.isNode()) { - console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + timeZone = new Date().getTimezoneOffset() / 60; + timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000; + bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); + console.log(`\n === 脚本执行 ${bjTime} ===\n`); } !(async () => { if (!startArr[0]) { From 96db9894bf96c71d8f68f1fd32cd2b2bf65cf0b5 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 17 Feb 2021 23:45:40 +0800 Subject: [PATCH 658/721] --- Task/Env.js | 71 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 27 deletions(-) diff --git a/Task/Env.js b/Task/Env.js index d33f3ea678..dc0edd04df 100644 --- a/Task/Env.js +++ b/Task/Env.js @@ -361,34 +361,51 @@ function Env(name, opts) { ) } } - /** - * - * 示例:$.time('yyyy-MM-dd qq HH:mm:ss.S') - * :$.time('yyyyMMddHHmmssS') - * y:年 M:月 d:日 q:季 H:时 m:分 s:秒 S:毫秒 - * 其中y可选0-4位占位符、S可选0-1位占位符,其余可选0-2位占位符 - * @param {string} fmt 格式化参数 - * @param {number} 可选: 根据指定时间戳返回格式化日期 - * - */ +/** + * 对Date的扩展,将 Date 转化为指定格式的String + * 月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q) 可以用 1-2 个占位符 + * 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字),12小时(h)可用一个占位符 + * eg: + * (new Date()).pattern("yyyy-MM-dd h:mm:ss.S") ==> 2006-07-02 上午8:09:04.423 + * (new Date()).pattern("yyyy-MM-dd E HH:mm:ss") ==> 2009-03-10 二 20:09:04 + * (new Date()).pattern("yyyy-MM-dd EE h:mm:ss") ==> 2009-03-10 周二 上午8:09:04 + * (new Date()).pattern("yyyy-MM-dd EEE h:mm:ss") ==> 2009-03-10 星期二 下午10:09:04 + * (new Date()).pattern("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 + */ time(fmt, ts = null) { - const date = ts ? new Date(ts) : new Date() - let o = { - 'M+': date.getMonth() + 1, - 'd+': date.getDate(), - 'H+': date.getHours(), - 'm+': date.getMinutes(), - 's+': date.getSeconds(), - 'q+': Math.floor((date.getMonth() + 3) / 3), - 'S': date.getMilliseconds() - } - if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)) - for (let k in o) - if (new RegExp('(' + k + ')').test(fmt)) - fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)) - return fmt - } - + const date = ts ? new Date(ts) : new Date() + var o = { + "M+" : this.getMonth()+1, //月份 + "d+" : this.getDate(), //日 + "h" : this.getHours()%12 == 0 ? 12 : this.getHours()/12 < 1 ? "上午" + this.getHours()%12 : "下午"+ this.getHours()%12 , //小时 + "H+" : this.getHours(), //小时 + "m+" : this.getMinutes(), //分 + "s+" : this.getSeconds(), //秒 + "q+" : Math.floor((this.getMonth()+3)/3), //季度 + "S" : this.getMilliseconds() //毫秒 + }; + var week = { + "0" : "\u65e5", + "1" : "\u4e00", + "2" : "\u4e8c", + "3" : "\u4e09", + "4" : "\u56db", + "5" : "\u4e94", + "6" : "\u516d" + }; + if(/(y+)/.test(fmt)){ + fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); + } + if(/(E+)/.test(fmt)){ + fmt=fmt.replace(RegExp.$1, ((RegExp.$1.length>1) ? (RegExp.$1.length>2 ? "\u661f\u671f" : "\u5468") : "")+week[this.getDay()+""]); + } + for(var k in o){ + if(new RegExp("("+ k +")").test(fmt)){ + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length))); + } + } + return fmt; +} /** * 系统通知 * From d4a6cef3fc9572d883e7ee292ed274bc54159b9d Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 01:47:19 +0800 Subject: [PATCH 659/721] --- Task/Env.js | 260 ++++++++++++++++++++++------------------------------ 1 file changed, 109 insertions(+), 151 deletions(-) diff --git a/Task/Env.js b/Task/Env.js index dc0edd04df..be1186f8b4 100644 --- a/Task/Env.js +++ b/Task/Env.js @@ -17,47 +17,39 @@ function Env(name, opts) { }) }) } - get(opts) { return this.send.call(this.env, opts) } - post(opts) { return this.send.call(this.env, opts, 'POST') } } - return new (class { constructor(name, opts) { - this.name = name - this.http = new Http(this) - this.data = null - this.dataFile = 'box.dat' - this.logs = [] - this.isMute = false - this.isNeedRewrite = false + this.name = name, + this.http = new Http(this), + this.data = null, + this.dataFile = 'box.dat', + this.logs = [], + this.isMute = false, + this.isNeedRewrite = false, this.logSeparator = '\n' - this.startTime = new Date().getTime() - Object.assign(this, opts) + this.startTime = new Date().getTime(); + Object.assign(this, opts); this.log('', `🔔${this.name}, 开始!`) } - 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(str, defaultValue = null) { try { return JSON.parse(str) @@ -65,7 +57,6 @@ function Env(name, opts) { return defaultValue } } - toStr(obj, defaultValue = null) { try { return JSON.stringify(obj) @@ -73,7 +64,6 @@ function Env(name, opts) { return defaultValue } } - getjson(key, defaultValue) { let json = defaultValue const val = this.getdata(key) @@ -84,7 +74,6 @@ function Env(name, opts) { } return json } - setjson(val, key) { try { return this.setdata(JSON.stringify(val), key) @@ -92,21 +81,19 @@ function Env(name, opts) { return false } } - getScript(url) { return new Promise((resolve) => { this.get({ url }, (err, resp, body) => resolve(body)) }) } - runScript(script, runOpts) { return new Promise((resolve) => { - let httpapi = this.getdata('@chavy_boxjs_userCfgs.httpapi') - httpapi = httpapi ? httpapi.replace(/\n/g, '').trim() : httpapi - let httpapi_timeout = this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout') - httpapi_timeout = httpapi_timeout ? httpapi_timeout * 1 : 20 - httpapi_timeout = runOpts && runOpts.timeout ? runOpts.timeout : httpapi_timeout - const [key, addr] = httpapi.split('@') + let httpapi = this.getdata('@chavy_boxjs_userCfgs.httpapi'); + httpapi = httpapi ? httpapi.replace(/\n/g, '').trim() : httpapi; + let httpapi_timeout = this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout'); + httpapi_timeout = httpapi_timeout ? httpapi_timeout * 1 : 20; + httpapi_timeout = runOpts && runOpts.timeout ? runOpts.timeout : httpapi_timeout; + const [key, addr] = httpapi.split('@'); const opts = { url: `http://${addr}/v1/scripting/evaluate`, body: { script_text: script, mock_type: 'cron', timeout: httpapi_timeout }, @@ -118,14 +105,14 @@ function Env(name, opts) { loaddata() { if (this.isNode()) { - this.fs = this.fs ? this.fs : require('fs') - this.path = this.path ? this.path : require('path') - const curDirDataFilePath = this.path.resolve(this.dataFile) - const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) - const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) - const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) + this.fs = this.fs ? this.fs : require('fs'); + this.path = this.path ? this.path : require('path'); + const curDirDataFilePath = this.path.resolve(this.dataFile); + const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile); + const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath); + const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath); if (isCurDirDataFile || isRootDirDataFile) { - const datPath = isCurDirDataFile ? curDirDataFilePath : rootDirDataFilePath + const datPath = isCurDirDataFile ? curDirDataFilePath : rootDirDataFilePath; try { return JSON.parse(this.fs.readFileSync(datPath)) } catch (e) { @@ -134,16 +121,15 @@ function Env(name, opts) { } else return {} } else return {} } - writedata() { if (this.isNode()) { - this.fs = this.fs ? this.fs : require('fs') - this.path = this.path ? this.path : require('path') - const curDirDataFilePath = this.path.resolve(this.dataFile) - const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) - const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) - const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) - const jsondata = JSON.stringify(this.data) + this.fs = this.fs ? this.fs : require('fs'); + this.path = this.path ? this.path : require('path'); + const curDirDataFilePath = this.path.resolve(this.dataFile); + const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile); + const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath); + const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath); + const jsondata = JSON.stringify(this.data); if (isCurDirDataFile) { this.fs.writeFileSync(curDirDataFilePath, jsondata) } else if (isRootDirDataFile) { @@ -153,22 +139,20 @@ function Env(name, opts) { } } } - lodash_get(source, path, defaultValue = undefined) { const paths = path.replace(/\[(\d+)\]/g, '.$1').split('.') - let result = source + let result = source; for (const p of paths) { - result = Object(result)[p] + result = Object(result)[p]; if (result === undefined) { return defaultValue } } return result } - lodash_set(obj, path, value) { - if (Object(obj) !== obj) return obj - if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [] + if (Object(obj) !== obj) return obj; + if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || []; path .slice(0, -1) .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[ @@ -176,16 +160,14 @@ function Env(name, opts) { ] = value return obj } - getdata(key) { - let val = this.getval(key) - // 如果以 @ + let val = this.getval(key); if (/^@/.test(key)) { - const [, objkey, paths] = /^@(.*?)\.(.*?)$/.exec(key) - const objval = objkey ? this.getval(objkey) : '' + const [, objkey, paths] = /^@(.*?)\.(.*?)$/.exec(key); + const objval = objkey ? this.getval(objkey) : ''; if (objval) { try { - const objedval = JSON.parse(objval) + const objedval = JSON.parse(objval); val = objedval ? this.lodash_get(objedval, paths, '') : val } catch (e) { val = '' @@ -194,20 +176,19 @@ function Env(name, opts) { } return val } - setdata(val, key) { - let issuc = false + let issuc = false; if (/^@/.test(key)) { - const [, objkey, paths] = /^@(.*?)\.(.*?)$/.exec(key) - const objdat = this.getval(objkey) - const objval = objkey ? (objdat === 'null' ? null : objdat || '{}') : '{}' + const [, objkey, paths] = /^@(.*?)\.(.*?)$/.exec(key); + const objdat = this.getval(objkey); + const objval = objkey ? (objdat === 'null' ? null : objdat || '{}') : '{}'; try { - const objedval = JSON.parse(objval) - this.lodash_set(objedval, paths, val) + const objedval = JSON.parse(objval); + this.lodash_set(objedval, paths, val); issuc = this.setval(JSON.stringify(objedval), objkey) } catch (e) { - const objedval = {} - this.lodash_set(objedval, paths, val) + const objedval = {}; + this.lodash_set(objedval, paths, val); issuc = this.setval(JSON.stringify(objedval), objkey) } } else { @@ -222,22 +203,21 @@ function Env(name, opts) { } else if (this.isQuanX()) { return $prefs.valueForKey(key) } else if (this.isNode()) { - this.data = this.loaddata() + this.data = this.loaddata(); return this.data[key] } else { return (this.data && this.data[key]) || null } } - setval(val, key) { if (this.isSurge() || this.isLoon()) { return $persistentStore.write(val, key) } else if (this.isQuanX()) { return $prefs.setValueForKey(val, key) } else if (this.isNode()) { - this.data = this.loaddata() - this.data[key] = val - this.writedata() + this.data = this.loaddata(), + this.data[key] = val, + this.writedata(); return true } else { return (this.data && this.data[key]) || null @@ -245,53 +225,52 @@ function Env(name, opts) { } initGotEnv(opts) { - 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() + 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(); if (opts) { - opts.headers = opts.headers ? opts.headers : {} + opts.headers = opts.headers ? opts.headers : {}; if (undefined === opts.headers.Cookie && undefined === opts.cookieJar) { opts.cookieJar = this.ckjar } } } - get(opts, callback = () => {}) { if (opts.headers) { - delete opts.headers['Content-Type'] + delete opts.headers['Content-Type']; delete opts.headers['Content-Length'] } if (this.isSurge() || this.isLoon()) { if (this.isSurge() && this.isNeedRewrite) { - opts.headers = opts.headers || {} + opts.headers = opts.headers || {}; Object.assign(opts.headers, { 'X-Surge-Skip-Scripting': false }) } $httpClient.get(opts, (err, resp, body) => { if (!err && resp) { - resp.body = body + resp.body = body, resp.statusCode = resp.status } callback(err, resp, body) }) } else if (this.isQuanX()) { if (this.isNeedRewrite) { - opts.opts = opts.opts || {} + opts.opts = opts.opts || {}; Object.assign(opts.opts, { hints: false }) } $task.fetch(opts).then( (resp) => { - const { statusCode: status, statusCode, headers, body } = resp + const { statusCode: status, statusCode, headers, body } = resp; callback(null, { status, statusCode, headers, body }, body) }, (err) => callback(err) ) } else if (this.isNode()) { - this.initGotEnv(opts) + this.initGotEnv(opts); this.got(opts) .on('redirect', (resp, nextOpts) => { try { if (resp.headers['set-cookie']) { - const ck = resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString() + const ck = resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString(); if (ck) { this.ckjar.setCookieSync(ck, null) } @@ -300,89 +279,88 @@ function Env(name, opts) { } catch (e) { this.logErr(e) } - // this.ckjar.setCookieSync(resp.headers['set-cookie'].map(Cookie.parse).toString()) }) .then( (resp) => { - const { statusCode: status, statusCode, headers, body } = resp + const { statusCode: status, statusCode, headers, body } = resp; callback(null, { status, statusCode, headers, body }, body) }, (err) => { - const { message: error, response: resp } = err + const { message: error, response: resp } = err; callback(error, resp, resp && resp.body) } ) } } - post(opts, callback = () => {}) { - // 如果指定了请求体, 但没指定`Content-Type`, 则自动生成 if (opts.body && opts.headers && !opts.headers['Content-Type']) { opts.headers['Content-Type'] = 'application/x-www-form-urlencoded' } if (opts.headers) delete opts.headers['Content-Length'] if (this.isSurge() || this.isLoon()) { if (this.isSurge() && this.isNeedRewrite) { - opts.headers = opts.headers || {} + opts.headers = opts.headers || {}; Object.assign(opts.headers, { 'X-Surge-Skip-Scripting': false }) } $httpClient.post(opts, (err, resp, body) => { if (!err && resp) { - resp.body = body + resp.body = body, resp.statusCode = resp.status } callback(err, resp, body) }) } else if (this.isQuanX()) { - opts.method = 'POST' + opts.method = 'POST'; if (this.isNeedRewrite) { - opts.opts = opts.opts || {} + opts.opts = opts.opts || {}; Object.assign(opts.opts, { hints: false }) } $task.fetch(opts).then( (resp) => { - const { statusCode: status, statusCode, headers, body } = resp + const { statusCode: status, statusCode, headers, body } = resp; callback(null, { status, statusCode, headers, body }, body) }, (err) => callback(err) ) } else if (this.isNode()) { - this.initGotEnv(opts) - const { url, ..._opts } = opts + this.initGotEnv(opts); + const { url, ..._opts } = opts; this.got.post(url, _opts).then( (resp) => { - const { statusCode: status, statusCode, headers, body } = resp + const { statusCode: status, statusCode, headers, body } = resp; callback(null, { status, statusCode, headers, body }, body) }, (err) => { - const { message: error, response: resp } = err + const { message: error, response: resp } = err; callback(error, resp, resp && resp.body) } ) } - } + } + /** * 对Date的扩展,将 Date 转化为指定格式的String * 月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q) 可以用 1-2 个占位符 - * 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字),12小时(h)可用一个占位符 + * 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) * eg: - * (new Date()).pattern("yyyy-MM-dd h:mm:ss.S") ==> 2006-07-02 上午8:09:04.423 - * (new Date()).pattern("yyyy-MM-dd E HH:mm:ss") ==> 2009-03-10 二 20:09:04 - * (new Date()).pattern("yyyy-MM-dd EE h:mm:ss") ==> 2009-03-10 周二 上午8:09:04 - * (new Date()).pattern("yyyy-MM-dd EEE h:mm:ss") ==> 2009-03-10 星期二 下午10:09:04 - * (new Date()).pattern("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 - */ + * $.time("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 + * $.time("yyyy-MM-dd E HH:mm:ss") ==> 2009-03-10 二 20:09:04 + * $.time("yyyy-MM-dd EE hh:mm:ss") ==> 2009-03-10 周二 08:09:04 + * $.time("yyyy-MM-dd EEE hh:mm:ss") ==> 2009-03-10 星期二 08:09:04 + * $.time("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 + * $.time("yyyy/MM/dd HH:mm", 1613568620000) ==> 2021/02/17 21:30 + */ time(fmt, ts = null) { - const date = ts ? new Date(ts) : new Date() + const date = ts ? new Date(ts) : new Date(); var o = { - "M+" : this.getMonth()+1, //月份 - "d+" : this.getDate(), //日 - "h" : this.getHours()%12 == 0 ? 12 : this.getHours()/12 < 1 ? "上午" + this.getHours()%12 : "下午"+ this.getHours()%12 , //小时 - "H+" : this.getHours(), //小时 - "m+" : this.getMinutes(), //分 - "s+" : this.getSeconds(), //秒 - "q+" : Math.floor((this.getMonth()+3)/3), //季度 - "S" : this.getMilliseconds() //毫秒 + "M+" : date.getMonth()+1, //月份 + "d+" : date.getDate(), //日 + "h" : date.getHours()%12 == 0 ? 12 : date.getHours()/12 < 1 ? "上午" + date.getHours()%12 : "下午"+ date.getHours()%12 , //小时 + "H+" : date.getHours(), //小时 + "m+" : date.getMinutes(), //分 + "s+" : date.getSeconds(), //秒 + "q+" : Math.floor((date.getMonth()+3)/3), //季度 + "S" : date.getMilliseconds() //毫秒 }; var week = { "0" : "\u65e5", @@ -394,37 +372,21 @@ function Env(name, opts) { "6" : "\u516d" }; if(/(y+)/.test(fmt)){ - fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); + fmt=fmt.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length)) } if(/(E+)/.test(fmt)){ - fmt=fmt.replace(RegExp.$1, ((RegExp.$1.length>1) ? (RegExp.$1.length>2 ? "\u661f\u671f" : "\u5468") : "")+week[this.getDay()+""]); + fmt=fmt.replace(RegExp.$1, ((RegExp.$1.length>1) ? (RegExp.$1.length>2 ? "\u661f\u671f" : "\u5468") : "")+week[date.getDay()+""]) } for(var k in o){ if(new RegExp("("+ k +")").test(fmt)){ - fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length))); + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length))) } - } - return fmt; -} - /** - * 系统通知 - * - * > 通知参数: 同时支持 QuanX 和 Loon 两种格式, EnvJs根据运行环境自动转换, Surge 环境不支持多媒体通知 - * - * 示例: - * $.msg(title, subt, desc, 'twitter://') - * $.msg(title, subt, desc, { 'open-url': 'twitter://', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) - * $.msg(title, subt, desc, { 'open-url': 'https://bing.com', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) - * - * @param {*} title 标题 - * @param {*} subt 副标题 - * @param {*} desc 通知详情 - * @param {*} opts 通知参数 - * - */ + } + return fmt + } msg(title = name, subt = '', desc = '', opts) { const toEnvOpts = (rawopts) => { - if (!rawopts) return rawopts + if (!rawopts) return rawopts; if (typeof rawopts === 'string') { if (this.isLoon()) return rawopts else if (this.isQuanX()) return { 'open-url': rawopts } @@ -432,12 +394,12 @@ function Env(name, opts) { else return undefined } else if (typeof rawopts === 'object') { if (this.isLoon()) { - let openUrl = rawopts.openUrl || rawopts.url || rawopts['open-url'] - let mediaUrl = rawopts.mediaUrl || rawopts['media-url'] + let openUrl = rawopts.openUrl || rawopts.url || rawopts['open-url']; + let mediaUrl = rawopts.mediaUrl || rawopts['media-url']; return { openUrl, mediaUrl } } else if (this.isQuanX()) { - let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl - let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl + let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl; + let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl; return { 'open-url': openUrl, 'media-url': mediaUrl } } else if (this.isSurge()) { let openUrl = rawopts.url || rawopts.openUrl || rawopts['open-url'] @@ -457,20 +419,18 @@ function Env(name, opts) { if (!this.isMuteLog) { let logs = ['', '==============📣系统通知📣=============='] logs.push(title) - subt ? logs.push(subt) : '' - desc ? logs.push(desc) : '' - console.log(logs.join('\n')) + subt ? logs.push(subt) : ''; + desc ? logs.push(desc) : ''; + console.log(logs.join('\n')); this.logs = this.logs.concat(logs) } } - log(...logs) { if (logs.length > 0) { this.logs = [...this.logs, ...logs] } - console.log(logs.join(this.logSeparator)) + console.log(logs.join(this.logSeparator)) } - logErr(err, msg) { const isPrintSack = !this.isSurge() && !this.isQuanX() && !this.isLoon() if (!isPrintSack) { @@ -479,16 +439,14 @@ function Env(name, opts) { this.log('', `❗️${this.name}, 错误!`, err.stack) } } - wait(time) { return new Promise((resolve) => setTimeout(resolve, time)) } - done(val = {}) { - const endTime = new Date().getTime() - const costTime = (endTime - this.startTime) / 1000 - this.log('', `🔔${this.name}, 结束! 🕛 ${costTime} 秒`) - this.log() + const endTime = new Date().getTime(); + const costTime = (endTime - this.startTime) / 1000; + this.log('', `🔔${this.name}, 结束! 🕛 ${costTime} 秒`); + this.log(); if (this.isSurge() || this.isQuanX() || this.isLoon()) { $done(val) } From a423eda315a6c3891a693cf707615a588d997168 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 02:07:15 +0800 Subject: [PATCH 660/721] --- Task/Env.js | 10 +++++----- Task/Env.min.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Task/Env.js b/Task/Env.js index be1186f8b4..f37a80c503 100644 --- a/Task/Env.js +++ b/Task/Env.js @@ -5,14 +5,14 @@ function Env(name, opts) { } send(opts, method = 'GET') { - opts = typeof opts === 'string' ? { url: opts } : opts - let sender = this.get + opts = typeof opts === 'string' ? { url: opts } : opts; + let sender = this.get; if (method === 'POST') { sender = this.post } return new Promise((resolve, reject) => { sender.call(this, opts, (err, resp, body) => { - if (err) reject(err) + if (err) reject(err); else resolve(resp) }) }) @@ -65,8 +65,8 @@ function Env(name, opts) { } } getjson(key, defaultValue) { - let json = defaultValue - const val = this.getdata(key) + let json = defaultValue; + const val = this.getdata(key); if (val) { try { json = JSON.parse(this.getdata(key)) diff --git a/Task/Env.min.js b/Task/Env.min.js index 21673d2cd5..b7936f2ac8 100644 --- a/Task/Env.min.js +++ b/Task/Env.min.js @@ -1 +1 @@ -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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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(name,opts){class Http{constructor(env){this.env=env};send(opts,method='GET'){opts=typeof opts==='string'?{url:opts}:opts;let sender=this.get;if(method==='POST'){sender=this.post};return new Promise((resolve,reject)=>{sender.call(this,opts,(err,resp,body)=>{if(err)reject(err);else resolve(resp)})})};get(opts){return this.send.call(this.env,opts)};post(opts){return this.send.call(this.env,opts,'POST')}};return new(class{constructor(name,opts){this.name=name,this.http=new Http(this),this.data=null,this.dataFile='box.dat',this.logs=[],this.isMute=false,this.isNeedRewrite=false,this.logSeparator='\n';this.startTime=new Date().getTime();Object.assign(this,opts);this.log('',`🔔${this.name}, 开始!`)};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(str,defaultValue=null){try{return JSON.parse(str)}catch{return defaultValue}};toStr(obj,defaultValue=null){try{return JSON.stringify(obj)}catch{return defaultValue}};getjson(key,defaultValue){let json=defaultValue;const val=this.getdata(key);if(val){try{json=JSON.parse(this.getdata(key))}catch{}};return json};setjson(val,key){try{return this.setdata(JSON.stringify(val),key)}catch{return false}}; getScript(url){return new Promise((resolve)=>{this.get({url},(err,resp,body)=>resolve(body))})};runScript(script,runOpts){return new Promise((resolve)=>{let httpapi=this.getdata('@chavy_boxjs_userCfgs.httpapi');httpapi=httpapi?httpapi.replace(/\n/g,'').trim():httpapi;let httpapi_timeout=this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout');httpapi_timeout=httpapi_timeout?httpapi_timeout*1:20;httpapi_timeout=runOpts&&runOpts.timeout?runOpts.timeout:httpapi_timeout;const[key,addr]=httpapi.split('@');const opts={url:`http://${addr}/v1/scripting/evaluate`,body:{script_text:script,mock_type:'cron',timeout:httpapi_timeout},headers:{'X-Key':key,'Accept':'*/*'}};this.post(opts,(err,resp,body)=>resolve(body))}).catch((e)=>this.logErr(e))};loaddata(){if(this.isNode()){this.fs=this.fs?this.fs:require('fs');this.path=this.path?this.path:require('path');const curDirDataFilePath=this.path.resolve(this.dataFile);const rootDirDataFilePath=this.path.resolve(process.cwd(),this.dataFile);const isCurDirDataFile=this.fs.existsSync(curDirDataFilePath);const isRootDirDataFile=!isCurDirDataFile&&this.fs.existsSync(rootDirDataFilePath);if(isCurDirDataFile||isRootDirDataFile){const datPath=isCurDirDataFile?curDirDataFilePath:rootDirDataFilePath;try{return JSON.parse(this.fs.readFileSync(datPath))}catch(e){return{}}}else return{}}else return{}};writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require('fs');this.path=this.path?this.path:require('path');const curDirDataFilePath=this.path.resolve(this.dataFile);const rootDirDataFilePath=this.path.resolve(process.cwd(),this.dataFile);const isCurDirDataFile=this.fs.existsSync(curDirDataFilePath);const isRootDirDataFile=!isCurDirDataFile&&this.fs.existsSync(rootDirDataFilePath);const jsondata=JSON.stringify(this.data);if(isCurDirDataFile){this.fs.writeFileSync(curDirDataFilePath,jsondata)}else if(isRootDirDataFile){this.fs.writeFileSync(rootDirDataFilePath,jsondata)}else{this.fs.writeFileSync(curDirDataFilePath,jsondata)}}};lodash_get(source,path,defaultValue=undefined){const paths=path.replace(/\[(\d+)\]/g,'.$1').split('.');let result=source;for(const p of paths){result=Object(result)[p];if(result===undefined){return defaultValue}};return result};lodash_set(obj,path,value){if(Object(obj)!==obj)return obj;if(!Array.isArray(path))path=path.toString().match(/[^.[\]]+/g)||[];path.slice(0,-1).reduce((a,c,i)=>(Object(a[c])===a[c]?a[c]:(a[c]=Math.abs(path[i+1])>>0===+path[i+1]?[]:{})),obj)[path[path.length-1]]=value;return obj};getdata(key){let val=this.getval(key);if(/^@/.test(key)){const[,objkey,paths]=/^@(.*?)\.(.*?)$/.exec(key);const objval=objkey?this.getval(objkey):'';if(objval){try{const objedval=JSON.parse(objval);val=objedval?this.lodash_get(objedval,paths,''):val}catch(e){val=''}}};return val};setdata(val,key){let issuc=false;if(/^@/.test(key)){const[,objkey,paths]=/^@(.*?)\.(.*?)$/.exec(key);const objdat=this.getval(objkey);const objval=objkey?(objdat==='null'?null:objdat||'{}'):'{}';try{const objedval=JSON.parse(objval);this.lodash_set(objedval,paths,val);issuc=this.setval(JSON.stringify(objedval),objkey)}catch(e){const objedval={};this.lodash_set(objedval,paths,val);issuc=this.setval(JSON.stringify(objedval),objkey)}}else{issuc=this.setval(val,key)};return issuc};getval(key){if(this.isSurge()||this.isLoon()){return $persistentStore.read(key)}else if(this.isQuanX()){return $prefs.valueForKey(key)}else if(this.isNode()){this.data=this.loaddata();return this.data[key]}else{return(this.data&&this.data[key])||null}};setval(val,key){if(this.isSurge()||this.isLoon()){return $persistentStore.write(val,key)}else if(this.isQuanX()){return $prefs.setValueForKey(val,key)}else if(this.isNode()){this.data=this.loaddata(),this.data[key]=val,this.writedata();return true}else{return(this.data&&this.data[key])||null}};initGotEnv(opts){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();if(opts){opts.headers=opts.headers?opts.headers:{};if(undefined===opts.headers.Cookie&&undefined===opts.cookieJar){opts.cookieJar=this.ckjar}}}; get(opts,callback=()=>{}){if(opts.headers){delete opts.headers['Content-Type'];delete opts.headers['Content-Length']};if(this.isSurge()||this.isLoon()){if(this.isSurge()&&this.isNeedRewrite){opts.headers=opts.headers||{};Object.assign(opts.headers,{'X-Surge-Skip-Scripting':false})};$httpClient.get(opts,(err,resp,body)=>{if(!err&&resp){resp.body=body,resp.statusCode=resp.status};callback(err,resp,body)})}else if(this.isQuanX()){if(this.isNeedRewrite){opts.opts=opts.opts||{};Object.assign(opts.opts,{hints:false})};$task.fetch(opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>callback(err))}else if(this.isNode()){this.initGotEnv(opts);this.got(opts).on('redirect',(resp,nextOpts)=>{try{if(resp.headers['set-cookie']){const ck=resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString();if(ck){this.ckjar.setCookieSync(ck,null)};nextOpts.cookieJar=this.ckjar}}catch(e){this.logErr(e)}}).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>{const{message:error,response:resp}=err;callback(error,resp,resp&&resp.body)})}};post(opts,callback=()=>{}){if(opts.body&&opts.headers&&!opts.headers['Content-Type']){opts.headers['Content-Type']='application/x-www-form-urlencoded'};if(opts.headers)delete opts.headers['Content-Length'];if(this.isSurge()||this.isLoon()){if(this.isSurge()&&this.isNeedRewrite){opts.headers=opts.headers||{};Object.assign(opts.headers,{'X-Surge-Skip-Scripting':false})};$httpClient.post(opts,(err,resp,body)=>{if(!err&&resp){resp.body=body,resp.statusCode=resp.status};callback(err,resp,body)})}else if(this.isQuanX()){opts.method='POST';if(this.isNeedRewrite){opts.opts=opts.opts||{};Object.assign(opts.opts,{hints:false})};$task.fetch(opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>callback(err))}else if(this.isNode()){this.initGotEnv(opts);const{url,..._opts}=opts;this.got.post(url,_opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>{const{message:error,response:resp}=err;callback(error,resp,resp&&resp.body)})}};time(fmt,ts=null){const date=ts?new Date(ts):new Date();var o={"M+":date.getMonth()+1,"d+":date.getDate(),"h":date.getHours()%12==0?12:date.getHours()/12<1?"上午"+date.getHours()%12:"下午"+date.getHours()%12,"H+":date.getHours(),"m+":date.getMinutes(),"s+":date.getSeconds(),"q+":Math.floor((date.getMonth()+3)/3),"S":date.getMilliseconds()};var week={"0":"\u65e5","1":"\u4e00","2":"\u4e8c","3":"\u4e09","4":"\u56db","5":"\u4e94","6":"\u516d"};if(/(y+)/.test(fmt)){fmt=fmt.replace(RegExp.$1,(date.getFullYear()+"").substr(4-RegExp.$1.length))};if(/(E+)/.test(fmt)){fmt=fmt.replace(RegExp.$1,((RegExp.$1.length>1)?(RegExp.$1.length>2?"\u661f\u671f":"\u5468"):"")+week[date.getDay()+""])};for(var k in o){if(new RegExp("("+k+")").test(fmt)){fmt=fmt.replace(RegExp.$1,(RegExp.$1.length==1)?(o[k]):(("00"+o[k]).substr((""+o[k]).length)))}};return fmt};msg(title=name,subt='',desc='',opts){const toEnvOpts=(rawopts)=>{if(!rawopts)return rawopts;if(typeof rawopts==='string'){if(this.isLoon())return rawopts;else if(this.isQuanX())return{'open-url':rawopts};else if(this.isSurge())return{url:rawopts};else return undefined}else if(typeof rawopts==='object'){if(this.isLoon()){let openUrl=rawopts.openUrl||rawopts.url||rawopts['open-url'];let mediaUrl=rawopts.mediaUrl||rawopts['media-url'];return{openUrl,mediaUrl}}else if(this.isQuanX()){let openUrl=rawopts['open-url']||rawopts.url||rawopts.openUrl;let mediaUrl=rawopts['media-url']||rawopts.mediaUrl;return{'open-url':openUrl,'media-url':mediaUrl}}else if(this.isSurge()){let openUrl=rawopts.url||rawopts.openUrl||rawopts['open-url'];return{url:openUrl}}}else{return undefined}};if(!this.isMute){if(this.isSurge()||this.isLoon()){$notification.post(title,subt,desc,toEnvOpts(opts))}else if(this.isQuanX()){$notify(title,subt,desc,toEnvOpts(opts))}};if(!this.isMuteLog){let logs=['','==============📣系统通知📣=============='];logs.push(title);subt?logs.push(subt):'';desc?logs.push(desc):'';console.log(logs.join('\n'));this.logs=this.logs.concat(logs)}};log(...logs){if(logs.length>0){this.logs=[...this.logs,...logs]};console.log(logs.join(this.logSeparator))};logErr(err,msg){const isPrintSack=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();if(!isPrintSack){this.log('',`❗️${this.name}, 错误!`,err)}else{this.log('',`❗️${this.name}, 错误!`,err.stack)}};wait(time){return new Promise((resolve)=>setTimeout(resolve,time))};done(val={}){const endTime=new Date().getTime();const costTime=(endTime-this.startTime)/1000;this.log('',`🔔${this.name}, 结束! 🕛 ${costTime} 秒`);this.log();if(this.isSurge()||this.isQuanX()||this.isLoon()){$done(val)}}})(name,opts)} \ No newline at end of file From d729a9f9f9e2829ee3d26051d863028dce91efa0 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 02:10:20 +0800 Subject: [PATCH 661/721] --- Task/Env.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Task/Env.js b/Task/Env.js index f37a80c503..f98a0a88c4 100644 --- a/Task/Env.js +++ b/Task/Env.js @@ -3,7 +3,6 @@ function Env(name, opts) { constructor(env) { this.env = env } - send(opts, method = 'GET') { opts = typeof opts === 'string' ? { url: opts } : opts; let sender = this.get; @@ -383,7 +382,24 @@ function Env(name, opts) { } } return fmt - } + } + /** + * 系统通知 + * + * > 通知参数: 同时支持 QuanX 和 Loon 两种格式, EnvJs根据运行环境自动转换, Surge 环境不支持多媒体通知 + * + * 示例: + * $.msg(title, subt, desc, 'twitter://') + * $.msg(title, subt, desc, { 'open-url': 'twitter://', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) + * $.msg(title, subt, desc, { 'open-url': 'https://bing.com', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) + * + * @param {*} title 标题 + * @param {*} subt 副标题 + * @param {*} desc 通知详情 + * @param {*} opts 通知参数 + * + */ + msg(title = name, subt = '', desc = '', opts) { const toEnvOpts = (rawopts) => { if (!rawopts) return rawopts; From 8c9cd1903d7017d20e3eed711ac6ea9b92d1bfa9 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 02:16:48 +0800 Subject: [PATCH 662/721] --- Task/youth.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 0801770745..3a702cfc2c 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -78,7 +78,7 @@ if(!$.isNode()&&cookieYouth.indexOf("#") ==-1){ console.log(`\n === 脚本执行 ${bjTime} ===\n`); console.log(` =========== 您共提供${cookieArr.length}个中青账号 ==========`); } -return + if (isGetCookie = typeof $request !== 'undefined') { GetCookie(); $.done() @@ -88,7 +88,6 @@ if (isGetCookie = typeof $request !== 'undefined') { $.msg($.name, '【提示】请先获取中青看点一cookie',"",{'open-url': "https://kandian.youth.cn/u/mhkjN"}) return; } - for (let i = 0; i < cookieArr.length; i++) { if (cookieArr[i]) { cookie = cookieArr[i]; From 4cff357fee05fe83cf7fe20bca422e66db01a569 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 09:08:35 +0800 Subject: [PATCH 663/721] --- Task/tvpreview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/tvpreview.js b/Task/tvpreview.js index 3f2abb30b6..27fab59526 100644 --- a/Task/tvpreview.js +++ b/Task/tvpreview.js @@ -67,9 +67,9 @@ function playTV() { endTime = playdata.et - parseInt(Date.now() / 1000); if (playdata.st == result.liveSt) { $.sub += " 剩余" + parseInt(endTime / 60) + "分钟" - } - if (i + 1 < result.program.length) { + if (i + 1 < result.program.length) { nextplay = "即将播出: " + result.program[i + 1].t + duration + } } } $.desc = nextplay + playlist; From 4b4ffbf7a4c084d0ebfbb098d559572aeb176bbf Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 11:14:49 +0800 Subject: [PATCH 664/721] --- Task/txnews.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Task/txnews.js b/Task/txnews.js index 0d46dfa62b..9047248ac3 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -1,6 +1,6 @@ /* -更新时间: 2021-02-17 00:50 +更新时间: 2021-02-18 11:15 腾讯新闻签到修改版,可以自动阅读文章获取红包,该活动为瓜分百万现金挑战赛,针对幸运用户参与,本脚本已不能自动打开红包,需每天要打开腾讯新闻app一次,请须知 @@ -76,7 +76,6 @@ if (isGetCookie) { console.log(`-------------------------\n\n开始【腾讯新闻账号${$.index}】`) ID = signurlVal.match(/devid=[a-zA-Z0-9_-]+/g)[0] token = signurlVal.split("mac")[1] - await getsign(); await activity(); await getTotal(); @@ -113,7 +112,7 @@ function GetCookie() { } } -function Host(api, body) { +function Host(api, body, taskurl) { return { url: 'https://api.inews.qq.com/activity/v1/'+api+'&isJailbreak=0&'+ID, headers:{ @@ -123,7 +122,9 @@ function Host(api, body) { 'Connection': 'keep-alive', 'Cookie': cookieVal, 'Host': 'api.inews.qq.com', - 'Referer': 'http://inews.qq.com/inews/iphone/', + 'Referer': taskurl, + 'store': '1', + 'devid': ID, 'User-Agent': 'QQNews/6.4.10 (iPhone; iOS 14.2; Scale/3.00)' }, body: body @@ -159,10 +160,11 @@ function activity() { $.get(Host('user/task/list?'), async(error, resp, data) =>{ try { let taskres = JSON.parse(data); - //$.log(JSON.stringify(obj,null,2)) + //$.log(JSON.stringify(taskres,null,2)) if (taskres.ret == 0) { actid = taskres.data.award_notice.activity_id; $.log(`\n您的活动ID为: ` + actid + "\n\n********* 开始阅读任务 ********\n"); + $.desc = "" for (tasks of taskres.data.list) { taskname = tasks.task_title, tasktype = tasks.task_type, @@ -170,6 +172,7 @@ function activity() { ratepack = tasks.rate, totalpack = tasks.quota; eventnum = tasks.task_desc + taskurl = tasks.task_url $.log("去" + taskname + "\n"); if (taskstatus == 3) { $.desc += "【" + taskname + "】✅ 已完成\n"; @@ -177,12 +180,12 @@ function activity() { } else { if (tasktype == "article") { readnum = eventnum.match(/>(\d+)(.+)<\/span>分钟/)[1] - $.desc += "【" + taskname + "】 已领" + ratepack + "个红包 已看"+videonum+"分钟\n"; + //$.desc += "【" + taskname + "】 已领" + ratepack + "个红包 已看"+videonum+"分钟\n"; await $.wait(5000); await toRead(videoVal, 'event=video_read') } else if(tasktype == "cooperation") { @@ -262,10 +265,12 @@ function StepsTotal() { redtotal = awards.total, red_opened = awards.opened, task_num = awards.event_num, + //readtitle = awards.title.split(",")[0].replace(/[\u4e00-\u9fa5]/g,``) + title = awards.title.match(/\d+/) over_red = Number(redtotal - red_opened); if (taskType == "article") { - readnum = awards.event_num, read_res = over_red; + $.desc += "【阅读资讯】 已领" + awards.opened + "个红包 已看"+readnum+"篇/再读"+title+"篇\n"; if (awards.openable !== 0) { $.log("可以打开" + awards.openable + "个阅读红包,去打开红包"); await $.wait(1000); @@ -274,7 +279,7 @@ function StepsTotal() { } if (taskType == "video") { video_res = over_red; - videonum = awards.event_num; + $.desc += "【观看视频】 已领" + awards.opened+ "个红包 已看"+videonum+"分钟/再读"+title+"分钟\n"; if (awards.openable !== 0) { $.log("可以打开" + awards.openable + "个视频红包,去打开红包"); await $.wait(1000); @@ -292,7 +297,7 @@ function StepsTotal() { //阶梯红包到账 function Redpack(red_body) { return new Promise((resolve, reject) =>{ - $.post(Host('activity/redpack/get?mac' + token, `redpack_type=${red_body}&activity_id=${actid}`), (error, resp, data) =>{ + $.post(Host('activity/redpack/get?', `redpack_type=${red_body}&activity_id=${actid}`), (error, resp, data) =>{ let rcash = JSON.parse(data); try { if (rcash.data.award.length == 1) { From 59da6ce644025a6127f4ae9ee0c269a5d0840ff9 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 14:16:22 +0800 Subject: [PATCH 665/721] =?UTF-8?q?=E5=BF=AB=E6=89=8B=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=89=88=E5=A4=9A=E8=B4=A6=E5=8F=B7ck=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/kuaishou.js | 122 ++++++++++++++++++++++++++++++----------------- 1 file changed, 78 insertions(+), 44 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 5ad2dc72c8..d0ca771857 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -1,10 +1,12 @@ /* -更新时间: 2020-12-20 15:30 +更新时间: 2021-02-18 14:15 + +本脚本仅适用于快手双版本签到,注意正式版Cookie签到有时效性,但Cookie仍然可用于签到极速版,即正式版会掉签;极速版Cookie只能用于极速版,支持正式版获取多Cookie -本脚本仅适用于快手双版本签到,注意正式版Cookie签到有时效性,但Cookie仍然可用于签到极速版,即正式版会掉签;极速版Cookie只能用于极速版 正式版APP获取Cookie方法: 1.将下方[rewrite_local]地址复制的相应的区域下,无需填写hostname; 2.打开APP稍等几秒,即可获取Cookie. + 极速版获取方法, 1.把URL的正则改为 https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\?,添加hostname = nebula.kuaishou.com; 2.点击设置页面的"积分兑好礼"即可 @@ -22,7 +24,7 @@ Surge 4.0 : [Script] 快手 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js,script-update-interval=0 -快手 = type=http-request,pattern=http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +快手 = type=http-request,pattern=http:\/\/uploads\d\.gifshow\.com\/rest\/n\/system\/speed,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js ~~~~~~~~~~~~~~~~ Loon 2.1.0+ @@ -30,7 +32,7 @@ Loon 2.1.0+ # 本地脚本 cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, enabled=true, tag=快手 -http-request http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +http-request http:\/\/uploads\d\.gifshow\.com\/rest\/n\/system\/speed script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js ----------------- @@ -40,7 +42,7 @@ QX 1.0.7+ : [rewrite_local] -http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +http:\/\/uploads\d\.gifshow\.com\/rest\/n\/system\/speed url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js ~~~~~~~~~~~~~~~~ @@ -48,19 +50,25 @@ http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed url script-request-heade const logs = false //日志开关 const $ = new Env('快手视频') let cookieArr = []; -if ($.isNode()) { - if (process.env.KS_TOKEN && process.env.KS_TOKEN.indexOf('&') > -1) { - ks_tokens = process.env.KS_TOKEN.split('&'); - } else { - ks_tokens = process.env.KS_TOKEN.split() - }; - Object.keys(ks_tokens).forEach((item) => { - if (ks_tokens[item]) { - cookieArr.push(ks_tokens[item]) - } - }) +let ks_tokens = $.getdata('cookie_ks') + +if (!$.isNode() && ks_tokens.indexOf('&') == -1) { + cookieArr.push(ks_tokens) } else { - cookieArr.push($.getdata('cookie_ks')) + if ($.isNode()) { + if (process.env.KS_TOKEN && process.env.KS_TOKEN.indexOf('&') > -1) { + ks_tokens = process.env.KS_TOKEN.split('&') + } else { + ks_tokens = [process.env.KS_TOKEN] + }; + } else if (!$.isNode() && ks_tokens.indexOf('&') > -1) { + ks_tokens = ks_tokens.split('&') + } + Object.keys(ks_tokens).forEach((item) =>{ + if (ks_tokens[item]) { + cookieArr.push(ks_tokens[item]) + } + }) } let isGetCookie = typeof $request !== 'undefined' @@ -74,14 +82,16 @@ if (isGetCookie) { return } if ($.isNode()){ - console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) - console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()}=============\n`) + timeZone = new Date().getTimezoneOffset() / 60; + timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000; + bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); + console.log(`\n === 脚本执行 ${bjTime} ===\n`); } for (let i = 0; i < cookieArr.length; i++) { if (cookieArr[i]) { cookieVal = cookieArr[i]; $.index = i + 1; - console.log(`-------------------------\n\n开始【快手视频账号${$.index}】`) + console.log(`-------------------\n\n开始【快手视频账号${$.index}】`) await speedSign(); await speedSignifo(); await speedInfo(); @@ -106,7 +116,7 @@ function officialSign() { body: '{"bizId": 29}' } $.post(signurl, (error, response, data) => { - if(logs)$.log(`${$.name}, data: ${data}`) + //$.log(`${$.name}, data: ${data}`) let officialSign_res = JSON.parse(data) offici_code = officialSign_res.result if(offici_code == 100111){ @@ -133,7 +143,7 @@ function officialSignifo() { headers: {Cookie: cookieVal, 'Content-Type': 'application/json;charset=utf-8'},} $.get(infourl, async(error, response, data) => { - if(logs)$.log(`${$.name}, data: ${data}`) + // $.log(`${$.name}, data: ${data}`) let _info = JSON.parse(data) if (_info.result == 1){ offic_info = `收益: ${_info.data.accounts[0].displayBalance}积分 现金: ${_info.data.accounts[1].displayBalance}元\n` @@ -144,19 +154,18 @@ function officialSignifo() { } function officialtaskCenter() { return new Promise((resolve, reject) => { - let reurl = {url:'https://activity.m.kuaishou.com/rest/wd/taskCenter/task/appStartup/reward', + let reurl = {url:'https://sf2021.kuaishou.com/rest/wd/sf2021/retain/dailyRedpack/receiveDailyRedPacket', headers: {Cookie: cookieVal,'Content-Type': 'application/json;charset=utf-8'}, body: '{"bizId": 29}' } $.post(reurl, (error, response, data) =>{ - if(logs)$.log(`${$.name}, data: ${data}`) + //$.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) - if (result.rewardSuccess == true) { - var rewards = result.reward.accounts - if (typeof result.reward.surpriseRewardCount !== undefined){ - rewards += result.reward.surpriseRewardCount - } - offic_reward = `获得收益: 💵${rewards}积分\n` + if (result.message == "success") { + var rewards = result.data.amount/100 + offic_reward = `获得现金红包: 💵${rewards}积分\n` + } else { + $.log("温暖好运年签到红包,"+ result.message) } resolve() }) @@ -212,14 +221,28 @@ function speedInfo() { if(logs)$.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) if (result.result == 1) { - speed_rewards = `现金收益: 💵${result.data.allCash}元 金币收益: 💰${result.data.totalCoin}` - await bdinvet() + speed_rewards = `现金收益: 💵${result.data.allCash}元 金币收益: 💰${result.data.totalCoin}`; + await bdinvet(); + await vetInfo() } resolve() }) }) } +function vetInfo() { + return new Promise((resolve, reject) => { + let reurl = {url:'https://sf2021.kuaishou.com/rest/wd/sf2021/retain/assistance/friendAssist', + headers: {Cookie: cookieVal, +'Content-Type': 'application/json;charset=utf-8'},body:'{"fid": "1928978411","shareObjectId":"5xjgr7a6ppa7ana"}'} + $.post(reurl, async(error, response, data) =>{ + //$.log(`${$.name}, data: ${data}`) + resolve() + }) + }) + } + + function showmsg() { $.sub ="", $.desc = ""; if(offici_code==1||offici_code ==100136 ){ @@ -233,18 +256,29 @@ $.msg($.name,$.sub,$.desc) } function GetCookie() { - var UA = $request.headers['User-Agent'] - if ($request && $request.method != `OPTIONS`&& UA.indexOf('ksNebula')>-1) { - const cookieVal = $request.headers['Cookie'] - if (cookieVal) $.setdata(cookieVal,'cookie_ks') - $.log(`${$.name} 获取Cookie: 成功,cookieVal: ${cookieVal}`) - $.msg($.name, `获取极速Cookie: 成功🎉`, ``) - } else if ($request && $request.method != `OPTIONS`&& UA.indexOf("ksNebula")==-1) { - const cookie = $request.headers['Cookie'] - cookieVal = cookie.match(/token=[a-z0-9-]+/)[0] - if (cookieVal) $.setdata(cookieVal,'cookie_ks') - $.log(`${$.name} 获取Cookie: 成功,cookieVal: ${cookieVal}`) - $.msg($.name, `获取正式Cookie: 成功🎉`, ``) + var UA = $request.headers['User-Agent'] + if ($request && $request.method != `OPTIONS` && UA.indexOf('ksNebula') > -1) { + const cookieVal = $request.headers['Cookie'] + if (cookieVal) $.setdata(cookieVal, 'cookie_ks'); + $.log(`${$.name}获取Cookie: 成功, cookieVal: $ {cookieVal}`); + $.msg($.name, `获取极速Cookie: 成功🎉`, ``) + } else if ($request && $request.method != `OPTIONS` && UA.indexOf("ksNebula") == -1) { + const cookie = $request.headers['Cookie'] ; + cookieVal = cookie.match(/token=[_a-z0-9-]+/)[0] + if (ks_tokens) { + if (ks_tokens.indexOf(cookieVal) > -1) { + $.log("cookie重复,已跳过") + } + if (ks_tokens.indexOf(cookieVal) == -1) { + Cookies = ks_tokens + "&" + cookieVal; + $.setdata(Cookies, 'cookie_ks'); + ck = Cookies.split("&"); + $.msg($.name, "获取正式Cookie" + ck.length + ": 成功🎉", ``) + } + } else { + $.setdata(cookieVal, 'cookie_ks'); + $.msg($.name, `获取正式Cookie: 成功🎉`, ``) + } } } function bdinvet() { From 6dbfc14093042c35353b4be2ceb59cde0a0da7b9 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 14:31:14 +0800 Subject: [PATCH 666/721] --- TaskConf/kuaishou/qx_rewite.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/kuaishou/qx_rewite.txt b/TaskConf/kuaishou/qx_rewite.txt index 9fd8c6d916..c9139714e7 100644 --- a/TaskConf/kuaishou/qx_rewite.txt +++ b/TaskConf/kuaishou/qx_rewite.txt @@ -1,5 +1,5 @@ hostname = nebula.kuaishou.com -http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +http:\/\/\w+\.gifshow\.com\/rest\/n\/system\/speed url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js From 5c3ca83e9e61c91386a0d9fa664635dac0350d57 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 19:09:16 +0800 Subject: [PATCH 667/721] --- Task/kuaishou.js | 113 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 91 insertions(+), 22 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index d0ca771857..395a6e2678 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-18 14:15 +更新时间: 2021-02-18 19:10 本脚本仅适用于快手双版本签到,注意正式版Cookie签到有时效性,但Cookie仍然可用于签到极速版,即正式版会掉签;极速版Cookie只能用于极速版,支持正式版获取多Cookie @@ -93,12 +93,13 @@ if (isGetCookie) { $.index = i + 1; console.log(`-------------------\n\n开始【快手视频账号${$.index}】`) await speedSign(); - await speedSignifo(); + await speedSigninfo(); await speedInfo(); - await officialSign(); + await formalCenter(); + await formalSign(); if(offici_code !== 100119){ - await officialSignifo(); - await officialtaskCenter(); + await formalinfo(); + await formalAct(); } await showmsg() } @@ -107,24 +108,92 @@ if (isGetCookie) { .catch((e) => $.logErr(e)) .finally(() => $.done()) } -function officialSign() { + +function formalHost(api,body){ + return { + url: 'https://activity.m.kuaishou.com/rest/wd/taskCenter/'+api, + headers:{ + 'Host': 'activity.m.kuaishou.com', + 'Cookie': cookieVal, + 'Content-Type': 'application/json;charset=utf-8', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Kwai/9.0.50.4936 CT/0 WebViewType/WK NetType/WIFI Yoda/2.3.7-rc5 TitleHT/44 StatusHT/20' + }, + body: body + } +} + +function formalCenter() { + return new Promise((resolve, reject) =>{ + $.post(formalHost('lowActive/module/list', '{"bizId":29,"configId":1}'), async(error, resp, data) =>{ + let central = JSON.parse(data); + try { + if (central.result == 1) { + for (lists of central.modules) { + Id = lists.moduleId, + moduleDesc = lists.moduleDesc; + $.log(moduleDesc + "\n"); + for (tasks of lists.tasks) { + status = tasks.status, + bizId = tasks.bizId, + tasktoken = tasks.token, + eventId = tasks.eventId, + taskName = tasks.reward.rewardName; + if (Id == "1123") { + if (status == 5) { + $.log(taskName + " " + tasks.schemeText + "\n") + } else if (tasks.schemeText == "去签到") { + $.log(taskName + tasks.schemeText + "\n"); + await formalSign() + } + } else if (Id == "1749" && status == 4) { + await openbox(tasktoken, eventId) + } + } + } + } + } catch(e) { + $.log("领取金币失败\n" + JSON.stringify(result, null, 2)) + } finally { + resolve() + } + }) + }) +} + +function openbox(tokens, eventId) { + return new Promise((resolve, reject) =>{ + $.post(formalHost('task/report', `{"bizId": 29,"taskToken": "${tokens}","eventId": "${eventId}","eventValue": 1}`), (error, resp, data) =>{ + let result = JSON.parse(data); + try { + //$.log(JSON.stringify(result,null,2)) + if (result.result == 1) { + rewards = result.reward.rewardCount, + boxname = result.dialog.title, + $.desc += "【" + boxname + "】+" + rewards + " " + result.dialog.closeBubble; + $.log(boxname + "领取金币" + rewards + "," + result.dialog.secondDesc) + } else { + $.log(boxname + result.error_msg) + } + } catch(e) { + $.log("领取金币失败\n" + JSON.stringify(result, null, 2)) + } finally { + resolve() + } + }) + }) +} + +function formalSign() { return new Promise((resolve, reject) => { - let signurl = { - url: 'https://activity.m.kuaishou.com/rest/wd/taskCenter/task/signIn', - headers: {Cookie: cookieVal, -'Content-Type': 'application/json;charset=utf-8'}, - body: '{"bizId": 29}' - } - $.post(signurl, (error, response, data) => { - //$.log(`${$.name}, data: ${data}`) + $.post(formalHost('task/signIn','{"bizId": 29}'), (error, response, data) => { + let officialSign_res = JSON.parse(data) offici_code = officialSign_res.result if(offici_code == 100111){ offic_sign = `签到结果: ${officialSign_res.error_msg}`; - // $.msg($.name,offic_sign,"") logs?$.log(`错误信息: ${officialSign_res.error_msg}`):""; resolve() - return + return } else if(offici_code == 100136){ offic_sign = `签到结果: ${officialSign_res.error_msg}` if(logs)console.log(""+officialSign_res.error_msg) @@ -136,7 +205,7 @@ function officialSign() { }) } -function officialSignifo() { +function formalinfo() { return new Promise((resolve, reject) => { infourl = { url: 'https://zt.gifshow.com/rest/zt/encourage/account/summary/withKscoinTrial?kpn=KUAISHOU&subBiz=lowActiveUserTaskEncourage', @@ -152,7 +221,7 @@ function officialSignifo() { }) }) } -function officialtaskCenter() { +function formalAct() { return new Promise((resolve, reject) => { let reurl = {url:'https://sf2021.kuaishou.com/rest/wd/sf2021/retain/dailyRedpack/receiveDailyRedPacket', headers: {Cookie: cookieVal,'Content-Type': 'application/json;charset=utf-8'}, @@ -195,7 +264,7 @@ function speedSign() { }) }) } -function speedSignifo() { +function speedSigninfo() { return new Promise((resolve, reject) => { earnurl = { url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/query', @@ -264,7 +333,7 @@ function GetCookie() { $.msg($.name, `获取极速Cookie: 成功🎉`, ``) } else if ($request && $request.method != `OPTIONS` && UA.indexOf("ksNebula") == -1) { const cookie = $request.headers['Cookie'] ; - cookieVal = cookie.match(/token=[_a-z0-9-]+/)[0] + cookieVal = cookie.replace(/(.+)(appver\=[0-9\.])(.+)(; client_key\=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,$2$4$6); if (ks_tokens) { if (ks_tokens.indexOf(cookieVal) > -1) { $.log("cookie重复,已跳过") @@ -273,11 +342,11 @@ function GetCookie() { Cookies = ks_tokens + "&" + cookieVal; $.setdata(Cookies, 'cookie_ks'); ck = Cookies.split("&"); - $.msg($.name, "获取正式Cookie" + ck.length + ": 成功🎉", ``) + $.msg($.name, "获取正式版Cookie" + ck.length + ": 成功🎉", ``) } } else { $.setdata(cookieVal, 'cookie_ks'); - $.msg($.name, `获取正式Cookie: 成功🎉`, ``) + $.msg($.name, `获取正式版Cookie: 成功🎉`, ``) } } } From 50ded94b1208622b1d0fc74cbb0f922252575fa1 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 19:13:17 +0800 Subject: [PATCH 668/721] --- Task/kuaishou.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 395a6e2678..4a59d227d7 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -334,11 +334,12 @@ function GetCookie() { } else if ($request && $request.method != `OPTIONS` && UA.indexOf("ksNebula") == -1) { const cookie = $request.headers['Cookie'] ; cookieVal = cookie.replace(/(.+)(appver\=[0-9\.])(.+)(; client_key\=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,$2$4$6); + uid= cookieVal.match(/userId=\d+/) if (ks_tokens) { - if (ks_tokens.indexOf(cookieVal) > -1) { + if (ks_tokens.indexOf(uid) > -1) { $.log("cookie重复,已跳过") } - if (ks_tokens.indexOf(cookieVal) == -1) { + if (ks_tokens.indexOf(uid) == -1) { Cookies = ks_tokens + "&" + cookieVal; $.setdata(Cookies, 'cookie_ks'); ck = Cookies.split("&"); From 20ff527053023e185d9991ff663360a102c0cdcb Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 19:19:50 +0800 Subject: [PATCH 669/721] --- Task/kuaishou.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 4a59d227d7..78e6ad1b49 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -333,7 +333,7 @@ function GetCookie() { $.msg($.name, `获取极速Cookie: 成功🎉`, ``) } else if ($request && $request.method != `OPTIONS` && UA.indexOf("ksNebula") == -1) { const cookie = $request.headers['Cookie'] ; - cookieVal = cookie.replace(/(.+)(appver\=[0-9\.])(.+)(; client_key\=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,$2$4$6); + cookieVal = cookie.replace(/(.+)(appver\=[0-9\.])(.+)(; client_key\=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,'$2$4$6$8'); uid= cookieVal.match(/userId=\d+/) if (ks_tokens) { if (ks_tokens.indexOf(uid) > -1) { From 5cdb90b39dcb25937c21776bb557cba71860ff2f Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 19:37:29 +0800 Subject: [PATCH 670/721] --- Task/kuaishou.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 78e6ad1b49..de8e7e4df6 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -333,8 +333,8 @@ function GetCookie() { $.msg($.name, `获取极速Cookie: 成功🎉`, ``) } else if ($request && $request.method != `OPTIONS` && UA.indexOf("ksNebula") == -1) { const cookie = $request.headers['Cookie'] ; - cookieVal = cookie.replace(/(.+)(appver\=[0-9\.])(.+)(; client_key\=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,'$2$4$6$8'); - uid= cookieVal.match(/userId=\d+/) + cookieVal = cookie.replace(/(.+)(appver=[0-9\.]+)(.+)(; client_key=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,'$2$4$6$8'); + uid= cookieVal.match(/userId=\d+/); if (ks_tokens) { if (ks_tokens.indexOf(uid) > -1) { $.log("cookie重复,已跳过") From 8f147484a5f98b68276d72a9a59e3dbaadd0e368 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 20:10:52 +0800 Subject: [PATCH 671/721] --- Task/kuaishou.js | 2 +- TaskConf/kuaishou/qx_rewite.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index de8e7e4df6..9bec13aff2 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -333,7 +333,7 @@ function GetCookie() { $.msg($.name, `获取极速Cookie: 成功🎉`, ``) } else if ($request && $request.method != `OPTIONS` && UA.indexOf("ksNebula") == -1) { const cookie = $request.headers['Cookie'] ; - cookieVal = cookie.replace(/(.+)(appver=[0-9\.]+)(.+)(; client_key=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,'$2$4$6$8'); + cookieVal = cookie.replace(/(appver=[0-9\.]+)(.+)(; client_key=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,'$1$3$5$7'); uid= cookieVal.match(/userId=\d+/); if (ks_tokens) { if (ks_tokens.indexOf(uid) > -1) { diff --git a/TaskConf/kuaishou/qx_rewite.txt b/TaskConf/kuaishou/qx_rewite.txt index c9139714e7..0af049b9cd 100644 --- a/TaskConf/kuaishou/qx_rewite.txt +++ b/TaskConf/kuaishou/qx_rewite.txt @@ -1,5 +1,5 @@ hostname = nebula.kuaishou.com -http:\/\/\w+\.gifshow\.com\/rest\/n\/system\/speed url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +http:\/\/uploads\d\.gifshow\.com\/rest\/n\/system\/speed url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js From a15614f3b7829a91663333c3041384615147e58d Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 20:21:26 +0800 Subject: [PATCH 672/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BF=AB=E6=89=8B?= =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E7=89=88ck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/kuaishou.js | 2 +- TaskConf/kuaishou/qx_rewite.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 9bec13aff2..804824447f 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-18 19:10 +更新时间: 2021-02-18 20:20 本脚本仅适用于快手双版本签到,注意正式版Cookie签到有时效性,但Cookie仍然可用于签到极速版,即正式版会掉签;极速版Cookie只能用于极速版,支持正式版获取多Cookie diff --git a/TaskConf/kuaishou/qx_rewite.txt b/TaskConf/kuaishou/qx_rewite.txt index 0af049b9cd..7ac8ffd50a 100644 --- a/TaskConf/kuaishou/qx_rewite.txt +++ b/TaskConf/kuaishou/qx_rewite.txt @@ -1,5 +1,5 @@ -hostname = nebula.kuaishou.com +hostname = nebula.kuaishou.com, activity.m.kuaishou.com -http:\/\/uploads\d\.gifshow\.com\/rest\/n\/system\/speed url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +https:\/\/activity\.m\.kuaishou\.com\/rest\/wd\/taskCenter\/lowActive\/module\/list url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js From 6dc4dee7563c5c47f513101e4aed38f9a8cb7d5a Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 20:33:17 +0800 Subject: [PATCH 673/721] --- TaskConf/kuaishou/qx_rewite.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TaskConf/kuaishou/qx_rewite.txt b/TaskConf/kuaishou/qx_rewite.txt index 7ac8ffd50a..5a4198bc11 100644 --- a/TaskConf/kuaishou/qx_rewite.txt +++ b/TaskConf/kuaishou/qx_rewite.txt @@ -1,5 +1,5 @@ hostname = nebula.kuaishou.com, activity.m.kuaishou.com -https:\/\/activity\.m\.kuaishou\.com\/rest\/wd\/taskCenter\/lowActive\/module\/list url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +https:\/\/activity\.m\.kuaishou\.com\/rest\/wd\/taskCenter\/\w+\/module\/list url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js From 3935cc408c099ee7bd6ca7d392261a56397465c2 Mon Sep 17 00:00:00 2001 From: Best Date: Thu, 18 Feb 2021 20:42:41 +0800 Subject: [PATCH 674/721] --- Task/kuaishou.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 804824447f..a4c015a430 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -144,6 +144,7 @@ function formalCenter() { } else if (tasks.schemeText == "去签到") { $.log(taskName + tasks.schemeText + "\n"); await formalSign() + continue } } else if (Id == "1749" && status == 4) { await openbox(tasktoken, eventId) From d9f36e2be8b76860805cc5dc98f47c57e1bb559f Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 10:05:49 +0800 Subject: [PATCH 675/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Sunert_Task.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index 8c41e0f211..6874a9c6ce 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -9,60 +9,60 @@ "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告, img-url=https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/tvpreview.png, enabled=true" }, { - "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js, tag=12306火车时刻, img-url=https://raw.githubusercontent.com/Orz-3/task/master/12306.png, enabled=false" + "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js, tag=12306火车时刻, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/12306.png, enabled=false" }, { - "config": "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js, tag=实时货币换算, img-url=https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png, enabled=false" + "config": "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js, tag=实时货币换算, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/exchangerate.png, enabled=false" }, { - "config": "7 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js, tag=谷歌中英互译, img-url=https://raw.githubusercontent.com/Orz-3/task/master/translate.png, enabled=false" + "config": "7 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js, tag=谷歌中英互译, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/translate.png, enabled=false" }, { - "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐, img-url=https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png, enabled=true", + "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/telecominfinty.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/dianxin/qx_rewite.txt, tag=dianxin_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "30 9 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻, img-url= https://raw.githubusercontent.com/Orz-3/task/master/txnews.png, enabled=true", + "config": "30 9 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻, img-url= https://raw.githubusercontent.com/Orz-3/mini/master/Color/txnews.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/qx_rewite.txt, tag=txnews_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "30 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js, tag=京东到家, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jddj.png, enabled=true", + "config": "30 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js, tag=京东到家, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jddj.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/jd/qx_rewite.txt, tag=jd_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼, img-url=https://raw.githubusercontent.com/Orz-3/task/master/lkyl.png, enabled=true", + "config": "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/lkyl.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/jd/qx_rewite.txt, tag=jd_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "0 0 7,22 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家, img-url=https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png, enabled=true", + "config": "0 0 7,22 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/dianshijia.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/dianshijia/qx_rewite.txt, tag=dianshijia_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, tag=快手, img-url=https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png, enabled=true", + "config": "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, tag=快手, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/kuaishou.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/kuaishou/qx_rewite.txt, tag=kuaishou_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=微博&钱包, img-url=https://raw.githubusercontent.com/Orz-3/task/master/weibo.png, enabled=true", + "config": "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=微博&钱包, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/weibo.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt, tag=sina_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "10 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js, tag=新浪新闻, img-url=https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png, enabled=true", + "config": "10 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js, tag=新浪新闻, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/sinanews.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt, tag=sina_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "20 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, tag=中青看点极速版, img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png, enabled=true", + "config": "20 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, tag=中青看点极速版, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/youth.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青自动阅读, img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png, enabled=true", + "config": "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青自动阅读, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/youth.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_youthread.txt, tag=youth_auto, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "20 5 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js, tag=中青浏览赚, img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png, enabled=true", + "config": "20 5 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js, tag=中青浏览赚, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/youth.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite.txt, tag=youth_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { - "config": "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家, img-url=https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png, enabled=true", + "config": "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/mydigit.png, enabled=true", "addons": "https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/digit_home/qx_rewite.txt, tag=mydigit_rewite, update-interval=-1, opt-parser=false, enabled=true" }, { From 6d514a4f010e239331b1bb2eda71831de6f87c94 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 10:10:24 +0800 Subject: [PATCH 676/721] --- Task/Sunert_Task.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json index 6874a9c6ce..3f8fae0e1c 100644 --- a/Task/Sunert_Task.json +++ b/Task/Sunert_Task.json @@ -3,7 +3,7 @@ "description": "https://github.com/Sunert/Scripts", "task": [ { - "config": "0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气, img-url=https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/moji.png, enabled=true" + "config": "0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/moji.png, enabled=true" }, { "config": "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告, img-url=https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/tvpreview.png, enabled=true" From deabc22cb08ee919afcac679b0950fbdae379df8 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 11:47:45 +0800 Subject: [PATCH 677/721] --- Task/kuaishou.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index a4c015a430..578395ff93 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -143,8 +143,8 @@ function formalCenter() { $.log(taskName + " " + tasks.schemeText + "\n") } else if (tasks.schemeText == "去签到") { $.log(taskName + tasks.schemeText + "\n"); - await formalSign() - continue + await formalSign(); + break } } else if (Id == "1749" && status == 4) { await openbox(tasktoken, eventId) @@ -292,7 +292,7 @@ function speedInfo() { let result = JSON.parse(data) if (result.result == 1) { speed_rewards = `现金收益: 💵${result.data.allCash}元 金币收益: 💰${result.data.totalCoin}`; - await bdinvet(); + await bdinvet(); await vetInfo() } resolve() @@ -335,7 +335,7 @@ function GetCookie() { } else if ($request && $request.method != `OPTIONS` && UA.indexOf("ksNebula") == -1) { const cookie = $request.headers['Cookie'] ; cookieVal = cookie.replace(/(appver=[0-9\.]+)(.+)(; client_key=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,'$1$3$5$7'); - uid= cookieVal.match(/userId=\d+/); + uid= cookieVal.match(/userId=(\d+)/)[1]; if (ks_tokens) { if (ks_tokens.indexOf(uid) > -1) { $.log("cookie重复,已跳过") From 8f7e51bb3595248fe0f0958e0064567030ec79b7 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 11:51:54 +0800 Subject: [PATCH 678/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/kuaishou.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 578395ff93..b788feb983 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -335,7 +335,7 @@ function GetCookie() { } else if ($request && $request.method != `OPTIONS` && UA.indexOf("ksNebula") == -1) { const cookie = $request.headers['Cookie'] ; cookieVal = cookie.replace(/(appver=[0-9\.]+)(.+)(; client_key=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,'$1$3$5$7'); - uid= cookieVal.match(/userId=(\d+)/)[1]; + uid= cookieVal.match(/userId=\d+/g); if (ks_tokens) { if (ks_tokens.indexOf(uid) > -1) { $.log("cookie重复,已跳过") From dbce923212222ad458716e620ea25e8d475d0e17 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 12:16:09 +0800 Subject: [PATCH 679/721] --- Task/kuaishou.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index b788feb983..8277b2a798 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -335,7 +335,7 @@ function GetCookie() { } else if ($request && $request.method != `OPTIONS` && UA.indexOf("ksNebula") == -1) { const cookie = $request.headers['Cookie'] ; cookieVal = cookie.replace(/(appver=[0-9\.]+)(.+)(; client_key=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,'$1$3$5$7'); - uid= cookieVal.match(/userId=\d+/g); + uid= cookieVal.match(/userId=(\d+)/g); if (ks_tokens) { if (ks_tokens.indexOf(uid) > -1) { $.log("cookie重复,已跳过") From 7980838edda4e14f4b0dcc4c3a2c3465e0a6e538 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 12:28:20 +0800 Subject: [PATCH 680/721] --- Task/kuaishou.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 8277b2a798..72a397fcbd 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -334,8 +334,8 @@ function GetCookie() { $.msg($.name, `获取极速Cookie: 成功🎉`, ``) } else if ($request && $request.method != `OPTIONS` && UA.indexOf("ksNebula") == -1) { const cookie = $request.headers['Cookie'] ; - cookieVal = cookie.replace(/(appver=[0-9\.]+)(.+)(; client_key=\w+)(.+)(; token=[0-9a-z-]+)(.+)(; userId=\d+)/,'$1$3$5$7'); - uid= cookieVal.match(/userId=(\d+)/g); + cookieVal = cookie.match(/appver=[0-9\.]+/)+cookie.match(/; client_key=\w+/)+cookie.match(/; token=[0-9a-z-]+/)+cookie.match(/; userId=\d+/); + uid= cookieVal.match(/userId=\d+/); if (ks_tokens) { if (ks_tokens.indexOf(uid) > -1) { $.log("cookie重复,已跳过") From b70dc82412ea8571fd08510d55ceb9f041f7854a Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 12:35:45 +0800 Subject: [PATCH 681/721] --- Task/kuaishou.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 72a397fcbd..8cebee56cc 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -339,8 +339,7 @@ function GetCookie() { if (ks_tokens) { if (ks_tokens.indexOf(uid) > -1) { $.log("cookie重复,已跳过") - } - if (ks_tokens.indexOf(uid) == -1) { + } else if (ks_tokens.indexOf(uid) == -1) { Cookies = ks_tokens + "&" + cookieVal; $.setdata(Cookies, 'cookie_ks'); ck = Cookies.split("&"); From d6a781e3e480ac8c82d31b95a0f4815d078a8deb Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 12:51:53 +0800 Subject: [PATCH 682/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/kuaishou.js | 18 ++++++++---------- Task/weibo.js | 9 ++++----- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 8cebee56cc..ebeb208cb0 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-18 20:20 +更新时间: 2021-02-19 12:50 本脚本仅适用于快手双版本签到,注意正式版Cookie签到有时效性,但Cookie仍然可用于签到极速版,即正式版会掉签;极速版Cookie只能用于极速版,支持正式版获取多Cookie @@ -52,6 +52,11 @@ const $ = new Env('快手视频') let cookieArr = []; let ks_tokens = $.getdata('cookie_ks') +let isGetCookie = typeof $request !== 'undefined' +if (isGetCookie) { + GetCookie(); + $.done() +} else { if (!$.isNode() && ks_tokens.indexOf('&') == -1) { cookieArr.push(ks_tokens) } else { @@ -70,23 +75,16 @@ if (!$.isNode() && ks_tokens.indexOf('&') == -1) { } }) } - -let isGetCookie = typeof $request !== 'undefined' -if (isGetCookie) { - GetCookie(); - $.done() -} else { !(async() => { if(!cookieArr[0]){ $.msg($.name, '【提示】🉐登录快手pp获取cookie',"", {"open-url": "https://live.kuaishou.com/fission/offkwai/index?cc=share_copylink&kpf=IPHONE&traceId=27&fid=1570609569&code=3429390431&shareMethod=token&kpn=KUAISHOU&subBiz=INVITE_CODE&shareId=1000517297081&shareToken=X-1oTjAy1OkMhgQk_AO&platform=copylink&shareMode=app&shareObjectId=3429390431"}); return } - if ($.isNode()){ timeZone = new Date().getTimezoneOffset() / 60; timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000; - bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); + bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}) console.log(`\n === 脚本执行 ${bjTime} ===\n`); - } + console.log(`\n === 共 ${cookieArr.length}个 账号 ===\n`) for (let i = 0; i < cookieArr.length; i++) { if (cookieArr[i]) { cookieVal = cookieArr[i]; diff --git a/Task/weibo.js b/Task/weibo.js index ff7bc0eef2..68a05bcc0d 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-15 00:20 +更新时间: 2021-02-19 12:30 本脚本仅适用于微博每日签到,支持多账号运行 @@ -17,8 +17,8 @@ let signcash = "", cookieArr=[]; if (isGetCookie = typeof $request !==`undefined`) { GetCookie(); $.done() -} - +} else{ +!(async () => { if(!$.isNode()&&wbtoken.indexOf("#")==-1){ tokenArr.push(wbtoken); cookieArr.push(cookies) @@ -59,7 +59,6 @@ if ($.isNode()) { } }); } -!(async () => { if (!tokenArr[0]) { $.msg($.name, '【提示】请先获取新浪微博一cookie') return; @@ -87,7 +86,7 @@ if ($.isNode()) { })() .catch((e) => $.logErr(e)) .finally(() => $.done()) - +} function GetCookie() { if ($request && $request.method != 'OPTIONS' && $request.url.indexOf("gsid=") > -1) { From 5dc2204904adf15f781210e157f9d7e10a28d182 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 17:02:26 +0800 Subject: [PATCH 683/721] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BF=AB=E6=89=8B?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E9=85=8D=E7=BD=AE=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/kuaishou.js | 148 ++++++++++++++----------------- TaskConf/kuaishou/loon.plugin | 10 +++ TaskConf/kuaishou/readme.md | 106 ++++++++++++++++++++++ TaskConf/kuaishou/surge.sgmodule | 13 +++ TaskConf/sina/readme.md | 2 +- 5 files changed, 199 insertions(+), 80 deletions(-) create mode 100644 TaskConf/kuaishou/loon.plugin create mode 100644 TaskConf/kuaishou/surge.sgmodule diff --git a/Task/kuaishou.js b/Task/kuaishou.js index ebeb208cb0..a3149187d3 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -1,53 +1,11 @@ /* -更新时间: 2021-02-19 12:50 - -本脚本仅适用于快手双版本签到,注意正式版Cookie签到有时效性,但Cookie仍然可用于签到极速版,即正式版会掉签;极速版Cookie只能用于极速版,支持正式版获取多Cookie - -正式版APP获取Cookie方法: - 1.将下方[rewrite_local]地址复制的相应的区域下,无需填写hostname; - 2.打开APP稍等几秒,即可获取Cookie. - -极速版获取方法, - 1.把URL的正则改为 https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\?,添加hostname = nebula.kuaishou.com; - 2.点击设置页面的"积分兑好礼"即可 +更新时间: 2021-02-19 16:50 +赞赏:快手邀请码`774010415`,农妇山泉 -> 有点咸,万分感谢 +本脚本仅适用于快手双版本签到,仅支持正式版获取多Cookie,建议使用正式版获取Cookie,点击视频页悬浮红包,或者进入设置,点击"积分兑好礼"即可 兼容Nodejs,把获取的Cookie填入KS_TOKEN,多账号用"&"分开 - -非专业人士制作,欢迎各位大佬提出宝贵意见和指导 -by Sunert -特别感谢 -@Chavy -@Nobyda -~~~~~~~~~~~~~~~~ - -Surge 4.0 : -[Script] -快手 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js,script-update-interval=0 - -快手 = type=http-request,pattern=http:\/\/uploads\d\.gifshow\.com\/rest\/n\/system\/speed,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js - -~~~~~~~~~~~~~~~~ -Loon 2.1.0+ -[Script] -# 本地脚本 -cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, enabled=true, tag=快手 - -http-request http:\/\/uploads\d\.gifshow\.com\/rest\/n\/system\/speed script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js - ------------------ - -QX 1.0.7+ : -[task_local] -0 9 * * * kuaishou.js - -[rewrite_local] - -http:\/\/uploads\d\.gifshow\.com\/rest\/n\/system\/speed url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js - -~~~~~~~~~~~~~~~~ - */ -const logs = false //日志开关 + const $ = new Env('快手视频') let cookieArr = []; let ks_tokens = $.getdata('cookie_ks') @@ -84,12 +42,12 @@ if (!$.isNode() && ks_tokens.indexOf('&') == -1) { timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000; bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}) console.log(`\n === 脚本执行 ${bjTime} ===\n`); - console.log(`\n === 共 ${cookieArr.length}个 账号 ===\n`) + console.log(` === 共 ${cookieArr.length}个 账号 === `) for (let i = 0; i < cookieArr.length; i++) { if (cookieArr[i]) { cookieVal = cookieArr[i]; $.index = i + 1; - console.log(`-------------------\n\n开始【快手视频账号${$.index}】`) + console.log(`\n------------------------\n\n开始【快手视频账号${$.index}】\n`) await speedSign(); await speedSigninfo(); await speedInfo(); @@ -131,21 +89,31 @@ function formalCenter() { moduleDesc = lists.moduleDesc; $.log(moduleDesc + "\n"); for (tasks of lists.tasks) { + //$.log(JSON.stringify(tasks,null,2)); status = tasks.status, bizId = tasks.bizId, tasktoken = tasks.token, eventId = tasks.eventId, + schemeText = tasks.schemeText taskName = tasks.reward.rewardName; - if (Id == "1123") { if (status == 5) { $.log(taskName + " " + tasks.schemeText + "\n") - } else if (tasks.schemeText == "去签到") { - $.log(taskName + tasks.schemeText + "\n"); + } else if (status == 2) { + $.log(taskName + schemeText + "\n"); + if (Id == "1123") { await formalSign(); break + } else if (Id == "1176") { + //$.log(taskName) + await getReward(); + break + } + } else if (Id == "1749"){ + if(status == 4){ + await openbox(tasktoken, eventId) + } else if(status == 1){ + $.log(tasks.reward.rewardName+",时间未达到\n") } - } else if (Id == "1749" && status == 4) { - await openbox(tasktoken, eventId) } } } @@ -185,39 +153,65 @@ function openbox(tokens, eventId) { function formalSign() { return new Promise((resolve, reject) => { $.post(formalHost('task/signIn','{"bizId": 29}'), (error, response, data) => { - - let officialSign_res = JSON.parse(data) - offici_code = officialSign_res.result + let formalSign_res = JSON.parse(data) + offici_code = formalSign_res.result if(offici_code == 100111){ - offic_sign = `签到结果: ${officialSign_res.error_msg}`; - logs?$.log(`错误信息: ${officialSign_res.error_msg}`):""; - resolve() + offic_sign = `签到结果: ${formalSign_res.error_msg}`; + $.log(`错误信息: ${formalSign_res.error_msg}`); return } else if(offici_code == 100136){ - offic_sign = `签到结果: ${officialSign_res.error_msg}` - if(logs)console.log(""+officialSign_res.error_msg) + offic_sign = `签到结果: ${formalSign_res.error_msg}`; + $.log(""+formalSign_res.error_msg) } else if(offici_code == 1){ - offic_sign = `签到结果: ✅ +${officialSign_res.reward.rewardCount} 积分` + offic_sign = `签到结果: ✅ +${formalSign_res.reward.rewardCount} 积分` } resolve() }) }) } +function getReward() { + return new Promise((resolve, reject) =>{ + $.post(formalHost('task/appStartup/reward', '{"bizId": 29}'), (error, response, data) =>{ + let reward_res = JSON.parse(data); + //moduleDesc = reward_res.appStartupModule.moduleDesc; + if (data.indexOf('surpriseRewardCount') > -1) { + surpriseReward = reward_res.reward.surpriseRewardCount + } + switch (reward_res.rewardSuccess) { + case true: + $.log("获得积分" + reward_res.reward.rewardCount + surpriseReward ? "现金奖励" + surpriseReward / 100 + "元": ""); + break; + case false: + //$.log(moduleDesc + "未完成 " + schemeText); + break; + default: + $.log('前面的条件不满足'); + break; + } + resolve() + }) + }) +} + + function formalinfo() { - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) =>{ infourl = { - url: 'https://zt.gifshow.com/rest/zt/encourage/account/summary/withKscoinTrial?kpn=KUAISHOU&subBiz=lowActiveUserTaskEncourage', - headers: {Cookie: cookieVal, -'Content-Type': 'application/json;charset=utf-8'},} - $.get(infourl, async(error, response, data) => { - // $.log(`${$.name}, data: ${data}`) - let _info = JSON.parse(data) - if (_info.result == 1){ - offic_info = `收益: ${_info.data.accounts[0].displayBalance}积分 现金: ${_info.data.accounts[1].displayBalance}元\n` - } + url: 'https://zt.gifshow.com/rest/zt/encourage/account/summary/withKscoinTrial?kpn=KUAISHOU&subBiz=lowActiveUserTaskEncourage', + headers: { + Cookie: cookieVal, + 'Content-Type': 'application/json;charset=utf-8' + }, + } + $.get(infourl, async(error, resp, data) =>{ + // $.log(`${$.name}, data: ${data}`) + let _info = JSON.parse(data); + if (_info.result == 1) { + offic_info = `积分: ${_info.data.accounts[0].displayBalance}积分 现金: ${_info.data.accounts[1].displayBalance}元\n` + } resolve() - }) + }) }) } function formalAct() { @@ -227,7 +221,6 @@ function formalAct() { body: '{"bizId": 29}' } $.post(reurl, (error, response, data) =>{ - //$.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) if (result.message == "success") { var rewards = result.data.amount/100 @@ -246,13 +239,12 @@ function speedSign() { url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/sign', headers: {Cookie: cookieVal}} $.get(signurl, (error, response, data) => { - if(logs)$.log(`${$.name}, data: ${data}`) let speed_res = JSON.parse(data) speed_code = speed_res.result if(speed_code == 10007){ speed_sign = `签到结果: ${speed_res.error_msg}`; $.msg($.name,speed_sign,''); - if(logs) $.log(`错误信息: ${speed_res.error_msg}`) + $.log(`错误信息: ${speed_res.error_msg}`) $.done() } else if(speed_code == 10901){ speed_sign = `签到结果: ${speed_res.error_msg}` @@ -271,7 +263,6 @@ function speedSigninfo() { 'Content-Type': 'application/json;charset=utf-8'}, } $.get(earnurl, (error, response, data) => { - if(logs)$.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) if (result.result == '1'){ speed_info = `${result.data.nebulaSignInPopup.subTitle}, ${result.data.nebulaSignInPopup.title}\n` @@ -286,10 +277,9 @@ function speedInfo() { headers: {Cookie: cookieVal, 'Content-Type': 'application/json;charset=utf-8'},} $.get(reurl, async(error, response, data) =>{ - if(logs)$.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) if (result.result == 1) { - speed_rewards = `现金收益: 💵${result.data.allCash}元 金币收益: 💰${result.data.totalCoin}`; + speed_rewards = '积分: '+result.data.totalCoin+'积分 现金: '+result.data.allCash+'元'; await bdinvet(); await vetInfo() } diff --git a/TaskConf/kuaishou/loon.plugin b/TaskConf/kuaishou/loon.plugin new file mode 100644 index 0000000000..d7290d1bbc --- /dev/null +++ b/TaskConf/kuaishou/loon.plugin @@ -0,0 +1,10 @@ + +[Script] +cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, enabled=true, tag=快手视频 + +http-request https:\/\/activity\.m\.kuaishou\.com\/rest\/wd\/taskCenter\/\w+\/module\/list script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, enabled=true, tag=快手视频正式版 + +http-request https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, enabled=true, tag=快手视频极速版 + +[MITM] +hostname = nebula.kuaishou.com, activity.m.kuaishou.com \ No newline at end of file diff --git a/TaskConf/kuaishou/readme.md b/TaskConf/kuaishou/readme.md index 8b13789179..6b674ff14e 100644 --- a/TaskConf/kuaishou/readme.md +++ b/TaskConf/kuaishou/readme.md @@ -1 +1,107 @@ + + [toc] + + #
快手视频签到使用说明
+ + [跳转至底部](#注意事项) ---- [回到主页](https://github.com/Sunert/Scripts) + +### IOS配置教程 + ``` +[MITM] +hostname = nebula.kuaishou.com, activity.m.kuaishou.com + ``` +#### Surge: +* [模块地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/kuaishou/surge.sgmodule) + + ``` +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/kuaishou/surge.sgmodule + ``` + * 本地重写 + + ``` +[Script] +快手视频 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js,script-update-interval=0 + +# 获取快手视频 Cookie. +快手正式版 = type=http-request,pattern=https:\/\/activity\.m\.kuaishou\.com\/rest\/wd\/taskCenter\/\w+\/module\/list,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +快手极速版 = type=http-request,pattern=https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +``` +#### Shadowrocket(Cron配置): + +``` +[Script] +快手视频 = type=cron,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js,cronexpr="35 5 0 * * *",timeout=20,enable=true +``` +#### Loon: + +* [插件地址](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/kuaishou/loon.plugin) + + ``` +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/kuaishou/loon.plugin + ``` +* 本地重写 + + ``` +[Script] +cron "4 0 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, enabled=true, tag=快手视频 + +http-request https:\/\/activity\.m\.kuaishou\.com\/rest\/wd\/taskCenter\/\w+\/module\/list script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, enabled=true, tag=快手视频正式版 +http-request https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, enabled=true, tag=快手视频极速版 +``` +#### Quantumult X: + * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/kuaishou/qx_rewite.txt) + +``` +[rewrite_remote] +https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/kuaishou/qx_rewite.txt +``` + * 本地重写配置 + +``` +[rewrite_local] +https:\/\/activity\.m\.kuaishou\.com\/rest\/wd\/taskCenter\/\w+\/module\/list url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +``` + * 本地任务配置 + +``` +[task_local] +1 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, tag=快手视频 +``` +### 获取Cookie方法 + 1. 点击视频页悬浮红包,或者进入设置,点击"积分兑好礼"即可 + + >>> [回到顶部](#IOS配置教程) + +### Nodejs 配置密钥 (Github Actions) + +
+ + + + Actions Secrets + + + +| Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | +| :-------: | :------: | :-------: | ------ | ------- | +| KS_TOKEN | 快手视频 | &或换行 | 必须 | 请求地址: "https://activity.m.kuaishou.com/rest/wd/taskCenter/lowActive/module/list",
任务Cookie: uid=xxx&gsid=xxx&s=xxx | + +
+ + >>> [回到上一页](..) + +### 注意事项: + * 本脚本仅限快手视频"低活国庆"部分任务,不能自动刷视频,可以自动领取视频积分 + * 本脚本仅适用于快手双版本签到,仅支持正式版获取多Cookie,建议使用正式版获取Cookie + + + + + + + + + + diff --git a/TaskConf/kuaishou/surge.sgmodule b/TaskConf/kuaishou/surge.sgmodule new file mode 100644 index 0000000000..8e58c395a7 --- /dev/null +++ b/TaskConf/kuaishou/surge.sgmodule @@ -0,0 +1,13 @@ + +#!name= kuaishou Rewrite +#!desc= 快手重写配置 +#!system=ios + +[Script] +快手视频 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js,script-update-interval=0 + +快手正式版 = type=http-request,pattern=https:\/\/activity\.m\.kuaishou\.com\/rest\/wd\/taskCenter\/\w+\/module\/list,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +快手极速版 = type=http-request,pattern=https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js + +[MITM] +hostname = %APPEND% nebula.kuaishou.com, activity.m.kuaishou.com \ No newline at end of file diff --git a/TaskConf/sina/readme.md b/TaskConf/sina/readme.md index 69cd1f70d1..6150806a7c 100644 --- a/TaskConf/sina/readme.md +++ b/TaskConf/sina/readme.md @@ -49,7 +49,7 @@ http-request https:\/\/api\.weibo\.cn\/\d\/users\/show script-path=https://raw.g http-request https:\/\/m\.weibo\.cn\/c\/checkin\/ug\/v2\/signin\/module\?module script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 ``` #### Quantumult X: - * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/txnews/qx_rewite.txt) + * [远程重写配置](https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/sina/qx_rewite.txt) ``` [rewrite_remote] From a25a68212eb0ffc88d4fc5713b5064ffb5a9a31d Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 20:20:16 +0800 Subject: [PATCH 684/721] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E9=9D=92?= =?UTF-8?q?=E8=8E=B7=E5=8F=96body=E9=87=8D=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Youth_Read.js | 4 ++-- Task/youth.js | 2 +- TaskConf/youth/loon.plugin | 2 +- TaskConf/youth/qx_rewite.txt | 2 +- TaskConf/youth/qx_youthread.txt | 2 +- TaskConf/youth/readme.md | 2 +- TaskConf/youth/surge.sgmodule | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 4c01eb1ed1..b86b100315 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -146,8 +146,8 @@ function readTime() { } function Getbody() { - if ($request && $request.method != `OPTIONS` && $request.url.match(/\/article\/complete/)) { - bodyVal = $request.body; + if ($request && $request.method != `OPTIONS` && $request.url.match(/\/article\/info\/get/)) { + bodyVal = $request.url.split("?")[1]; if (YouthBody) { if (YouthBody.indexOf(bodyVal) > -1) { $.log("此阅读请求已存在,本次跳过") diff --git a/Task/youth.js b/Task/youth.js index 3a702cfc2c..7effe6c2bc 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -742,6 +742,6 @@ async function showmsg() { } } -function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/complete/)){const articlebodyVal=$request.body;if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} +function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/info\/get/)){articlebodyVal=$request.url.split("?")[1];if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} 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)} diff --git a/TaskConf/youth/loon.plugin b/TaskConf/youth/loon.plugin index b2830c70e6..04984ad990 100644 --- a/TaskConf/youth/loon.plugin +++ b/TaskConf/youth/loon.plugin @@ -3,7 +3,7 @@ [Script] cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 -http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/article\/info\/get\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 diff --git a/TaskConf/youth/qx_rewite.txt b/TaskConf/youth/qx_rewite.txt index 123099ee66..1606f9642b 100644 --- a/TaskConf/youth/qx_rewite.txt +++ b/TaskConf/youth/qx_rewite.txt @@ -2,7 +2,7 @@ hostname = kd.youth.cn, ios.baertt.com https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +https:\/\/ios\.baertt\.com\/v5\/article\/info\/get\.json url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js diff --git a/TaskConf/youth/qx_youthread.txt b/TaskConf/youth/qx_youthread.txt index d39036e034..ebafb1cc4c 100644 --- a/TaskConf/youth/qx_youthread.txt +++ b/TaskConf/youth/qx_youthread.txt @@ -1,5 +1,5 @@ hostname = ios.baertt.com -https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js +https:\/\/ios\.baertt\.com\/v5\/article\/info\/get\.json url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js \ No newline at end of file diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 12c8a1279e..bc9d717b4d 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -62,7 +62,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/qx_rewite ``` [rewrite_local] https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -https?:\/\/ios\.baertt\.com\/v5\/article\/complete url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js +https:\/\/ios\.baertt\.com\/v5\/article\/info\/get\.json url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js ``` diff --git a/TaskConf/youth/surge.sgmodule b/TaskConf/youth/surge.sgmodule index b868c668b0..69edfa174c 100644 --- a/TaskConf/youth/surge.sgmodule +++ b/TaskConf/youth/surge.sgmodule @@ -7,7 +7,7 @@ 中青看点 = type=http-request,pattern=https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/info\/get\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true From 9e709c3db6b2f5dc8aba9a809f8cb8cc4278ed3c Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 21:27:12 +0800 Subject: [PATCH 685/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/sunert.boxjs.json | 28 ++++++++++++++-------------- TaskConf/youth/readme.md | 8 ++++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 5191951cb2..4de0f9adc9 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -23,7 +23,7 @@ "name" : "新浪微博", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", - "https://raw.githubusercontent.com/Orz-3/task/master/weibo.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/weibo.png" ] }, { @@ -100,7 +100,7 @@ "name" : "中青看点", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", - "https://raw.githubusercontent.com/Orz-3/task/master/youth.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/youth.png" ] }, { @@ -115,7 +115,7 @@ "name" : "中青浏览赚", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", - "https://raw.githubusercontent.com/Orz-3/task/master/youth.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/youth.png" ] }, { @@ -130,7 +130,7 @@ "name" : "中青自动阅读", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", - "https://raw.githubusercontent.com/Orz-3/task/master/youth.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/youth.png" ] }, { @@ -168,7 +168,7 @@ "name" : "电视家", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", - "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/dianshijia.png" ] }, { @@ -182,7 +182,7 @@ "name" : "快手极速版", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", - "https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/kuaishou.png" ] }, { @@ -199,7 +199,7 @@ "name" : "新浪新闻", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", - "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/sinanews.png" ] }, { @@ -223,7 +223,7 @@ "name" : "电信套餐查询", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", - "https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/telecominfinty.png" ] }, { @@ -237,7 +237,7 @@ "name" : "京东到家", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", - "https://raw.githubusercontent.com/Orz-3/task/master/jddj.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/jddj.png" ] }, { @@ -404,7 +404,7 @@ "name" : "数码之家", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", - "https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/mydigit.png" ] }, { @@ -489,7 +489,7 @@ "name" : "腾讯新闻", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", - "https://raw.githubusercontent.com/Orz-3/task/master/txnews.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/txnews.png" ] }, { @@ -513,7 +513,7 @@ "name" : "谷歌翻译", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", - "https://raw.githubusercontent.com/Orz-3/task/master/translate.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/translate.png" ] }, { @@ -550,7 +550,7 @@ "name" : "汇率换算", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", - "https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/exchangerate.png" ] }, { @@ -611,7 +611,7 @@ "name" : "列车时刻", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", - "https://raw.githubusercontent.com/Orz-3/task/master/12306.png" + "https://raw.githubusercontent.com/Orz-3/mini/master/Color/12306.png" ] } ] diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index bc9d717b4d..2620b682ca 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -23,7 +23,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/surge.sgm [Script] 中青看点 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js,script-update-interval=0 中青看点 = type=http-request,pattern=https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js -中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/complete,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true +中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/article\/info\/get\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true 中青看点 = type=http-request,pattern=https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true ``` @@ -46,7 +46,7 @@ https://raw.githubusercontent.com/Sunert/Scripts/master/TaskConf/youth/loon.plug [Script] cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 -http-request https:\/\/ios\.baertt\.com\/v5\/article\/complete script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 +http-request https:\/\/ios\.baertt\.com\/v5\/article\/info\/get\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, requires-body=true, enabled=true, tag=中青看点 ``` @@ -74,8 +74,8 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body h ``` ### 获取Cookie方法 * 打开极速版APP,进去个人中心,提示获取Cookie - - 浏览一篇短文,等待倒计时结束,提示获取阅读请求 - * 多阅读几篇短文,随机获取阅读时长请求(至少1分钟左右) + - 打开一篇短文资讯,提示获取阅读请求 + * 多阅读几篇短文,随机获取阅读时长请求(至少1分钟左右,增加时长有关) - 正常提现一次,获取提现请求(可选,AC无添加) >>> [回到顶部](#IOS配置教程) From d5c488fda48b4a25b4314f6405cf3df5e7a06a95 Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 22:15:30 +0800 Subject: [PATCH 686/721] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AD=89=E5=BE=85?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/youth_read.yml | 2 +- Task/Youth_Read.js | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index cfdca6d629..a63f7abc29 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -6,7 +6,7 @@ name: 中青自动阅读 on: workflow_dispatch: schedule: - - cron: '8 1-12/2 * * *' + - cron: '6 1-16/3 * * *' watch: types: started jobs: diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index b86b100315..484c23d966 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -18,7 +18,7 @@ if (isGetbody = typeof $request !==`undefined`) { Getbody(); $done() } -let lastIndex = $.getdata('zq_lastbody') +let lastIndex = $.getdata('zqbody_index') if(!$.isNode()&&!YouthBody==true){ $.log("您未获取阅读请求,请求阅读后获取") $.msg($.name, "您未获取阅读请求,请求阅读后获取","",{'open-url':"https://kandian.youth.cn/u/8S9DO"}) @@ -60,17 +60,19 @@ if(!$.isNode()&&!YouthBody==true){ let indexLast = $.getdata('zqbody_index'); $.begin = indexLast ? parseInt(indexLast,10) : 1; $.index = 0; + $.log( "上次运行到第"+$.begin+"次终止,本次从"+(parseInt($.begin)+1)+"次开始"); for ( var i = indexLast ? indexLast:0; i < ReadArr.length; i++) { if (ReadArr[i]) { articlebody = ReadArr[i]; $.index = $.index + 1; - console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`); - await $.wait(1000); - await AutoRead(); + $.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`); + await $.wait(10000); + await AutoRead(); }; } $.log("本次共阅读"+artsnum+"次资讯,共获得"+readscore+"青豆\n观看"+videosnum+"次视频,获得"+videoscore+"青豆(不含0青豆次数)\n") - console.log(`-------------------------\n\n中青看点共完成${$.index}次阅读,共计获得${readscore+videoscore}个青豆,阅读请求全部结束`) + console.log(`-------------------------\n\n中青看点共完成${$.index}次阅读,共计获得${readscore+videoscore}个青豆,阅读请求全部结束`); + $.msg($.name, `本次运行共完成${$.index}次阅读,共计获得${readscore+videoscore}个青豆`) })() .catch((e) => $.logErr(e)) .finally(() => $.done()) @@ -106,10 +108,10 @@ function AutoRead() { if($.index==ReadArr.length){ $.log($.index+"次任务已全部完成,即将结束") } else { - await $.wait(28000); + await $.wait(20000); } } else if (readres.error_code == '0' && data.indexOf('"score":0') > -1 && readres.items.score == 0) { - console.log(`\n本次阅读获得0个青豆,等待1s即将开始下次阅读\n`); + console.log(`\n本次阅读获得0个青豆,等待10s即将开始下次阅读\n`); } else if (readres.success == false) { console.log(`第${$.index}次阅读请求有误,请删除此请求`) } else if (readres.items.max_notice == '\u770b\u592a\u4e45\u4e86\uff0c\u63621\u7bc7\u8bd5\u8bd5') { @@ -133,7 +135,7 @@ function batHost(api, body) { } function readTime() { - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { $.post(batHost('user/stay.json',timebodyVal), (error, resp, data) => { let timeres = JSON.parse(data) if (timeres.error_code == 0) { From 2029505f86d5dc1dc587fdb4515220385738a95e Mon Sep 17 00:00:00 2001 From: Best Date: Fri, 19 Feb 2021 22:52:49 +0800 Subject: [PATCH 687/721] --- Task/youth.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 7effe6c2bc..c3bb83a362 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -228,6 +228,7 @@ function getsign() { } else if (signres.status == 1) { detail = `【签到结果】成功 🎉 青豆: +${signres.score},明日青豆: +${signres.nextScore}\n`; await comApp(); + await Census() } resolve() }) @@ -424,7 +425,21 @@ function SevCont() { }) }) } - +function Census() { + return new Promise((resolve, reject) =>{ + let url= { + url:"https://kd.youth.cn/user/inviteCensus2?jsonpcallback=jQuery20308548318424756004_1613745418308&uid=46308484&_="+Date.now(), + headers:{ + 'Cookie':cookie, + 'Referer': 'https://kandian.youth.cn/user/mmsq/ee9d523f55d7f1e985384c5c4c22228f?uid=46308484&reward_sign=5REAvA90VGotgq4exRtrCoiDgQGGv9zp&avatar=http://res.youth.cn/avatar_202004_28_28o_5ea8469f50c0746308484h.jpg&is_new=0&title_mark=1' + } + } + $.post(url, async(error, resp, data) =>{ + //$.log(resp) + resolve() + }) + }) +} //开启时段宝箱 function openbox() { From 7b03c4871f786dbb557b122fe3aea40df6e9a960 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 20 Feb 2021 20:02:57 +0800 Subject: [PATCH 688/721] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BF=BC=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E7=94=B5=E4=BF=A1=E5=A5=97=E9=A4=90=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/bestPay.js | 175 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 Task/bestPay.js diff --git a/Task/bestPay.js b/Task/bestPay.js new file mode 100644 index 0000000000..bc7f58ad77 --- /dev/null +++ b/Task/bestPay.js @@ -0,0 +1,175 @@ +/* +更新时间: 2021-02-20 20:00 +https:\/\/czapp\.bestpay\.com\.cn\/payassistant-client\?method=queryPhoneBalance url script-request-body bestPay.js +hostname = czapp.bestpay.com.cn +翼支付打开权益专区,点击套餐详情,重进翼支付App时需重新获取请求,即重写配置不必禁用 + +*/ +const $ = new Env('翼支付电信套餐'); +const bodyVal = $.getdata('bestpay_tele'); +const queryTime = $.getdata('bestpay_bill')||parseInt($.time("yyyyMM")-1); +const cash = $.getdata('tele_balance')||"10"; + +let isGetCookie = typeof $request !== 'undefined' +if (isGetCookie) { + GetCookie() +} else { +!(async () => { + await queryBalance(); + await queryResource(); + await queryBill(); + $.msg($.name,$.sub,$.desc) +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) +} +function GetCookie() { + if ($request.body) { + var bodyValue = $request.body; + if ($.getdata('bestpay_tele') != (undefined || null)) { + if ($.getdata('bestpay_tele') != bodyValue) { + var bodys = $.setdata(bodyValue, 'bestpay_tele'); + if (!bodys) { + $.msg("更新" + $.name + "请求失败‼️", "", ""); + $.log(`获取请求体: 失败`); + } else { + $.msg("更新" + $.name + "请求成功 🎉", "", ""); + $.log($.name+`, 获取请求: 成功, body: ${bodyValue}`) + } + } + } else { + var bodys = $.setdata(bodyValue, 'bestpay_tele'); + if (!bodys) { + $.msg("首次写入" + $.name + "请求失败‼️", "", ""); + } else { + $.msg("首次写入" + $.name + "请求成功 🎉", "", ""); + } + } + } else { + $.msg("写入" + $.name + "请求失败‼️", "", "配置错误, 无法读取请求体, "); + } + $.done() +} + + +function config(api,queryApi) { + return { + url:'https://czapp.bestpay.com.cn/payassistant-client?method='+api, + headers:{ + Host: 'czapp.bestpay.com.cn', + Referer: 'https://h5.bestpay.com.cn/subapps/payassistant/payassistant-new/index.html?hybridVersion=3.0&channel=quanyi', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Bestpay/10.1.91 hybridVersion/3.0 /sa-sdk-ios', + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: bodyVal+"&"+queryApi + } +} + + +function queryResource() { + return new Promise((resolve) =>{ + $.post(config('queryUserResource', 'BILLCYCLE='+$.time("yyyyMM")), (error, resp, data) =>{ + let result = JSON.parse(data); + try { + if (result.RESPONSECODE == "000000") { + products = result.RESULTDATASET; + //$.log(JSON.stringify(products,null,2)); + $.desc = "使用详情:\n"; + $.log("已开套餐:") + for (x in products) { + productsname = products[x].PRODUCTOFFNAME, + offerType = products[x].OFFERTYPE, + ratableid = products[x].RATABLERESOURCEID; + $.log(" "+productsname+" 类型:"+offerType); + if (ratableid) { + unitType = products[x].UNITTYPEID, + ratableName = products[x].RATABLERESOURCENAME, + mainname = productsname, + ratableAmount = products[x].RATABLEAMOUNT, + balanceAmount = products[x].BALANCEAMOUNT, + usageAmount = products[x].USAGEAMOUNT; + if(unitType !== "KB") { + usageAmount += unitType, + ratableAmount += unitType , + balanceAmount += unitType + } else if (unitType == "KB") { + usageAmount = formatFlow(usageAmount), + ratableAmount = formatFlow(ratableAmount), + balanceAmount = formatFlow(balanceAmount); + ratableName = ratableName?ratableName:productsname; + } + $.desc += " "+ratableName +":"+(balanceAmount?"总计:"+ratableAmount+" 使用:"+usageAmount+" 剩余:"+balanceAmount+"\n":""); + } + } + $.log("\n"+$.desc) + } + } catch(e) { + $.log("查询套餐信息错误"+ $.log(JSON.stringify(result,null,2))) + } finally { + resolve() + } + }) + }) +} + +function queryBill() { + return new Promise((resolve) =>{ + $.post(config('detailBillQueryNew', 'BILLCYCLE=' + queryTime), (error, resp, data) =>{ + let result = JSON.parse(data); + $.log("账单明细:") + $.desc += "账单明细:\n" + try { + billDate = result.BILLINGCYCLE, + userName = result.customerName, + cashTotal = result.TOTAL / 100, + discount = result.CHARGEFREEDISCOUNT / 100, + mustPay = result.CHARGECORPUSDISCOUNT / 100; + for (lists of result.RESULTDATASET) { + billName = lists.CHARGETYPENAME, + billCharge = lists.CHARGE / 100; + $.desc += " "+billName + " 费用 " + billCharge + "元\n" + $.log(" "+billName + " 费用 " + billCharge + "元") + } + } catch(e) { + $.log("获取账单明细失败" + $.log(JSON.stringify(result, null, 2))) + } finally { + resolve() + } + }) + }) +} + +function queryBalance() { + return new Promise((resolve) =>{ + $.post(config('queryPhoneBalance'), (error, resp, data) =>{ + let result = JSON.parse(data); + try { + addressCity = result.CITYNAME, + teleNO = result.PRODUCTNO, + teleNO = teleNO.substr(0,3)+"****"+teleNO.substr(7) + balance = result.TELEBALANCE / 100, + userBalance = result.USAGEAMOUNT, + payAmount = result.payAmount / 100, + comBalance = result.COMBALANCE / 100; + if (balance < cash) { + $.msg($.name, "您的号码: " + teleNO + " 余额为" + balance + "元", "余额小于" + cash + "元,请您及时充值") + } + $.sub = "归属地:"+addressCity+" 号码:"+teleNO+" 余额:"+balance+"元" + } catch(e) { + $.log("获取手机余额失败" + $.log(JSON.stringify(result, null, 2))) + } finally { + resolve() + } + }) + }) +} + +function formatFlow(number) { + if (number/1024 < 1024) { + return (number/1024).toFixed(2) + "MB" + } + return (number/1024/1024).toFixed(2) + "GB" +} + + +function Env(name,opts){class Http{constructor(env){this.env=env};send(opts,method='GET'){opts=typeof opts==='string'?{url:opts}:opts;let sender=this.get;if(method==='POST'){sender=this.post};return new Promise((resolve,reject)=>{sender.call(this,opts,(err,resp,body)=>{if(err)reject(err);else resolve(resp)})})};get(opts){return this.send.call(this.env,opts)};post(opts){return this.send.call(this.env,opts,'POST')}};return new(class{constructor(name,opts){this.name=name,this.http=new Http(this),this.data=null,this.dataFile='box.dat',this.logs=[],this.isMute=false,this.isNeedRewrite=false,this.logSeparator='\n';this.startTime=new Date().getTime();Object.assign(this,opts);this.log('',`🔔${this.name}, 开始!`)};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(str,defaultValue=null){try{return JSON.parse(str)}catch{return defaultValue}};toStr(obj,defaultValue=null){try{return JSON.stringify(obj)}catch{return defaultValue}};getjson(key,defaultValue){let json=defaultValue;const val=this.getdata(key);if(val){try{json=JSON.parse(this.getdata(key))}catch{}};return json};setjson(val,key){try{return this.setdata(JSON.stringify(val),key)}catch{return false}}; getScript(url){return new Promise((resolve)=>{this.get({url},(err,resp,body)=>resolve(body))})};runScript(script,runOpts){return new Promise((resolve)=>{let httpapi=this.getdata('@chavy_boxjs_userCfgs.httpapi');httpapi=httpapi?httpapi.replace(/\n/g,'').trim():httpapi;let httpapi_timeout=this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout');httpapi_timeout=httpapi_timeout?httpapi_timeout*1:20;httpapi_timeout=runOpts&&runOpts.timeout?runOpts.timeout:httpapi_timeout;const[key,addr]=httpapi.split('@');const opts={url:`http://${addr}/v1/scripting/evaluate`,body:{script_text:script,mock_type:'cron',timeout:httpapi_timeout},headers:{'X-Key':key,'Accept':'*/*'}};this.post(opts,(err,resp,body)=>resolve(body))}).catch((e)=>this.logErr(e))};loaddata(){if(this.isNode()){this.fs=this.fs?this.fs:require('fs');this.path=this.path?this.path:require('path');const curDirDataFilePath=this.path.resolve(this.dataFile);const rootDirDataFilePath=this.path.resolve(process.cwd(),this.dataFile);const isCurDirDataFile=this.fs.existsSync(curDirDataFilePath);const isRootDirDataFile=!isCurDirDataFile&&this.fs.existsSync(rootDirDataFilePath);if(isCurDirDataFile||isRootDirDataFile){const datPath=isCurDirDataFile?curDirDataFilePath:rootDirDataFilePath;try{return JSON.parse(this.fs.readFileSync(datPath))}catch(e){return{}}}else return{}}else return{}};writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require('fs');this.path=this.path?this.path:require('path');const curDirDataFilePath=this.path.resolve(this.dataFile);const rootDirDataFilePath=this.path.resolve(process.cwd(),this.dataFile);const isCurDirDataFile=this.fs.existsSync(curDirDataFilePath);const isRootDirDataFile=!isCurDirDataFile&&this.fs.existsSync(rootDirDataFilePath);const jsondata=JSON.stringify(this.data);if(isCurDirDataFile){this.fs.writeFileSync(curDirDataFilePath,jsondata)}else if(isRootDirDataFile){this.fs.writeFileSync(rootDirDataFilePath,jsondata)}else{this.fs.writeFileSync(curDirDataFilePath,jsondata)}}};lodash_get(source,path,defaultValue=undefined){const paths=path.replace(/\[(\d+)\]/g,'.$1').split('.');let result=source;for(const p of paths){result=Object(result)[p];if(result===undefined){return defaultValue}};return result};lodash_set(obj,path,value){if(Object(obj)!==obj)return obj;if(!Array.isArray(path))path=path.toString().match(/[^.[\]]+/g)||[];path.slice(0,-1).reduce((a,c,i)=>(Object(a[c])===a[c]?a[c]:(a[c]=Math.abs(path[i+1])>>0===+path[i+1]?[]:{})),obj)[path[path.length-1]]=value;return obj};getdata(key){let val=this.getval(key);if(/^@/.test(key)){const[,objkey,paths]=/^@(.*?)\.(.*?)$/.exec(key);const objval=objkey?this.getval(objkey):'';if(objval){try{const objedval=JSON.parse(objval);val=objedval?this.lodash_get(objedval,paths,''):val}catch(e){val=''}}};return val};setdata(val,key){let issuc=false;if(/^@/.test(key)){const[,objkey,paths]=/^@(.*?)\.(.*?)$/.exec(key);const objdat=this.getval(objkey);const objval=objkey?(objdat==='null'?null:objdat||'{}'):'{}';try{const objedval=JSON.parse(objval);this.lodash_set(objedval,paths,val);issuc=this.setval(JSON.stringify(objedval),objkey)}catch(e){const objedval={};this.lodash_set(objedval,paths,val);issuc=this.setval(JSON.stringify(objedval),objkey)}}else{issuc=this.setval(val,key)};return issuc};getval(key){if(this.isSurge()||this.isLoon()){return $persistentStore.read(key)}else if(this.isQuanX()){return $prefs.valueForKey(key)}else if(this.isNode()){this.data=this.loaddata();return this.data[key]}else{return(this.data&&this.data[key])||null}};setval(val,key){if(this.isSurge()||this.isLoon()){return $persistentStore.write(val,key)}else if(this.isQuanX()){return $prefs.setValueForKey(val,key)}else if(this.isNode()){this.data=this.loaddata(),this.data[key]=val,this.writedata();return true}else{return(this.data&&this.data[key])||null}};initGotEnv(opts){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();if(opts){opts.headers=opts.headers?opts.headers:{};if(undefined===opts.headers.Cookie&&undefined===opts.cookieJar){opts.cookieJar=this.ckjar}}}; get(opts,callback=()=>{}){if(opts.headers){delete opts.headers['Content-Type'];delete opts.headers['Content-Length']};if(this.isSurge()||this.isLoon()){if(this.isSurge()&&this.isNeedRewrite){opts.headers=opts.headers||{};Object.assign(opts.headers,{'X-Surge-Skip-Scripting':false})};$httpClient.get(opts,(err,resp,body)=>{if(!err&&resp){resp.body=body,resp.statusCode=resp.status};callback(err,resp,body)})}else if(this.isQuanX()){if(this.isNeedRewrite){opts.opts=opts.opts||{};Object.assign(opts.opts,{hints:false})};$task.fetch(opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>callback(err))}else if(this.isNode()){this.initGotEnv(opts);this.got(opts).on('redirect',(resp,nextOpts)=>{try{if(resp.headers['set-cookie']){const ck=resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString();if(ck){this.ckjar.setCookieSync(ck,null)};nextOpts.cookieJar=this.ckjar}}catch(e){this.logErr(e)}}).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>{const{message:error,response:resp}=err;callback(error,resp,resp&&resp.body)})}};post(opts,callback=()=>{}){if(opts.body&&opts.headers&&!opts.headers['Content-Type']){opts.headers['Content-Type']='application/x-www-form-urlencoded'};if(opts.headers)delete opts.headers['Content-Length'];if(this.isSurge()||this.isLoon()){if(this.isSurge()&&this.isNeedRewrite){opts.headers=opts.headers||{};Object.assign(opts.headers,{'X-Surge-Skip-Scripting':false})};$httpClient.post(opts,(err,resp,body)=>{if(!err&&resp){resp.body=body,resp.statusCode=resp.status};callback(err,resp,body)})}else if(this.isQuanX()){opts.method='POST';if(this.isNeedRewrite){opts.opts=opts.opts||{};Object.assign(opts.opts,{hints:false})};$task.fetch(opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>callback(err))}else if(this.isNode()){this.initGotEnv(opts);const{url,..._opts}=opts;this.got.post(url,_opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>{const{message:error,response:resp}=err;callback(error,resp,resp&&resp.body)})}};time(fmt,ts=null){const date=ts?new Date(ts):new Date();var o={"M+":date.getMonth()+1,"d+":date.getDate(),"h":date.getHours()%12==0?12:date.getHours()/12<1?"上午"+date.getHours()%12:"下午"+date.getHours()%12,"H+":date.getHours(),"m+":date.getMinutes(),"s+":date.getSeconds(),"q+":Math.floor((date.getMonth()+3)/3),"S":date.getMilliseconds()};var week={"0":"\u65e5","1":"\u4e00","2":"\u4e8c","3":"\u4e09","4":"\u56db","5":"\u4e94","6":"\u516d"};if(/(y+)/.test(fmt)){fmt=fmt.replace(RegExp.$1,(date.getFullYear()+"").substr(4-RegExp.$1.length))};if(/(E+)/.test(fmt)){fmt=fmt.replace(RegExp.$1,((RegExp.$1.length>1)?(RegExp.$1.length>2?"\u661f\u671f":"\u5468"):"")+week[date.getDay()+""])};for(var k in o){if(new RegExp("("+k+")").test(fmt)){fmt=fmt.replace(RegExp.$1,(RegExp.$1.length==1)?(o[k]):(("00"+o[k]).substr((""+o[k]).length)))}};return fmt};msg(title=name,subt='',desc='',opts){const toEnvOpts=(rawopts)=>{if(!rawopts)return rawopts;if(typeof rawopts==='string'){if(this.isLoon())return rawopts;else if(this.isQuanX())return{'open-url':rawopts};else if(this.isSurge())return{url:rawopts};else return undefined}else if(typeof rawopts==='object'){if(this.isLoon()){let openUrl=rawopts.openUrl||rawopts.url||rawopts['open-url'];let mediaUrl=rawopts.mediaUrl||rawopts['media-url'];return{openUrl,mediaUrl}}else if(this.isQuanX()){let openUrl=rawopts['open-url']||rawopts.url||rawopts.openUrl;let mediaUrl=rawopts['media-url']||rawopts.mediaUrl;return{'open-url':openUrl,'media-url':mediaUrl}}else if(this.isSurge()){let openUrl=rawopts.url||rawopts.openUrl||rawopts['open-url'];return{url:openUrl}}}else{return undefined}};if(!this.isMute){if(this.isSurge()||this.isLoon()){$notification.post(title,subt,desc,toEnvOpts(opts))}else if(this.isQuanX()){$notify(title,subt,desc,toEnvOpts(opts))}};if(!this.isMuteLog){let logs=['','==============📣\u7CFB\u7EDF\u901A\u77E5📣=============='];logs.push(title);subt?logs.push(subt):'';desc?logs.push(desc):'';console.log(logs.join('\n'));this.logs=this.logs.concat(logs)}};log(...logs){if(logs.length>0){this.logs=[...this.logs,...logs]};console.log(logs.join(this.logSeparator))};logErr(err,msg){const isPrintSack=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();if(!isPrintSack){this.log('',`❗️${this.name}, \u9519\u8BEF!`,err)}else{this.log('',`❗️${this.name}, \u9519\u8BEF!`,err.stack)}};wait(time){return new Promise((resolve)=>setTimeout(resolve,time))};done(val={}){const endTime=new Date().getTime();const costTime=(endTime-this.startTime)/1000;this.log('',`🔔${this.name}, \u7ED3\u675F! 🕛 ${costTime} \u79D2`);this.log();if(this.isSurge()||this.isQuanX()||this.isLoon()){$done(val)}}})(name,opts)} From d94fe172360969dfe7d0b037125fd6b2c3e7e717 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 20 Feb 2021 20:37:54 +0800 Subject: [PATCH 689/721] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BF=BC=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/sunert.boxjs.json | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 4de0f9adc9..1ea75f41d4 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -220,11 +220,41 @@ "desc" : "填入账单月份,可查最近六个月,本月账单下月可查" } ], - "name" : "电信套餐查询", + "name" : "天翼电信套餐查询", "icons" : [ "https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/telecominfinty.png" ] + }, + { + "author" : "@sunert", + "keys" : [ + "bestpay_tele" + ], + "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/bestPay.js", + "id" : "bestpay", + "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/bestPay.js", + "settings" : [ + { + "id" : "bestpay_bill", + "val" : "202008", + "name" : "查询月份", + "type" : "month", + "desc" : "账单查询时间" + }, + { + "id" : "tele_balance", + "val" : "10", + "name" : "余额报警", + "type" : "number", + "desc" : "余额低于设置值时显示余额通知,设置0为不警示" + } + ], + "name" : "翼支付电信套餐查询", + "icons" : [ + "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/bestPay_mini.png", + "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/bestPay.png" + ] }, { "author" : "@sunert", @@ -454,8 +484,8 @@ ], "name" : "百度极速任务", "icons" : [ - "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/baiduspeed_mini.png", - "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/baiduspeed.png" + "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/baiduspeed_mini.png", + "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/baiduspeed.png" ] }, { From 52a7e16cfdcdce0060dfc95e57e2a8a9cb14b73c Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 20 Feb 2021 20:51:11 +0800 Subject: [PATCH 690/721] --- Task/bestPay.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Task/bestPay.js b/Task/bestPay.js index bc7f58ad77..c357f14be9 100644 --- a/Task/bestPay.js +++ b/Task/bestPay.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-20 20:00 +更新时间: 2021-02-20 20:50 https:\/\/czapp\.bestpay\.com\.cn\/payassistant-client\?method=queryPhoneBalance url script-request-body bestPay.js hostname = czapp.bestpay.com.cn 翼支付打开权益专区,点击套餐详情,重进翼支付App时需重新获取请求,即重写配置不必禁用 @@ -7,7 +7,7 @@ hostname = czapp.bestpay.com.cn */ const $ = new Env('翼支付电信套餐'); const bodyVal = $.getdata('bestpay_tele'); -const queryTime = $.getdata('bestpay_bill')||parseInt($.time("yyyyMM")-1); +const queryTime = $.getdata('bestpay_bill').replace("-","")||parseInt($.time("yyyyMM")-1); const cash = $.getdata('tele_balance')||"10"; let isGetCookie = typeof $request !== 'undefined' @@ -116,8 +116,8 @@ function queryBill() { return new Promise((resolve) =>{ $.post(config('detailBillQueryNew', 'BILLCYCLE=' + queryTime), (error, resp, data) =>{ let result = JSON.parse(data); - $.log("账单明细:") - $.desc += "账单明细:\n" + $.log(queryTime+"期账单明细:") + $.desc += queryTime+"期账单明细:\n" try { billDate = result.BILLINGCYCLE, userName = result.customerName, From c072b6668e05213fa3989afc846e471fafb664e0 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 20 Feb 2021 22:14:34 +0800 Subject: [PATCH 691/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index c3bb83a362..a4123a986e 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -205,7 +205,7 @@ function TaskCenter() { function getAction(acttype) { return new Promise((resolve, reject) =>{ - $.get(kdHost(`WebApi/NewTaskIos/sendTwentyScore?action=${acttype}`), (error, resp, data) =>{ + $.get(kdHost('WebApi/NewTaskIos/sendTwentyScore?action='+acttype), (error, resp, data) =>{ let actres = JSON.parse(data); if (actres.status == 1) { $.log("获得青豆" + actres.score) @@ -228,7 +228,7 @@ function getsign() { } else if (signres.status == 1) { detail = `【签到结果】成功 🎉 青豆: +${signres.score},明日青豆: +${signres.nextScore}\n`; await comApp(); - await Census() + // await Census() } resolve() }) @@ -279,6 +279,7 @@ function userInfo() { totalscore = signinfo.data.user.score subTitle = `【收益总计】${totalscore}青豆 现金约${cash}元`; nick = `账号: ${signinfo.data.user.nickname}`; + await Census(); if(cookieArr.length ==1){ $.setdata(nick,"zq_nick") } else { @@ -427,14 +428,7 @@ function SevCont() { } function Census() { return new Promise((resolve, reject) =>{ - let url= { - url:"https://kd.youth.cn/user/inviteCensus2?jsonpcallback=jQuery20308548318424756004_1613745418308&uid=46308484&_="+Date.now(), - headers:{ - 'Cookie':cookie, - 'Referer': 'https://kandian.youth.cn/user/mmsq/ee9d523f55d7f1e985384c5c4c22228f?uid=46308484&reward_sign=5REAvA90VGotgq4exRtrCoiDgQGGv9zp&avatar=http://res.youth.cn/avatar_202004_28_28o_5ea8469f50c0746308484h.jpg&is_new=0&title_mark=1' - } - } - $.post(url, async(error, resp, data) =>{ + $.post(kdHost('u/wyRAM'),(error, resp, data) =>{ //$.log(resp) resolve() }) From 7c9a314326444583f0eef1e5eaf8d3819e05b6df Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 20 Feb 2021 22:34:34 +0800 Subject: [PATCH 692/721] --- Task/youth.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index a4123a986e..72b6bc9b13 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-17 22:50 +更新时间: 2021-02-20 22:50 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行, @@ -178,8 +178,8 @@ function TaskCenter() { else if (dailys.id == "7" && dailys.status == "0") { await readTime(); } - else if (dailys.id == "4" && dailys.status == "0") { - await getArt(); + else if (dailys.title == "新春额外赚" && dailys.status == "0") { + await Census(); } else if (dailys.id == "10" && dailys.status == "0") { $.log(dailys.title + "未完成,去做任务"); @@ -228,7 +228,6 @@ function getsign() { } else if (signres.status == 1) { detail = `【签到结果】成功 🎉 青豆: +${signres.score},明日青豆: +${signres.nextScore}\n`; await comApp(); - // await Census() } resolve() }) @@ -279,7 +278,6 @@ function userInfo() { totalscore = signinfo.data.user.score subTitle = `【收益总计】${totalscore}青豆 现金约${cash}元`; nick = `账号: ${signinfo.data.user.nickname}`; - await Census(); if(cookieArr.length ==1){ $.setdata(nick,"zq_nick") } else { @@ -444,6 +442,7 @@ function openbox() { boxretime = boxres.data.time; detail += `【时段宝箱】 +${boxres.data.score}青豆,${boxres.data.time / 60}分钟后再次奖励\n`; await boxshare(); + await getArt() } else { //detail += `【时段宝箱】${boxres.msg}\n`; $.log(`时段宝箱: ${boxres.msg}`) From 3a6cf880da45cce4d2e825ddb02815ada971d136 Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 20 Feb 2021 22:45:42 +0800 Subject: [PATCH 693/721] --- Task/youth.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 72b6bc9b13..5221420d49 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -426,13 +426,26 @@ function SevCont() { } function Census() { return new Promise((resolve, reject) =>{ - $.post(kdHost('u/wyRAM'),(error, resp, data) =>{ - //$.log(resp) + $.post(kdHost('u/wyRAM'),async(error, resp, data) =>{ + await $.wait(500); + await int(); resolve() }) }) } +function int() { + return new Promise((resolve, reject) =>{ + let url = { + url:"https://kandian.youth.cn/user/mmsq?uid=46308484", + headers:kdHost().headers + } + $.post(url),(error, resp, data) =>{ + //$.log(resp) + resolve() + }) + }) +} //开启时段宝箱 function openbox() { return new Promise((resolve, reject) =>{ From f6c98dae81a242b03d035d74b85daf90f509fc7b Mon Sep 17 00:00:00 2001 From: Best Date: Sat, 20 Feb 2021 23:07:57 +0800 Subject: [PATCH 694/721] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=85=BE=E8=AE=AF=E6=96=B0=E9=97=BB=E6=B4=BB=E5=8A=A8id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/sunert.boxjs.json | 3 ++- Task/txnews.js | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 1ea75f41d4..8b788ff250 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -493,7 +493,8 @@ "keys" : [ "sy_signurl_txnews", "sy_cookie_txnews", - "video_txnews" + "video_txnews", + "txnews_id" ], "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", "id" : "txnews", diff --git a/Task/txnews.js b/Task/txnews.js index 9047248ac3..473206910e 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -163,6 +163,9 @@ function activity() { //$.log(JSON.stringify(taskres,null,2)) if (taskres.ret == 0) { actid = taskres.data.award_notice.activity_id; + if(!actid){ + actid = $.getdata('txnews_id') + } $.log(`\n您的活动ID为: ` + actid + "\n\n********* 开始阅读任务 ********\n"); $.desc = "" for (tasks of taskres.data.list) { @@ -211,8 +214,7 @@ function toRead(urlVal, body) { url: urlVal, headers: Host().headers, body: body - }, - (error, resp, data) =>{ + },(error, resp, data) =>{ try { let obj = JSON.parse(data) //$.log(JSON.stringify(obj,null,2)) From ba1175896d0798fac8163d26173ecc6a146427ac Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 21 Feb 2021 00:23:26 +0800 Subject: [PATCH 695/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 5221420d49..cf71644624 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -440,7 +440,7 @@ function int() { url:"https://kandian.youth.cn/user/mmsq?uid=46308484", headers:kdHost().headers } - $.post(url),(error, resp, data) =>{ + $.post(url,(error, resp, data) =>{ //$.log(resp) resolve() }) From d2ef50c8712160db157f83b9233882b3f786bd66 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 21 Feb 2021 01:20:36 +0800 Subject: [PATCH 696/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/Youth_Read.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js index 484c23d966..2b5b023c04 100644 --- a/Task/Youth_Read.js +++ b/Task/Youth_Read.js @@ -91,10 +91,10 @@ function AutoRead() { if(data.indexOf("ctype")>-1){ if(readres.items.ctype==0){ artsnum += 1 - readscore += readres.items.read_score; + readscore += parseInt(readres.items.read_score); } else if(readres.items.ctype==3){ videosnum += 1 - videoscore += readres.items.read_score; + videoscore += parseInt(readres.items.read_score); } } if ($.index % 2 == 0) { From d4b6ec7610645cb822861397ebbd4696eb83c9b8 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 21 Feb 2021 10:24:27 +0800 Subject: [PATCH 697/721] --- Task/kuaishou.js | 162 ++++++++++++++++++++++------------------- Task/sunert.boxjs.json | 26 +++++++ 2 files changed, 113 insertions(+), 75 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index a3149187d3..7e28771407 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-19 16:50 +更新时间: 2021-02-21 10:15 赞赏:快手邀请码`774010415`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于快手双版本签到,仅支持正式版获取多Cookie,建议使用正式版获取Cookie,点击视频页悬浮红包,或者进入设置,点击"积分兑好礼"即可 @@ -8,7 +8,9 @@ const $ = new Env('快手视频') let cookieArr = []; -let ks_tokens = $.getdata('cookie_ks') +let ks_tokens = $.getdata('cookie_ks'); +const nebulaCash = $.getdata('cash_nebulaks')||"10"; +const cashType = $.getdata('tpcash_nebula')||"ALIPAY"; let isGetCookie = typeof $request !== 'undefined' if (isGetCookie) { @@ -48,14 +50,12 @@ if (!$.isNode() && ks_tokens.indexOf('&') == -1) { cookieVal = cookieArr[i]; $.index = i + 1; console.log(`\n------------------------\n\n开始【快手视频账号${$.index}】\n`) - await speedSign(); - await speedSigninfo(); - await speedInfo(); + await nebulaInfo(); + await nebulaPopup(); await formalCenter(); await formalSign(); if(offici_code !== 100119){ await formalinfo(); - await formalAct(); } await showmsg() } @@ -82,12 +82,13 @@ function formalCenter() { return new Promise((resolve, reject) =>{ $.post(formalHost('lowActive/module/list', '{"bizId":29,"configId":1}'), async(error, resp, data) =>{ let central = JSON.parse(data); +$.log("\n--------------------------------------------------------------------------------\n\n现在开始正式版任务") try { if (central.result == 1) { for (lists of central.modules) { Id = lists.moduleId, moduleDesc = lists.moduleDesc; - $.log(moduleDesc + "\n"); + $.log("\n"+moduleDesc); for (tasks of lists.tasks) { //$.log(JSON.stringify(tasks,null,2)); status = tasks.status, @@ -97,9 +98,9 @@ function formalCenter() { schemeText = tasks.schemeText taskName = tasks.reward.rewardName; if (status == 5) { - $.log(taskName + " " + tasks.schemeText + "\n") + $.log(taskName + " " + tasks.schemeText) } else if (status == 2) { - $.log(taskName + schemeText + "\n"); + $.log(taskName + schemeText); if (Id == "1123") { await formalSign(); break @@ -112,14 +113,14 @@ function formalCenter() { if(status == 4){ await openbox(tasktoken, eventId) } else if(status == 1){ - $.log(tasks.reward.rewardName+",时间未达到\n") + $.log(tasks.reward.rewardName+",时间未达到") } } } } } } catch(e) { - $.log("领取金币失败\n" + JSON.stringify(result, null, 2)) + $.log("领取金币失败\n" + e + JSON.stringify(result, null, 2)) } finally { resolve() } @@ -161,7 +162,7 @@ function formalSign() { return } else if(offici_code == 100136){ offic_sign = `签到结果: ${formalSign_res.error_msg}`; - $.log(""+formalSign_res.error_msg) + $.log(""+formalSign_res.error_msg) } else if(offici_code == 1){ offic_sign = `签到结果: ✅ +${formalSign_res.reward.rewardCount} 积分` } @@ -205,41 +206,20 @@ function formalinfo() { }, } $.get(infourl, async(error, resp, data) =>{ - // $.log(`${$.name}, data: ${data}`) + let _info = JSON.parse(data); if (_info.result == 1) { - offic_info = `积分: ${_info.data.accounts[0].displayBalance}积分 现金: ${_info.data.accounts[1].displayBalance}元\n` + offic_info = `积分: ${_info.data.accounts[0].displayBalance}积分 现金: ${_info.data.accounts[1].displayBalance}元` } resolve() }) }) } -function formalAct() { - return new Promise((resolve, reject) => { - let reurl = {url:'https://sf2021.kuaishou.com/rest/wd/sf2021/retain/dailyRedpack/receiveDailyRedPacket', - headers: {Cookie: cookieVal,'Content-Type': 'application/json;charset=utf-8'}, - body: '{"bizId": 29}' - } - $.post(reurl, (error, response, data) =>{ - let result = JSON.parse(data) - if (result.message == "success") { - var rewards = result.data.amount/100 - offic_reward = `获得现金红包: 💵${rewards}积分\n` - } else { - $.log("温暖好运年签到红包,"+ result.message) - } - resolve() - }) - }) -} -function speedSign() { +function nebulaSign() { return new Promise((resolve, reject) => { - let signurl = { - url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/sign', - headers: {Cookie: cookieVal}} - $.get(signurl, (error, response, data) => { - let speed_res = JSON.parse(data) + $.get(nebulaHost('sign/sign'), async(error, response, data) => { + let speed_res = JSON.parse(data); speed_code = speed_res.result if(speed_code == 10007){ speed_sign = `签到结果: ${speed_res.error_msg}`; @@ -250,20 +230,20 @@ function speedSign() { speed_sign = `签到结果: ${speed_res.error_msg}` } else if(speed_code == 1){ speed_sign = `签到结果: ${speed_res.data.toast}` + if(parseInt(nebulacash) > nebulaCash){ + await nebulaWithdraw() + } } + $.log(speed_sign) resolve() }) }) } -function speedSigninfo() { + +function nebulaPopup() { return new Promise((resolve, reject) => { - earnurl = { - url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/query', - headers: {Cookie: cookieVal, -'Content-Type': 'application/json;charset=utf-8'}, -} - $.get(earnurl, (error, response, data) => { - let result = JSON.parse(data) + $.get(nebulaHost('sign/query'), (error, resp, data) => { + let result = JSON.parse(data); if (result.result == '1'){ speed_info = `${result.data.nebulaSignInPopup.subTitle}, ${result.data.nebulaSignInPopup.title}\n` } @@ -271,46 +251,76 @@ function speedSigninfo() { }) }) } -function speedInfo() { +function nebulaInfo() { return new Promise((resolve, reject) => { - let reurl = {url:'https://nebula.kuaishou.com/rest/n/nebula/activity/earn/overview', - headers: {Cookie: cookieVal, -'Content-Type': 'application/json;charset=utf-8'},} - $.get(reurl, async(error, response, data) =>{ - let result = JSON.parse(data) + $.get(nebulaHost('activity/earn/overview'), async(error, response, data) =>{ + let result = JSON.parse(data); if (result.result == 1) { - speed_rewards = '积分: '+result.data.totalCoin+'积分 现金: '+result.data.allCash+'元'; - await bdinvet(); - await vetInfo() + nebulacash = result.data.allCash, + nickname = result.data.userData.nickname; + $.log("************ 昵称: "+nickname+" **********\n\n开始极速版任务\n"); + speed_rewards = '积分: '+result.data.totalCoin+'积分 现金: '+nebulacash+'元'; + for(nebulaTask of result.data.dailyTasks){ + taskName = nebulaTask.name + taskid = nebulaTask.id + $.log("去"+taskName) + if( nebulaTask.status!==1){ + } else { + if( taskid == 5){ +if(nebulaTask.extParam.todayIsSigned==false){ + await nebulaSign() + } else { + speed_sign = nebulaTask.desc + } + } else if(taskid == 3){ + await bdinvet(); + } + $.log(nebulaTask.desc+"\n"); + + } + } } resolve() }) }) } -function vetInfo() { +function nebulaWithdraw() { return new Promise((resolve, reject) => { - let reurl = {url:'https://sf2021.kuaishou.com/rest/wd/sf2021/retain/assistance/friendAssist', - headers: {Cookie: cookieVal, -'Content-Type': 'application/json;charset=utf-8'},body:'{"fid": "1928978411","shareObjectId":"5xjgr7a6ppa7ana"}'} - $.post(reurl, async(error, response, data) =>{ - //$.log(`${$.name}, data: ${data}`) + $.post(nebulaHost('outside/withdraw/apply',`{"channel":"${cashType}","amount":${nebulacash}}`), (error, resp, data) =>{ + let result = JSON.parse(data); + if (result.result == 1) { + $.msg($.name,"极速版提现成功,提现") + } + else { + $.log(result.error_msg) + } resolve() }) }) } +function nebulaHost(api,body){ + return { + url: 'https://nebula.kuaishou.com/rest/n/nebula/'+api, + headers:{ + 'Host': 'nebula.kuaishou.com', + 'Cookie': cookieVal, + 'Content-Type': 'application/json;charset=utf-8', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Mobile/15E148 Safari/604.1' + }, + body: body + } +} function showmsg() { $.sub ="", $.desc = ""; -if(offici_code==1||offici_code ==100136 ){ - $.desc += `【正式版】:\n `+offic_info+" "+offic_sign +'\n' - } -if(speed_code==1||speed_code ==10901 ){ - $.desc += `【极速版】:\n `+speed_rewards+"\n "+speed_info+" " +speed_sign - } -$.msg($.name,$.sub,$.desc) + $.desc += `【正式版】:\n `+offic_info+" "+offic_sign +'\n' + + $.desc += `【极速版】:\n `+speed_rewards+"\n "+speed_info + +$.msg($.name+" 昵称:"+nickname,$.sub,$.desc) } function GetCookie() { @@ -339,13 +349,15 @@ function GetCookie() { } } } -function bdinvet() { - let bdurl = { - url: `https://nbic3g9vs.get666bjxi3t687tp8c.com/nebula/ares/preBindCode?cc=share_copylink&fid=953324934&shareMode=app&code=774010415&shareMethod=card&kpn=NEBULA&subBiz=INVITE_CODE&shareToken=YVthN8M1_AO&shareObjectId=774010415`, - headers: {Cookie:cookieVal}, - } - $.get(bdurl, (error, resp, data) => { - //$.log(data) + +function bdinvet(){ + const bdurl = { + url: 'http://apissl.gifshow.com/rest/nebula/inviteCode/bind?c=a&apptype=2&did=D4B25234-725E-4D81-92B1-74DB50DA409E&kpn=NEBULA&keyconfig_state=1&deviceBit=0&sw=1242&kpf=IPHONE&sourceType=9&sys=ios13.7&sh=2208&kcv=1312&browseType=3&net=%E4%B8%AD%E5%9B%BD%E7%94%B5%E4%BF%A1_5&darkMode=false&inviteCode=774010415&ver=9.0&sync=1&isp=CTCC&mod=iPhone8%2C2&ud=953324934&cold_launch_time_ms=1613871841353&vague=0&egid=DFP942522CAECD367BB4299B87A4D670C60F89C2D9ED85DE0DEEC1E63A2925D1&appver=9.0.50.594', + headers: nebulaHost().headers, + body: cookieVal + }; + $.post(bdurl, (error, resp, data) => { + // $.log(resp.statusCode) }) } 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)} diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 8b788ff250..82496f0ae9 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -176,6 +176,32 @@ "keys" : [ "cookie_ks" ], + "settings" : [ + { + "id" : "cash_nebulaks", + "val" : "30", + "name" : "极速版提现", + "type" : "number", + "desc" : "极速版提现金额,默认30" + }, + { + "id" : "cash_nebulaks", + "val" : "30", + "name" : "极速版提现", + "type" : "radios", + "items": [ + { + "key" : "ALIPAY", + "label" : "支付宝" + }, + { + "key" : "WECHAT", + "label" : "微信" + } + ] + "desc" : "极速版提现金额,默认30,前提是绑定支付方式" + }, + ], "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", "id" : "kuaishou", "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js", From 435275c35ecc9599ed1ee18dc405533fdf8f06e6 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 21 Feb 2021 10:28:05 +0800 Subject: [PATCH 698/721] --- Task/sunert.boxjs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 82496f0ae9..7dc009c601 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -198,7 +198,7 @@ "key" : "WECHAT", "label" : "微信" } - ] + ], "desc" : "极速版提现金额,默认30,前提是绑定支付方式" }, ], From 3bbf8b0508dd82a5862cea1c7ae85893b2842757 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 21 Feb 2021 10:31:31 +0800 Subject: [PATCH 699/721] --- Task/sunert.boxjs.json | 1110 ++++++++++++++++++++-------------------- 1 file changed, 552 insertions(+), 558 deletions(-) diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index 7dc009c601..ae2996716f 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -1,675 +1,669 @@ { - "id" : "sunert.app.sub", - "author" : "@Sunert", - "icon" : "https://avatars2.githubusercontent.com/u/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", - "name" : "Sunert 签到应用订阅", - "repo" : "https://github.com/Sunert/Scripts/tree/master", - "apps" : [ + "id": "sunert.app.sub", + "author": "@Sunert", + "icon": "https://avatars2.githubusercontent.com/u/47924389?s=460&u=5152f048a9e8aaa45102763a578172407c40fcc8&v=4", + "name": "Sunert 签到应用订阅", + "repo": "https://github.com/Sunert/Scripts/tree/master", + "apps": [ { - "author" : "@sunert", + "author": "@sunert", "descs_html": [ - "

获取Cookie以及脚本配置请查看配置说明

", - "
", - "

其中wb_nick为账号昵称,无需另外获取,脚本运行可自动生成,wb_cookie为任务红包余额,获取后方可显示,可选,sy_token_wb为微博签到token,必选

" - ], - "keys" : [ - "sy_token_wb", - "wb_cookie", + "

获取Cookie以及脚本配置请查看配置说明

", + "
", + "

其中wb_nick为账号昵称,无需另外获取,脚本运行可自动生成,wb_cookie为任务红包余额,获取后方可显示,可选,sy_token_wb为微博签到token,必选

" + ], + "keys": [ + "sy_token_wb", + "wb_cookie", "wb_nick" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", - "id" : "weibo", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js", - "name" : "新浪微博", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/weibo.js", + "id": "weibo", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js", + "name": "新浪微博", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/weibo.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/weibo.png" ] - }, + }, { - "author" : "@sunert", + "author": "@sunert", "descs_html": [ - "

获取Cookie以及脚本配置请查看配置说明

", - "
", - "

其中zq_nick、zqcash和zqcard为昵称、提现金额和早起打卡开关,无需另外获取,相关项设置后自动生成,cashurl_zq和cashbody_zq为提现请求,获取后方可自动提现,可选

" - ], - "keys" : [ - "zq_nick", - "youthheader_zq", - "read_zq", - "readtime_zq", - "cashurl_zq", - "cashbody_zq", - "zqcash", + "

获取Cookie以及脚本配置请查看配置说明

", + "
", + "

其中zq_nick、zqcash和zqcard为昵称、提现金额和早起打卡开关,无需另外获取,相关项设置后自动生成,cashurl_zq和cashbody_zq为提现请求,获取后方可自动提现,可选

" + ], + "keys": [ + "zq_nick", + "youthheader_zq", + "read_zq", + "readtime_zq", + "cashurl_zq", + "cashbody_zq", + "zqcash", "zqcard" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", - "id" : "youth", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js", - "settings" : [ - { - "id" : "zqcard", - "val" : "false", - "name" : "打卡赚钱", - "type" : "boolean", - "desc" : "每日打卡报名及早起打卡" - }, - { - "id" : "zqtime", - "val" : "05", - "name" : "打卡时间", - "type" : "number", - "desc" : "每日早起打卡时间" - }, - { - "id" : "delay_rotary_zq", - "val" : "10", - "name" : "转盘时间间隔", - "type" : "number", - "desc" : "间隔时间设置,如1秒填1即可" - }, - { - "id" : "notifytimes", - "val" : "", - "name" : "通知频率 (点击查看设置说明)", - "type" : "number", - "desc" : "设定通知频率,前三次为全部通知,之后转盘次数/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" - }, - { - "id" : "zqcash", - "val" : "30", - "name" : "提现金额", - "type" : "radios", - "desc" : "自动提现金额需和获取提现请求保持一致", - "items" : [ + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth.js", + "id": "youth", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js", + "settings": [ + { + "id": "zqcard", + "val": "false", + "name": "打卡赚钱", + "type": "boolean", + "desc": "每日打卡报名及早起打卡" + }, + { + "id": "zqtime", + "val": "05", + "name": "打卡时间", + "type": "number", + "desc": "每日早起打卡时间" + }, + { + "id": "delay_rotary_zq", + "val": "10", + "name": "转盘时间间隔", + "type": "number", + "desc": "间隔时间设置,如1秒填1即可" + }, + { + "id": "notifytimes", + "val": "", + "name": "通知频率 (点击查看设置说明)", + "type": "number", + "desc": "设定通知频率,前三次为全部通知,之后转盘次数/设定频率整除时通知,如设置0为无通知,设置1为全部通知,设置其他数可整除余0时通知,默认值50" + }, + { + "id": "zqcash", + "val": "30", + "name": "提现金额", + "type": "radios", + "desc": "自动提现金额需和获取提现请求保持一致", + "items": [ { - "key" : "10", - "label" : "10元" - }, + "key": "10", + "label": "10元" + }, { - "key" : "30", - "label" : "30元" - }, + "key": "30", + "label": "30元" + }, { - "key" : "100", - "label" : "100元" + "key": "100", + "label": "100元" } ] } - ], - "name" : "中青看点", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", + ], + "name": "中青看点", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/youth.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - "youth_start", + "author": "@sunert", + "keys": [ + "youth_start", "youth_end" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", - "id" : "youthGain", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js", - "name" : "中青浏览赚", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/youth_gain.js", + "id": "youthGain", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js", + "name": "中青浏览赚", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/youth.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - "youth_autoread", + "author": "@sunert", + "keys": [ + "youth_autoread", "autotime_zq" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/Youth_Read.js", - "id" : "youthRead", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js", - "name" : "中青自动阅读", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/Youth_Read.js", + "id": "youthRead", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js", + "name": "中青自动阅读", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/youth.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - "sy_signheader_dsj", + "author": "@sunert", + "keys": [ + "sy_signheader_dsj", "drawal_dsj" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", - "id" : "dianshijia", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js", - "settings" : [ + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/dianshijia.js", + "id": "dianshijia", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js", + "settings": [ { - "items" : [ + "items": [ { - "key" : "55", - "label" : "提现额度" - }, + "key": "55", + "label": "提现额度" + }, { - "key" : "44", - "label" : "1天VIP" - }, + "key": "44", + "label": "1天VIP" + }, { - "key" : "42", - "label" : "1888金币" + "key": "42", + "label": "1888金币" } - ], - "id" : "REWARD", - "val" : "55", - "name" : "额外签到奖励", - "type" : "radios", - "desc" : "" + ], + "id": "REWARD", + "val": "55", + "name": "额外签到奖励", + "type": "radios", + "desc": "" } - ], - "name" : "电视家", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", + ], + "name": "电视家", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/dianshijia.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ + "author": "@sunert", + "keys": [ "cookie_ks" - ], - "settings" : [ - { - "id" : "cash_nebulaks", - "val" : "30", - "name" : "极速版提现", - "type" : "number", - "desc" : "极速版提现金额,默认30" - }, - { - "id" : "cash_nebulaks", - "val" : "30", - "name" : "极速版提现", - "type" : "radios", + ], + "settings": [ + { + "id": "cash_nebulaks", + "val": "30", + "name": "极速版提现", + "type": "number", + "desc": "极速版提现金额,默认30" + }, + { + "id": "cash_nebulaks", + "val": "30", + "name": "极速版提现", + "type": "radios", "items": [ - { - "key" : "ALIPAY", - "label" : "支付宝" - }, - { - "key" : "WECHAT", - "label" : "微信" - } - ], - "desc" : "极速版提现金额,默认30,前提是绑定支付方式" - }, - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", - "id" : "kuaishou", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js", - "name" : "快手极速版", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", + { + "key": "ALIPAY", + "label": "支付宝" + }, + { + "key": "WECHAT", + "label": "微信" + } + ], + "desc": "极速版提现金额,默认30,前提是绑定支付方式" + } + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/kuaishou.js", + "id": "kuaishou", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js", + "name": "快手极速版", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/kuaishou.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/kuaishou.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - "sy_signurl_snews", - "sy_info_snews", - "sy_ck_snews", + "author": "@sunert", + "keys": [ + "sy_signurl_snews", + "sy_info_snews", + "sy_ck_snews", "sy_infoheader_snews" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", - "id" : "sinanews", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js", - "name" : "新浪新闻", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/sinanews.js", + "id": "sinanews", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js", + "name": "新浪新闻", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/sinanews.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - "china_telecom_authToken_10000", + "author": "@sunert", + "keys": [ + "china_telecom_authToken_10000", "china_telecom_cookie" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", - "id" : "chinatelecomEnquiry", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js", - "settings" : [ - { - "id" : "Mon", - "val" : "2020-08", - "name" : "查询月份", - "type" : "month", - "desc" : "填入账单月份,可查最近六个月,本月账单下月可查" + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/telecomInfinity.js", + "id": "chinatelecomEnquiry", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js", + "settings": [ + { + "id": "Mon", + "val": "2020-08", + "name": "查询月份", + "type": "month", + "desc": "填入账单月份,可查最近六个月,本月账单下月可查" } - ], - "name" : "天翼电信套餐查询", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", + ], + "name": "天翼电信套餐查询", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/telecominfinty.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/telecominfinty.png" ] - }, - { - "author" : "@sunert", - "keys" : [ + }, + { + "author": "@sunert", + "keys": [ "bestpay_tele" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/bestPay.js", - "id" : "bestpay", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/bestPay.js", - "settings" : [ - { - "id" : "bestpay_bill", - "val" : "202008", - "name" : "查询月份", - "type" : "month", - "desc" : "账单查询时间" - }, - { - "id" : "tele_balance", - "val" : "10", - "name" : "余额报警", - "type" : "number", - "desc" : "余额低于设置值时显示余额通知,设置0为不警示" + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/bestPay.js", + "id": "bestpay", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/bestPay.js", + "settings": [ + { + "id": "bestpay_bill", + "val": "202008", + "name": "查询月份", + "type": "month", + "desc": "账单查询时间" + }, + { + "id": "tele_balance", + "val": "10", + "name": "余额报警", + "type": "number", + "desc": "余额低于设置值时显示余额通知,设置0为不警示" } - ], - "name" : "翼支付电信套餐查询", - "icons" : [ - "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/bestPay_mini.png", + ], + "name": "翼支付电信套餐查询", + "icons": [ + "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/bestPay_mini.png", "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/bestPay.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ + "author": "@sunert", + "keys": [ "sy_cookie_dj" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/jddj.js", - "id" : "jddj", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js", - "name" : "京东到家", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jddj.js", + "id": "jddj", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js", + "name": "京东到家", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/jddj.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/jddj.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ + "author": "@sunert", + "keys": [ "c" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "id" : "TVlist", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js", - "settings" : [ - { - "id" : "c", - "val" : "cctv8", - "name" : "电视台", - "type" : "text", - "desc" : "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", + "id": "TVlist", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js", + "settings": [ + { + "id": "c", + "val": "cctv8", + "name": "电视台", + "type": "text", + "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" } - ], - "name" : "电视预告", - "icons" : [ - "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/tvpreview_mini.png", + ], + "name": "电视预告", + "icons": [ + "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/tvpreview_mini.png", "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/tvpreview.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - "city", - "citynum", - "cut", - "day_desc", - "hour_desc", + "author": "@sunert", + "keys": [ + "city", + "citynum", + "cut", + "day_desc", + "hour_desc", "index_desc" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", - "id" : "moji", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js", - "settings" : [ - { - "id" : "city", - "val" : "北京", - "name" : "城市", - "type" : "text", - "desc" : "请填写中文地区" - }, - { - "id" : "citynum", - "placeholder" : "默认1 (点击以展开说明)", - "val" : "", - "name" : "城市序号", - "type" : "number", - "desc" : "选择地区,请填写日志内冒号前的数字序号" - }, - { - "id" : "cut", - "val" : false, - "name" : "精简日志模式", - "type" : "boolean", - "desc" : "显示详情描述,默认关闭日志" - }, - { - "id" : "day_desc", - "val" : true, - "name" : "每周天气", - "type" : "boolean", - "desc" : "每周天气接口,可显示6天天气情况" - }, - { - "id" : "hour_desc", - "val" : false, - "name" : "小时天气", - "type" : "boolean", - "desc" : "未来6小时天气情况" - }, - { - "id" : "forty_desc", - "val" : false, - "name" : "40天预告", - "type" : "boolean", - "desc" : "未来40天天气预告" - }, - { - "id" : "index_desc", - "val" : true, - "name" : "生活指数", - "type" : "boolean", - "desc" : "可显示生活指数情况" + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/moji.js", + "id": "moji", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js", + "settings": [ + { + "id": "city", + "val": "北京", + "name": "城市", + "type": "text", + "desc": "请填写中文地区" + }, + { + "id": "citynum", + "placeholder": "默认1 (点击以展开说明)", + "val": "", + "name": "城市序号", + "type": "number", + "desc": "选择地区,请填写日志内冒号前的数字序号" + }, + { + "id": "cut", + "val": false, + "name": "精简日志模式", + "type": "boolean", + "desc": "显示详情描述,默认关闭日志" + }, + { + "id": "day_desc", + "val": true, + "name": "每周天气", + "type": "boolean", + "desc": "每周天气接口,可显示6天天气情况" + }, + { + "id": "hour_desc", + "val": false, + "name": "小时天气", + "type": "boolean", + "desc": "未来6小时天气情况" + }, + { + "id": "forty_desc", + "val": false, + "name": "40天预告", + "type": "boolean", + "desc": "未来40天天气预告" + }, + { + "id": "index_desc", + "val": true, + "name": "生活指数", + "type": "boolean", + "desc": "可显示生活指数情况" } - ], - "name" : "墨迹天气", - "icons" : [ - "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/moji_mini.png", + ], + "name": "墨迹天气", + "icons": [ + "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/moji_mini.png", "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/moji.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - "jukan_body", + "author": "@sunert", + "keys": [ + "jukan_body", "jukan_name" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", - "id" : "jukan", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js", - "settings" : [ - { - "id" : "jukan_out", - "val" : false, - "name" : "自动提现", - "type" : "boolean", - "desc" : "自动提现开关,请填入提现金额及微信绑定实名,默认关闭" - }, - { - "id" : "jukan_cash", - "val" : "", - "name" : "提现金额", - "type" : "radios", - "items" : [ + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/jukan.js", + "id": "jukan", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jukan.js", + "settings": [ + { + "id": "jukan_out", + "val": false, + "name": "自动提现", + "type": "boolean", + "desc": "自动提现开关,请填入提现金额及微信绑定实名,默认关闭" + }, + { + "id": "jukan_cash", + "val": "", + "name": "提现金额", + "type": "radios", + "items": [ { - "key" : "3", - "label" : "3元(邀请专享)" - }, + "key": "3", + "label": "3元(邀请专享)" + }, { - "key" : "10", - "label" : "10元(阅读/邀请)" - }, + "key": "10", + "label": "10元(阅读/邀请)" + }, { - "key" : "30", - "label" : "30元(无条件)" - }, + "key": "30", + "label": "30元(无条件)" + }, { - "key" : "50", - "label" : "50元(无条件)" - }, + "key": "50", + "label": "50元(无条件)" + }, { - "key" : "100", - "label" : "100元(无条件)" + "key": "100", + "label": "100元(无条件)" } ] - }, + }, { - "id" : "jukan_name", - "placeholder" : "填入微信真实姓名", - "val" : "", - "name" : "微信真实姓名", - "type" : "text" + "id": "jukan_name", + "placeholder": "填入微信真实姓名", + "val": "", + "name": "微信真实姓名", + "type": "text" } - ], - "name" : "聚看点", - "icons" : [ - "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/jukan_mini.png", + ], + "name": "聚看点", + "icons": [ + "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/jukan_mini.png", "https://github.com/Sunert/Profiles/raw/master/QuantumultX/Rules/Images/icon/jukan.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ + "author": "@sunert", + "keys": [ "sign_mydigit" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", - "id" : "mydigit", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js", - "name" : "数码之家", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/mydigit.js", + "id": "mydigit", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js", + "name": "数码之家", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/mydigit.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/mydigit.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - "baidu_nick", - "chavy_cookie_tieba", - "CookieTB", + "author": "@sunert", + "keys": [ + "baidu_nick", + "chavy_cookie_tieba", + "CookieTB", "cash_baidu" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/baiduspeed.js", - "id" : "baidu", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baiduspeed.js", - "settings" : [ + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/baiduspeed.js", + "id": "baidu", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/baiduspeed.js", + "settings": [ { - "items" : [ + "items": [ { - "key" : "5", - "label" : "5元" - }, + "key": "5", + "label": "5元" + }, { - "key" : "30", - "label" : "30元" - }, + "key": "30", + "label": "30元" + }, { - "key" : "50", - "label" : "50元" - }, + "key": "50", + "label": "50元" + }, { - "key" : "100", - "label" : "100元" + "key": "100", + "label": "100元" } - ], - "id" : "cash_baidu", - "val" : "30", - "name" : "提现金额", - "type" : "radios", - "desc" : "自动提现金额" - }, - { - "id" : "task_baidu", - "val" : true, - "name" : "任务开关", - "type" : "boolean", - "desc" : "除提现和兑换金币外开关,默认开启所有任务" + ], + "id": "cash_baidu", + "val": "30", + "name": "提现金额", + "type": "radios", + "desc": "自动提现金额" + }, + { + "id": "task_baidu", + "val": true, + "name": "任务开关", + "type": "boolean", + "desc": "除提现和兑换金币外开关,默认开启所有任务" } - ], - "name" : "百度极速任务", - "icons" : [ - "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/baiduspeed_mini.png", + ], + "name": "百度极速任务", + "icons": [ + "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/baiduspeed_mini.png", "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/baiduspeed.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - "sy_signurl_txnews", - "sy_cookie_txnews", - "video_txnews", + "author": "@sunert", + "keys": [ + "sy_signurl_txnews", + "sy_cookie_txnews", + "video_txnews", "txnews_id" - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", - "id" : "txnews", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js", - "settings" : [ - { - "id" : "notifynum", - "placeholder" : "默认50 (点击以展开说明)", - "val" : "", - "name" : "通知频率", - "type" : "number", - "desc" : "阅读篇数间隔通知开为1,常关为0(默认50篇)" - }, - { - "id" : "delay", - "placeholder" : "默认200 (点击以展开说明)", - "val" : "", - "name" : "延迟时间(毫秒)", - "type" : "number", - "desc" : "接口延迟时间" + ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/txnews.js", + "id": "txnews", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js", + "settings": [ + { + "id": "notifynum", + "placeholder": "默认50 (点击以展开说明)", + "val": "", + "name": "通知频率", + "type": "number", + "desc": "阅读篇数间隔通知开为1,常关为0(默认50篇)" + }, + { + "id": "delay", + "placeholder": "默认200 (点击以展开说明)", + "val": "", + "name": "延迟时间(毫秒)", + "type": "number", + "desc": "接口延迟时间" } - ], - "name" : "腾讯新闻", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", + ], + "name": "腾讯新闻", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/txnews.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "id" : "translate", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js", - "settings" : [ - { - "id" : "word", - "placeholder" : "Hello World", - "val" : "Hello World", - "name" : "原文", - "type" : "textarea", - "desc" : "兼容中英文短语翻译,填入原文后手动运行" + "author": "@sunert", + "keys": [ ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/tvpreview.js", + "id": "translate", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/translate.js", + "settings": [ + { + "id": "word", + "placeholder": "Hello World", + "val": "Hello World", + "name": "原文", + "type": "textarea", + "desc": "兼容中英文短语翻译,填入原文后手动运行" } - ], - "name" : "谷歌翻译", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", + ], + "name": "谷歌翻译", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/translate.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/translate.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", - "id" : "exchange rate", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js", - "settings" : [ - { - "id" : "froma", - "val" : "人民币", - "name" : "使用币", - "type" : "text", - "desc" : "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" - }, - { - "id" : "toex", - "val" : "港币", - "name" : "兑换币", - "type" : "text", - "desc" : "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" - }, - { - "id" : "numex", - "val" : "10", - "name" : "兑换金额", - "type" : "number", - "desc" : "填写数字" + "author": "@sunert", + "keys": [ ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/exchangeRate.js", + "id": "exchange rate", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js", + "settings": [ + { + "id": "froma", + "val": "人民币", + "name": "使用币", + "type": "text", + "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" + }, + { + "id": "toex", + "val": "港币", + "name": "兑换币", + "type": "text", + "desc": "填写中文币种,注意澳门元为澳门帕塔卡,香港元为港币,台湾为新台币" + }, + { + "id": "numex", + "val": "10", + "name": "兑换金额", + "type": "number", + "desc": "填写数字" } - ], - "name" : "汇率换算", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", + ], + "name": "汇率换算", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/exchangerate.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/exchangerate.png" ] - }, + }, { - "author" : "@sunert", - "keys" : [ - - ], - "repo" : "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", - "id" : "trainquery", - "script" : "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js", - "settings" : [ - { - "items" : [ + "author": "@sunert", + "keys": [ ], + "repo": "https://github.com/Sunert/Scripts/blob/master/Task/trainquery.js", + "id": "trainquery", + "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js", + "settings": [ + { + "items": [ { - "key" : "ADULT", - "label" : "成人" - }, + "key": "ADULT", + "label": "成人" + }, { - "key" : "0X00", - "label" : "学生" + "key": "0X00", + "label": "学生" } - ], - "id" : "people", - "val" : "ADULT", - "name" : "乘客类型", - "type" : "radios", - "desc" : "成人/学生" - }, - { - "id" : "left", - "val" : "北京", - "name" : "出发站点", - "type" : "text", - "desc" : "填入中文站点" - }, - { - "id" : "end", - "val" : "上海", - "name" : "目的地", - "type" : "text", - "desc" : "填入中文站点" - }, - { - "id" : "leavedate", - "val" : "2020-08-15", - "name" : "出发时间", - "type" : "date", - "desc" : "填入出发日期,请按照格式填写" - }, - { - "id" : "setrain", - "val" : "G5", - "name" : "列车车次", - "type" : "text", - "desc" : "填入列车车次或者列车序号,列车序号请查看日志详情" + ], + "id": "people", + "val": "ADULT", + "name": "乘客类型", + "type": "radios", + "desc": "成人/学生" + }, + { + "id": "left", + "val": "北京", + "name": "出发站点", + "type": "text", + "desc": "填入中文站点" + }, + { + "id": "end", + "val": "上海", + "name": "目的地", + "type": "text", + "desc": "填入中文站点" + }, + { + "id": "leavedate", + "val": "2020-08-15", + "name": "出发时间", + "type": "date", + "desc": "填入出发日期,请按照格式填写" + }, + { + "id": "setrain", + "val": "G5", + "name": "列车车次", + "type": "text", + "desc": "填入列车车次或者列车序号,列车序号请查看日志详情" } - ], - "name" : "列车时刻", - "icons" : [ - "https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", + ], + "name": "列车时刻", + "icons": [ + "https://raw.githubusercontent.com/Orz-3/mini/master/12306.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/12306.png" ] } ] -} +} \ No newline at end of file From 4b89ceaca74da298ca643e9e65e27075722581ad Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 21 Feb 2021 10:55:05 +0800 Subject: [PATCH 700/721] --- Task/kuaishou.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 7e28771407..518d9e1df0 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -82,7 +82,7 @@ function formalCenter() { return new Promise((resolve, reject) =>{ $.post(formalHost('lowActive/module/list', '{"bizId":29,"configId":1}'), async(error, resp, data) =>{ let central = JSON.parse(data); -$.log("\n--------------------------------------------------------------------------------\n\n现在开始正式版任务") +$.log("\n————————————————————\n\n现在开始正式版任务") try { if (central.result == 1) { for (lists of central.modules) { @@ -314,10 +314,7 @@ function nebulaHost(api,body){ } function showmsg() { - $.sub ="", $.desc = ""; - - $.desc += `【正式版】:\n `+offic_info+" "+offic_sign +'\n' - + $.desc = `【正式版】:\n `+offic_info+"\n "+offic_sign +'\n' $.desc += `【极速版】:\n `+speed_rewards+"\n "+speed_info $.msg($.name+" 昵称:"+nickname,$.sub,$.desc) From 09912fd45e225d7a5002d84794d4d8ec75035577 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 21 Feb 2021 13:09:25 +0800 Subject: [PATCH 701/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index cf71644624..8eb751afa7 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -426,7 +426,7 @@ function SevCont() { } function Census() { return new Promise((resolve, reject) =>{ - $.post(kdHost('u/wyRAM'),async(error, resp, data) =>{ + $.post(kdHost('u/w7a29'),async(error, resp, data) =>{ await $.wait(500); await int(); resolve() From b1cba1be5eb81158b796fad8023498d9dc0d0d4a Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 21 Feb 2021 20:01:45 +0800 Subject: [PATCH 702/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/weibo.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index 68a05bcc0d..59cb107e28 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -114,10 +114,11 @@ else if ($request && $request.method != 'OPTIONS' && $request.headers.Cookie.ind if (cookies.indexOf(cookieval) > -1) { $.log("此账号Cookie已存在,本次跳过") } else if (cookies.indexOf(cookieval) == -1) { - tokens = cookies + "#" + cookieval; - $.setdata(tokens, 'wb_cookie'); - $.log(`cookie: ${tokens}`); - $.msg($.name, `获取微博用户Cookie: 成功`, ``) + cookie = cookies + "#" + cookieval; + $.setdata(cookie, 'wb_cookie'); + Cookies = cookie.split('#') + $.log(`cookie: ${cookie}`); + $.msg($.name, '获取微博用户'+Cookies.length+'Cookie: 成功', ``) } } else { $.setdata(cookieval, 'wb_cookie'); From 3e7f7c3ee8d0db436e255b32663160d1f25eee07 Mon Sep 17 00:00:00 2001 From: Best Date: Sun, 21 Feb 2021 22:30:18 +0800 Subject: [PATCH 703/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/weibo.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index 59cb107e28..a07d2d5582 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-19 12:30 +更新时间: 2021-02-21 22:30 本脚本仅适用于微博每日签到,支持多账号运行 @@ -109,14 +109,14 @@ function GetCookie() { } } else if ($request && $request.method != 'OPTIONS' && $request.headers.Cookie.indexOf("SUB=") > -1) { - const cookieval = $request.headers.Cookie.match(/SUB=[\w\-]+/); + const cookieval = $request.headers.Cookie.match(/SUB=[\w\-]+/)[0]; if (cookies) { if (cookies.indexOf(cookieval) > -1) { $.log("此账号Cookie已存在,本次跳过") } else if (cookies.indexOf(cookieval) == -1) { cookie = cookies + "#" + cookieval; $.setdata(cookie, 'wb_cookie'); - Cookies = cookie.split('#') + Cookies = cookie.split('#'); $.log(`cookie: ${cookie}`); $.msg($.name, '获取微博用户'+Cookies.length+'Cookie: 成功', ``) } From d9fb60f59f4c919ef7a1f004c6f626f7dce71bab Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 22 Feb 2021 18:35:46 +0800 Subject: [PATCH 704/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/weibo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Task/weibo.js b/Task/weibo.js index a07d2d5582..6b11910c16 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -91,8 +91,8 @@ if ($.isNode()) { function GetCookie() { if ($request && $request.method != 'OPTIONS' && $request.url.indexOf("gsid=") > -1) { const signurlVal = $request.url; - let token = signurlVal.replace(/(.+)(from=\w+)(.+)(&uid=\d+)(.+)(&gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)/,'$2$4$6$8'), - uid = token.match(/uid=\d+/); + let token = signurlVal.replace(/(.+)(from=\w+)(.+)(&uid=\d+)(.+)(&gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)&?/,'$2$4$6$8'), + uid = token.match(/uid=\d+/)[0]; if (wbtoken) { if (wbtoken.indexOf(uid) > -1) { $.log("此账号Cookie已存在,本次跳过") From ee96fba52d22d1662c1b258e1486bb73f14954e9 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 22 Feb 2021 19:04:30 +0800 Subject: [PATCH 705/721] --- Task/weibo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/weibo.js b/Task/weibo.js index 6b11910c16..cefad3f11f 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -91,7 +91,7 @@ if ($.isNode()) { function GetCookie() { if ($request && $request.method != 'OPTIONS' && $request.url.indexOf("gsid=") > -1) { const signurlVal = $request.url; - let token = signurlVal.replace(/(.+)(from=\w+)(.+)(&uid=\d+)(.+)(&gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)&?/,'$2$4$6$8'), + let token = signurlVal.replace(/(.+)(from=\w+)(.+)(&uid=\d+)(.+)(&gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)(.+)/,'$2$4$6$8'), uid = token.match(/uid=\d+/)[0]; if (wbtoken) { if (wbtoken.indexOf(uid) > -1) { From cb2137230a0fca151fc3332607f72f0790e895de Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 22 Feb 2021 23:00:14 +0800 Subject: [PATCH 706/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 8eb751afa7..8c0babf1fa 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -437,7 +437,7 @@ function Census() { function int() { return new Promise((resolve, reject) =>{ let url = { - url:"https://kandian.youth.cn/user/mmsq?uid=46308484", + url:"https://focus.youth.cn/v/oHi6Z/share?", headers:kdHost().headers } $.post(url,(error, resp, data) =>{ From cb1dbe4606e581d55e51201763cd9cec98a70d48 Mon Sep 17 00:00:00 2001 From: Best Date: Mon, 22 Feb 2021 23:01:43 +0800 Subject: [PATCH 707/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 8c0babf1fa..17f8eeb930 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -426,7 +426,7 @@ function SevCont() { } function Census() { return new Promise((resolve, reject) =>{ - $.post(kdHost('u/w7a29'),async(error, resp, data) =>{ + $.post(kdHost('u/w4aFB'),async(error, resp, data) =>{ await $.wait(500); await int(); resolve() From cdf6032a77ca211f180f2acec75cef95a2674af5 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 01:09:24 +0800 Subject: [PATCH 708/721] --- Task/youth.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Task/youth.js b/Task/youth.js index 17f8eeb930..6eb1e5ffd6 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -97,6 +97,7 @@ if (isGetCookie = typeof $request !== 'undefined') { }; myuid = cookie.match(/uid=\d+/); await userInfo(); + nick = nick?nick:null; $.log(`\n********** ${nick} 现金收益: ${cash}元 ********\n`); await friendsign(); await ExtraList(); From fe7cc19531878939fb4e7110c3ff6f90e22f4fa8 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 01:09:47 +0800 Subject: [PATCH 709/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 6eb1e5ffd6..26847e3dee 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-20 22:50 +更新时间: 2021-02-23 00:50 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行, From eca5c8a8e0b08e6b1c868504bde77660b7ca84d5 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 08:00:17 +0800 Subject: [PATCH 710/721] --- .github/workflows/youth_read.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml index a63f7abc29..4191724570 100644 --- a/.github/workflows/youth_read.yml +++ b/.github/workflows/youth_read.yml @@ -6,7 +6,7 @@ name: 中青自动阅读 on: workflow_dispatch: schedule: - - cron: '6 1-16/3 * * *' + - cron: '6 1-22/5 * * *' watch: types: started jobs: From 521d367c81999746ef3531fbfdab3dd1aeed823e Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 08:53:15 +0800 Subject: [PATCH 711/721] =?UTF-8?q?=E5=BF=AB=E6=89=8B=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加nodejs通知,仅在签到成功时发送通知 --- Task/kuaishou.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 518d9e1df0..85b51a68bb 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -1,14 +1,15 @@ /* 更新时间: 2021-02-21 10:15 -赞赏:快手邀请码`774010415`,农妇山泉 -> 有点咸,万分感谢 -本脚本仅适用于快手双版本签到,仅支持正式版获取多Cookie,建议使用正式版获取Cookie,点击视频页悬浮红包,或者进入设置,点击"积分兑好礼"即可 - +赞赏:快手邀请码`774010415`,农妇山泉 -> 有点咸,万分感谢; +本脚本仅适用于快手双版本签到,仅支持正式版获取多Cookie,建议使用正式版获取Cookie,点击视频页悬浮红包,或者进入设置,点击"积分兑好礼"即可; +本脚本仅在签到成功时通知; 兼容Nodejs,把获取的Cookie填入KS_TOKEN,多账号用"&"分开 */ const $ = new Env('快手视频') let cookieArr = []; let ks_tokens = $.getdata('cookie_ks'); +const notify = $.isNode() ? require('./sendNotify') : ''; const nebulaCash = $.getdata('cash_nebulaks')||"10"; const cashType = $.getdata('tpcash_nebula')||"ALIPAY"; @@ -56,8 +57,15 @@ if (!$.isNode() && ks_tokens.indexOf('&') == -1) { await formalSign(); if(offici_code !== 100119){ await formalinfo(); - } - await showmsg() + }; + $.desc = `【正式版】:\n `+offic_info+"\n "+offic_sign +'\n' + $.desc += `【极速版】:\n `+speed_rewards+"\n "+speed_info; + if(offici_code==1){ + $.msg($.name+" 昵称:"+nickname,"",$.desc); + await notify.sendNotify($.name+ " " +nickname,$.desc) + } else { + $.log( "~~~~~~~~~~~~~~~~~\n 昵称:" +nickname+"\n"+ $.desc) + } } } })() @@ -82,7 +90,7 @@ function formalCenter() { return new Promise((resolve, reject) =>{ $.post(formalHost('lowActive/module/list', '{"bizId":29,"configId":1}'), async(error, resp, data) =>{ let central = JSON.parse(data); -$.log("\n————————————————————\n\n现在开始正式版任务") +$.log("\n----------------------------------------\n\n现在开始正式版任务") try { if (central.result == 1) { for (lists of central.modules) { @@ -276,10 +284,9 @@ if(nebulaTask.extParam.todayIsSigned==false){ await bdinvet(); } $.log(nebulaTask.desc+"\n"); - } - } - } + } + } resolve() }) }) @@ -313,13 +320,6 @@ function nebulaHost(api,body){ } } -function showmsg() { - $.desc = `【正式版】:\n `+offic_info+"\n "+offic_sign +'\n' - $.desc += `【极速版】:\n `+speed_rewards+"\n "+speed_info - -$.msg($.name+" 昵称:"+nickname,$.sub,$.desc) -} - function GetCookie() { var UA = $request.headers['User-Agent'] if ($request && $request.method != `OPTIONS` && UA.indexOf('ksNebula') > -1) { From e63045ba1353fcd91d3920312217582e604eb862 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 08:55:19 +0800 Subject: [PATCH 712/721] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/kuaishou.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kuaishou.yml b/.github/workflows/kuaishou.yml index f8e8183bbc..63ff425be3 100644 --- a/.github/workflows/kuaishou.yml +++ b/.github/workflows/kuaishou.yml @@ -3,7 +3,7 @@ name: 快手视频签到 on: workflow_dispatch: schedule: - - cron: '15 19 * * *' + - cron: '1/20 10-23/3 * * *' watch: types: started jobs: From 9c4964c144982d9d9b80bdd79a38c05dbeb3bf68 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 23:17:47 +0800 Subject: [PATCH 713/721] --- Task/backup/beatPay.js | 175 +++++++++++++++ Task/backup/tele_p5.js | 172 +++++++++++++++ Task/sunert.boxjs.json | 30 --- Task/youth.js | 470 +++++++++++++++++++---------------------- Task/youth_env.js | 22 ++ 5 files changed, 591 insertions(+), 278 deletions(-) create mode 100644 Task/backup/beatPay.js create mode 100644 Task/backup/tele_p5.js create mode 100644 Task/youth_env.js diff --git a/Task/backup/beatPay.js b/Task/backup/beatPay.js new file mode 100644 index 0000000000..c357f14be9 --- /dev/null +++ b/Task/backup/beatPay.js @@ -0,0 +1,175 @@ +/* +更新时间: 2021-02-20 20:50 +https:\/\/czapp\.bestpay\.com\.cn\/payassistant-client\?method=queryPhoneBalance url script-request-body bestPay.js +hostname = czapp.bestpay.com.cn +翼支付打开权益专区,点击套餐详情,重进翼支付App时需重新获取请求,即重写配置不必禁用 + +*/ +const $ = new Env('翼支付电信套餐'); +const bodyVal = $.getdata('bestpay_tele'); +const queryTime = $.getdata('bestpay_bill').replace("-","")||parseInt($.time("yyyyMM")-1); +const cash = $.getdata('tele_balance')||"10"; + +let isGetCookie = typeof $request !== 'undefined' +if (isGetCookie) { + GetCookie() +} else { +!(async () => { + await queryBalance(); + await queryResource(); + await queryBill(); + $.msg($.name,$.sub,$.desc) +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) +} +function GetCookie() { + if ($request.body) { + var bodyValue = $request.body; + if ($.getdata('bestpay_tele') != (undefined || null)) { + if ($.getdata('bestpay_tele') != bodyValue) { + var bodys = $.setdata(bodyValue, 'bestpay_tele'); + if (!bodys) { + $.msg("更新" + $.name + "请求失败‼️", "", ""); + $.log(`获取请求体: 失败`); + } else { + $.msg("更新" + $.name + "请求成功 🎉", "", ""); + $.log($.name+`, 获取请求: 成功, body: ${bodyValue}`) + } + } + } else { + var bodys = $.setdata(bodyValue, 'bestpay_tele'); + if (!bodys) { + $.msg("首次写入" + $.name + "请求失败‼️", "", ""); + } else { + $.msg("首次写入" + $.name + "请求成功 🎉", "", ""); + } + } + } else { + $.msg("写入" + $.name + "请求失败‼️", "", "配置错误, 无法读取请求体, "); + } + $.done() +} + + +function config(api,queryApi) { + return { + url:'https://czapp.bestpay.com.cn/payassistant-client?method='+api, + headers:{ + Host: 'czapp.bestpay.com.cn', + Referer: 'https://h5.bestpay.com.cn/subapps/payassistant/payassistant-new/index.html?hybridVersion=3.0&channel=quanyi', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Bestpay/10.1.91 hybridVersion/3.0 /sa-sdk-ios', + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: bodyVal+"&"+queryApi + } +} + + +function queryResource() { + return new Promise((resolve) =>{ + $.post(config('queryUserResource', 'BILLCYCLE='+$.time("yyyyMM")), (error, resp, data) =>{ + let result = JSON.parse(data); + try { + if (result.RESPONSECODE == "000000") { + products = result.RESULTDATASET; + //$.log(JSON.stringify(products,null,2)); + $.desc = "使用详情:\n"; + $.log("已开套餐:") + for (x in products) { + productsname = products[x].PRODUCTOFFNAME, + offerType = products[x].OFFERTYPE, + ratableid = products[x].RATABLERESOURCEID; + $.log(" "+productsname+" 类型:"+offerType); + if (ratableid) { + unitType = products[x].UNITTYPEID, + ratableName = products[x].RATABLERESOURCENAME, + mainname = productsname, + ratableAmount = products[x].RATABLEAMOUNT, + balanceAmount = products[x].BALANCEAMOUNT, + usageAmount = products[x].USAGEAMOUNT; + if(unitType !== "KB") { + usageAmount += unitType, + ratableAmount += unitType , + balanceAmount += unitType + } else if (unitType == "KB") { + usageAmount = formatFlow(usageAmount), + ratableAmount = formatFlow(ratableAmount), + balanceAmount = formatFlow(balanceAmount); + ratableName = ratableName?ratableName:productsname; + } + $.desc += " "+ratableName +":"+(balanceAmount?"总计:"+ratableAmount+" 使用:"+usageAmount+" 剩余:"+balanceAmount+"\n":""); + } + } + $.log("\n"+$.desc) + } + } catch(e) { + $.log("查询套餐信息错误"+ $.log(JSON.stringify(result,null,2))) + } finally { + resolve() + } + }) + }) +} + +function queryBill() { + return new Promise((resolve) =>{ + $.post(config('detailBillQueryNew', 'BILLCYCLE=' + queryTime), (error, resp, data) =>{ + let result = JSON.parse(data); + $.log(queryTime+"期账单明细:") + $.desc += queryTime+"期账单明细:\n" + try { + billDate = result.BILLINGCYCLE, + userName = result.customerName, + cashTotal = result.TOTAL / 100, + discount = result.CHARGEFREEDISCOUNT / 100, + mustPay = result.CHARGECORPUSDISCOUNT / 100; + for (lists of result.RESULTDATASET) { + billName = lists.CHARGETYPENAME, + billCharge = lists.CHARGE / 100; + $.desc += " "+billName + " 费用 " + billCharge + "元\n" + $.log(" "+billName + " 费用 " + billCharge + "元") + } + } catch(e) { + $.log("获取账单明细失败" + $.log(JSON.stringify(result, null, 2))) + } finally { + resolve() + } + }) + }) +} + +function queryBalance() { + return new Promise((resolve) =>{ + $.post(config('queryPhoneBalance'), (error, resp, data) =>{ + let result = JSON.parse(data); + try { + addressCity = result.CITYNAME, + teleNO = result.PRODUCTNO, + teleNO = teleNO.substr(0,3)+"****"+teleNO.substr(7) + balance = result.TELEBALANCE / 100, + userBalance = result.USAGEAMOUNT, + payAmount = result.payAmount / 100, + comBalance = result.COMBALANCE / 100; + if (balance < cash) { + $.msg($.name, "您的号码: " + teleNO + " 余额为" + balance + "元", "余额小于" + cash + "元,请您及时充值") + } + $.sub = "归属地:"+addressCity+" 号码:"+teleNO+" 余额:"+balance+"元" + } catch(e) { + $.log("获取手机余额失败" + $.log(JSON.stringify(result, null, 2))) + } finally { + resolve() + } + }) + }) +} + +function formatFlow(number) { + if (number/1024 < 1024) { + return (number/1024).toFixed(2) + "MB" + } + return (number/1024/1024).toFixed(2) + "GB" +} + + +function Env(name,opts){class Http{constructor(env){this.env=env};send(opts,method='GET'){opts=typeof opts==='string'?{url:opts}:opts;let sender=this.get;if(method==='POST'){sender=this.post};return new Promise((resolve,reject)=>{sender.call(this,opts,(err,resp,body)=>{if(err)reject(err);else resolve(resp)})})};get(opts){return this.send.call(this.env,opts)};post(opts){return this.send.call(this.env,opts,'POST')}};return new(class{constructor(name,opts){this.name=name,this.http=new Http(this),this.data=null,this.dataFile='box.dat',this.logs=[],this.isMute=false,this.isNeedRewrite=false,this.logSeparator='\n';this.startTime=new Date().getTime();Object.assign(this,opts);this.log('',`🔔${this.name}, 开始!`)};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(str,defaultValue=null){try{return JSON.parse(str)}catch{return defaultValue}};toStr(obj,defaultValue=null){try{return JSON.stringify(obj)}catch{return defaultValue}};getjson(key,defaultValue){let json=defaultValue;const val=this.getdata(key);if(val){try{json=JSON.parse(this.getdata(key))}catch{}};return json};setjson(val,key){try{return this.setdata(JSON.stringify(val),key)}catch{return false}}; getScript(url){return new Promise((resolve)=>{this.get({url},(err,resp,body)=>resolve(body))})};runScript(script,runOpts){return new Promise((resolve)=>{let httpapi=this.getdata('@chavy_boxjs_userCfgs.httpapi');httpapi=httpapi?httpapi.replace(/\n/g,'').trim():httpapi;let httpapi_timeout=this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout');httpapi_timeout=httpapi_timeout?httpapi_timeout*1:20;httpapi_timeout=runOpts&&runOpts.timeout?runOpts.timeout:httpapi_timeout;const[key,addr]=httpapi.split('@');const opts={url:`http://${addr}/v1/scripting/evaluate`,body:{script_text:script,mock_type:'cron',timeout:httpapi_timeout},headers:{'X-Key':key,'Accept':'*/*'}};this.post(opts,(err,resp,body)=>resolve(body))}).catch((e)=>this.logErr(e))};loaddata(){if(this.isNode()){this.fs=this.fs?this.fs:require('fs');this.path=this.path?this.path:require('path');const curDirDataFilePath=this.path.resolve(this.dataFile);const rootDirDataFilePath=this.path.resolve(process.cwd(),this.dataFile);const isCurDirDataFile=this.fs.existsSync(curDirDataFilePath);const isRootDirDataFile=!isCurDirDataFile&&this.fs.existsSync(rootDirDataFilePath);if(isCurDirDataFile||isRootDirDataFile){const datPath=isCurDirDataFile?curDirDataFilePath:rootDirDataFilePath;try{return JSON.parse(this.fs.readFileSync(datPath))}catch(e){return{}}}else return{}}else return{}};writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require('fs');this.path=this.path?this.path:require('path');const curDirDataFilePath=this.path.resolve(this.dataFile);const rootDirDataFilePath=this.path.resolve(process.cwd(),this.dataFile);const isCurDirDataFile=this.fs.existsSync(curDirDataFilePath);const isRootDirDataFile=!isCurDirDataFile&&this.fs.existsSync(rootDirDataFilePath);const jsondata=JSON.stringify(this.data);if(isCurDirDataFile){this.fs.writeFileSync(curDirDataFilePath,jsondata)}else if(isRootDirDataFile){this.fs.writeFileSync(rootDirDataFilePath,jsondata)}else{this.fs.writeFileSync(curDirDataFilePath,jsondata)}}};lodash_get(source,path,defaultValue=undefined){const paths=path.replace(/\[(\d+)\]/g,'.$1').split('.');let result=source;for(const p of paths){result=Object(result)[p];if(result===undefined){return defaultValue}};return result};lodash_set(obj,path,value){if(Object(obj)!==obj)return obj;if(!Array.isArray(path))path=path.toString().match(/[^.[\]]+/g)||[];path.slice(0,-1).reduce((a,c,i)=>(Object(a[c])===a[c]?a[c]:(a[c]=Math.abs(path[i+1])>>0===+path[i+1]?[]:{})),obj)[path[path.length-1]]=value;return obj};getdata(key){let val=this.getval(key);if(/^@/.test(key)){const[,objkey,paths]=/^@(.*?)\.(.*?)$/.exec(key);const objval=objkey?this.getval(objkey):'';if(objval){try{const objedval=JSON.parse(objval);val=objedval?this.lodash_get(objedval,paths,''):val}catch(e){val=''}}};return val};setdata(val,key){let issuc=false;if(/^@/.test(key)){const[,objkey,paths]=/^@(.*?)\.(.*?)$/.exec(key);const objdat=this.getval(objkey);const objval=objkey?(objdat==='null'?null:objdat||'{}'):'{}';try{const objedval=JSON.parse(objval);this.lodash_set(objedval,paths,val);issuc=this.setval(JSON.stringify(objedval),objkey)}catch(e){const objedval={};this.lodash_set(objedval,paths,val);issuc=this.setval(JSON.stringify(objedval),objkey)}}else{issuc=this.setval(val,key)};return issuc};getval(key){if(this.isSurge()||this.isLoon()){return $persistentStore.read(key)}else if(this.isQuanX()){return $prefs.valueForKey(key)}else if(this.isNode()){this.data=this.loaddata();return this.data[key]}else{return(this.data&&this.data[key])||null}};setval(val,key){if(this.isSurge()||this.isLoon()){return $persistentStore.write(val,key)}else if(this.isQuanX()){return $prefs.setValueForKey(val,key)}else if(this.isNode()){this.data=this.loaddata(),this.data[key]=val,this.writedata();return true}else{return(this.data&&this.data[key])||null}};initGotEnv(opts){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();if(opts){opts.headers=opts.headers?opts.headers:{};if(undefined===opts.headers.Cookie&&undefined===opts.cookieJar){opts.cookieJar=this.ckjar}}}; get(opts,callback=()=>{}){if(opts.headers){delete opts.headers['Content-Type'];delete opts.headers['Content-Length']};if(this.isSurge()||this.isLoon()){if(this.isSurge()&&this.isNeedRewrite){opts.headers=opts.headers||{};Object.assign(opts.headers,{'X-Surge-Skip-Scripting':false})};$httpClient.get(opts,(err,resp,body)=>{if(!err&&resp){resp.body=body,resp.statusCode=resp.status};callback(err,resp,body)})}else if(this.isQuanX()){if(this.isNeedRewrite){opts.opts=opts.opts||{};Object.assign(opts.opts,{hints:false})};$task.fetch(opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>callback(err))}else if(this.isNode()){this.initGotEnv(opts);this.got(opts).on('redirect',(resp,nextOpts)=>{try{if(resp.headers['set-cookie']){const ck=resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString();if(ck){this.ckjar.setCookieSync(ck,null)};nextOpts.cookieJar=this.ckjar}}catch(e){this.logErr(e)}}).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>{const{message:error,response:resp}=err;callback(error,resp,resp&&resp.body)})}};post(opts,callback=()=>{}){if(opts.body&&opts.headers&&!opts.headers['Content-Type']){opts.headers['Content-Type']='application/x-www-form-urlencoded'};if(opts.headers)delete opts.headers['Content-Length'];if(this.isSurge()||this.isLoon()){if(this.isSurge()&&this.isNeedRewrite){opts.headers=opts.headers||{};Object.assign(opts.headers,{'X-Surge-Skip-Scripting':false})};$httpClient.post(opts,(err,resp,body)=>{if(!err&&resp){resp.body=body,resp.statusCode=resp.status};callback(err,resp,body)})}else if(this.isQuanX()){opts.method='POST';if(this.isNeedRewrite){opts.opts=opts.opts||{};Object.assign(opts.opts,{hints:false})};$task.fetch(opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>callback(err))}else if(this.isNode()){this.initGotEnv(opts);const{url,..._opts}=opts;this.got.post(url,_opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>{const{message:error,response:resp}=err;callback(error,resp,resp&&resp.body)})}};time(fmt,ts=null){const date=ts?new Date(ts):new Date();var o={"M+":date.getMonth()+1,"d+":date.getDate(),"h":date.getHours()%12==0?12:date.getHours()/12<1?"上午"+date.getHours()%12:"下午"+date.getHours()%12,"H+":date.getHours(),"m+":date.getMinutes(),"s+":date.getSeconds(),"q+":Math.floor((date.getMonth()+3)/3),"S":date.getMilliseconds()};var week={"0":"\u65e5","1":"\u4e00","2":"\u4e8c","3":"\u4e09","4":"\u56db","5":"\u4e94","6":"\u516d"};if(/(y+)/.test(fmt)){fmt=fmt.replace(RegExp.$1,(date.getFullYear()+"").substr(4-RegExp.$1.length))};if(/(E+)/.test(fmt)){fmt=fmt.replace(RegExp.$1,((RegExp.$1.length>1)?(RegExp.$1.length>2?"\u661f\u671f":"\u5468"):"")+week[date.getDay()+""])};for(var k in o){if(new RegExp("("+k+")").test(fmt)){fmt=fmt.replace(RegExp.$1,(RegExp.$1.length==1)?(o[k]):(("00"+o[k]).substr((""+o[k]).length)))}};return fmt};msg(title=name,subt='',desc='',opts){const toEnvOpts=(rawopts)=>{if(!rawopts)return rawopts;if(typeof rawopts==='string'){if(this.isLoon())return rawopts;else if(this.isQuanX())return{'open-url':rawopts};else if(this.isSurge())return{url:rawopts};else return undefined}else if(typeof rawopts==='object'){if(this.isLoon()){let openUrl=rawopts.openUrl||rawopts.url||rawopts['open-url'];let mediaUrl=rawopts.mediaUrl||rawopts['media-url'];return{openUrl,mediaUrl}}else if(this.isQuanX()){let openUrl=rawopts['open-url']||rawopts.url||rawopts.openUrl;let mediaUrl=rawopts['media-url']||rawopts.mediaUrl;return{'open-url':openUrl,'media-url':mediaUrl}}else if(this.isSurge()){let openUrl=rawopts.url||rawopts.openUrl||rawopts['open-url'];return{url:openUrl}}}else{return undefined}};if(!this.isMute){if(this.isSurge()||this.isLoon()){$notification.post(title,subt,desc,toEnvOpts(opts))}else if(this.isQuanX()){$notify(title,subt,desc,toEnvOpts(opts))}};if(!this.isMuteLog){let logs=['','==============📣\u7CFB\u7EDF\u901A\u77E5📣=============='];logs.push(title);subt?logs.push(subt):'';desc?logs.push(desc):'';console.log(logs.join('\n'));this.logs=this.logs.concat(logs)}};log(...logs){if(logs.length>0){this.logs=[...this.logs,...logs]};console.log(logs.join(this.logSeparator))};logErr(err,msg){const isPrintSack=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();if(!isPrintSack){this.log('',`❗️${this.name}, \u9519\u8BEF!`,err)}else{this.log('',`❗️${this.name}, \u9519\u8BEF!`,err.stack)}};wait(time){return new Promise((resolve)=>setTimeout(resolve,time))};done(val={}){const endTime=new Date().getTime();const costTime=(endTime-this.startTime)/1000;this.log('',`🔔${this.name}, \u7ED3\u675F! 🕛 ${costTime} \u79D2`);this.log();if(this.isSurge()||this.isQuanX()||this.isLoon()){$done(val)}}})(name,opts)} diff --git a/Task/backup/tele_p5.js b/Task/backup/tele_p5.js new file mode 100644 index 0000000000..78a5680fc4 --- /dev/null +++ b/Task/backup/tele_p5.js @@ -0,0 +1,172 @@ +/* +更新时间: 2021-02-20 20:50 +https:\/\/czapp\.bestpay\.com\.cn\/payassistant-client\?method=queryPhoneBalance url script-request-body bestPay.js +hostname = czapp.bestpay.com.cn +翼支付打开权益专区,点击套餐详情,重进翼支付App时需重新获取请求,即重写配置不必禁用 + +*/ +const $ = new Env('电信套餐'); +const cookieVal = $.getdata('p5_tele'); +const queryTime = $.getdata('bestpay_bill').replace("-","")||parseInt($.time("yyyyMM")-1); +const cash = $.getdata('tele_balance')||"10"; + +let isGetCookie = typeof $request !== 'undefined' +if (isGetCookie) { + GetCookie() +} else { +!(async () => { + //await queryBalance(); + await queryResource(); + await queryBill(); + $.msg($.name,$.sub,$.desc) +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) +} +function GetCookie() { + if ($request.headers) { + var bodyValue = $request.headers['Cookie']; + if ($.getdata('p5_tele') != (undefined || null)) { + if ($.getdata('p5_tele') != bodyValue) { + var bodys = $.setdata(bodyValue, 'p5_tele'); + if (!bodys) { + $.msg("更新" + $.name + "请求失败‼️", "", ""); + $.log(`获取请求体: 失败`); + } else { + $.msg("更新" + $.name + "请求成功 🎉", "", ""); + $.log($.name+`, 获取请求: 成功, body: ${bodyValue}`) + } + } + } else { + var bodys = $.setdata(bodyValue, 'p5_tele'); + if (!bodys) { + $.msg("首次写入" + $.name + "请求失败‼️", "", ""); + } else { + $.msg("首次写入" + $.name + "请求成功 🎉", "", ""); + } + } + } else { + $.msg("写入" + $.name + "请求失败‼️", "", "配置错误, 无法读取请求体, "); + } + $.done() +} + + +function config(api,body) { + return { + url:'http://zj.189.cn/zjpr/'+api, + headers:{ + Host: 'zj.189.cn', + Referer: 'http://zj.189.cn/zjpr/servicenew/tcAmount/tcAmount.html?menuFlag=1', + 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64, x64; Trident/7.0; rv:11.0) like Gecko', + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', + 'Cookie': cookieVal + }, + body: body + } +} + + +function queryResource() { + return new Promise((resolve) =>{ + $.post(config('servicenew/tcAmount/queryTaoCan.html','queryDate=202102&type=2'), (error, resp, data) =>{ + let result = JSON.parse(data); +//$.log(JSON.stringify(result,null,2)); + try { + if (result.result){ + $.msg($.name,result.result,""); + return + } else { + //$.desc = '语音套餐\n' + for(yuyin of result.yuyinList){ + productName = yuyin.ProductName + ResName = yuyin.FreeResName + yuyinTotal = yuyin.FreeResLimit + yuyinBalance = yuyin.otherSurplusAmount; + yuyinUsed = yuyin.FreeResUsed + Unit = yuyin.ResUnit + $.desc += productName+':\n '+ResName+':总计'+yuyinTotal+Unit+' 已用'+yuyinUsed+Unit+' 剩余'+yuyinBalance+Unit+'\n' + + }; + //$.desc += '流量套餐\n'; + for(datas of result.ll_country_details){ + productName = datas.ProductName + ResName = datas.FreeResTypeName + dataTotal = datas.FreeResLimit + dataBalance = datas.promSurplusAmount; + dataUsed = datas.FreeResUsed + $.desc += productName+':\n '+ResName+':总计'+formatFlow(dataTotal)+' 已用'+formatFlow(dataUsed)+' 剩余'+formatFlow(dataBalance)+'\n' + } + } + } catch(e) { + $.log("查询套餐信息错误"+ $.log(JSON.stringify(result,null,2))) + } finally { + resolve() + } + }) + }) +} + +function queryBill() { + return new Promise((resolve) =>{ + $.post(config('bill/queryUopBillInfo.htm', 'billMonth=' + queryTime), (error, resp, data) =>{ +$.log(data) + let result = JSON.parse(data); + $.log(queryTime+"期账单明细:") + $.desc += queryTime+"期账单明细:\n" +return + try { + billDate = result.BILLINGCYCLE, + userName = result.customerName, + cashTotal = result.TOTAL / 100, + discount = result.CHARGEFREEDISCOUNT / 100, + mustPay = result.CHARGECORPUSDISCOUNT / 100; + for (lists of result.RESULTDATASET) { + billName = lists.CHARGETYPENAME, + billCharge = lists.CHARGE / 100; + $.desc += " "+billName + " 费用 " + billCharge + "元\n" + $.log(" "+billName + " 费用 " + billCharge + "元") + } + } catch(e) { + $.log("获取账单明细失败" + $.log(JSON.stringify(result, null, 2))) + } finally { + resolve() + } + }) + }) +} + +function queryBalance() { + return new Promise((resolve) =>{ + $.post(config('queryPhoneBalance'), (error, resp, data) =>{ + let result = JSON.parse(data); + try { + addressCity = result.CITYNAME, + teleNO = result.PRODUCTNO, + teleNO = teleNO.substr(0,3)+"****"+teleNO.substr(7) + balance = result.TELEBALANCE / 100, + userBalance = result.USAGEAMOUNT, + payAmount = result.payAmount / 100, + comBalance = result.COMBALANCE / 100; + if (balance < cash) { + $.msg($.name, "您的号码: " + teleNO + " 余额为" + balance + "元", "余额小于" + cash + "元,请您及时充值") + } + $.sub = "归属地:"+addressCity+" 号码:"+teleNO+" 余额:"+balance+"元" + } catch(e) { + $.log("获取手机余额失败" + $.log(JSON.stringify(result, null, 2))) + } finally { + resolve() + } + }) + }) +} + +function formatFlow(number) { + if (parseInt(number) < 1024) { + return number + "MB" + } + return (number/1024).toFixed(2) + "GB" +} + + +function Env(name,opts){class Http{constructor(env){this.env=env};send(opts,method='GET'){opts=typeof opts==='string'?{url:opts}:opts;let sender=this.get;if(method==='POST'){sender=this.post};return new Promise((resolve,reject)=>{sender.call(this,opts,(err,resp,body)=>{if(err)reject(err);else resolve(resp)})})};get(opts){return this.send.call(this.env,opts)};post(opts){return this.send.call(this.env,opts,'POST')}};return new(class{constructor(name,opts){this.name=name,this.http=new Http(this),this.data=null,this.dataFile='box.dat',this.logs=[],this.isMute=false,this.isNeedRewrite=false,this.logSeparator='\n';this.startTime=new Date().getTime();Object.assign(this,opts);this.log('',`🔔${this.name}, 开始!`)};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(str,defaultValue=null){try{return JSON.parse(str)}catch{return defaultValue}};toStr(obj,defaultValue=null){try{return JSON.stringify(obj)}catch{return defaultValue}};getjson(key,defaultValue){let json=defaultValue;const val=this.getdata(key);if(val){try{json=JSON.parse(this.getdata(key))}catch{}};return json};setjson(val,key){try{return this.setdata(JSON.stringify(val),key)}catch{return false}}; getScript(url){return new Promise((resolve)=>{this.get({url},(err,resp,body)=>resolve(body))})};runScript(script,runOpts){return new Promise((resolve)=>{let httpapi=this.getdata('@chavy_boxjs_userCfgs.httpapi');httpapi=httpapi?httpapi.replace(/\n/g,'').trim():httpapi;let httpapi_timeout=this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout');httpapi_timeout=httpapi_timeout?httpapi_timeout*1:20;httpapi_timeout=runOpts&&runOpts.timeout?runOpts.timeout:httpapi_timeout;const[key,addr]=httpapi.split('@');const opts={url:`http://${addr}/v1/scripting/evaluate`,body:{script_text:script,mock_type:'cron',timeout:httpapi_timeout},headers:{'X-Key':key,'Accept':'*/*'}};this.post(opts,(err,resp,body)=>resolve(body))}).catch((e)=>this.logErr(e))};loaddata(){if(this.isNode()){this.fs=this.fs?this.fs:require('fs');this.path=this.path?this.path:require('path');const curDirDataFilePath=this.path.resolve(this.dataFile);const rootDirDataFilePath=this.path.resolve(process.cwd(),this.dataFile);const isCurDirDataFile=this.fs.existsSync(curDirDataFilePath);const isRootDirDataFile=!isCurDirDataFile&&this.fs.existsSync(rootDirDataFilePath);if(isCurDirDataFile||isRootDirDataFile){const datPath=isCurDirDataFile?curDirDataFilePath:rootDirDataFilePath;try{return JSON.parse(this.fs.readFileSync(datPath))}catch(e){return{}}}else return{}}else return{}};writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require('fs');this.path=this.path?this.path:require('path');const curDirDataFilePath=this.path.resolve(this.dataFile);const rootDirDataFilePath=this.path.resolve(process.cwd(),this.dataFile);const isCurDirDataFile=this.fs.existsSync(curDirDataFilePath);const isRootDirDataFile=!isCurDirDataFile&&this.fs.existsSync(rootDirDataFilePath);const jsondata=JSON.stringify(this.data);if(isCurDirDataFile){this.fs.writeFileSync(curDirDataFilePath,jsondata)}else if(isRootDirDataFile){this.fs.writeFileSync(rootDirDataFilePath,jsondata)}else{this.fs.writeFileSync(curDirDataFilePath,jsondata)}}};lodash_get(source,path,defaultValue=undefined){const paths=path.replace(/\[(\d+)\]/g,'.$1').split('.');let result=source;for(const p of paths){result=Object(result)[p];if(result===undefined){return defaultValue}};return result};lodash_set(obj,path,value){if(Object(obj)!==obj)return obj;if(!Array.isArray(path))path=path.toString().match(/[^.[\]]+/g)||[];path.slice(0,-1).reduce((a,c,i)=>(Object(a[c])===a[c]?a[c]:(a[c]=Math.abs(path[i+1])>>0===+path[i+1]?[]:{})),obj)[path[path.length-1]]=value;return obj};getdata(key){let val=this.getval(key);if(/^@/.test(key)){const[,objkey,paths]=/^@(.*?)\.(.*?)$/.exec(key);const objval=objkey?this.getval(objkey):'';if(objval){try{const objedval=JSON.parse(objval);val=objedval?this.lodash_get(objedval,paths,''):val}catch(e){val=''}}};return val};setdata(val,key){let issuc=false;if(/^@/.test(key)){const[,objkey,paths]=/^@(.*?)\.(.*?)$/.exec(key);const objdat=this.getval(objkey);const objval=objkey?(objdat==='null'?null:objdat||'{}'):'{}';try{const objedval=JSON.parse(objval);this.lodash_set(objedval,paths,val);issuc=this.setval(JSON.stringify(objedval),objkey)}catch(e){const objedval={};this.lodash_set(objedval,paths,val);issuc=this.setval(JSON.stringify(objedval),objkey)}}else{issuc=this.setval(val,key)};return issuc};getval(key){if(this.isSurge()||this.isLoon()){return $persistentStore.read(key)}else if(this.isQuanX()){return $prefs.valueForKey(key)}else if(this.isNode()){this.data=this.loaddata();return this.data[key]}else{return(this.data&&this.data[key])||null}};setval(val,key){if(this.isSurge()||this.isLoon()){return $persistentStore.write(val,key)}else if(this.isQuanX()){return $prefs.setValueForKey(val,key)}else if(this.isNode()){this.data=this.loaddata(),this.data[key]=val,this.writedata();return true}else{return(this.data&&this.data[key])||null}};initGotEnv(opts){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();if(opts){opts.headers=opts.headers?opts.headers:{};if(undefined===opts.headers.Cookie&&undefined===opts.cookieJar){opts.cookieJar=this.ckjar}}}; get(opts,callback=()=>{}){if(opts.headers){delete opts.headers['Content-Type'];delete opts.headers['Content-Length']};if(this.isSurge()||this.isLoon()){if(this.isSurge()&&this.isNeedRewrite){opts.headers=opts.headers||{};Object.assign(opts.headers,{'X-Surge-Skip-Scripting':false})};$httpClient.get(opts,(err,resp,body)=>{if(!err&&resp){resp.body=body,resp.statusCode=resp.status};callback(err,resp,body)})}else if(this.isQuanX()){if(this.isNeedRewrite){opts.opts=opts.opts||{};Object.assign(opts.opts,{hints:false})};$task.fetch(opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>callback(err))}else if(this.isNode()){this.initGotEnv(opts);this.got(opts).on('redirect',(resp,nextOpts)=>{try{if(resp.headers['set-cookie']){const ck=resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString();if(ck){this.ckjar.setCookieSync(ck,null)};nextOpts.cookieJar=this.ckjar}}catch(e){this.logErr(e)}}).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>{const{message:error,response:resp}=err;callback(error,resp,resp&&resp.body)})}};post(opts,callback=()=>{}){if(opts.body&&opts.headers&&!opts.headers['Content-Type']){opts.headers['Content-Type']='application/x-www-form-urlencoded'};if(opts.headers)delete opts.headers['Content-Length'];if(this.isSurge()||this.isLoon()){if(this.isSurge()&&this.isNeedRewrite){opts.headers=opts.headers||{};Object.assign(opts.headers,{'X-Surge-Skip-Scripting':false})};$httpClient.post(opts,(err,resp,body)=>{if(!err&&resp){resp.body=body,resp.statusCode=resp.status};callback(err,resp,body)})}else if(this.isQuanX()){opts.method='POST';if(this.isNeedRewrite){opts.opts=opts.opts||{};Object.assign(opts.opts,{hints:false})};$task.fetch(opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>callback(err))}else if(this.isNode()){this.initGotEnv(opts);const{url,..._opts}=opts;this.got.post(url,_opts).then((resp)=>{const{statusCode:status,statusCode,headers,body}=resp;callback(null,{status,statusCode,headers,body},body)},(err)=>{const{message:error,response:resp}=err;callback(error,resp,resp&&resp.body)})}};time(fmt,ts=null){const date=ts?new Date(ts):new Date();var o={"M+":date.getMonth()+1,"d+":date.getDate(),"h":date.getHours()%12==0?12:date.getHours()/12<1?"上午"+date.getHours()%12:"下午"+date.getHours()%12,"H+":date.getHours(),"m+":date.getMinutes(),"s+":date.getSeconds(),"q+":Math.floor((date.getMonth()+3)/3),"S":date.getMilliseconds()};var week={"0":"\u65e5","1":"\u4e00","2":"\u4e8c","3":"\u4e09","4":"\u56db","5":"\u4e94","6":"\u516d"};if(/(y+)/.test(fmt)){fmt=fmt.replace(RegExp.$1,(date.getFullYear()+"").substr(4-RegExp.$1.length))};if(/(E+)/.test(fmt)){fmt=fmt.replace(RegExp.$1,((RegExp.$1.length>1)?(RegExp.$1.length>2?"\u661f\u671f":"\u5468"):"")+week[date.getDay()+""])};for(var k in o){if(new RegExp("("+k+")").test(fmt)){fmt=fmt.replace(RegExp.$1,(RegExp.$1.length==1)?(o[k]):(("00"+o[k]).substr((""+o[k]).length)))}};return fmt};msg(title=name,subt='',desc='',opts){const toEnvOpts=(rawopts)=>{if(!rawopts)return rawopts;if(typeof rawopts==='string'){if(this.isLoon())return rawopts;else if(this.isQuanX())return{'open-url':rawopts};else if(this.isSurge())return{url:rawopts};else return undefined}else if(typeof rawopts==='object'){if(this.isLoon()){let openUrl=rawopts.openUrl||rawopts.url||rawopts['open-url'];let mediaUrl=rawopts.mediaUrl||rawopts['media-url'];return{openUrl,mediaUrl}}else if(this.isQuanX()){let openUrl=rawopts['open-url']||rawopts.url||rawopts.openUrl;let mediaUrl=rawopts['media-url']||rawopts.mediaUrl;return{'open-url':openUrl,'media-url':mediaUrl}}else if(this.isSurge()){let openUrl=rawopts.url||rawopts.openUrl||rawopts['open-url'];return{url:openUrl}}}else{return undefined}};if(!this.isMute){if(this.isSurge()||this.isLoon()){$notification.post(title,subt,desc,toEnvOpts(opts))}else if(this.isQuanX()){$notify(title,subt,desc,toEnvOpts(opts))}};if(!this.isMuteLog){let logs=['','==============📣\u7CFB\u7EDF\u901A\u77E5📣=============='];logs.push(title);subt?logs.push(subt):'';desc?logs.push(desc):'';console.log(logs.join('\n'));this.logs=this.logs.concat(logs)}};log(...logs){if(logs.length>0){this.logs=[...this.logs,...logs]};console.log(logs.join(this.logSeparator))};logErr(err,msg){const isPrintSack=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();if(!isPrintSack){this.log('',`❗️${this.name}, \u9519\u8BEF!`,err)}else{this.log('',`❗️${this.name}, \u9519\u8BEF!`,err.stack)}};wait(time){return new Promise((resolve)=>setTimeout(resolve,time))};done(val={}){const endTime=new Date().getTime();const costTime=(endTime-this.startTime)/1000;this.log('',`🔔${this.name}, \u7ED3\u675F! 🕛 ${costTime} \u79D2`);this.log();if(this.isSurge()||this.isQuanX()||this.isLoon()){$done(val)}}})(name,opts)} diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index ae2996716f..8357ab63c0 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -252,36 +252,6 @@ "https://raw.githubusercontent.com/Orz-3/mini/master/Color/telecominfinty.png" ] }, - { - "author": "@sunert", - "keys": [ - "bestpay_tele" - ], - "repo": "https://github.com/Sunert/Scripts/blob/master/Task/bestPay.js", - "id": "bestpay", - "script": "https://raw.githubusercontent.com/Sunert/Scripts/master/Task/bestPay.js", - "settings": [ - { - "id": "bestpay_bill", - "val": "202008", - "name": "查询月份", - "type": "month", - "desc": "账单查询时间" - }, - { - "id": "tele_balance", - "val": "10", - "name": "余额报警", - "type": "number", - "desc": "余额低于设置值时显示余额通知,设置0为不警示" - } - ], - "name": "翼支付电信套餐查询", - "icons": [ - "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/bestPay_mini.png", - "https://raw.githubusercontent.com/Sunert/Profiles/master/QuantumultX/Rules/Images/icon/bestPay.png" - ] - }, { "author": "@sunert", "keys": [ diff --git a/Task/youth.js b/Task/youth.js index 26847e3dee..0f20decb5e 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-23 00:50 +更新时间: 2021-02-23 23:20 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行, @@ -8,137 +8,117 @@ */ const $ = new Env("中青看点") + +const notify = $.isNode() ? require('./sendNotify') : ''; +const youthNode = $.isNode() ? require('./youth_env') : ''; + +// 可设置部分 let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖每50次通知一次,如需关闭全部通知请设为0 +let ONCard = $.getdata('zqcard')||"false" //早起打卡开关 let s = $.getdata('delay_rotary_zq')||"10" //转盘延迟时间 -const notify = $.isNode() ? require('./sendNotify') : ''; -const ONCard = $.getdata('zqcard')||"false" //早起打卡开关 -const withdrawcash = $.getdata('zqcash')||30 //提现金额 -let withdrawUrl = $.getdata('cashurl_zq'); -let withdrawBody = $.getdata('cashbody_zq'); -let cookieYouth = $.getdata('youthheader_zq'); -let ARTBODYs = $.getdata('read_zq'); -let READTIME = $.getdata('readtime_zq'); +let withdrawcash = $.getdata('zqcash')||30 //提现金额 let cardTime = $.getdata('zqtime')||"05";//打卡时间 -let rotaryscore=0,doublerotary=0; +// 需获取部分 +let withdrawUrl = $.getdata('cashurl_zq'); //提现地址,可选 +let withdrawBody = $.getdata('cashbody_zq'); //提现请求,可选 +let cookieYouth = $.getdata('youthheader_zq'); +let artBody = $.getdata('read_zq'); +let readTimes = $.getdata('readtime_zq'); + +//声明部分 +let rotaryscore=0,doublerotary=0; let cookieArr = [], cookie = '', - readArr = [], articlebodyVal ='', - timeArr = [], timebodyVal = '', + readArr = [], articbody ='', + timeArr = [], timebody = '', detail = ``, subTitle = ``; -if(!$.isNode()&&cookieYouth.indexOf("#") ==-1){ - cookieArr.push($.getdata('youthheader_zq')); - readArr.push($.getdata('read_zq')); - timeArr.push($.getdata('readtime_zq')) + +// 脚本部分 +if (isGetCookie = typeof $request !== 'undefined') { + GetCookie(); + $.done() +} else if (!$.isNode() && !cookieYouth) { + $.msg($.name, "您未获取中青Cookie","请进入任务中心获取") } else { - if($.isNode()){ - if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('#') > -1) { - cookieYouth = process.env.YOUTH_HEADER.split('#'); - } else if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('\n') > -1) { - cookieYouth = process.env.YOUTH_HEADER.split('\n'); - } else { - cookieYouth = [process.env.YOUTH_HEADER] + !(async() =>{ + if (!$.isNode() && cookieYouth.indexOf("#") == -1) { + cookieArr.push(cookieYouth); + readArr.push(artBody); + timeArr.push(readTimes) + } else { + if (!$.isNode() && cookieYouth.indexOf("#") > -1) { + cookieYouth = cookieYouth.split("#"), + artBody = artBody.split("&"), + readTimes = readTimes.split("&") + } else if($.isNode()){ + await youthNode.youth_env() }; - if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('&') > -1) { - ARTBODYs = process.env.YOUTH_ARTBODY.split('&'); - } else if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('\n') > -1) { - ARTBODYs = process.env.YOUTH_ARTBODY.split('\n'); - } else { - ARTBODYs = [process.env.YOUTH_ARTBODY] - }; - if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('&') > -1) { - READTIME = process.env.YOUTH_TIME.split('&'); - } else if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('\n') > -1) { - READTIME = process.env.YOUTH_TIME.split('\n'); - } else { - READTIME = [process.env.YOUTH_TIME] - } - } else if(!$.isNode()&&cookieYouth.indexOf("#")>-1){ - cookieYouth = cookieYouth.split("#") - ARTBODYs = ARTBODYs.split("&") - READTIME = READTIME.split("&") -}; - Object.keys(cookieYouth).forEach((item) =>{ - if (cookieYouth[item]) { + Object.keys(cookieYouth).forEach((item) =>{ + if (cookieYouth[item]) { cookieArr.push(cookieYouth[item]) - } - }); - Object.keys(ARTBODYs).forEach((item) =>{ - if (ARTBODYs[item]) { - readArr.push(ARTBODYs[item]) - } + } }); - Object.keys(READTIME).forEach((item) =>{ - if (READTIME[item]) { - timeArr.push(READTIME[item]) - } + Object.keys(artBody).forEach((item) =>{ + if (artBody[item]) { + readArr.push(artBody[item]) + } }); - timeZone = new Date().getTimezoneOffset() / 60; - timestamp = Date.now()+ (8+timeZone) * 60 * 60 * 1000; - bjTime = new Date(timestamp).toLocaleString('zh',{hour12:false,timeZoneName: 'long'}); - console.log(`\n === 脚本执行 ${bjTime} ===\n`); - console.log(` =========== 您共提供${cookieArr.length}个中青账号 ==========`); -} - -if (isGetCookie = typeof $request !== 'undefined') { - GetCookie(); - $.done() -}; -!(async () => { - if (!cookieArr[0]) { - $.msg($.name, '【提示】请先获取中青看点一cookie',"",{'open-url': "https://kandian.youth.cn/u/mhkjN"}) - return; - } - for (let i = 0; i < cookieArr.length; i++) { - if (cookieArr[i]) { - cookie = cookieArr[i]; - articlebodyVal = readArr[i]; - timebodyVal = timeArr[i]; - $.index = i + 1; - }; - myuid = cookie.match(/uid=\d+/); - await userInfo(); - nick = nick?nick:null; - $.log(`\n********** ${nick} 现金收益: ${cash}元 ********\n`); - await friendsign(); - await ExtraList(); - await TaskCenter() - await openbox(); - await getAdVideo(); - await gameVideo(); - await readArticle(); - $.log("开始转盘抽奖任务") -for (k=0;k<5;k++){ - await $.wait(s*1000); - await rotary(); - -if (rotaryres.status == 0) { - rotarynum = ` 转盘${rotaryres.msg}🎉`; - break - } else if(rotaryres.status == 1){ - console.log("等待"+s+"秒进行开始转盘任务") - rotaryscore += rotaryres.data.score - rotarytimes = rotaryres.data.remainTurn - } -} - -if (rotaryres.status == 1) { - detail += `【转盘抽奖】+${rotaryscore}个青豆 剩余${rotaryres.data.remainTurn}次\n`; - $.log(`转盘抽奖: 共计+${rotaryscore}个青豆 剩余${rotaryres.data.remainTurn}次`) -} -if (rotaryres.status !== 0&&rotaryres.data.doubleNum !== 0){ - detail += `【转盘双倍】+${doublerotary}青豆 剩余${rotaryres.data.doubleNum}次\n` -$.log(`转盘双倍: +${doublerotary}青豆 剩余${rotaryres.data.doubleNum}次`) -} - await earningsInfo(); - await showmsg(); - if ($.isNode()&&rotaryres.status !== 0) - if( rotarytimes && (100-rotarytimes)%95 == 0 && cash >= 10){ - await notify.sendNotify($.name + " " + nick, "您的余额约为"+cash+"元,已可以提现"+'\n'+`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n${detail}`) + Object.keys(readTime).forEach((item) =>{ + if (readTime[item]) { + timeArr.push(readTime[item]) + } + }) + }; + timeZone = new Date().getTimezoneOffset() / 60; + timestamp = Date.now() + (8 + timeZone) * 60 * 60 * 1000; + bjTime = new Date(timestamp).toLocaleString('zh', {hour12: false,timeZoneName: 'long'}); + $.log(`\n === 脚本执行${bjTime} === \n`); + $.log(` =========== 您共提供${cookieArr.length}个中青账号 ==========`); + if (!cookieArr[0]) { + $.msg($.name, '【提示】请先获取中青看点一cookie', "", {'open-url': "https://kandian.youth.cn/u/mhkjN"}); + return; } - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) + for (let i = 0; i < cookieArr.length; i++) { + if (cookieArr[i]) { + cookie = cookieArr[i]; + articbody = readArr[i]; + timebody = timeArr[i]; + $.index = i + 1; + }; + myuid = cookie.match(/uid=\d+/); + await userInfo(); + nick = nick ? nick: null; + $.log(`\n ********** ${nick}现金收益: ${cash}元 ********\n`); + await bonusTask(); + await TaskCenter(); + await openbox(); + await getAdVideo(); + await gameVideo(); + await readArticle(); + $.log("开始转盘抽奖任务"); + for (k = 0; k < 5; k++) { + await $.wait(s*1000); + await rotary(); + if (rotaryres.status == 0) { + rotarynum = `转盘${rotaryres.msg}🎉`; + break + } + } + if (rotaryres.status == 1) { + detail += `【转盘抽奖】 + ${rotaryscore}个青豆剩余${rotarytimes}次\n`; + $.log(`转盘抽奖: 共计 + ${rotaryscore}个青豆剩余${rotarytimes}次`); + if (doubleTimes !== 0) { + detail += `【转盘双倍】 + ${doublerotary}青豆剩余${doubleTimes}次\n`; + $.log(`转盘双倍: +${doublerotary}青豆剩余${doubleTimes}次`) + } + } + await earningsInfo(); + await showmsg() + } + })() + .catch((e) =>$.logErr(e)) + .finally(() =>$.done()) +} function kdHost(api,body) { return { @@ -155,14 +135,49 @@ function kdHost(api,body) { //timeout: 1000, } } +function userInfo() { + return new Promise((resolve, reject) =>{ + $.post(kdHost('WebApi/NewTaskIos/getSign'), async(error, resp, data) =>{ + signinfo = JSON.parse(data); + if (signinfo.status == 1) { + cash = signinfo.data.user.money; + signday = signinfo.data.sign_day; + totalscore = signinfo.data.user.score; + subTitle = `【收益总计】${totalscore}青豆 现金约${cash}元`; + nick = '账号:'+signinfo.data.user.nickname; + if (cookieArr.length == 1) { + $.setdata(nick, "zq_nick") + } else { + $.setdata("账号" + cookieArr.length + "合一", "zq_nick") + } + if (parseInt(cash) >= withdrawcash && !withdrawBody == false) { + await withDraw() + }; + if (signinfo.data.is_sign == false) { + await getsign(); + } else if (signinfo.data.is_sign == true) { + detail = `【签到结果】🔁 (今天+${signinfo.data.sign_score}青豆)已连签${signday}天\n<本次收益> :\n` + }; + if (signday == 7) { + await SevCont(); + } + } else { + $.log(signinfo.msg); + return + } + resolve() + }) + }) +} + function TaskCenter() { return new Promise((resolve, reject) =>{ $.post(kdHost('WebApi/NewTaskIos/getTaskList?'), async(error, resp, data) =>{ try { taskres = JSON.parse(data); - //$.log(JSON.stringify(taskres,null,2)) - //return + //$.log(JSON.stringify(taskres,null,2)); if (taskres.status == 1) { + await friendsign(); for (dailys of taskres.list.daily) { await $.wait(500); if (dailys.status == "1" && dailys.action != "") { @@ -269,41 +284,6 @@ function artshare(artsid) { }) } -function userInfo() { - return new Promise((resolve, reject) => { - $.post(kdHost('WebApi/NewTaskIos/getSign'), async(error, resp, data) => { - signinfo = JSON.parse(data); - if (signinfo.status == 1) { - cash = signinfo.data.user.money; - signday = signinfo.data.sign_day; - totalscore = signinfo.data.user.score - subTitle = `【收益总计】${totalscore}青豆 现金约${cash}元`; - nick = `账号: ${signinfo.data.user.nickname}`; - if(cookieArr.length ==1){ - $.setdata(nick,"zq_nick") - } else { - $.setdata("账号"+cookieArr.length+"合一","zq_nick") - } - if(parseInt(cash) >= withdrawcash && !withdrawBody == false){ - await withDraw() - }; - if(signinfo.data.is_sign == false){ - await getsign(); - } else if(signinfo.data.is_sign == true){ - detail = `【签到结果】🔁 (今天+${signinfo.data.sign_score}青豆) 已连签${signday}天\n <本次收益>:\n` - }; - if(signday==7){ - await SevCont(); - } - } else { - subTitle = `${signinfo.msg}`; - detail = ``; - } - resolve() - }) - }) -} - function withDraw() { return new Promise((resolve, reject) => { const url = { @@ -419,7 +399,7 @@ function SevCont() { detail += `【七日签到】 + ${sevres.data.score}青豆\n` } else if (sevres.code == 0) { //detail += `【七日签到】${sevres.msg}\n`; - $.log(`七日签到:${sevres.msg}`) + //$.log(`七日签到:${sevres.msg}`) } resolve() }) @@ -454,12 +434,11 @@ function openbox() { let boxres = JSON.parse(data); if (boxres.code == 1) { boxretime = boxres.data.time; - detail += `【时段宝箱】 +${boxres.data.score}青豆,${boxres.data.time / 60}分钟后再次奖励\n`; + detail += '【时段宝箱】 +'+boxres.data.score+'青豆,'+boxres.data.time/60+'分钟后再次奖励\n'; await boxshare(); await getArt() } else { - //detail += `【时段宝箱】${boxres.msg}\n`; - $.log(`时段宝箱: ${boxres.msg}`) + $.log('时段宝箱:'+ boxres.msg) } resolve() }) @@ -468,18 +447,15 @@ function openbox() { //宝箱分享 function boxshare() { - return new Promise((resolve, reject) => { - $.post(kdHost('WebApi/invite/shareEnd'), (error, resp, data) => { - let shareres = JSON.parse(data); - if (shareres.code == 1) { - detail += `【宝箱分享】+${shareres.data.score}青豆\n` - } else { - //detail += `【宝箱分享】${shareres.msg}\n`; - //$.log(`${shareres.msg}`) - } - resolve() - }) + return new Promise((resolve, reject) =>{ + $.post(kdHost('WebApi/invite/shareEnd'), (error, resp, data) =>{ + let shareres = JSON.parse(data); + if (shareres.code == 1) { + //detail += `【宝箱分享】 + ${shareres.data.score}青豆\n` + } + resolve() }) + }) } function friendsign() { @@ -499,16 +475,16 @@ function friendsign() { }) } function friendSign(uid) { - return new Promise((resolve, reject) => { - $.get(kdHost(`WebApi/ShareSignNew/sendScoreV2?friend_uid=${uid}`), (error, response, data) => { - let friendres = JSON.parse(data); - if (friendres.error_code == "0") { - detail += `【好友红包】+${friendres.data[0].score}个青豆\n`; - console.log(`好友签到,我得红包 +${friendres.data[0].score}个青豆`) - } - resolve() - }) + return new Promise((resolve, reject) =>{ + $.get(kdHost('WebApi/ShareSignNew/sendScoreV2?friend_uid='+uid), (error, resp, data) =>{ + let friendres = JSON.parse(data); + if (friendres.error_code == "0") { + detail += '【好友红包】+' + friendres.data[0].score + '个青豆\n'; + $.log('好友签到,我得红包 +'+friendres.data[0].score+'个青豆') + } + resolve() }) + }) } //看视频奖励 @@ -517,7 +493,7 @@ function getAdVideo() { $.post(kdHost('taskCenter/getAdVideoReward','type=taskCenter'), (error, resp, data) =>{ let adVideores = JSON.parse(data); if (adVideores.status == 1) { - detail += `【观看视频】 +${adVideores.score}个青豆\n`; + //detail += `【观看视频】+${adVideores.score}个青豆\n`; $.log("观看视频广告" + adVideores.num + "次 +" + adVideores.score + "青豆") } resolve() @@ -525,17 +501,17 @@ function getAdVideo() { }) } function recordAdVideo(acttype) { - return new Promise((resolve, reject) =>{ - $.get(kdHost(`WebApi/NewTaskIos/recordNum?action=${acttype}`), async(error, resp, data) =>{ - try { - record = JSON.parse(data); - } catch(e) { - $.log("获取任务失败," + e) - } finally { - resolve() - } - }) + return new Promise((resolve, reject) =>{ + $.get(kdHost('WebApi/NewTaskIos/recordNum?action='+acttype), async(error, resp, data) =>{ + try { + record = JSON.parse(data); + } catch(e) { + $.log("获取任务失败," + e) + } finally { + resolve() + } }) + }) } function batHost(api, body) { @@ -552,33 +528,24 @@ function batHost(api, body) { // 激励视频奖励 function gameVideo() { - return new Promise((resolve, reject) => { - $.post(batHost('Game/GameVideoReward.json', articlebodyVal), (error, resp, data) => { - gameres = JSON.parse(data) - if (gameres.success == true) { - detail += `【激励视频】${gameres.items.score}\n` - $.log("激励视频 "+gameres.items.score) - }else{ - if(gameres.error_code == "10003"){ - //detail += `【激励视频】${gameres.message}\n` - //$.log("激励视频 "+gameres.message) - } - } - resolve() - }) + return new Promise((resolve, reject) =>{ + $.post(batHost('Game/GameVideoReward.json', articbody), (error, resp, data) =>{ + gameres = JSON.parse(data); + if (gameres.success == true) { + //detail += `【激励视频】${gameres.items.score}\n` + $.log("激励视频 " + gameres.items.score) + } + resolve() }) + }) } function comApp() { return new Promise((resolve, reject) => { - $.post(batHost('mission/msgRed.json',articlebodyVal), (error, response, data) => { - redres = JSON.parse(data) - if (redres.success == true) { - detail += `【回访奖励】+${redres.items.score}个青豆\n` - }else{ - if(redres.error_code == "100009"){ - $.log( `回访奖励: ${redres.message}`) - } + $.post(batHost('mission/msgRed.json',articbody), (error, resp, data) => { + comres = JSON.parse(data) + if (comres.success == true) { + detail += `【回访奖励】+${comres.items.score}个青豆\n` } resolve() }) @@ -588,15 +555,13 @@ function comApp() { //阅读奖励 function readArticle() { return new Promise((resolve, reject) => { - $.post(batHost('article/complete.json',articlebodyVal), (error, response, data) => { + $.post(batHost('article/complete.json',articbody), (error, resp, data) => { try{ readres = JSON.parse(data); - if (data.indexOf('read_score')>-1&&readres.items.read_score!=0) { + if(data.indexOf('read_score')>-1 && readres.items.read_score!=0) { detail += `【阅读奖励】+${readres.items.read_score}个青豆\n`; $.log(`阅读奖励 +${readres.items.read_score}个青豆`) - } - else if (readres.items.max_notice == '看太久了,换1篇试试') { - //detail += `【阅读奖励】看太久了,换1篇试试\n`; + } else if (readres.items.max_notice == '看太久了,换1篇试试') { //$.log(readres.items.max_notice) } } catch(e) { @@ -609,27 +574,25 @@ function readArticle() { } function readTime() { - return new Promise((resolve, reject) => { - $.post(batHost('user/stay.json',timebodyVal), (error, resp, data) => { - let timeres = JSON.parse(data) - if (timeres.error_code == 0) { - readtimes = timeres.time / 60 - detail += `【阅读时长】共计` + Math.floor(readtimes) + `分钟\n` - $.log(`阅读时长共计` + Math.floor(readtimes) + `分钟`) - } else { - if (timeres.error_code == 200001) { - detail += `【阅读时长】❎ 未获取阅读时长请求\n` - }else{ - detail += `【阅读时长】❎ ${timeres.msg}\n` - $.log(`阅读时长统计失败,原因:${timeres.msg}`) - } - } - resolve() - }) + return new Promise((resolve, reject) =>{ + $.post(batHost('user/stay.json', timebody), (error, resp, data) =>{ + let timeres = JSON.parse(data); + if (timeres.error_code == 0) { + readtimes = timeres.time / 60; + detail += `【阅读时长】共计` + Math.floor(readtimes) + `分钟\n`; + $.log('阅读时长共计' + Math.floor(readtimes) + '分钟') + } else { + if (timeres.error_code == 200001) { + detail += '【阅读时长】❎ 未获取阅读时长请求\n'; + $.log(`阅读时长统计失败,原因:${timeres.msg}`) + } + } + resolve() }) + }) } -function ExtraList() { +function bonusTask() { return new Promise((resolve, reject) =>{ $.post(kdHost('WebApi/ShareNew/bereadExtraList'), async(error, resp, data) =>{ extrares = JSON.parse(data); @@ -667,17 +630,24 @@ function rotary() { $.post(kdHost(`WebApi/RotaryTable/turnRotary?_=${Date.now()}&`,cookie), async(error, resp, data) =>{ try { rotaryres = JSON.parse(data); - if (rotaryres.status==1){ - $.log("进行"+Number(100-rotaryres.data.remainTurn)+"次转盘,获得"+rotaryres.data.score+"青豆") - if(rotaryres.data.score != 0&&rotaryres.data.doubleNum!=0){ + if (rotaryres.status == 0) { + rotarynum = `转盘${rotaryres.msg}🎉`; + $.log(rotarynum) + } else if (rotaryres.status == 1) { + $.log("等待" + s + "秒进行开始转盘任务"); + rotaryscore += rotaryres.data.score; + rotarytimes = rotaryres.data.remainTurn; + doubleTimes = rotaryres.data.doubleNum + $.log("进行"+parseInt(100-rotarytimes)+"次转盘,获得"+rotaryres.data.score+"青豆"); + if(rotaryres.data.score != 0&&doubleTimes!=0){ $.log("等待10s,获得双倍青豆") await $.wait(10000); await TurnDouble(); } - await rotaryCheck(); - } + await rotaryCheck(); + } } catch(e) { - $.logErr(e+resp); + $.logErr(e,resp); } finally { resolve() } @@ -690,7 +660,7 @@ function rotaryCheck() { return new Promise(async(resolve) => { let i = 0; while (i <= 3) { - if (100 - rotaryres.data.remainTurn >= rotaryres.data.chestOpen[i].times&&rotaryres.data.chestOpen[i].received==0) { + if (100 - rotarytimes >= rotaryres.data.chestOpen[i].times&&rotaryres.data.chestOpen[i].received==0) { await runRotary(i + 1) } i++; @@ -740,7 +710,7 @@ function earningsInfo() { $.get(kdHost(`wap/user/balance?`+cookie), (error, response, data) =>{ infores = JSON.parse(data); if (infores.status == 0) { - detail += ` <收益统计>:\n` + detail += '<收益统计> :\n' for (i = 0; i < infores.history[0].group.length; i++) { detail += '【' + infores.history[0].group[i].name + '】' + infores.history[0].group[i].money + '个青豆\n' } @@ -751,12 +721,16 @@ function earningsInfo() { }) } async function showmsg() { - if (rotaryres.status == 1 && rotarytimes >= 97) { + if ($.isNode() && rotaryres.status !== 0) { + if (rotarytimes && (100 - rotarytimes) % 95 == 0 && cash >= 10) { + await notify.sendNotify($.name + " " + nick, "您的余额约为" + cash + "元,已可以提现" + '\n' + `【收益总计】${signinfo.data.user.score}青豆现金约${cash}元\n${detail}`) + } + } else if (rotaryres.status == 1 && rotarytimes >= 97) { $.msg($.name + " " + nick, subTitle, detail) //默认前三次为通知 }else if (rotaryres.status == 1 && rotarytimes % notifyInterval == 0) { $.msg($.name + " " + nick, subTitle, detail) //转盘次数/间隔整除时通知; }else if (rotaryres.code == 10010 && notifyInterval != 0) { - rotarynum = ` 转盘${rotaryres.msg}🎉` + //rotarynum = ` 转盘${rotaryres.msg}🎉` $.msg($.name+" "+nick+" "+rotarynum,subTitle,detail)//任务全部完成且通知间隔不为0时通知; } else { @@ -764,6 +738,6 @@ async function showmsg() { } } -function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/info\/get/)){articlebodyVal=$request.url.split("?")[1];if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articlebodyVal: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} +function GetCookie(){if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/NewTaskIos\/getTaskList/)){RefererVal=$request.headers.Referer;signheaderVal=RefererVal.match(/&uid=\d+/)+RefererVal.match(/&cookie=[_a-zA-Z0-9-]+/)+RefererVal.match(/&cookie_id=[a-zA-Z0-9]+/);if(signheaderVal)$.setdata(signheaderVal,'youthheader_zq');$.log(`${$.name}获取Cookie: 成功, signheaderVal: $}`);$.msg($.name,`获取Cookie: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/article\/info\/get/)){articlebodyVal=$request.url.split("?")[1];if(articlebodyVal)$.setdata(articlebodyVal,'read_zq');$.log(`${$.name}获取阅读: 成功, articbody: ${articlebodyVal}`);$.msg($.name,`获取阅读请求: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/v5\/user\/stay/)){const timebodyVal=$request.body;if(timebodyVal)$.setdata(timebodyVal,'readtime_zq');$.log(`${$.name}获取阅读时长: 成功, timebodyVal: ${timebodyVal}`);$.msg($.name,`获取阅读时长: 成功🎉`,``)}else if($request&&$request.method!=`OPTIONS`&&$request.url.match(/\/withdraw\d?\.json/)){const withdrawVal=$request.body;const withdrawUrl=$request.url;if(withdrawVal)$.setdata(withdrawVal,'cashbody_zq');if(withdrawUrl)$.setdata(withdrawUrl,'cashurl_zq');$.log(`${$.name}, 获取提现请求: 成功, withdrawUrl: ${withdrawUrl}`);$.log(`${$.name}, 获取提现请求: 成功, withdrawBody: ${withdrawVal}`);$.msg($.name,`获取提现请求: 成功🎉`,``)}} 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)} diff --git a/Task/youth_env.js b/Task/youth_env.js new file mode 100644 index 0000000000..86ac048725 --- /dev/null +++ b/Task/youth_env.js @@ -0,0 +1,22 @@ + if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('#') > -1) { + cookieYouth = process.env.YOUTH_HEADER.split('#'); + } else if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('\n') > -1) { + cookieYouth = process.env.YOUTH_HEADER.split('\n'); + } else { + cookieYouth = [process.env.YOUTH_HEADER] + }; + if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('&') > -1) { + ARTBODYs = process.env.YOUTH_ARTBODY.split('&'); + } else if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('\n') > -1) { + ARTBODYs = process.env.YOUTH_ARTBODY.split('\n'); + } else { + ARTBODYs = [process.env.YOUTH_ARTBODY] + }; + if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('&') > -1) { + READTIME = process.env.YOUTH_TIME.split('&'); + } else if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('\n') > -1) { + READTIME = process.env.YOUTH_TIME.split('\n'); + } else { + READTIME = [process.env.YOUTH_TIME] + } + } \ No newline at end of file From 6b20faa5fc54f84bdc336e7978e696f5c890946a Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 23:19:49 +0800 Subject: [PATCH 714/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 0f20decb5e..3bb6286a0e 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -88,7 +88,7 @@ if (isGetCookie = typeof $request !== 'undefined') { myuid = cookie.match(/uid=\d+/); await userInfo(); nick = nick ? nick: null; - $.log(`\n ********** ${nick}现金收益: ${cash}元 ********\n`); + $.log(`\n ********** ${nick} 现金: ${cash}元 ********\n`); await bonusTask(); await TaskCenter(); await openbox(); From cbf7f713941960cefb772b111f604f1af2e257f4 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 23:35:12 +0800 Subject: [PATCH 715/721] --- Task/youth.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 3bb6286a0e..52aafe3a3c 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -51,7 +51,28 @@ if (isGetCookie = typeof $request !== 'undefined') { artBody = artBody.split("&"), readTimes = readTimes.split("&") } else if($.isNode()){ - await youthNode.youth_env() + if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('#') > -1) { + cookieYouth = process.env.YOUTH_HEADER.split('#'); + } else if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('\n') > -1) { + cookieYouth = process.env.YOUTH_HEADER.split('\n'); + } else { + cookieYouth = [process.env.YOUTH_HEADER] + }; + if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('&') > -1) { + ARTBODYs = process.env.YOUTH_ARTBODY.split('&'); + } else if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('\n') > -1) { + ARTBODYs = process.env.YOUTH_ARTBODY.split('\n'); + } else { + ARTBODYs = [process.env.YOUTH_ARTBODY] + }; + if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('&') > -1) { + READTIME = process.env.YOUTH_TIME.split('&'); + } else if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('\n') > -1) { + READTIME = process.env.YOUTH_TIME.split('\n'); + } else { + READTIME = [process.env.YOUTH_TIME] + } + } }; Object.keys(cookieYouth).forEach((item) =>{ if (cookieYouth[item]) { From 5e14dd2cd4892b091b180326f198627db2267379 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 23:42:28 +0800 Subject: [PATCH 716/721] --- Task/youth.js | 3 +-- TaskConf/youth/readme.md | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 52aafe3a3c..909fa6943e 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-23 23:20 +更新时间: 2021-02-23 23:45 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行, @@ -72,7 +72,6 @@ if (isGetCookie = typeof $request !== 'undefined') { } else { READTIME = [process.env.YOUTH_TIME] } - } }; Object.keys(cookieYouth).forEach((item) =>{ if (cookieYouth[item]) { diff --git a/TaskConf/youth/readme.md b/TaskConf/youth/readme.md index 2620b682ca..5355e390aa 100644 --- a/TaskConf/youth/readme.md +++ b/TaskConf/youth/readme.md @@ -73,7 +73,7 @@ https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body h 1 */5 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, enabled=true, tag=中青看点 ``` ### 获取Cookie方法 - * 打开极速版APP,进去个人中心,提示获取Cookie + * 打开极速版APP,进去我的"任务中心",提示获取Cookie - 打开一篇短文资讯,提示获取阅读请求 * 多阅读几篇短文,随机获取阅读时长请求(至少1分钟左右,增加时长有关) - 正常提现一次,获取提现请求(可选,AC无添加) From 4722091bd8dd0308a67c18a77a09665706b0dbbc Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 23:49:13 +0800 Subject: [PATCH 717/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 909fa6943e..586e98debe 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -10,7 +10,7 @@ const $ = new Env("中青看点") const notify = $.isNode() ? require('./sendNotify') : ''; -const youthNode = $.isNode() ? require('./youth_env') : ''; +//const youthNode = $.isNode() ? require('./youth_env') : ''; // 可设置部分 let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖每50次通知一次,如需关闭全部通知请设为0 From 57a41d0ca07547e1446c7bf79f809ee4427ff7b9 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 23:49:49 +0800 Subject: [PATCH 718/721] --- Task/youth_env.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Task/youth_env.js b/Task/youth_env.js index 86ac048725..d5cff58cf3 100644 --- a/Task/youth_env.js +++ b/Task/youth_env.js @@ -18,5 +18,4 @@ READTIME = process.env.YOUTH_TIME.split('\n'); } else { READTIME = [process.env.YOUTH_TIME] - } - } \ No newline at end of file + } \ No newline at end of file From 1c4d9c96b4dbc7c282c35ea452b1ec00f389fe05 Mon Sep 17 00:00:00 2001 From: Best Date: Tue, 23 Feb 2021 23:54:58 +0800 Subject: [PATCH 719/721] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/youth.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Task/youth.js b/Task/youth.js index 586e98debe..5b6ed03448 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,5 +1,5 @@ /* -更新时间: 2021-02-23 23:45 +更新时间: 2021-02-23 23:55 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 本脚本仅适用于中青看点极速版领取青豆 食用说明请查看本仓库目录Taskconf/youth/readme.md,其中打卡挑战赛可通过Boxjs开关,报名时间为23点,早起打卡时间为早5点,报名需1000青豆押金,打卡成功可返1000+青豆,打卡失败则押金不予返还,请注意时间运行, @@ -59,18 +59,18 @@ if (isGetCookie = typeof $request !== 'undefined') { cookieYouth = [process.env.YOUTH_HEADER] }; if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('&') > -1) { - ARTBODYs = process.env.YOUTH_ARTBODY.split('&'); + artBody = process.env.YOUTH_ARTBODY.split('&'); } else if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('\n') > -1) { - ARTBODYs = process.env.YOUTH_ARTBODY.split('\n'); + artBody = process.env.YOUTH_ARTBODY.split('\n'); } else { - ARTBODYs = [process.env.YOUTH_ARTBODY] + artBody = [process.env.YOUTH_ARTBODY] }; if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('&') > -1) { - READTIME = process.env.YOUTH_TIME.split('&'); + readTimes = process.env.YOUTH_TIME.split('&'); } else if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('\n') > -1) { - READTIME = process.env.YOUTH_TIME.split('\n'); + readTimes = process.env.YOUTH_TIME.split('\n'); } else { - READTIME = [process.env.YOUTH_TIME] + readTimes = [process.env.YOUTH_TIME] } }; Object.keys(cookieYouth).forEach((item) =>{ @@ -83,8 +83,8 @@ if (isGetCookie = typeof $request !== 'undefined') { readArr.push(artBody[item]) } }); - Object.keys(readTime).forEach((item) =>{ - if (readTime[item]) { + Object.keys(readTimes).forEach((item) =>{ + if (readTimes[item]) { timeArr.push(readTime[item]) } }) From a72ff44320bc894bf234def9861102b2a00a9c37 Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 24 Feb 2021 00:40:11 +0800 Subject: [PATCH 720/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index 5b6ed03448..f0041300ea 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -427,7 +427,7 @@ function SevCont() { } function Census() { return new Promise((resolve, reject) =>{ - $.post(kdHost('u/w4aFB'),async(error, resp, data) =>{ + $.post(kdHost('u/w6j7s'),async(error, resp, data) =>{ await $.wait(500); await int(); resolve() From 091933d1eb3462eafb613a82f6269f16b6f0501c Mon Sep 17 00:00:00 2001 From: Best Date: Wed, 24 Feb 2021 01:03:07 +0800 Subject: [PATCH 721/721] --- Task/youth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/youth.js b/Task/youth.js index f0041300ea..204018e525 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -334,7 +334,7 @@ function CardStatus() { if (punchcard.code == 1) { if (punchcard.data.user.status == 0 && $.time("HH") > "22") { await punchCard() - } else if (punchcard.data.user.status == 1) { + } else if (punchcard.data.user.status == 2) { $.log("每日打卡已报名,请每天早晨"+cardTime+"点运行打卡"); detail += `【打卡报名】🔔 待明早${cardTime}点打卡\n` } else if (punchcard.data.user.status == 3&&$.time("HH")==cardTime) {