Skip to content

Commit

Permalink
中青阅读增加文章不存在自动删除
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunert committed Feb 27, 2021
1 parent 5095086 commit b774628
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Task/Youth_Read.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
更新时间: 2021-02-25 20:51
更新时间: 2021-02-27 17:20
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的文本框中,添加的请求体越多,获得青豆次数越多,本脚本不包含任何推送通知
Expand Down Expand Up @@ -95,21 +95,24 @@ function bodyInfo() {
return new Promise((resolve, reject) => {
$.get(batHost('article/info/get.json?' + articlebody), async(error, resp, data) => {
let bodyobj = JSON.parse(data);
$.log(JSON.stringify(bodyobj,null,2))
//$.log(JSON.stringify(bodyobj,null,2))
try {
if (bodyobj.error_code == 0) {
if (bodyobj.error_code == "200007") {
$.log(bodyobj.message+"已自动删除");
repeatbody = $.getdata('youth_autoread').replace("&" + articlebody, "")
} else if (bodyobj.error_code == 0) {
acticid = bodyobj.url.match(/\d+/)[0];
artdesc = bodyobj.description
author = bodyobj.account.name
ctype = bodyobj.ctype == 0 ? "阅读资讯" : "观看视频";
if (artArr.indexOf(acticid) == -1) {
artArr.unshift(acticid);
artArr.unshift(acticid);
$.log(ctype + ": " + artdesc + " ----- " + author + "\n")
await $.wait(10000);
await AutoRead();
} else if (artArr.indexOf(acticid) > -1) {
repeatbody = $.getdata('youth_autoread').replace("&" + articlebody, "");
$.setdata(repeatbody, 'youth_autoread')
$.setdata(repeatbody, 'youth_autoread')
$.log("文章ID:" + acticid + " 请求重复,已自动删除")
delbody += 1;
await $.wait(1000)
Expand All @@ -129,9 +132,9 @@ function AutoRead() {
return new Promise((resolve, reject) => {
$.post(batHost('article/complete.json', articlebody), async(error, response, data) => {
let readres = JSON.parse(data);
$.log(JSON.stringify(readres,null,2))
//$.log(JSON.stringify(readres,null,2))
if (readres.items.complete == 1) {
$.log(readres.items.max_notice)
//$.log(readres.items.max_notice)
} else {
$.begin = $.begin + 1;
let res = $.begin % ReadArr.length;
Expand Down

0 comments on commit b774628

Please sign in to comment.