Skip to content

Commit b6a8616

Browse files
committed
更新文件
1 parent 9beef11 commit b6a8616

File tree

5 files changed

+536
-0
lines changed

5 files changed

+536
-0
lines changed

spider/js/星芽短剧[短].js

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*
2+
@header({
3+
searchable: 2,
4+
filterable: 1,
5+
quickSearch: 1,
6+
title: '星芽短剧',
7+
lang: 'ds'
8+
})
9+
*/
10+
11+
// http://localhost:5757/api/星芽短剧?ac=list&t=1&pg=1
12+
// http://localhost:5757/api/星芽短剧?ac=detail&ids=https://app.whjzjx.cn/v2/theater_parent/detail?theater_parent_id=3523
13+
// http://localhost:5757/api/星芽短剧?wd=龙王&pg=1
14+
// http://localhost:5757/api/星芽短剧?play=http://qcapp.xingya.com.cn/h265/wz_mp40905dingtianhou01.mp4?sign=4db245c4e9cd5bd3d3026e2e0f6147a6&t=674ee966&flag=星芽短剧
15+
var rule = {
16+
类型: '影视',
17+
title: '星芽短剧',
18+
desc: '星芽短剧纯js版本',
19+
host: 'https://app.whjzjx.cn',
20+
url: '/cloud/v2/theaterfyfilter',
21+
filter_url: '/home_page?theater_class_id=fyclass&type=1&{{fl.type or "class2_ids=0"}}&page_num=fypage&page_size=24',
22+
searchUrl: '/v3/search',
23+
searchable: 2,
24+
quickSearch: 1,
25+
filterable: 1,
26+
filter: 'H4sIAAAAAAAAA6vmUgACJUMlK4VoMBMEquEssGR2aiVQWqmksiBVSQdVKi8xNxUk93zj7qfzutFlyxJzSlNRTMZuA8I4kFlPW1e8bF6BZhbCTJCS5JzE4mKj+MyUYlsDJQx1tZha8dn3snnv0x1NxNpnQrF9T/uXvFjcSqx9phTb97xvw5Pdi1+saHjWTLSthpRb+6xjxvOl84i10IjycH3Z0PZi0VpiLTSnPFxX7n+xrYvoEKXcwqd9bU/7NxGdUCnPGS+2zni6cj/RUWhGeZAunfe0ZzfRFlKeSF+29z6fMp9YC6ngwSlznq5bQKx9xsbUKGxIzvzGVMgbfS1PdxIdkcaUR+SLCT1P180l1kJLyu1rmfhsC9Glm7ERxRY+2bWJhCg0MaTchzMnPGtEr9JxWmiBxT4UkVguVPFYrloA8HqNcnwIAAA=',
27+
headers: {
28+
'User-Agent': 'okhttp/4.10.0',
29+
'Accept-Encoding': 'gzip',
30+
'x-app-id': '7',
31+
'platform': '1',
32+
'manufacturer': 'realme',
33+
'version_name': '3.3.1',
34+
'user_agent': 'Mozilla/5.0 (Linux; Android 9; RMX1931 Build/PQ3A.190605.05081124; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/91.0.4472.114 Mobile Safari/537.36',
35+
'dev_token': 'BFdbZBGOEgG7QDt01ldOQNNfhO2F-rv4QcugZoFZm5_3DlPJEo_bSBeJ6dW2X3eKzxxKKWz3xJCM_u5PppGMqRuYPxcsVg9a-jriWiIoPZvHMSLbcbxTFuasqgTivTY3GabW1yP57LQSsJNQfKoX1BKYGHducrhb0bTwvigfn3gE*',
36+
'app_version': '3.1.0.1',
37+
'device_platform': 'android',
38+
'personalized_recommend_status': '1',
39+
'device_type': 'RMX1931',
40+
'device_brand': 'realme',
41+
'os_version': '9',
42+
'channel': 'default',
43+
'raw_channel': 'default',
44+
'oaid': '',
45+
'msa_oaid': '',
46+
'uuid': 'randomUUID_8a0324bf-03c8-4789-8ef8-12d3bcff28f5',
47+
'device_id': '24250683a3bdb3f118dff25ba4b1cba1a',
48+
'ab_id': '',
49+
'support_h265': '1'
50+
},
51+
timeout: 5000,
52+
class_name: '剧场&热播剧&会员专享&星选好剧&新剧&阳光剧场',
53+
class_url: '1&2&8&7&3&5',
54+
play_parse: true,
55+
class_parse: async () => {
56+
},
57+
预处理: async () => {
58+
let html = await post('https://u.shytkjgs.com/user/v1/account/login', {
59+
headers: {
60+
'User-Agent': 'okhttp/4.10.0',
61+
'Accept-Encoding': 'gzip',
62+
'Content-Type': 'application/x-www-form-urlencoded',
63+
'x-app-id': '7',
64+
'platform': '1',
65+
'manufacturer': 'realme',
66+
'version_name': '3.3.1',
67+
'user_agent': 'Mozilla/5.0 (Linux; Android 9; RMX1931 Build/PQ3A.190605.05081124; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/91.0.4472.114 Mobile Safari/537.36',
68+
'app_version': '3.3.1',
69+
'device_platform': 'android',
70+
'personalized_recommend_status': '1',
71+
'device_type': 'RMX1931',
72+
'device_brand': 'realme',
73+
'os_version': '9',
74+
'channel': 'default',
75+
'raw_channel': 'default',
76+
'oaid': '',
77+
'msa_oaid': '',
78+
'uuid': 'randomUUID_914e7a9b-deac-4f80-9247-db56669187df',
79+
'device_id': '24250683a3bdb3f118dff25ba4b1cba1a',
80+
'ab_id': '',
81+
'support_h265': '1'
82+
},
83+
body: "device=24250683a3bdb3f118dff25ba4b1cba1a&install_first_open=false&first_install_time=1723214205125&last_update_time=1723214205125&report_link_url="
84+
});
85+
// log('html:', html);
86+
html = JSON.parse(html);
87+
try {
88+
rule.headers['authorization'] = html.data.token
89+
} catch (e) {
90+
rule.headers['authorization'] = html.data.data.token
91+
}
92+
log('authorization:', rule.headers['authorization']);
93+
},
94+
推荐: async () => {
95+
return []
96+
},
97+
一级: async function (tid, pg, filter, extend) {
98+
let {input} = this;
99+
let d = [];
100+
let html = await request(input, {headers: rule.headers});
101+
let data = JSON.parse(html).data.list;
102+
data.forEach(it => {
103+
let id = 'https://app.whjzjx.cn/v2/theater_parent/detail?theater_parent_id=' + it.theater.id;
104+
d.push({
105+
url: id,
106+
title: it.theater.title,
107+
img: it.theater.cover_url,
108+
desc: it.theater.theme,
109+
})
110+
})
111+
return setResult(d);
112+
},
113+
二级: async function (ids) {
114+
let {input} = this;
115+
let urls = [];
116+
let html = await request(input, {headers: rule.headers});
117+
let data = JSON.parse(html).data;
118+
let vod = {
119+
vod_id: input,
120+
vod_name: data.theaters.son_title,
121+
vod_pic: data.cover_url,
122+
}
123+
let playFroms = [];
124+
let playUrls = [];
125+
data.theaters.forEach(it => {
126+
urls.push(it.num + '$' + encodeURIComponent(it.son_video_url));
127+
})
128+
playFroms.push('不知道倾情打造');
129+
vod.vod_play_from = playFroms.join('$$$');
130+
playUrls.push(urls.join('#'));
131+
vod.vod_play_url = playUrls.join('$$$');
132+
return vod
133+
},
134+
搜索: async function (wd, quick, pg) {
135+
let {input, KEY} = this
136+
let d = [];
137+
let html = await post(input, {headers: rule.headers, body: {"text": KEY}})
138+
let list = JSON.parse(html).data.theater.search_data;
139+
list.forEach(it => {
140+
let id = 'https://app.whjzjx.cn/v2/theater_parent/detail?theater_parent_id=' + it.id;
141+
d.push({
142+
url: id,
143+
title: it.title,
144+
desc: it.total,
145+
img: it.cover_url,
146+
content: it.introduction,
147+
})
148+
})
149+
return setResult(d);
150+
},
151+
lazy: async function (flag, id, flags) {
152+
let {input} = this;
153+
return {parse: 0, url: input, js: ''}
154+
},
155+
};

spider/js/牛牛短剧[短].js

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
/*
2+
@header({
3+
searchable: 2,
4+
filterable: 1,
5+
quickSearch: 0,
6+
title: '牛牛短句[短]',
7+
'类型': '影视',
8+
lang: 'ds'
9+
})
10+
*/
11+
12+
var rule = {
13+
title: '牛牛短句[短]',
14+
host: 'https://new.tianjinzhitongdaohe.com',
15+
homeUrl: '/api/v1/app/screen/screenType',
16+
searchUrl: '/api/v1/app/search/searchMovie',
17+
url: '/api/v1/app/screen/screenMovie?classify=fyclass&page=fypage',
18+
headers: {
19+
"Cache-Control": "no-cache",
20+
"Content-Type": "application/json;charset=UTF-8",
21+
"User-Agent": "okhttp/4.12.0"
22+
},
23+
timeout: 5000,
24+
filterable: 1,
25+
limit: 40,
26+
multi: 1,
27+
searchable: 2,
28+
play_parse: true,
29+
search_match: true,
30+
31+
class_parse: async function () {
32+
const url = `${rule.host}/api/v1/app/screen/screenType`;
33+
try {
34+
const response = await request(url, {
35+
method: 'POST',
36+
headers: rule.headers
37+
});
38+
const data = JSON.parse(response);
39+
const classes = [];
40+
41+
if (data.data && data.data[0]?.children?.[0]?.children) {
42+
data.data[0].children[0].children.forEach(vod => {
43+
classes.push({
44+
type_name: `${vod.name}`,
45+
type_id: vod.name
46+
});
47+
});
48+
}
49+
50+
return {
51+
class: classes,
52+
filters: {}
53+
};
54+
} catch (e) {
55+
console.error("分类解析错误:", e);
56+
return {class: []};
57+
}
58+
},
59+
60+
一级: async function () {
61+
const {input, MY_PAGE} = this;
62+
const cid = input.split('classify=')[1].split('&')[0];
63+
const page = MY_PAGE || 1;
64+
const payload = JSON.stringify({
65+
condition: {
66+
classify: cid,
67+
typeId: "S1"
68+
},
69+
pageNum: String(page),
70+
pageSize: rule.limit
71+
});
72+
73+
try {
74+
const url = `${rule.host}/api/v1/app/screen/screenMovie`;
75+
const response = await request(url, {
76+
method: 'POST',
77+
headers: rule.headers,
78+
body: payload
79+
});
80+
const data = JSON.parse(response);
81+
const videos = [];
82+
if (data.data?.records) {
83+
data.data.records.forEach(vod => {
84+
videos.push({
85+
title: vod.name,
86+
img: vod.cover,
87+
desc: `${vod.totalEpisode}集`,
88+
url: vod.id
89+
});
90+
});
91+
}
92+
93+
return setResult(videos);
94+
} catch (e) {
95+
console.error("一级列表错误:", e);
96+
return [];
97+
}
98+
},
99+
100+
二级: async function () {
101+
const { orId } = this;
102+
let did = orId;
103+
let bofang = '';
104+
let xianlu = '';
105+
let content = '';
106+
107+
try {
108+
// 获取剧集列表
109+
const detailPayload = JSON.stringify({
110+
id: did,
111+
source: 0,
112+
typeId: "S1",
113+
userId: "223664"
114+
});
115+
116+
const detailUrl = `${rule.host}/api/v1/app/play/movieDetails`;
117+
const detailResponse = await request(detailUrl, {
118+
method: 'POST',
119+
headers: rule.headers,
120+
body: detailPayload
121+
});
122+
123+
const detailData = JSON.parse(detailResponse).data || {};
124+
if (detailData.episodeList && detailData.episodeList.length > 0) {
125+
const episodes = detailData.episodeList.map(ep => {
126+
return `${ep.episode}$${did}@${ep.id}`;
127+
});
128+
bofang = episodes.join('#');
129+
xianlu = '牛牛短句';
130+
content = detailData.introduce || '暂无剧情介绍';
131+
}
132+
133+
return {
134+
vod_name: detailData.name || '未知名称',
135+
vod_pic: detailData.cover || '',
136+
vod_content: content,
137+
vod_play_from: xianlu || '暂无资源',
138+
vod_play_url: bofang || '暂无播放地址$0'
139+
};
140+
} catch (e) {
141+
console.error("详情解析错误:", e);
142+
return {
143+
vod_name: '加载失败',
144+
vod_pic: '',
145+
vod_content: '详情加载失败,请稍后重试',
146+
vod_play_from: '暂无资源',
147+
vod_play_url: '暂无播放地址$0'
148+
};
149+
}
150+
},
151+
152+
搜索: async function () {
153+
const {KEY, MY_PAGE} = this;
154+
const page = MY_PAGE || 1;
155+
const payload = JSON.stringify({
156+
condition: {
157+
typeId: "S1",
158+
value: KEY
159+
},
160+
pageNum: String(page),
161+
pageSize: rule.limit
162+
});
163+
164+
try {
165+
const url = `${rule.host}/api/v1/app/search/searchMovie`;
166+
const response = await request(url, {
167+
method: 'POST',
168+
headers: rule.headers,
169+
body: payload
170+
});
171+
const data = JSON.parse(response);
172+
const videos = [];
173+
174+
if (data.data?.records) {
175+
data.data.records.forEach(vod => {
176+
if (rule.search_match && !vod.name.includes(KEY)) return;
177+
178+
videos.push({
179+
title: vod.name,
180+
img: vod.cover,
181+
desc: `更新时间${vod.year || '未知'}`,
182+
url: vod.id
183+
});
184+
});
185+
}
186+
return setResult(videos);
187+
} catch (e) {
188+
console.error("搜索错误:", e);
189+
return [];
190+
}
191+
},
192+
193+
lazy: async function () {
194+
const {input} = this;
195+
const [videoId, episodeId] = input.split('@');
196+
const payload = JSON.stringify({
197+
episodeId,
198+
id: videoId,
199+
source: 0,
200+
typeId: "S1",
201+
userId: "223664"
202+
});
203+
204+
try {
205+
const url = `${rule.host}/api/v1/app/play/movieDetails`;
206+
const response = await request(url, {
207+
method: 'POST',
208+
headers: rule.headers,
209+
body: payload
210+
});
211+
const data = JSON.parse(response);
212+
213+
return {
214+
parse: 0,
215+
url: data.data?.url || '',
216+
header: {
217+
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36'
218+
}
219+
};
220+
} catch (e) {
221+
console.error("播放地址获取错误:", e);
222+
return {
223+
parse: 0,
224+
url: '',
225+
header: {}
226+
};
227+
}
228+
}
229+
};

0 commit comments

Comments
 (0)