-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy path腾云驾雾[官].js
201 lines (200 loc) · 9.71 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
var rule = {
title: '腾云驾雾[官]',
host: 'https://v.%71%71.com',
homeUrl: '/x/bu/pagesheet/list?_all=1&append=1&channel=cartoon&listpage=1&offset=0&pagesize=21&iarea=-1&sort=18',
detailUrl: 'https://node.video.%71%71.com/x/api/float_vinfo2?cid=fyid',
searchUrl: 'https://pbaccess.video.%71%71.com/trpc.videosearch.smartboxServer.HttpRountRecall/Smartbox?query=**&appID=3172&appKey=lGhFIPeD3HsO9xEp&pageNum=(fypage-1)&pageSize=10',
searchable: 2,
filterable: 1,
url: '/x/bu/pagesheet/list?_all=1&append=1&channel=fyclass&listpage=1&offset=((fypage-1)*21)&pagesize=21&iarea=-1',
filter_url: 'sort={{fl.sort or 75}}&iyear={{fl.iyear}}&year={{fl.year}}&itype={{fl.type}}&ifeature={{fl.feature}}&iarea={{fl.area}}&itrailer={{fl.itrailer}}&gender={{fl.sex}}',
filter: 'H4sIAAAAAAAAA+1Y3U8aWRT/X+ZZEwYEtI9207Rp0r40+9CNDxM7G8laaZCamsYEinyoDYp1sa1I/aJSK4ita3Eo9J+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1FmpAQ+D37dH7PE4qsvPe7btyftuE5ezknPgriXTvPPidy/H7ELlmd6yTHeEO0wPqH/52C2DoHzvZsqtHdvqAZE5lBiYrGbNZoAWDFnmPBS6uQv/VzT1mjDV/KsWPjV5n9113mwZ8r2V+fSuVIJsQNJ+WjRZmAX5/YBpLUiLYrIVJBvxon+yw2SEPGpYDmLX4dUDzgG5npEyKbwPQnrGepDAP2/09NvcvaIIuCAgUAAA=',
headers: {
'User-Agent': 'PC_UA'
},
timeout: 5000,
cate_exclude: '会员|游戏|全部',
class_name: '精选&电影&电视剧&综艺&动漫&少儿&纪录片',
class_url: 'choice&movie&tv&variety&cartoon&child&doco',
limit: 20,
play_parse: true,
// 推荐: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
// 一级: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
推荐: async function () {
let {input, pdfa, pdfh, pd} = this;
let html = await request(input);
let d = [];
let data = pdfa(html, '.list_item');
data.forEach((it) => {
d.push({
title: pdfh(it, 'img&&alt'),
pic_url: pd(it, 'img&&src'),
desc: pdfh(it, 'a&&Text'),
url: pdfh(it, 'a&&data-float'),
})
});
return setResult(d)
},
一级: async function () {
let {input, pdfa, pdfh, pd, MY_CATE} = this;
let html = await request(input);
let d = [];
let data = pdfa(html, '.list_item');
data.forEach((it) => {
d.push({
title: pdfh(it, 'img&&alt'),
pic_url: pd(it, 'img&&src'),
desc: pdfh(it, 'a&&Text'),
url: MY_CATE + '$' + pdfh(it, 'a&&data-float'),
})
});
return setResult(d)
},
二级: async function () {
let {input, pdfh, pd, fetch_params} = this;
let d = [];
let VOD = {};
let video_list = [];
let video_lists = [];
let list = [];
let QZOutputJson;
let html = await request(input);
let sourceId = /get_playsource/.test(input) ? input.match(/id=(\d*?)&/)[1] : input.split("cid=")[1];
let cid = sourceId;
let detailUrl = "https://v.%71%71.com/detail/m/" + cid + ".html";
log("详情页:" + detailUrl);
try {
let json = JSON.parse(html);
VOD = {
vod_url: input,
vod_name: json.c.title,
type_name: json.typ.join(","),
vod_actor: json.nam.join(","),
vod_year: json.c.year,
vod_content: json.c.description,
vod_remarks: json.rec,
vod_pic: urljoin(input, json.c.pic)
}
} catch (e) {
log("解析片名海报等基础信息发生错误:" + e.message)
}
if (/get_playsource/.test(input)) {
eval(html);
let indexList = QZOutputJson.PlaylistItem.indexList;
for (const it of indexList) {
let dataUrl = "https://s.video.qq.com/get_playsource?id=" + sourceId + "&plat=2&type=4&data_type=3&range=" + it + "&video_type=10&plname=qq&otype=json";
eval(await fetch(dataUrl, fetch_params));
let vdata = QZOutputJson.PlaylistItem.videoPlayList;
vdata.forEach(function (item) {
d.push({
title: item.title,
pic_url: item.pic,
desc: item.episode_number + "\t\t\t播放量:" + item.thirdLine,
url: item.playUrl
})
});
video_lists = video_lists.concat(vdata)
}
} else {
let json = JSON.parse(html);
video_lists = json.c.video_ids;
let url = "https://v.qq.com/x/cover/" + sourceId + ".html";
if (video_lists.length === 1) {
let vid = video_lists[0];
url = "https://v.qq.com/x/cover/" + cid + "/" + vid + ".html";
d.push({
title: "在线播放",
url: url
})
} else if (video_lists.length > 1) {
for (let i = 0; i < video_lists.length; i += 30) {
video_list.push(video_lists.slice(i, i + 30))
}
let t1 = (new Date()).getTime();
let reqUrls = video_list.map(it => {
let o_url = "https://union.video.qq.com/fcgi-bin/data?otype=json&tid=1804&appid=20001238&appkey=6c03bbe9658448a4&union_platform=1&idlist=" + it.join(",");
return {
url: o_url,
options: {
timeout: rule.timeout,
headers: rule.headers
}
}
});
let htmls = await batchFetch(reqUrls);
let t2 = (new Date()).getTime();
log(`批量请求二级 ${detailUrl} 耗时${t2 - t1}毫秒:`);
htmls.forEach((ht) => {
if (ht) {
eval(ht);
// QZOutputJson = JSON5.parse(ht.split('QZOutputJson=')[1].slice(0, -1));
// log(QZOutputJson)
QZOutputJson.results.forEach(function (it1) {
it1 = it1.fields;
let url = "https://v.qq.com/x/cover/" + cid + "/" + it1.vid + ".html";
d.push({
title: it1.title,
pic_url: it1.pic160x90.replace("/160", ""),
desc: it1.video_checkup_time,
url: url,
type: it1.category_map && it1.category_map.length > 1 ? it1.category_map[1] : ""
})
})
}
});
}
}
let yg = d.filter(function (it) {
return it.type && it.type !== "正片"
});
let zp = d.filter(function (it) {
return !(it.type && it.type !== "正片")
});
VOD.vod_play_from = yg.length < 1 ? "qq" : "qq$$$qq 预告及花絮";
VOD.vod_play_url = yg.length < 1 ? d.map(function (it) {
return it.title + "$" + it.url
}).join("#") : [zp, yg].map(function (it) {
return it.map(function (its) {
return its.title + "$" + its.url
}).join("#")
}).join("$$$");
return VOD
},
搜索: async function () {
let {input} = this;
let d = [];
let html = await request(input);
let json = JSON.parse(html);
if (json.data.smartboxItemList.length > 0) {
for (const vod of json.data.smartboxItemList.filter(it => it.basicDoc && it.basicDoc.id)) {
let cid = vod.basicDoc.id;
let title = vod.basicDoc.title;
let url = 'https://node.video.qq.com/x/api/float_vinfo2?cid=' + cid;
if (vod.videoInfo && vod.videoInfo.imgUrl) {
d.push({
title: title,
img: vod.videoInfo.imgUrl,
url: url,
content: '',
desc: vod.videoInfo.typeName || ''
});
} else {
let html1 = await request(url);
let data = JSON.parse(html1);
d.push({
title: data.c.title,
img: data.c.pic,
url: url,
content: data.c.description,
desc: data.rec
});
}
}
}
return setResult(d);
},
lazy: async function () {
let {input} = this;
return {parse: 1, jx: 1, url: input}
}
}