-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy path短剧库.js
174 lines (161 loc) · 4.93 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
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,
预处理: async () => {
return []
},
class_parse: async function () {
const { sign, timestamp } = this.decodeCk();
const html = await request(`${this.host}/label/tabs.html`, {
headers: {
Ck: { user_check:"", time: timestamp, sign, "Version": "1.0.0" },
"Content-Type": "application/x-www-form-urlencoded",
Origin: "https://modupan.com",
Referer: "https://modupan.com/",
}
});
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 { sign, timestamp } = this.decodeCk();
const html = await request(`${this.host}/vod/index.html?page=1&type=recommend`, {
headers: {
Ck: { user_check:"", time: timestamp, sign, "Version": "1.0.0" },
"Content-Type": "application/x-www-form-urlencoded",
Origin: "https://modupan.com",
Referer: "https://modupan.com/",
}
});
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 { sign, timestamp } = this.decodeCk();
const html = await request(input, {
headers: {
Ck: { user_check:"", time: timestamp, sign, "Version": "1.0.0" },
"Content-Type": "application/x-www-form-urlencoded",
Origin: "https://modupan.com",
Referer: "https://modupan.com/",
}
});
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 { sign, timestamp } = this.decodeCk();
const html = await request(url, {
headers: {
Ck: { user_check:"", time: timestamp, sign, "Version": "1.0.0" },
"Content-Type": "application/x-www-form-urlencoded",
Origin: "https://modupan.com",
Referer: "https://modupan.com/",
}
});
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 { sign, timestamp } = this.decodeCk();
const html = await request(input, {
headers: {
Ck: { user_check:"", time: timestamp, sign, "Version": "1.0.0" },
"Content-Type": "application/x-www-form-urlencoded",
Origin: "https://modupan.com",
Referer: "https://modupan.com/",
}
});
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;
if (/m3u8|mp4|flv/.test(input)) {
return { parse: 0, url: input };
} else {
return { parse: 1, url: input };
}
},
decodeCk: function () {
const prefix = 'e3e2e10r058g6';
const suffix = 'e3e2e10r058g6';
const version = 'Version=1.0.0';
const timestamp = Math.ceil(new Date().getTime() / 1000);
const plainText = `${prefix}${encodeURIComponent(version)}${timestamp}${suffix}`;
const sign = md5(plainText);
return { sign, timestamp };
}
}