11/*
2- 更新时间: 2020-12-15 01:46
2+ 更新时间: 2020-12-16 20:16
33Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异
44
5- 中青看点看看赚任务 ,手动完成任务,获取请求体,支持boxjs及Github Actions,多请求用"&"分开,支持自动获取请求
5+ 中青看点浏览赚任务 ,手动完成任务,获取请求体,支持boxjs及Github Actions,多请求用"&"分开,支持自动获取请求
66
77https:\/\/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
1515const $ = new Env ( "中青看看赚" )
1616const notify = $ . isNode ( ) ? require ( './sendNotify' ) : '' ;
17- let StartBody = [ ] , EndBody = [ ] , gainscore = 0 ;
17+ let StartBody = [ ] , EndBody = [ ] , gainscore = Number ( ) ;
1818let startArr = [ ] , endArr = [ ] ;
19+ let startbodys = $ . getdata ( 'youth_start' )
20+ let endbodys = $ . getdata ( 'youth_end' )
1921if ( 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
127125function GetCookie ( ) {
128126if ( $request && $request . method != 'OPTIONS' && $request . url . match ( / \/ b r o w s e _ s t a r t \. j s o n / ) ) {
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+
144144if ( $request && $request . method != 'OPTIONS' && $request . url . match ( / \/ b r o w s e _ e n d \. j s o n / ) ) {
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