From 64a1e72e7e90b385a3ae166fcc52770cb2df02fc Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Wed, 6 Jan 2021 10:05:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E9=B9=85=E9=98=85=E8=AF=BB=E6=96=B0?= =?UTF-8?q?=E5=A2=9Ecookie=E8=BF=87=E6=9C=9F=E6=8F=90=E9=86=92=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E4=B8=80=E5=A4=A9=E5=8F=AA=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E4=B8=A4=E6=AC=A1=E9=80=9A=E7=9F=A5(=E8=87=AA=E7=94=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backUp/qqread.js | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/backUp/qqread.js b/backUp/qqread.js index 0ff1d2d9..3f8aa651 100644 --- a/backUp/qqread.js +++ b/backUp/qqread.js @@ -14,27 +14,6 @@ ziye 本人github地址 https://github.com/ziye12/JavaScript 转载请备注个名字,谢谢 -11.25 增加 阅读时长上传,阅读金币,阅读随机金币 -11.25 修复翻倍宝箱不同时领取的问题.增加阅读金币判定 -11.25 修复阅读时长问题,阅读金币问题,请重新获取时长cookie -11.26 随机金币只有一次,故去除,调整修复阅读金币问题,增加时长上传限制 -11.26 增加领取周时长奖励 -11.26 增加结束命令 -11.27 调整通知为,成功开启宝箱再通知 -11.28 修复错误 -12.1 调整通知为15次宝箱通知一次 -12.1 优化通知 - -⚠️cookie获取方法: - -进 https://m.q.qq.com/a/s/d3eacc70120b9a37e46bad408c0c4c2a 点我的 获取cookie - -进一本书 看 10秒以下 然后退出,获取阅读时长cookie,看书一定不能超过10秒 - -可能某些页面会卡住,但是能获取到cookie,再注释cookie重写就行了! - - - ⚠️宝箱奖励为20分钟一次,自己根据情况设置定时,建议设置11分钟一次 hostname=mqqapi.reader.qq.com @@ -80,6 +59,7 @@ let qqreadtimeurlVal = $.getdata(qqreadtimeurlKey) const qqreadtimeheaderKey = 'qqreadtimehd' let qqreadtimeheaderVal = $.getdata(qqreadtimeheaderKey) +let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); //云函数使用在下面填写 let QQ_READ_COOKIES = [ { @@ -180,6 +160,7 @@ async function QQ_READ() { for (let i = 0; i < QQ_READ_COOKIES.length; i++) { $.log(`\n*************开始QQ账号${i + 1}**************\n`); tz = ''; + $.isLogin = true; if (!QQ_READ_COOKIES[i]["qqreadbodyVal"] || !QQ_READ_COOKIES[i]['qqreadtimeurlVal'] || !QQ_READ_COOKIES[i]['qqreadtimeheaderVal']) { $.log(`账号${i + 1}暂未提供脚本执行所需的cookie`); continue @@ -188,6 +169,13 @@ async function QQ_READ() { qqreadtimeurlVal = QQ_READ_COOKIES[i]['qqreadtimeurlVal']; qqreadtimeheaderVal = QQ_READ_COOKIES[i]['qqreadtimeheaderVal']; await qqreadinfo();//用户名 + if (!$.isLogin) { + $.log(`企鹅阅读账号${i + 1} cookie过期`); + if (nowTimes.getHours() % 12 === 0 && (nowTimes.getMinutes() > 0 && nowTimes.getMinutes() <= 15)) { + await notify.sendNotify(`企鹅阅读账号${i + 1} cookie过期`, '请及时更新 QQ_READ_TIME_HEADER_VAL') + } + continue + } await qqreadwktime();//周时长查询 await qqreadtrack(); await qqreadconfig();//时长查询 @@ -236,8 +224,7 @@ async function QQ_READ() { } function showmsg() { return new Promise(async resolve => { - let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); - if (nowTimes.getHours() === 22 && (nowTimes.getMinutes() >= 0 && nowTimes.getMinutes() <= 15)) { + if (nowTimes.getHours() === 22 && (nowTimes.getMinutes() > 0 && nowTimes.getMinutes() <= 15)) { await notify.sendNotify(jsname, tz); } $.msg(jsname, "", tz); @@ -328,6 +315,13 @@ function qqreadinfo() { $.get(toqqreadinfourl, (error, response, data) => { if (logs) $.log(`${jsname}, 用户名: ${data}`); let info = JSON.parse(data); + if (info.code === 0) { + $.isLogin = info.data['isLogin']; + if (!$.isLogin) { + resolve(); + return + } + } kz += `\n========== 【${info.data.user.nickName}】 ==========\n`; tz += `\n========== 【${info.data.user.nickName}】 ==========\n`;