1+ /*
2+ @header ({
3+ searchable: 1,
4+ filterable: 0,
5+ quickSearch: 0,
6+ title: '番茄听书',
7+ author: 'EylinSir',
8+ '类型': '听书',
9+ lang: 'ds'
10+ })
11+ */
12+
13+ var rule = {
14+ 类型 : '听书' ,
15+ author : 'EylinSir' ,
16+ title : '番茄听书' ,
17+ host : 'https://qkfqapi.vv9v.cn' ,
18+ url : '' ,
19+ searchUrl : '/api/search?key=**&tab_type=2&offset=((fypage-1)*10)' ,
20+ detailUrl : '/api/detail?book_id=fyid' ,
21+ headers : { 'User-Agent' : 'UC_UA' } ,
22+ searchable : 1 ,
23+ quickSearch : 0 ,
24+ filterable : 0 ,
25+ double : true ,
26+ play_parse : true ,
27+ limit : 12 ,
28+
29+ action : async function ( action , value ) {
30+ if ( action === 'only_search' ) {
31+ return '此源为纯搜索源,你直接全局搜索这个源或者使用此页面的源内搜索就好了' ;
32+ }
33+ } ,
34+
35+ 推荐 : async function ( ) {
36+ return [ {
37+ vod_id : 'only_search' ,
38+ vod_name : '纯搜索源哦!' ,
39+ vod_tag : 'action' ,
40+ vod_pic : this . publicUrl + '/images/icon_cookie/搜索.jpg'
41+ } ] ;
42+ } ,
43+
44+ 一级 : async function ( ) {
45+ return [ ] ;
46+ } ,
47+
48+ 二级 : async function ( ) {
49+ let detailApi = `${ this . host } /api/detail?book_id=${ this . orId } ` ;
50+ let detailJson = await request ( detailApi ) ;
51+ let detailData = JSON . parse ( detailJson ) ;
52+ let data = detailData . data . data ;
53+ let chaptersApi = `${ this . host } /api/book?book_id=${ this . orId } ` ;
54+ let chaptersJson = await request ( chaptersApi ) ;
55+ let chaptersData = JSON . parse ( chaptersJson ) ;
56+ let bookData = chaptersData . data . data ;
57+ let list = bookData . chapterListWithVolume ?. flat ( ) || bookData . chapterList || [ ] ;
58+ let urls = list . map ( it => it . title + '$' + it . itemId + '@' + it . title ) . join ( '#' ) ;
59+ return {
60+ vod_id : this . orId ,
61+ vod_name : data . book_name ,
62+ type_name : data . category ,
63+ vod_pic : data . thumb_url || data . expand_thumb_url ,
64+ vod_content : data . abstract || data . book_abstract_v2 ,
65+ vod_remarks : data . sub_info ,
66+ vod_director : data . author ,
67+ vod_play_from : '番茄听书' ,
68+ vod_play_url : urls
69+ } ;
70+ } ,
71+
72+ 搜索 : async function ( ) {
73+ let { input, MY_PAGE } = this ;
74+ let html = await request ( input ) ;
75+ let json = JSON . parse ( html ) ;
76+ let data = json . data . search_tabs [ 4 ] . data ;
77+ let d = [ ] ;
78+ for ( let it of data . filter ( i => i . book_data ) ) {
79+ let book = it . book_data [ 0 ] ;
80+ d . push ( {
81+ title : book . book_name ,
82+ url : book . book_id ,
83+ desc : book . author ,
84+ content : book . book_abstract || book . abstract ,
85+ pic_url : book . thumb_url
86+ } ) ;
87+ }
88+ return setResult ( d ) ;
89+ } ,
90+
91+ lazy : async function ( ) {
92+ let { input} = this ;
93+ let parts = input . split ( '@' ) ;
94+ let itemId = parts [ 0 ] ;
95+ let toneId = '1' ;
96+ let content_url = `${ this . host } /api/content?item_id=${ itemId } &tab=听书&tone_id=${ toneId } ` ;
97+ let jsonStr = await request ( content_url ) ;
98+ let data = JSON . parse ( jsonStr ) ;
99+ return { parse : 0 , url : data . data . content } ;
100+ }
101+ }
0 commit comments