-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathOmoFun[漫].js
131 lines (123 loc) · 3.98 KB
/
OmoFun[漫].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
class Rule {
类型 = '影视';
title = 'OmoFun';
desc = 'http://fb.omofun.one';
host = 'https://omofunw.com';
homeUrl = '/';
url = '/index.php/vod/show/id/fyclass/page/fypage.html';
searchUrl = '/index.php/vod/search/page/fypage/wd/**.html';
searchable = 2;
quickSearch = 0;
timeout = 5000;
play_parse = true;
async class_parse() {
let classes = [
{type_id: '22', type_name: '动漫电影'},
{type_id: '23', type_name: '欧美动漫'},
{type_id: '20', type_name: '日本动漫'},
];
return {class: classes,}
}
async 预处理() {
}
async 推荐() {
let {input, pdfa, pdfh, pd} = this;
let html = await request(input);
let d = [];
let data = pdfa(html, '.hl-vod-list li');
data.forEach((it) => {
d.push({
title: pdfh(it, 'a&&title'),
pic_url: pd(it, '.hl-lazy&&data-original'),
desc: pdfh(it, '.public-list-prb&&Text'),
url: pd(it, 'a&&href'),
})
});
return setResult(d)
}
async 一级(tid, pg, filter, extend) {
let {input, pdfa, pdfh, pd} = this;
let html = await request(input);
let d = [];
let data = pdfa(html, '.hl-vod-list li');
data.forEach((it) => {
d.push({
title: pdfh(it, 'a&&title'),
pic_url: pd(it, '.hl-lazy&&data-original'),
desc: pdfh(it, '.public-list-prb&&Text'),
url: pd(it, 'a&&href'),
})
});
return setResult(d)
}
async 搜索(wd, quick, pg) {
let {input, pdfa, pdfh, pd} = this;
let html = await request(input);
let d = [];
let data = pdfa(html, '.hl-one-list.hl-theme-by li');
data.forEach((it) => {
d.push({
title: pdfh(it, 'a&&title'),
pic_url: pd(it, '.hl-lazy&&data-original'),
desc: pdfh(it, '.hl-pic-text&&Text'),
url: pd(it, 'a&&href'),
content: pdfh(it, 'p:eq(0)&&Text'),
})
});
return setResult(d)
}
async 二级(ids) {
let {
input,
pdfa,
pdfh,
pd
} = this;
let html = await request(input);
let VOD = {};
VOD.vod_name = pdfh(html, 'h2&&Text');
VOD.vod_content = pdfh(html, '.hl-col-xs-12.blurb&&Text');
let playlist = pdfa(html, '#hl-plays-list')
let tabs = pdfa(html, '.hl-plays-from.hl-tabs a');
let playmap = {};
tabs.map((item, i) => {
const form = pdfh(item, 'Text')
const list = playlist[i]
const a = pdfa(list, 'body&&a:not(:contains(展开))')
a.map((it) => {
let title = pdfh(it, 'a&&Text')
let urls = pd(it, 'a&&href', input)
if (!playmap.hasOwnProperty(form)) {
playmap[form] = [];
}
playmap[form].push(title + "$" + urls);
});
});
VOD.vod_play_from = Object.keys(playmap).join('$$$');
const urls = Object.values(playmap);
const playUrls = urls.map((urllist) => {
return urllist.join("#")
});
VOD.vod_play_url = playUrls.join('$$$');
return VOD
}
async lazy(flag, id, flags) {
let {input} = this
const html = JSON.parse((await req(input)).content.match(/r player_.*?=(.*?)</)[1]);
let url = html.url;
if (html.encrypt == "1") {
url = unescape(url)
return {parse: 0, url: url}
} else if (html.encrypt == "2") {
url = unescape(base64Decode(url))
return {parse: 0, url: url}
}
if (/m3u8|mp4/.test(url)) {
input = url
return {parse: 0, url: input}
} else {
return {parse: 0, url: input}
}
}
}
rule = new Rule();