Skip to content

Commit 85da17f

Browse files
committed
Update 修复中青浏览赚任务获取Body
1 parent 59a73d6 commit 85da17f

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

Task/youth_gain.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2-
更新时间: 2020-12-15 01:46
2+
更新时间: 2020-12-16 20:16
33
Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异
44
5-
中青看点看看赚任务,手动完成任务,获取请求体,支持boxjs及Github Actions,多请求用"&"分开,支持自动获取请求
5+
中青看点浏览赚任务,手动完成任务,获取请求体,支持boxjs及Github Actions,多请求用"&"分开,支持自动获取请求
66
77
https:\/\/ios\.baertt\.com\/v5\/task\/browse_(start|end)\.json url script-request-body youth_gain.js
88
@@ -14,8 +14,10 @@ https:\/\/ios\.baertt\.com\/v5\/task\/browse_(start|end)\.json url script-reques
1414

1515
const $ = new Env("中青看看赚")
1616
const notify = $.isNode() ? require('./sendNotify') : '';
17-
let StartBody = [], EndBody = [],gainscore = 0;
17+
let StartBody = [], EndBody = [], gainscore = Number();
1818
let startArr = [],endArr = [];
19+
let startbodys = $.getdata('youth_start')
20+
let endbodys = $.getdata('youth_end')
1921
if (isGetCookie = typeof $request !==`undefined`) {
2022
GetCookie();
2123
$.done()
@@ -56,7 +58,6 @@ if ($.isNode()) {
5658
console.log($.name, '【提示】请把抓包的请求体填入Github 的 Secrets 中,请以&隔开')
5759
return;
5860
}
59-
6061
console.log(`您共提供${startArr.length}次看看赚任务`)
6162
for (let i = 0; i < startArr.length; i++) {
6263
if (startArr[i]) {
@@ -66,12 +67,9 @@ if ($.isNode()) {
6667
console.log(`-------------------------\n\n开始中青看点看看赚第${$.index}次任务`)
6768
}
6869
await GainStart();
69-
7070
}
7171
console.log(`-------------------------\n\n中青看点共完成${$.index}次任务,共计获得${gainscore}个青豆,看看赚任务全部结束`);
72-
7372
$.msg($.name, `共完成${$.index}次任务`, `共计获得${gainscore}个青豆`)
74-
7573
})()
7674
.catch((e) => $.logErr(e))
7775
.finally(() => $.done())
@@ -126,36 +124,38 @@ function GainEnd() {
126124

127125
function GetCookie() {
128126
if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/browse_start\.json/)) {
129-
const startbodyVal = $request.body
130-
let startbodys = $.getdata('youth_start')
127+
const startbodyVal = $request.body;
131128
if(startbodys){
132129
if(startbodys.indexOf(startbodyVal)>-1){
133-
$.msg($.name,'阅读请求重复,本次跳过');
134-
} else if(startbodys.indexOf("&")>-1){
135-
startbodys += "&"+startbodyVal
136-
} else if(endbodys.indexOf("&")=-1){
137-
startbodys = startbodyVal
130+
$.msg($.name,'阅读请求重复,本次跳过');
131+
return
132+
}else if(startbodys.indexOf(startbodyVal)==-1)
133+
{
134+
startbodys += "&"+startbodyVal
135+
}
136+
} else {
137+
startbodys = $request.body
138138
}
139139
$.setdata(startbodys,'youth_start')
140140
$.log("看看赚开始请求: "+startbodyVal)
141141
$.msg($.name,'获取开始请求成功');
142-
}
143-
}
142+
};
143+
144144
if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/browse_end\.json/)) {
145145
const endbodyVal = $request.body
146-
let endbodys = $.getdata('youth_end')
147146
if(endbodys){
148147
if(endbodys.indexOf(endbodyVal)>-1){
149148
$.msg($.name,'获取任务开始请求重复,本次跳过');
150-
} else if(endbodys.indexOf("&")>-1){
151-
endbodys += "&"+endbodyVal
152-
}else if(endbodys.indexOf("&")=-1){
153-
endbodys = endbodyVal
149+
return
150+
} else if(endbodys.indexOf(endbodyVal)==-1){
151+
endbodys += "&"+endbodyVal
152+
}
153+
}else {
154+
endbodys = $request.body
154155
}
155156
$.setdata(endbodys,'youth_end')
156157
$.log("看看赚结束请求: "+endbodyVal)
157158
$.msg($.name,'获取任务结束请求成功');
158-
}
159159
}
160160
}
161161

0 commit comments

Comments
 (0)