-
Notifications
You must be signed in to change notification settings - Fork 291
Expand file tree
/
Copy path凤凰FM[听].js
More file actions
117 lines (116 loc) · 3.56 KB
/
凤凰FM[听].js
File metadata and controls
117 lines (116 loc) · 3.56 KB
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
/*
@header({
searchable: 2,
filterable: 0,
quickSearch: 1,
title: '凤凰FM',
'类型': '影视',
lang: 'ds'
})
*/
const h_ost = 'https://s.fm.renbenai.com';
var rule = {
title: '凤凰FM',
host: h_ost,
url: '/fm/read/fmd/android/600/getProgramList.html&cid=fyclass&pagenum=fypage',
homeUrl: '/fm/read/fmd/static/categoryTvGet_100.html',
detailUrl: '/fm/read/fmd/android/getProgramAudioList_620.html&pid=fyid',
searchUrl: '/fm/read/fmd/public/search_720.html&keyWord=**&searchType=1&pageNum=fypage',
searchable: 2,
quickSearch: 1,
filterable: 0,
headers: {
'User-Agent': 'okhttp/3.12.11',
'Cookie': 'KLBRSID=9b9dd35888924d7c870dd3474e89cab6|1753290568|1753290499'
},
play_parse: true,
search_match: true,
class_parse: async function () {
let {input} = this;
let html = await request(input);
let classes = [];
let data = JSON.parse(html).data.list[0].channelContent;
data.forEach((it) => {
let typeName = it.nodeName;
let typeId = it.id;
classes.push({
type_name: typeName,
type_id: typeId,
});
});
return {
class: classes,
}
},
一级: async function () {
let {input} = this;
let d = [];
let html = await request(input);
let data = JSON.parse(html).data.hotList;
data.forEach(item => {
let title = item.programName;
if (!/名称|排除/.test(title)) {
d.push({
title: title,
desc: item.resourceTitle,
img: item.img640_640,
url: item.id,
});
}
});
return setResult(d);
},
二级: async function () {
let {input} = this;
let html = await request(input);
let list = JSON.parse(html).data.list;
let VOD = {
vod_name: list[0]['title'] || '暂无名称',
type_name: list[0]['vod_class'] || '暂无类型',
vod_pic: list[0]['img370_370'] || '暂无图片',
vod_remarks: list[0]['tags'] || '暂无备注',
vod_content: list[0]['programDetails'] || '暂无剧情介绍'
};
let playlist = list[0]['audiolist'];
let playForm = [];
let playUrls = [];
list.forEach(item => {
const title = item.title;
const firstUrl = item.audiolist && item.audiolist[0] ? item.audiolist[0].filePath : '';
playUrls.push(`${title}$${firstUrl}`);
});
VOD.vod_play_from = '凤凰FM';
VOD.vod_play_url = playUrls.join('#');
return VOD
},
搜索: async function () {
let {input, KEY} = this;
let d = [];
let html = await request(input);
let data = JSON.parse(html).data.program;
if (rule.search_match) {
data = data.filter(it => {
let title = it.programName;
return title && new RegExp(KEY, "i").test(title);
});
}
data.forEach(item => {
let title = item.programName;
if (!/名称|排除/.test(title)) {
d.push({
title: title,
desc: item.programName,
img: item.img640_640,
url: item.id,
});
}
});
return setResult(d);
},
lazy: async function () {
return {
parse: 0,
url: input
};
},
}