@@ -23,45 +23,46 @@ var cookie = ''
2323var barkKey = '' ; //Bark APP 通知推送Key
2424
2525/*********************
26- QuantumultX 远程脚本配置:
27- **********************
28- [task_local]
29- # 爱奇艺会员签到
30- 0 9 * * * https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
26+ QuantumultX 远程脚本配置:
27+ **********************
28+ [task_local]
29+ # 爱奇艺会员签到
30+ 0 9 * * * https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
3131
32- [rewrite_local]
33- # 获取Cookie
34- ^https?:\/\/iface(\d)?\.iqiyi\.com\/ url script-request-header https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
32+ [rewrite_local]
33+ # 获取Cookie
34+ ^https?:\/\/iface(\d)?\.iqiyi\.com\/ url script-request-header https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
3535
36- [mitm]
37- hostname= ifac*.iqiyi.com
36+ [mitm]
37+ hostname= ifac*.iqiyi.com
3838
39- **********************
40- Surge 4.2.0+ 脚本配置:
41- **********************
42- [Script]
43- 爱奇艺签到 = type=cron,cronexp=0 9 * * *,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
39+ **********************
40+ Surge 4.2.0+ 脚本配置:
41+ **********************
42+ [Script]
43+ 爱奇艺签到 = type=cron,cronexp=0 9 * * *,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
4444
45- 爱奇艺获取Cookie = type=http-request,pattern=^https?:\/\/iface(\d)?\.iqiyi\.com\/,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
45+ 爱奇艺获取Cookie = type=http-request,pattern=^https?:\/\/iface(\d)?\.iqiyi\.com\/,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
4646
47- [MITM]
48- hostname= ifac*.iqiyi.com
47+ [MITM]
48+ hostname= ifac*.iqiyi.com
4949
50- ************************
51- Loon 2.1.0+ 脚本配置:
52- ************************
50+ ************************
51+ Loon 2.1.0+ 脚本配置:
52+ ************************
5353
54- [Script]
55- # 爱奇艺签到
56- cron "0 9 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
54+ [Script]
55+ # 爱奇艺签到
56+ cron "0 9 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
5757
58- # 获取Cookie
59- http-request ^https?:\/\/iface(\d)?\.iqiyi\.com\/ script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
58+ # 获取Cookie
59+ http-request ^https?:\/\/iface(\d)?\.iqiyi\.com\/ script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
6060
61- [Mitm]
62- hostname= ifac*.iqiyi.com
61+ [Mitm]
62+ hostname= ifac*.iqiyi.com
6363
64- */
64+ */
65+ var tasks = [ 'b6e688905d4e7184' , 'a7f02e895ccbf416' ] //浏览任务号
6566
6667var LogDetails = false ; // 响应日志
6768
@@ -79,6 +80,16 @@ var $nobyda = nobyda();
7980 await login ( ) ;
8081 await Checkin ( ) ;
8182 await Lottery ( 500 ) ;
83+ for ( let i = 0 ; i < tasks . length ; i ++ ) {
84+ await joinTask ( tasks [ i ] ) ;
85+ await notifyTask ( tasks [ i ] ) ;
86+ await new Promise ( r => setTimeout ( r , 5000 ) ) ;
87+ await getTaskRewards ( tasks [ i ] ) ;
88+ }
89+ await barkNotify ( ) ;
90+ const expires = $nobyda . expire ? $nobyda . expire . replace ( / \u5230 \u671f / , "" ) : "获取失败 ⚠️"
91+ if ( ! $nobyda . isNode ) $nobyda . notify ( "爱奇艺" , "到期时间: " + expires , $nobyda . data ) ;
92+ if ( barkKey ) await BarkNotify ( $nobyda , barkKey , '爱奇艺' , `到期时间: ${ expires } \n${ $nobyda . data } ` ) ;
8293 await $nobyda . time ( ) ;
8394 } else {
8495 $nobyda . notify ( "爱奇艺会员" , "" , "签到终止, 未获取Cookie" ) ;
@@ -147,9 +158,9 @@ function Checkin() {
147158function Lottery ( s ) {
148159 return new Promise ( resolve => {
149160 $nobyda . times ++
150- const URL = {
151- url : 'https://iface2.iqiyi.com/aggregate/3.0/lottery_activity?app_k=0&app_v=0&platform_id=0&dev_os=0&dev_ua=0&net_sts=0&qyid=0&psp_uid=0&psp_cki=' + cookie + '&psp_status=0&secure_p=0&secure_v=0&req_sn=0'
152- }
161+ const URL = {
162+ url : 'https://iface2.iqiyi.com/aggregate/3.0/lottery_activity?app_k=0&app_v=0&platform_id=0&dev_os=0&dev_ua=0&net_sts=0&qyid=0&psp_uid=0&psp_cki=' + cookie + '&psp_status=0&secure_p=0&secure_v=0&req_sn=0'
163+ }
153164 setTimeout ( ( ) => {
154165 $nobyda . get ( URL , async function ( error , response , data ) {
155166 if ( error ) {
@@ -174,17 +185,97 @@ function Lottery(s) {
174185 }
175186 if ( ! $nobyda . last && $nobyda . times < 3 ) {
176187 await Lottery ( s )
177- } else {
178- const expires = $nobyda . expire ? $nobyda . expire . replace ( / \u5230 \u671f / , "" ) : "获取失败 ⚠️"
179- if ( ! $nobyda . isNode ) $nobyda . notify ( "爱奇艺" , "到期时间: " + expires , $nobyda . data ) ;
180- if ( barkKey ) await BarkNotify ( $nobyda , barkKey , '爱奇艺' , `到期时间: ${ expires } \n${ $nobyda . data } ` ) ;
181188 }
182189 resolve ( )
183190 } )
184191 } , s )
185192 if ( out ) setTimeout ( resolve , out + s )
186193 } )
187194}
195+ function joinTask ( task ) {
196+ return new Promise ( resolve => {
197+ $nobyda . get ( 'https://tc.vip.iqiyi.com/taskCenter/task/joinTask?taskCode=' + task + '&lang=zh_CN&platform=0000000000000000&P00001=' + cookie , function ( error , response , data ) { resolve ( ) } )
198+ if ( out ) setTimeout ( resolve , out )
199+ } )
200+ }
201+
202+ function notifyTask ( task ) {
203+ return new Promise ( resolve => {
204+ $nobyda . get ( 'https://tc.vip.iqiyi.com/taskCenter/task/notify?taskCode=' + task + '&lang=zh_CN&platform=0000000000000000&P00001=' + cookie , function ( error , response , data ) { resolve ( ) } )
205+ if ( out ) setTimeout ( resolve , out )
206+ } )
207+ }
208+
209+ function getTaskRewards ( task ) {
210+ return new Promise ( resolve => {
211+ $nobyda . get ( 'https://tc.vip.iqiyi.com/taskCenter/task/getTaskRewards?taskCode=' + task + '&lang=zh_CN&platform=0000000000000000&P00001=' + cookie , function ( error , response , data ) {
212+ if ( error ) {
213+ $nobyda . data += "\n浏览奖励失败: 接口请求出错 ‼️"
214+ console . log ( `爱奇艺-抽奖失败: \n${ data } (${ $nobyda . times } )` )
215+ } else {
216+ const obj = JSON . parse ( data )
217+ const Details = LogDetails ? `response:\n${ data } ` : ''
218+ if ( obj . msg == "成功" ) {
219+ if ( obj . code == "A00000" ) {
220+ $nobyda . data += `\n浏览奖励成功: ${ obj . dataNew [ 0 ] . name + obj . dataNew [ 0 ] . value } 🎉`
221+ console . log ( `爱奇艺-浏览奖励成功: ${ obj . dataNew [ 0 ] . name + obj . dataNew [ 0 ] . value } 🎉` )
222+ } else {
223+ $nobyda . data += `\n浏览奖励失败: ${ obj . msg } ⚠️`
224+ console . log ( `爱奇艺-抽奖失败: ${ obj . msg || `未知错误` } ⚠️ (${ $nobyda . times } ) ${ msg ? Details : `response:\n${ data } ` } ` )
225+ }
226+ } else {
227+ $nobyda . data += "\n浏览奖励失败: Cookie无效/接口失效 ⚠️"
228+ console . log ( `爱奇艺-浏览奖励失败: \n${ data } ` )
229+ }
230+ resolve ( )
231+ }
232+ } )
233+ if ( out ) setTimeout ( resolve , out )
234+ } )
235+ }
236+
237+ function viewPageTask ( task ) {
238+ return new Promise ( resolve => {
239+ //Join Task
240+ $nobyda . get ( 'https://tc.vip.iqiyi.com/taskCenter/task/joinTask?taskCode=' + task + '&lang=zh_CN&platform=0000000000000000&P00001=' + cookie , function ( error , response , data ) { resolve ( ) } )
241+ console . log ( 1 )
242+ //Notify Task
243+ $nobyda . get ( 'https://tc.vip.iqiyi.com/taskCenter/task/notify?taskCode=' + task + '&lang=zh_CN&platform=0000000000000000&P00001=' + cookie , function ( error , response , data ) { resolve ( ) } )
244+ console . log ( 2 )
245+ //Join Task
246+ $nobyda . get ( 'https://tc.vip.iqiyi.com/taskCenter/task/getTaskRewards?taskCode=' + task + '&lang=zh_CN&platform=0000000000000000&P00001=' + cookie , function ( error , response , data ) {
247+ if ( error ) {
248+ $nobyda . data = "浏览奖励失败: 接口请求出错 ‼️"
249+ console . log ( `爱奇艺-${ $nobyda . data } ${ error } ` )
250+ } else {
251+ const obj = JSON . parse ( data )
252+ const Details = LogDetails ? `response:\n${ data } ` : ''
253+
254+ console . log ( data )
255+ console . log ( 'https://tc.vip.iqiyi.com/taskCenter/task/getTaskRewards?taskCode=' + task + '&lang=zh_CN&platform=0000000000000000&P00001=' + cookie )
256+ if ( obj . msg == "成功" ) {
257+ if ( obj . code == "A00000" ) {
258+ $nobyda . data = "浏览奖励成功: " + obj . dataNew . name + obj . dataNew . value + " 🎉"
259+ console . log ( `爱奇艺-${ $nobyda . data } ${ Details } ` )
260+ } else {
261+ $nobyda . data = "浏览奖励失败: " + obj . msg + " ⚠️"
262+ console . log ( `爱奇艺-${ $nobyda . data } ${ Details } ` )
263+ }
264+ } else {
265+ $nobyda . data = "浏览奖励失败: Cookie无效/接口失效 ⚠️"
266+ console . log ( `爱奇艺-${ $nobyda . data } ${ Details } ` )
267+ }
268+ resolve ( )
269+ }
270+ } )
271+ console . log ( 3 )
272+ if ( out ) setTimeout ( resolve , out )
273+ } )
274+ }
275+
276+ function barkNotify ( ) {
277+
278+ }
188279
189280function GetCookie ( ) {
190281 var CKA = $request . url . match ( / ( p s p _ c k i = | P 0 0 0 0 1 = | a u t h c o o k i e = ) ( [ A - Z a - z 0 - 9 ] + ) / )
0 commit comments