1+ /* 青木倪壁纸
2+ @header ({
3+ searchable: 1,
4+ filterable: 1,
5+ quickSearch: 1,
6+ title: '青木倪壁纸',
7+ lang: 'cat'
8+ })
9+ */
10+
11+ let siteKey = "" , siteType = "" , sourceKey = "" , ext = "" ;
12+ const limit = 50 ;
13+
14+ async function request ( data ) {
15+ const resp = await req ( 'https://www.6qmn.com/index.php/joe/api' , {
16+ method : 'POST' ,
17+ body : data ,
18+ headers : {
19+ 'Referer' : 'https://www.6qmn.com/' ,
20+ 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36' ,
21+ 'content-type' : 'application/x-www-form-urlencoded'
22+ }
23+ } ) ;
24+ return resp . content ;
25+ }
26+
27+ function init ( cfg ) {
28+ siteKey = cfg . skey ;
29+ siteType = cfg . stype ;
30+ sourceKey = cfg . sourceKey ;
31+ ext = cfg . ext ;
32+ }
33+
34+ async function home ( filter ) {
35+ const res = await request ( {
36+ routeType : 'wallpaper_type'
37+ } ) ;
38+
39+ const data = JSON . parse ( res ) . data ;
40+ let classes = [ ] ;
41+ for ( const item of data ) {
42+ classes . push ( {
43+ 'type_id' : item . name + '$' + item . id ,
44+ 'type_name' : item . name ,
45+ 'type_flag' : '0-0-16T9'
46+ } ) ;
47+ }
48+ return JSON . stringify ( {
49+ 'class' : classes ,
50+ 'type_flag' : '0-0-16T9'
51+ } ) ;
52+ }
53+
54+ function homeVod ( params ) {
55+ return category ( '4K专区$36' , 1 ) ;
56+ }
57+
58+ async function category ( tid , pg , filter , extend ) {
59+ const page = pg || 1 ;
60+ console . log ( 'tid:' + tid + ', pg:' + pg + ', filter:' + filter + ', extend:' + JSON . stringify ( extend ) ) ;
61+
62+ const videos = [ ] ;
63+
64+ const ajax_data = {
65+ routeType : 'wallpaper_list' ,
66+ cid : tid . split ( '$' ) [ 1 ] ,
67+ start : ( page - 1 ) * limit ,
68+ count : limit
69+ } ;
70+ const res = await request ( ajax_data ) ;
71+
72+ const json = JSON . parse ( res ) ;
73+ const total = parseInt ( json . total ) ;
74+ const pagecount = Math . ceil ( total / limit ) ;
75+ let index = ( page - 1 ) * limit ;
76+ for ( const v of json . data ) {
77+ const video = {
78+ 'vod_id' : tid + '|' + total + '$' + pagecount + '$' + page + '|' + v . utag + '|' + v . url ,
79+ 'vod_name' : v . utag ,
80+ 'vod_pic' : v . url ,
81+ 'vod_remarks' : '' + page
82+ } ;
83+ videos . push ( video ) ;
84+ index ++ ;
85+ }
86+
87+ return JSON . stringify ( {
88+ 'page' : pg ,
89+ 'pagecount' : pagecount ,
90+ 'limit' : limit ,
91+ 'total' : total ,
92+ 'list' : videos ,
93+ 'type_des' : ''
94+ } ) ;
95+ }
96+
97+ function detail ( id ) {
98+ const info = id . split ( '|' ) ;
99+ const total = parseInt ( info [ 1 ] . split ( '$' ) [ 0 ] ) ;
100+ const pagecount = parseInt ( info [ 1 ] . split ( '$' ) [ 1 ] ) ;
101+ const page = parseInt ( info [ 1 ] . split ( '$' ) [ 2 ] ) ;
102+ const cid = info [ 0 ] . split ( '$' ) [ 1 ] ;
103+ let vod = {
104+ 'vod_id' : id ,
105+ 'vod_name' : info [ 0 ] . split ( '$' ) [ 0 ] ,
106+ 'vod_pic' : info [ 3 ] ,
107+ 'type_name' : '壁纸' ,
108+ 'vod_content' : info [ 0 ] . split ( '$' ) [ 0 ] + ',共 ' + total + ' 张壁纸,每页 ' + limit + ' 张,共 ' + pagecount + ' 页' ,
109+ 'vod_play_from' : '青木倪' ,
110+ 'vod_play_url' : ''
111+ } ;
112+ const urls = [ '0$' + info [ 2 ] + '@' + info [ 3 ] ] ;
113+ for ( let i = 1 ; i <= pagecount ; i ++ ) {
114+ urls . push ( i + '$' + cid + '-' + i ) ;
115+ }
116+ vod [ 'vod_play_url' ] = urls . join ( "#" ) ;
117+ // console.log(JSON.stringify({'list':[vod]}));
118+ return JSON . stringify ( {
119+ 'list' : [ vod ]
120+ } ) ;
121+ }
122+
123+ async function play ( flag , id , flags ) {
124+ let info = id . split ( '-' ) ;
125+ if ( info . length == 1 ) {
126+ return {
127+ parse : 0 ,
128+ url : 'pics://' + id . replace ( '@' , '$' ) . split ( '$' ) . slice ( - 1 ) [ 0 ] ,
129+ }
130+ }
131+
132+ const page = parseInt ( info [ 1 ] ) ;
133+ const ajax_data = {
134+ routeType : 'wallpaper_list' ,
135+ cid : info [ 0 ] ,
136+ start : ( page - 1 ) * limit ,
137+ count : limit
138+ } ;
139+ const res = await request ( ajax_data ) ;
140+ // console.log(res);
141+
142+ const json = JSON . parse ( res ) ;
143+ let content = [ ] ;
144+ for ( const v of json . data ) {
145+ // content.push(v.utag + '$' + v.url);
146+ content . push ( v . url ) ;
147+ }
148+ return {
149+ parse : 0 ,
150+ url : 'pics://' + content . join ( '&&' ) ,
151+ }
152+ }
153+
154+ export function __jsEvalReturn ( ) {
155+ return {
156+ init : init ,
157+ home : home ,
158+ homeVod : homeVod ,
159+ category : category ,
160+ detail : detail ,
161+ play : play ,
162+ proxy : null ,
163+ search : null ,
164+ extResult : null ,
165+ } ;
166+ }
0 commit comments