|
9 | 9 | title: '荐片', |
10 | 10 | lang: 'ds' |
11 | 11 | }) |
12 | | -*/var rule = { |
| 12 | +*/ |
| 13 | +let imghost = ''; |
| 14 | + |
| 15 | +var rule = { |
13 | 16 | title: '荐片', |
14 | 17 | // host: 'http://api2.rinhome.com', |
15 | 18 | //host: 'https://oiuzy.haitu33.com', |
16 | 19 | host: 'https://dns.alidns.com/resolve?name=jpmobile.jianpiandns.com&type=TXT', |
17 | 20 | hostJs: async function () { |
18 | | - let {HOST} = this; |
19 | | - log(HOST) |
20 | | - var html = await request(HOST, {headers: {"User-Agent": MOBILE_UA}}); |
21 | | - let json = JSON.parse(html); |
22 | | - let data = json.Answer[0].data.replace(/'|"/g, '').split(','); |
23 | | - src = data[0]; |
24 | | - if (!src.startsWith('http')) { |
25 | | - src = 'https://' + src; |
26 | | - } |
27 | | - HOST = src |
| 21 | + // let {HOST} = this; |
| 22 | + // log(HOST) |
| 23 | + // var html = await request(HOST, {headers: {"User-Agent": MOBILE_UA}}); |
| 24 | + // let json = JSON.parse(html); |
| 25 | + // let data = json.Answer[0].data.replace(/'|"/g, '').split(','); |
| 26 | + // src = data[0]; |
| 27 | + // if (!src.startsWith('http')) { |
| 28 | + // src = 'https://' + src; |
| 29 | + // } |
| 30 | + // HOST = src |
| 31 | + HOST = 'https://api.ubj83.com' |
| 32 | + imghost = `https://${JSON.parse((await req(`${HOST}/api/appAuthConfig`)).content).data.imgDomain}`; |
28 | 33 | return HOST |
29 | 34 | }, |
30 | | - homeUrl: '/api/tag/hand?code=unknown601193cf375db73d&channel=wandoujia',//网站的首页链接,用于分类获取和推荐获取 |
| 35 | + // homeUrl: '/api/tag/hand?code=unknown601193cf375db73d&channel=wandoujia',//网站的首页链接,用于分类获取和推荐获取 |
| 36 | + homeUrl: '/api/slide/list?pos_id=88',//网站的首页链接,用于分类获取和推荐获取 |
31 | 37 | // url:'/api/crumb/list?area=0&category_id=fyclass&page=fypage&type=0&limit=24&fyfilter', |
32 | 38 | url: '/api/crumb/list?page=fypage&type=0&limit=24&fyfilter', |
33 | | - class_name: '全部&电影&电视剧&动漫&综艺', // 筛选 /api/term/ad_fenlei?limit=10&page=1 |
34 | | - class_url: '0&1&2&3&4', |
35 | | - detailUrl: '/api/node/detail?channel=wandoujia&token=&id=fyid',//二级详情拼接链接(json格式用) |
36 | | - searchUrl: '/api/video/search?key=**&page=fypage', |
| 39 | + class_name: '电影&电视剧&动漫&综艺', // 筛选 /api/term/ad_fenlei?limit=10&page=1 |
| 40 | + class_url: '1&2&3&4', |
| 41 | + // detailUrl: '/api/node/detail?channel=wandoujia&token=&id=fyid',//二级详情拼接链接(json格式用) |
| 42 | + detailUrl: '/api/video/detailv2?id=fyid',//二级详情拼接链接(json格式用) |
| 43 | + // searchUrl: '/api/video/search?key=**&page=fypage', |
| 44 | + searchUrl: '/api/v2/search/videoV2?key=**&category_id=88&page=fypage&pageSize=20', |
37 | 45 | searchable: 2, |
38 | 46 | quickSearch: 0, |
39 | 47 | filterable: 1, |
|
46 | 54 | 3: {cateId: '3'}, |
47 | 55 | 4: {cateId: '4'} |
48 | 56 | }, |
| 57 | + // headers: { |
| 58 | + // 'User-Agent': 'jianpian-android/350', |
| 59 | + // 'JPAUTH': 'y261ow7kF2dtzlxh1GS9EB8nbTxNmaK/QQIAjctlKiEv' |
| 60 | + // }, |
49 | 61 | headers: { |
50 | | - 'User-Agent': 'jianpian-android/350', |
51 | | - 'JPAUTH': 'y261ow7kF2dtzlxh1GS9EB8nbTxNmaK/QQIAjctlKiEv' |
| 62 | + 'User-Agent': 'Mozilla/5.0 (Linux; Android 9; V2196A Build/PQ3A.190705.08211809; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/91.0.4472.114 Mobile Safari/537.36;webank/h5face;webank/1.0;netType:NETWORK_WIFI;appVersion:416;packageName:com.jp3.xg3', |
52 | 63 | }, |
53 | 64 | timeout: 5000, |
54 | 65 | limit: 8, |
55 | 66 | play_parse: true, |
56 | | - lazy: async function () { |
57 | | - let {input} = this; |
| 67 | + lazy: async function (flag, id, flags) { |
| 68 | + // let {input} = this; |
| 69 | + // return { |
| 70 | + // parse: 0, |
| 71 | + // url: input, |
| 72 | + // jx: 0 |
| 73 | + // } |
| 74 | + |
58 | 75 | return { |
59 | 76 | parse: 0, |
60 | | - url: input, |
61 | | - jx: 0 |
| 77 | + url: id.indexOf(".m3u8") > -1?id:`tvbox-xg:${id}` |
62 | 78 | } |
63 | 79 |
|
64 | 80 | }, |
| 81 | + parseList(html) { |
| 82 | + let res = JSON.parse(html); |
| 83 | + // console.log(res); |
| 84 | + |
| 85 | + return res.data.map(item => ({ |
| 86 | + vod_id: item.jump_id || item.id, |
| 87 | + vod_name: item.title, |
| 88 | + vod_pic: `${imghost}${item.thumbnail}`, |
| 89 | + vod_remarks: item.mask, |
| 90 | + style: {"type": "rect", "ratio": 1.33} |
| 91 | + })) |
| 92 | +}, |
| 93 | + parseDetail(html) { |
| 94 | + let res = JSON.parse(html).data; |
| 95 | + let play_from = res.source_list_source.map(item => item.name).join('$$$').replace(/常规线路/g, '边下边播'); |
| 96 | + let play_url = res.source_list_source.map(play => |
| 97 | + play.source_list.map(({source_name, url}) => `${source_name}$${url}`).join('#') |
| 98 | + ).join('$$$'); |
| 99 | + |
| 100 | + var vod = { |
| 101 | + "type_name": '', |
| 102 | + "vod_year": res.year, |
| 103 | + "vod_area": res.area, |
| 104 | + "vod_remarks": res.mask, |
| 105 | + "vod_content": res.description, |
| 106 | + "vod_play_from": play_from, |
| 107 | + "vod_play_url": play_url |
| 108 | + }; |
| 109 | + |
| 110 | + return vod |
| 111 | + }, |
65 | 112 |
|
66 | 113 | 推荐: async function () { |
67 | 114 | let {input} = this; |
68 | 115 | var d = []; |
69 | 116 | var html = await request(input); |
70 | | - html = JSON.parse(html).data[0].video; |
71 | | - html.forEach(it => { |
72 | | - d.push({ |
73 | | - title: it.title, |
74 | | - img: it.path + '@Referer=www.jianpianapp.com@User-Agent=jianpian-version353', |
75 | | - desc: it.playlist.title + ' ⭐' + it.score, |
76 | | - url: it.id |
77 | | - }) |
78 | | - }); |
79 | | - return setResult(d); |
| 117 | + // console.log(html); |
| 118 | + // html = JSON.parse(html).data[0].video; |
| 119 | + // html.forEach(it => { |
| 120 | + // d.push({ |
| 121 | + // title: it.title, |
| 122 | + // img: it.path + '@Referer=www.jianpianapp.com@User-Agent=jianpian-version353', |
| 123 | + // desc: it.playlist.title + ' ⭐' + it.score, |
| 124 | + // url: it.id |
| 125 | + // }) |
| 126 | + // }); |
| 127 | + // return setResult(d); |
| 128 | + return this.parseList(html); |
80 | 129 | }, |
81 | 130 | // 一级:'json:data;title;path;playlist.title;id', |
82 | 131 | 一级: async function (tid) { |
|
87 | 136 | input = HOST + '/api/video/search?key=' + tid + '&page=' + +MY_PAGE; |
88 | 137 | } |
89 | 138 | var d = []; |
| 139 | + // https://api.ubj83.com/api/crumb/list?page=1&type=0&limit=24&area=0&sort=update&year=0&category_id=0 |
| 140 | + // console.log('全部:',input); |
90 | 141 | let html = await request(input); |
| 142 | + // console.log(html); |
91 | 143 | html = JSON.parse(html).data; |
92 | 144 | html.forEach(it => { |
93 | 145 | d.push({ |
94 | 146 | title: it.title, |
95 | | - img: it.thumbnail || it.path, |
| 147 | + // img: it.thumbnail || it.path, |
| 148 | + img: `${imghost}${it.thumbnail || it.path}`, |
96 | 149 | desc: (it.mask || it.playlist.title) + ' ⭐' + it.score, |
97 | 150 | url: it.id |
98 | 151 | }) |
|
113 | 166 | } |
114 | 167 |
|
115 | 168 | try { |
| 169 | + console.log(input); |
116 | 170 | let html = await request(input); |
| 171 | + // console.log(html); |
| 172 | + return this.parseDetail(html); |
117 | 173 | html = JSON.parse(html); |
118 | 174 | let node = html.data; |
119 | 175 | VOD = { |
|
160 | 216 | let {input} = this; |
161 | 217 | var d = []; |
162 | 218 | let html = await request(input); |
163 | | - html = JSON.parse(html).data; |
164 | | - html.forEach(it => { |
165 | | - d.push({ |
166 | | - title: it.title, |
167 | | - img: it.thumbnail, |
168 | | - desc: it.mask + ' ⭐' + it.score, |
169 | | - url: it.id |
170 | | - }) |
171 | | - }); |
172 | | - return setResult(d); |
| 219 | + return this.parseList(html); |
| 220 | + // html = JSON.parse(html).data; |
| 221 | + // html.forEach(it => { |
| 222 | + // d.push({ |
| 223 | + // title: it.title, |
| 224 | + // img: it.thumbnail, |
| 225 | + // desc: it.mask + ' ⭐' + it.score, |
| 226 | + // url: it.id |
| 227 | + // }) |
| 228 | + // }); |
| 229 | + // return setResult(d); |
173 | 230 | }, |
174 | 231 | } |
0 commit comments