22// http://localhost:5757/api/番薯动漫?ac=detail&ids=/voddetail/USJJJJJk.html
33// http://localhost:5757/api/番薯动漫?wd=我的&pg=1
44// http://localhost:5757/api/番薯动漫?play=/vodplay/USJJJJJk-2-1.html&flag=由qq倾情打造
5- const { getHtml } = $ . require ( './_lib.request.js' )
5+ const { getHtml} = $ . require ( './_lib.request.js' )
66
77var rule = {
88 类型 : '影视' ,
@@ -50,7 +50,7 @@ var rule = {
5050 return [ ]
5151 } ,
5252 一级 : async function ( tid , pg , filter , extend ) {
53- let { MY_CATE , input } = this ;
53+ let { MY_CATE , input} = this ;
5454 if ( pg <= 0 ) pg = 1 ;
5555 const html = ( await _req ( `${ rule . host } /vodshow/${ tid } --------${ pg } ---.html` ) ) . content ;
5656 const $ = pq ( html ) ;
@@ -70,7 +70,7 @@ var rule = {
7070 return videos
7171 } ,
7272 二级 : async function ( ids ) {
73- let { input } = this ;
73+ let { input} = this ;
7474 const html = ( await _req ( rule . host + ids [ 0 ] ) ) . content
7575 const $ = pq ( html ) ;
7676 let vod = {
@@ -79,6 +79,7 @@ var rule = {
7979 vod_remarks : $ ( ".module-info-item-title:contains(更新)+p" ) . text ( ) ,
8080 vod_content : $ ( ".show-desc" ) . text ( ) . trim ( )
8181 } ;
82+ log ( `加载二级:${ input } ` ) ;
8283 vod . vod_play_from = $ ( "#y-playList span" ) . map ( ( _ , i ) => $ ( i ) . text ( ) ) . get ( ) . join ( '$$$' ) ;
8384 vod . vod_play_url = $ ( ".module-play-list-content" ) . map ( ( _ , item ) => {
8485 return $ ( item ) . find ( "a" ) . map ( ( _ , i ) => {
@@ -88,7 +89,7 @@ var rule = {
8889 return vod
8990 } ,
9091 搜索 : async function ( wd , quick , pg ) {
91- let { input } = this ;
92+ let { input} = this ;
9293 let ck = await verifyCode (
9394 rule . host + "/index.php/verify/index.html?" ,
9495 {
@@ -128,7 +129,7 @@ var rule = {
128129 return videos
129130 } ,
130131 lazy : async function ( flag , id , flags ) {
131- let { input } = this ;
132+ let { input} = this ;
132133 const html = ( await _req ( rule . host + id ) ) . content ;
133134 eval ( html . match ( / p l a y e r _ a a a a [ \s \S ] * ?(? = < \/ s c r i p t > ) / ) [ 0 ] )
134135 let purl = "https://api.bytegooty.com//?url=" + player_aaaa . url
@@ -138,10 +139,11 @@ var rule = {
138139 let play_url ;
139140 try {
140141 const sortByKey = ( _0x2df378 , _0x5d56c7 , _0x3a5216 ) => _0x5d56c7 . sort ( ( {
141- [ _0x2df378 ] : _0x258bb0
142- } , {
143- [ _0x2df378 ] : _0x58eebd
144- } ) => _0x3a5216 ( _0x258bb0 , _0x58eebd ) )
142+ [ _0x2df378 ] : _0x258bb0
143+ } , {
144+ [ _0x2df378 ] : _0x58eebd
145+ } ) => _0x3a5216 ( _0x258bb0 , _0x58eebd ) )
146+
145147 function decrypt ( _0x29c3c3 ) {
146148 let _0x9d66e = $ ( "meta[name=\"viewport\"]" ) . attr ( "id" ) . replace ( "now_" , "" ) ,
147149 _0x165aac = $ ( "meta[charset=\"UTF-8\"]" ) . attr ( "id" ) . replace ( "now_" , "" ) ,
@@ -168,16 +170,18 @@ var rule = {
168170 } ) ;
169171 return _0x477cb9 . toString ( CryptoJS . enc . Utf8 ) ;
170172 }
173+
171174 play_url = decrypt ( config . url )
172175 } catch ( error ) {
173176 console . log ( error )
174177 }
175- return { parse : 0 , url : play_url }
178+ return { parse : 0 , url : play_url }
176179 } ,
177180} ;
178181
179182const expire = 60 * 5 * 1000 ; // 设置cookie过期时间,单位毫秒
180183let timeA = new Date ( ) . getTime ( ) ;
184+
181185async function _req ( url , opt ) {
182186 let timeB = new Date ( ) . getTime ( ) ;
183187 if ( ! rule . headers . cookie || timeB - timeA > expire ) {
@@ -213,16 +217,16 @@ async function getJwt() {
213217 height : 864
214218 } ;
215219
216- const wasmBuffer = await axios . get ( "https://challenge.rivers.chaitin.cn/challenge/v2/calc.wasm" , { responseType : 'arraybuffer' } ) ;
217- const rootResp = await axios . get ( "https://www.fsdm02.com/" , { headers : { "User-Agent" : UA } } ) . catch ( error => error . response ) ;
220+ const wasmBuffer = await axios . get ( "https://challenge.rivers.chaitin.cn/challenge/v2/calc.wasm" , { responseType : 'arraybuffer' } ) ;
221+ const rootResp = await axios . get ( "https://www.fsdm02.com/" , { headers : { "User-Agent" : UA } } ) . catch ( error => error . response ) ;
218222 const cookie = rootResp ?. headers ?. [ 'set-cookie' ] ?. map ( it => it . replace ( / ; .* / , "" ) ) . join ( ";" ) ;
219223 const html = rootResp . data ;
220224 const clientId = html . match ( / S a f e L i n e C h a l l e n g e \( " ( .* ?) " / ) [ 1 ] ;
221225 const level = parseInt ( html . match ( / S a f e L i n e C h a l l e n g e .* ?l e v e l : \s * " ( \d + ) " / ) [ 1 ] , 10 ) ;
222226 const issueJson = ( await axios . post ( "https://challenge.rivers.chaitin.cn/challenge/v2/api/issue" , {
223227 client_id : clientId ,
224228 level
225- } , { headers : { "Content-Type" : "application/json" } } ) ) . data ;
229+ } , { headers : { "Content-Type" : "application/json" } } ) ) . data ;
226230
227231 function u ( e , t ) {
228232 return ( {
@@ -232,7 +236,7 @@ async function getJwt() {
232236 } )
233237 }
234238
235- WebAssembly . instantiate ( wasmBuffer . data ) . then ( ( { instance } ) => {
239+ WebAssembly . instantiate ( wasmBuffer . data ) . then ( ( { instance} ) => {
236240 let n = { } ;
237241 n . data = ( u ( function ( e ) {
238242 return instance . exports . reset ( ) ,
@@ -243,6 +247,7 @@ async function getJwt() {
243247 return instance . exports . ret ( )
244248 } )
245249 } , issueJson . data ) )
250+
246251 function generateRandomString ( length ) {
247252 const characters = '0123456789abcdefghijklmnopqrstuvwxyz' ;
248253 let result = '' ;
@@ -255,6 +260,7 @@ async function getJwt() {
255260
256261 return result ;
257262 }
263+
258264 const visitorId = generateRandomString ( 32 ) ;
259265 axios . post ( "https://challenge.rivers.chaitin.cn/challenge/v2/api/verify" , {
260266 issue_id : n . data . issue_id ,
@@ -323,7 +329,7 @@ async function verifyCode(imgUrl, verifyUrlOpt, num = 1) {
323329 setCookie = [ setCookie ] ;
324330 }
325331 cookie = setCookie . map ( it => it . replace ( / ; .* / , '' ) ) . join ( ";" ) ;
326- let { url : vurl , ...vopt } = JSON . parse ( JSON . stringify ( verifyUrlOpt )
332+ let { url : vurl , ...vopt } = JSON . parse ( JSON . stringify ( verifyUrlOpt )
327333 . replace ( / \$ c o o k i e / g, cookie )
328334 . replace ( / \$ c o d e / g, validate )
329335 )
0 commit comments