-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy path短剧库.js
127 lines (115 loc) · 3.27 KB
/
短剧库.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
var rule = {
类型: '影视',
title: '短剧库',
desc: '源动力出品',
host: 'https://duanjuzy.com',
url: '/vod/search/class/fyclass.html?page=fypage',
searchUrl: '/vod/search.html?page=fypage&wd=**',
searchable: 2,
quickSearch: 0,
timeout: 5000,
play_parse: true,
filterable: 0,
class_name: '热门新番&日本动漫&国产动漫&欧美动漫&动漫电影',
class_url: '23&21&22&25&24',
预处理: async () => {
return []
},
class_parse: async () => {
const html = await request('https://duanjuzy.com/label/tabs.html');
const response = JSON.parse(html);
const lists = response.list;
const classes = [];
const filters = {};
for (let list of lists) {
classes.push({
type_id: list.name,
type_name: list.name
})
}
return { class: classes, filters }
},
推荐: async function (tid, pg, filter, extend) {
const { input, pdfa, pdfh, pd } = this;
const html = await request("https://duanjuzy.com/vod/index.html?page=1&type=recommend");
const response = JSON.parse(html);
const lists = response.data;
const vod = [];
lists.forEach((list) => {
vod.push({
vod_name: list.title,
vod_id: list.id,
vod_pic: list.image,
vod_remarks: list.subtitle
})
});
return vod;
},
一级: async function (tid, pg, filter, extend) {
const { input, pdfa, pdfh, pd } = this;
const html = await request(input);
const response = JSON.parse(html);
const lists = response.data;
const vod = [];
lists.forEach((list) => {
vod.push({
vod_name: list.title,
vod_id: list.id,
vod_pic: list.image,
vod_remarks: list.subtitle
})
});
return vod;
},
二级: async function (ids) {
const { input, pdfa, pdfh, pd } = this;
const url = `${this.host}/vod/detail/id/${ids[0]}.html`
const html = await request(url);
const response = JSON.parse(html);
const vod = {
vod_id: response.id,
vod_name: response.title,
vod_pic: response.image,
};
const playFroms = ["源动力偷的线路"];
const playUrls = [];
const episodes = response.list;
const tmpUrls = [];
const image = response.image;
const basePlayUrl = image.split('/').slice(0, -1).join('/');
episodes.forEach((episode) => {
const index = episode.nid;
const playUrl = `${basePlayUrl}/${index}.mp4`;
tmpUrls.push(`${episode.name}$${playUrl}`);
});
playUrls.push(tmpUrls.join('#'));
vod.vod_play_from = playFroms.join('$$$');
vod.vod_play_url = playUrls.join('$$$');
return vod;
},
搜索: async function (wd, quick, pg) {
const { input, pdfa, pdfh, pd } = this;
const html = await request(input);
const response = JSON.parse(html);
const lists = response.data;
const vod = [];
lists.forEach((list) => {
vod.push({
vod_name: list.title,
vod_id: list.id,
vod_pic: list.image,
vod_remarks: list.subtitle
})
});
return vod;
},
lazy: async function (flag, id, flags) {
const { input, pdfa, pdfh, pd } = this;
console.log(input)
if (/m3u8|mp4|flv/.test(input)) {
return { parse: 0, url: input };
} else {
return { parse: 1, url: input };
}
}
}