From d5c0bae44034da65617569caedb596f396d2930b Mon Sep 17 00:00:00 2001 From: any Date: Fri, 25 Dec 2020 23:04:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E7=BD=AE=E7=BA=A2=E5=8C=85=E9=9B=A8id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_live_redrain.js | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/jd_live_redrain.js b/jd_live_redrain.js index f13c7e33..96f147fd 100644 --- a/jd_live_redrain.js +++ b/jd_live_redrain.js @@ -21,7 +21,18 @@ cron "0 0,9,11,13,15,17,19,20,21,23 * * *" script-path=https://raw.githubusercon 直播红包雨 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, cronexpr="0 0,9,11,13,15,17,19,20,21,23 * * *", timeout=200, enable=true */ const $ = new Env('直播红包雨'); - +let ids = { + '0': 'RRA3S6TRRbnNNuGN43oHMA5okbcXmRY', + '9': 'RRA3vyGH4MRwCJELDwV7p24mNAByiSk', + '11': 'RRAnabmRSnpzSSZicXUhSFGBvFXs5c', + '13': 'RRA4RhWMc159kA62qLbaEa88evE7owb', + '15': 'RRA2CnovS9KVTTwBD9NV7o4kc3P8PTN', + '17': 'RRA2nFXT2oSQM3KaYX9uhBC1hBijDey', + '19': 'RRA3SQpuSAAJq1ckoPr4TXaxwbLG73k', + '20': 'RRA2cHV3KXqvHAZGboTTryr8JMYZd5j', + '21': 'RRA3SPs4XrDEXXwQjEFGrBLtMpjtkMV', + '23': 'RRA3dFHoZXGThSnctvtAf69dmVyEDfm', +} const notify = $.isNode() ? require('./sendNotify') : ''; //Node.js用户请在jdCookie.js处填写京东ck; const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; @@ -67,12 +78,23 @@ const JD_API_HOST = 'https://api.m.jd.com/api'; $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); return; } + $.log(`=====远程红包雨信息=====`) await getRedRain(); if(!$.activityId) return let nowTs = new Date().getTime() if (!($.st <= nowTs && nowTs < $.ed)) { - console.log(`不在红包雨时间之内`) - return + $.log(`远程红包雨配置获取错误,从本地读取配置`) + $.log(`\n`) + let hour = new Date().getUTCHours() + 8 + if (ids[hour]){ + $.activityId = ids[hour] + $.log(`本地红包雨配置获取成功`) + } else{ + $.log(`无法从本地读取配置,请检查运行时间`) + return + } + } else{ + $.log(`远程红包雨配置获取成功`) } for (let i = 0; i < cookiesArr.length; i++) { if (cookiesArr[i]) {