Skip to content

Commit 6e6d604

Browse files
committed
Update 梨园行[戏].js and add new js files
1 parent be0d97d commit 6e6d604

File tree

4 files changed

+289
-49
lines changed

4 files changed

+289
-49
lines changed
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,19 @@ var rule = {
2020
quickSearch: 1,
2121
filterable: 0,
2222
headers: {
23-
'User-Agent': MOBILE_UA
23+
'User-Agent': MOBILE_UA,
24+
'Accept': 'application/json, text/plain, */*',
25+
'accept-language': 'zh-CN,zh;q=0.9',
26+
'cache-control': 'no-cache',
27+
'pragma': 'no-cache',
28+
'priority': 'u=1, i',
29+
'sec-ch-ua': '"Google Chrome";v="143", "Chromium";v="143", "Not A(Brand";v="24"',
30+
'sec-ch-ua-mobile': '?0',
31+
'sec-ch-ua-platform': '"Windows"',
32+
'sec-fetch-dest': 'empty',
33+
'sec-fetch-mode': 'cors',
34+
'sec-fetch-site': 'same-origin',
35+
'x-platform': 'web'
2436
},
2537
play_parse: true,
2638
search_match: true,

spider/js/梨园行[戏].js

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
/*
2+
@header({
3+
searchable: 1,
4+
filterable: 1,
5+
quickSearch: 0,
6+
title: '梨园行戏曲',
7+
author: 'EylinSir',
8+
'类型': '影视',
9+
logo: 'https://img.znds.com//uploads/new/221222/9-2212221050561N.png',
10+
lang: 'ds'
11+
})
12+
*/
13+
14+
var rule = {
15+
类型: '影视',
16+
author: 'EylinSir',
17+
title: '梨园行戏曲',
18+
desc: '梨园行戏曲源',
19+
host: 'https://fly.daoran.tv',
20+
homeUrl: 'https://fly.daoran.tv',
21+
url: '/API_ROP/search/album/screen',
22+
searchUrl: '/API_ROP/search/album/list?keyword=**',
23+
logo: 'https://img.znds.com//uploads/new/221222/9-2212221050561N.png',
24+
searchable: 1,
25+
quickSearch: 0,
26+
filterable: 1,
27+
timeout: 10000,
28+
play_parse: true,
29+
headers: {
30+
'md5': 'SkvyrWqK9QHTdCT12Rhxunjx+WwMTe9y4KwgeASFDhbYabRSPskR0Q==',
31+
'Content-Type': 'application/json; charset=UTF-8',
32+
'User-Agent': 'okhttp/3.12.10',
33+
'Host': 'fly.daoran.tv',
34+
'Connection': 'Keep-Alive'
35+
},
36+
37+
request: async function (url, obj) {
38+
obj = obj || {};
39+
let response = await _fetch(url, {
40+
method: obj.method || 'POST',
41+
headers: obj.headers || this.headers,
42+
body: obj.data ? JSON.stringify(obj.data) : undefined
43+
});
44+
return response.text();
45+
},
46+
47+
_format_img: function (img) {
48+
if (!img) {
49+
return '';
50+
}
51+
if (!img.startsWith('http')) {
52+
return `https://ottphoto.daoran.tv/HD/${img}`;
53+
}
54+
return img;
55+
},
56+
57+
预处理: async function () {},
58+
59+
class_parse: async function () {
60+
let cate_list = [
61+
{"n": "全部", "v": ""},
62+
{"n": "黄梅戏", "v": "hmx"}, {"n": "京剧", "v": "jingju"}, {"n": "曲剧", "v": "quju"},
63+
{"n": "秦腔", "v": "qinq"}, {"n": "潮剧", "v": "chaoju"}, {"n": "沪剧", "v": "huju"},
64+
{"n": "昆曲", "v": "kunqu"}, {"n": "淮剧", "v": "huaiju"}, {"n": "婺剧", "v": "wuju"},
65+
{"n": "河南大鼓书", "v": "hndgs"}, {"n": "滇剧", "v": "dianju"}, {"n": "老年大学", "v": "WK"},
66+
{"n": "绍剧", "v": "shaojv"}, {"n": "曲艺晚会", "v": "else"}, {"n": "皮影戏", "v": "pyx"},
67+
{"n": "四平调", "v": "spd"}, {"n": "吕剧", "v": "lvjv"}, {"n": "柳琴戏", "v": "liuqx"},
68+
{"n": "莆仙戏", "v": "pxx"}, {"n": "宛梆", "v": "wb"}, {"n": "锡剧", "v": "xiju"},
69+
{"n": "大平调", "v": "dpd"}, {"n": "话剧", "v": "huaju"}, {"n": "西秦戏", "v": "xqx"},
70+
{"n": "川剧", "v": "chuanju"}, {"n": "赣剧", "v": "tagId"}, {"n": "太康道情", "v": "tkdq"},
71+
{"n": "闽剧", "v": "minju"}, {"n": "梅花大鼓", "v": "mhdg"}, {"n": "吉剧", "v": "jiju"},
72+
{"n": "白字戏", "v": "bzx"}, {"n": "豫剧", "v": "yuju"}, {"n": "越剧", "v": "yueju"},
73+
{"n": "评剧", "v": "pingju"}, {"n": "坠子", "v": "hnzz"}, {"n": "河北梆子", "v": "hbbz"},
74+
{"n": "粤剧", "v": "gddx"}, {"n": "二夹弦", "v": "ejx"}, {"n": "河南琴书", "v": "hnqs"},
75+
{"n": "戏曲", "v": "xq"}, {"n": "二人台", "v": "ERT"}, {"n": "越调", "v": "yued"},
76+
{"n": "乐腔", "v": "lq"}, {"n": "扬剧", "v": "yangju"}, {"n": "京韵大鼓", "v": "jydg"},
77+
{"n": "彩调", "v": "caidiao"}, {"n": "琼剧", "v": "qiongju"}, {"n": "蒲剧", "v": "pujv"},
78+
{"n": "西河大鼓", "v": "xhdg"}, {"n": "湘剧", "v": "xj"}, {"n": "麦田乡韾", "v": "mtxy"},
79+
{"n": "评书", "v": "pingshu"}, {"n": "庐剧", "v": "luju"}, {"n": "单弦", "v": "danxian"},
80+
{"n": "花鼓戏", "v": "huagx"}, {"n": "相声", "v": "xiang"}, {"n": "四股弦", "v": "sgx"},
81+
{"n": "保定老调", "v": "bdld"}, {"n": "晋剧", "v": "jinju"}, {"n": "其他", "v": "other"},
82+
{"n": "正字戏", "v": "zzx"}, {"n": "楚剧", "v": "chuju"}
83+
];
84+
85+
return {
86+
class: [{ 'type_name': '戏曲片库', 'type_id': 'all' }],
87+
filters: {
88+
"all": [
89+
{"key": "sect", "name": "曲种", "value": cate_list},
90+
{"key": "area", "name": "资费", "value": [{"n": "全部", "v": "0"}, {"n": "免费", "v": "1"}, {"n": "VIP", "v": "2"}]},
91+
{"key": "sort", "name": "排序", "value": [{"n": "最热", "v": "hot"}, {"n": "最新", "v": "online"}]}
92+
]
93+
}
94+
};
95+
},
96+
97+
推荐: async function () {
98+
return await this.一级('all', 1, {}, {});
99+
},
100+
101+
一级: async function (tid, pg, filter, extend) {
102+
let url = `${this.host}/API_ROP/search/album/screen`;
103+
let sect = extend?.sect || '';
104+
if (tid === 'all' && !sect) {
105+
sect = '';
106+
}
107+
108+
let payload = {
109+
"cur": parseInt(pg),
110+
"pageSize": 30,
111+
"resType": 1,
112+
"sect": sect,
113+
"orderby": extend?.sort || 'hot',
114+
"tagId": 0,
115+
"userId": "92315ec6e58a45ba7f47fd143b3d7956",
116+
"channel": "vivo",
117+
"item": "y9",
118+
"nodeCode": "001000",
119+
"project": "lyhxcx"
120+
};
121+
122+
let area = extend?.area || '0';
123+
if (area === '1' || area === '2') {
124+
payload['free'] = parseInt(area);
125+
}
126+
127+
try {
128+
let resp = await this.request(url, { data: payload });
129+
let json = JSON.parse(resp);
130+
let data = json.pb || json.data || {};
131+
let vod_list = [];
132+
for (let item of data.dataList || []) {
133+
vod_list.push({
134+
title: item.name,
135+
url: `${this.host}/API_ROP/album/res/list?albumCode=${item.code}`,
136+
desc: (item.publishTime || '').split(' ')[0],
137+
pic_url: this._format_img(item.imgsec),
138+
vod_year: (item.publishTime || '').substring(0, 4)
139+
});
140+
}
141+
142+
return setResult(vod_list);
143+
} catch (e) {
144+
console.error(e);
145+
return setResult([]);
146+
}
147+
},
148+
149+
二级: async function () {
150+
let albumCode = this.input.match(/albumCode=(.*?)(?:&|$)/)[1];
151+
let url = `${this.host}/API_ROP/album/res/list`;
152+
153+
let payload = {
154+
"albumCode": albumCode,
155+
"cur": 1,
156+
"pageSize": 500,
157+
"userId": "92315ec6e58a45ba7f47fd143b3d7956",
158+
"channel": "vivo",
159+
"item": "y9",
160+
"nodeCode": "001000",
161+
"project": "lyhxcx"
162+
};
163+
164+
try {
165+
let resp = await this.request(url, { data: payload });
166+
let json = JSON.parse(resp);
167+
let album = json.album || {};
168+
let tracks = json.pb?.dataList || [];
169+
tracks.sort((a, b) => parseInt(a.sort || 0) - parseInt(b.sort || 0));
170+
let play_urls = [];
171+
for (let t of tracks) {
172+
if (t.code) {
173+
play_urls.push(`${t.name.replace(/\$/g, '_')}$${t.code}`);
174+
}
175+
}
176+
177+
let VOD = {
178+
vod_id: albumCode,
179+
vod_name: album.name || '未知',
180+
vod_pic: this._format_img(album.imgsec),
181+
type_name: "戏曲",
182+
vod_year: album.publishTime || '',
183+
vod_area: "中国",
184+
vod_content: album.des || '暂无简介',
185+
vod_play_from: "梨园行",
186+
vod_play_url: play_urls.join('#')
187+
};
188+
189+
return VOD;
190+
} catch (e) {
191+
console.error(e);
192+
return {};
193+
}
194+
},
195+
196+
搜索: async function () {
197+
let url = `${this.host}/API_ROP/search/album/list`;
198+
let payload = {
199+
"cur": parseInt(this.MY_PAGE),
200+
"pageSize": 20,
201+
"keyword": this.KEY,
202+
"item": "y9",
203+
"nodeCode": "001000",
204+
"orderby": "hot",
205+
"px": 2,
206+
"sect": [],
207+
"userId": "92315ec6e58a45ba7f47fd143b3d7956",
208+
"project": "lyhxcx"
209+
};
210+
211+
try {
212+
let resp = await this.request(url, { data: payload });
213+
let json = JSON.parse(resp);
214+
let data = json.pb || json.data || {};
215+
let vod_list = [];
216+
for (let item of data.dataList || []) {
217+
vod_list.push({
218+
title: item.name,
219+
url: `${this.host}/API_ROP/album/res/list?albumCode=${item.code}`,
220+
desc: (item.publishTime || ''),
221+
pic_url: this._format_img(item.imgsec)
222+
});
223+
}
224+
return setResult(vod_list);
225+
} catch (e) {
226+
console.error(e);
227+
return setResult([]);
228+
}
229+
},
230+
231+
lazy: async function () {
232+
let resCode = this.input;
233+
let url = `${this.host}/API_ROP/play/get/playurl`;
234+
let payload = {
235+
"resCode": resCode,
236+
"item": "y9",
237+
"mask": 0,
238+
"nodeCode": "001000",
239+
"project": "lyhxcx",
240+
"px": 2,
241+
"userId": "92315ec6e58a45ba7f47fd143b3d7956"
242+
};
243+
244+
try {
245+
let resp = await this.request(url, { data: payload });
246+
let json = JSON.parse(resp);
247+
let play_url = json.playres?.playurl || '';
248+
return {
249+
parse: 0,
250+
url: play_url,
251+
header: { 'User-Agent': this.headers['User-Agent'] }
252+
};
253+
} catch (e) {
254+
console.error(e);
255+
return {
256+
parse: 0,
257+
url: ''
258+
};
259+
}
260+
}
261+
};

0 commit comments

Comments
 (0)