Skip to content

Commit e736c2b

Browse files
committed
update:发布1.1.2版本
1 parent 3ca8504 commit e736c2b

File tree

14 files changed

+797
-228
lines changed

14 files changed

+797
-228
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# drpyS(drpy-node)
22

33
nodejs作为服务端的drpy实现。全面升级异步写法
4-
积极开发中,每日一更,当前进度 `27%`
4+
积极开发中,每日一更,当前进度 `28%`
55

66
* [本地配置接口-动态本地](/config?pwd=)
77
* [本地配置接口-动态外网/局域网](/config/1?pwd=)
@@ -16,11 +16,11 @@ nodejs作为服务端的drpy实现。全面升级异步写法
1616

1717
## 更新记录
1818

19-
### 20250105
19+
### 20250106
2020

21-
更新至V1.1.1
21+
更新至V1.1.2
2222

23-
1. 增加了一些源,小改了框架功能
23+
1. 重写底层 `req` 方法,实现 `gbk` 等网页编码支持
2424

2525
[点此查看完整更新记录](docs/updateRecord.md)
2626

custom.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"sites_count": 61,
2+
"sites_count": 63,
33
"sites": [
44
{
55
"key": "drpyS_设置中心",
@@ -216,6 +216,16 @@
216216
"quickSearch": 0,
217217
"ext": ""
218218
},
219+
{
220+
"key": "drpyS_光速[优]",
221+
"name": "光速[优](DS)",
222+
"type": 4,
223+
"api": "http://localhost:5757/api/光速[优]",
224+
"searchable": 1,
225+
"filterable": 0,
226+
"quickSearch": 0,
227+
"ext": ""
228+
},
219229
{
220230
"key": "drpyS_好乐影视",
221231
"name": "好乐影视(DS)",
@@ -286,6 +296,16 @@
286296
"quickSearch": 0,
287297
"ext": ""
288298
},
299+
{
300+
"key": "drpyS_九七电影网",
301+
"name": "九七电影网(DS)",
302+
"type": 4,
303+
"api": "http://localhost:5757/api/九七电影网",
304+
"searchable": 2,
305+
"filterable": 0,
306+
"quickSearch": 0,
307+
"ext": ""
308+
},
289309
{
290310
"key": "drpyS_蜡笔[盘]",
291311
"name": "蜡笔[盘](DS)",

docs/updateRecord.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# drpyS更新记录
22

3+
### 20250106
4+
5+
更新至V1.1.2
6+
7+
1. 修复 `动漫巴士[漫].js`
8+
2. 重写 `req` 方法,使之支持 `request` 使用时支持字符串解码功能,支持 `gbk`等类型的网站数据,与之对应的源 `九七电影网.js`
9+
3. ds推送兼容装逼壳新增推送相关属性 `vod_play_flag` `vod_play_index` `vod_play_position`
10+
4. 增加源 `光速[优].js`
11+
312
### 20250105
413

514
更新至V1.1.1

index.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"sites_count": 61,
2+
"sites_count": 63,
33
"sites": [
44
{
55
"key": "drpyS_设置中心",
@@ -216,6 +216,16 @@
216216
"quickSearch": 0,
217217
"ext": ""
218218
},
219+
{
220+
"key": "drpyS_光速[优]",
221+
"name": "光速[优](DS)",
222+
"type": 4,
223+
"api": "http://localhost:5757/api/光速[优]",
224+
"searchable": 1,
225+
"filterable": 0,
226+
"quickSearch": 0,
227+
"ext": ""
228+
},
219229
{
220230
"key": "drpyS_好乐影视",
221231
"name": "好乐影视(DS)",
@@ -286,6 +296,16 @@
286296
"quickSearch": 0,
287297
"ext": ""
288298
},
299+
{
300+
"key": "drpyS_九七电影网",
301+
"name": "九七电影网(DS)",
302+
"type": 4,
303+
"api": "http://localhost:5757/api/九七电影网",
304+
"searchable": 2,
305+
"filterable": 0,
306+
"quickSearch": 0,
307+
"ext": ""
308+
},
289309
{
290310
"key": "drpyS_蜡笔[盘]",
291311
"name": "蜡笔[盘](DS)",

js/_base.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
var rule = {
2+
类型: '影视',
3+
title: '',
4+
host: '',
5+
url: '',
6+
searchUrl: '',
7+
headers: {'User-Agent': 'UC_UA'},
8+
searchable: 1,
9+
quickSearch: 0,
10+
filterable: 0,
11+
double: true,
12+
play_parse: true,
13+
limit: 6,
14+
class_name: '电影&电视剧&动漫&短剧&综艺',
15+
class_url: '1&2&3&4&5',
16+
hostJs: async function () {
17+
let {HOST} = this;
18+
return await request(HOST);
19+
},
20+
预处理: async function () {
21+
22+
},
23+
class_parse: async function () {
24+
let {input, pdfa, pdfh, pd} = this;
25+
return {}
26+
},
27+
lazy: async function () {
28+
let {input} = this;
29+
return input
30+
},
31+
推荐: async function () {
32+
let {input, pdfa, pdfh, pd} = this;
33+
let d = [];
34+
return setResult(d)
35+
},
36+
一级: async function () {
37+
let {input, pdfa, pdfh, pd} = this;
38+
let d = [];
39+
return setResult(d)
40+
},
41+
二级: async function () {
42+
let {input, pdfa, pdfh, pd} = this;
43+
let VOD = {};
44+
return VOD
45+
},
46+
搜索: async function () {
47+
let {input, pdfa, pdfh, pd} = this;
48+
let d = [];
49+
return setResult(d)
50+
}
51+
}

js/_lib.request.js

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const iconv = require('iconv-lite');
2+
13
async function requestHtml(url, options) {
24
try {
35
let html = (await req(url, options)).content;
@@ -43,10 +45,42 @@ async function getHtml(config) {
4345

4446
}
4547

48+
async function req_(reqUrl, mt, headers, data) {
49+
let config = {
50+
method: mt || 'Get',
51+
url: reqUrl,
52+
headers: headers || {
53+
'User-Agent': 'Mozilla/5.0 (Linux; Android 9; RMX1931 Build/PQ3A.190605.05081124; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/91.0.4472.114 Mobile Safari/537.36 QSTAPP/1.6.9 Html5Plus/1.0',
54+
},
55+
data: data || '',
56+
};
57+
let res = await axios.request(config);
58+
return res.data;
59+
}
60+
61+
async function req_encoding(reqUrl, mt, headers, encoding, data) {
62+
let config = {
63+
method: mt || 'Get',
64+
url: reqUrl,
65+
headers: headers || {
66+
'User-Agent': 'Mozilla/5.0 (Linux; Android 9; RMX1931 Build/PQ3A.190605.05081124; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/91.0.4472.114 Mobile Safari/537.36 QSTAPP/1.6.9 Html5Plus/1.0',
67+
},
68+
data: data || '',
69+
responseType: 'arraybuffer'
70+
};
71+
let res = await axios.request(config);
72+
if (encoding) {
73+
res.data = iconv.decode(res.data, encoding);
74+
}
75+
return res.data;
76+
}
77+
4678
$.exports = {
4779
requestHtml,
4880
requestJson,
4981
getPublicIp,
50-
getHtml
82+
getHtml,
83+
req_,
84+
req_encoding
5185
// axios // 没法import系统库
5286
}

js/push_agent.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ var rule = {
4040
vod.vod_play_url = push_vod.url || push_vod.vod_play_url || '';
4141
// 推送json兼容依赖播放属性
4242
vod.vod_play_api = push_vod.vod_play_api || '';
43+
vod.vod_play_flag = push_vod.vod_play_flag || null;
44+
vod.vod_play_index = push_vod.vod_play_index || null;
45+
vod.vod_play_position = push_vod.vod_play_position || null;
4346
return vod
4447
} catch (e) {
4548
}

js/九七电影网.js

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
var rule = {
2+
类型: '影视',
3+
title: '九七电影网',
4+
编码: 'gb18030',
5+
desc: '不告诉你',
6+
host: 'http://m.aogetu.com',
7+
url: '/fyclass/indexfypage.html[/fyclass]',
8+
searchUrl: '/s.asp?page=fypage&searchword=**&searchtype=-1',
9+
headers: {'User-Agent': 'MOBILE_UA'},
10+
searchable: 2, quickSearch: 0, timeout: 5000, play_parse: true, filterable: 0,
11+
class_name: '动作片&喜剧片&爱情片&科幻片&恐怖片&剧情片&战争片&纪录片&VIP&动画&国产剧&欧美剧&香港剧&韩国剧&台湾剧&日本剧&泰国剧&海外剧&微短剧&国产动漫&日韩动漫&欧美动漫&其他动漫&大陆综艺&香港综艺&台湾综艺&日韩综艺&欧美综艺&其他综艺&理论片&写真&主播',
12+
class_url: 'dianying/dongzuopian&dianying/xijupian&dianying/aiqingpian&dianying/kehuanpian&dianying/kongbupian&dianying/juqingpian&dianying/zhanzhengpian&dianying/jilupian&dianying/fuli&dianying/dhdy&dianshiju/guochanju&dianshiju/oumeiju&dianshiju/hongkongju&dianshiju/hanguoju&dianshiju/taiwanju&dianshiju/ribengju&dianshiju/taiguoju&dianshiju/haiwaiju&dianshiju/duanju&dongmandonghua/guochandonghua&dongmandonghua/ribendongman&dongmandonghua/oumeidongman&dongmandonghua/qitadongman&zongyiyule/daluzongyi&zongyiyule/hongkongzongyi&zongyiyule/taiwanzongyi&zongyiyule/rihanzongyi&zongyiyule/oumeizongyi&zongyiyule/qitazongyi&wuyejuchang/lunli&wuyejuchang/xiezhen&wuyejuchang/zhubo',
13+
预处理: async () => {
14+
return []
15+
},
16+
推荐: async function (tid, pg, filter, extend) {
17+
let {input, pdfa, pdfh, pd} = this;
18+
let html = await request(input);
19+
let d = [];
20+
let data = pdfa(html, '.list_tab_img li');
21+
data.forEach((it) => {
22+
d.push({
23+
title: pdfh(it, 'a&&title'),
24+
pic_url: pd(it, '.loading&&data-original'),
25+
desc: pdfh(it, '.title&&Text'),
26+
url: pd(it, 'a&&href'),
27+
})
28+
});
29+
return setResult(d)
30+
},
31+
一级: async function (tid, pg, filter, extend) {
32+
let {input, pdfa, pdfh, pd} = this;
33+
let html = await request(input);
34+
let d = [];
35+
let data = pdfa(html, '.list_tab_img li');
36+
data.forEach((it) => {
37+
d.push({
38+
title: pdfh(it, 'a&&title'),
39+
pic_url: pd(it, '.loading&&data-original'),
40+
desc: pdfh(it, '.name&&Text'),
41+
url: pd(it, 'a&&href'),
42+
})
43+
});
44+
return setResult(d)
45+
},
46+
二级: async function (ids) {
47+
let {input, pdfa, pdfh, pd} = this;
48+
let html = await request(input);
49+
let VOD = {};
50+
VOD.vod_name = pdfh(html, 'h1&&Text');
51+
VOD.vod_content = pdfh(html, '.v-js.clear.yc&&Text');
52+
let playlist = pdfa(html, '.plau-ul-list');
53+
let tabs = pdfa(html, '.vod-info-tab .play-title');
54+
let playmap = {};
55+
tabs.map((item, i) => {
56+
const form = pdfh(item, 'Text');
57+
const list = playlist[i];
58+
const a = pdfa(list, 'body&&a');
59+
a.map((it) => {
60+
let title = pdfh(it, 'a&&Text');
61+
let urls = pd(it, 'a&&href', input);
62+
if (!playmap.hasOwnProperty(form)) {
63+
playmap[form] = [];
64+
}
65+
playmap[form].push(title + "$" + urls);
66+
});
67+
});
68+
VOD.vod_play_from = Object.keys(playmap).join('$$$');
69+
const urls = Object.values(playmap);
70+
const playUrls = urls.map((urllist) => {
71+
return urllist.join("#");
72+
});
73+
VOD.vod_play_url = playUrls.join('$$$');
74+
return VOD;
75+
},
76+
搜索: async function (wd, quick, pg) {
77+
let {input, pdfa, pdfh, pd} = this;
78+
let html = await request(input);
79+
let d = [];
80+
let data = pdfa(html, '.list_tab_img li');
81+
data.forEach((it) => {
82+
d.push({
83+
title: pdfh(it, 'a&&title'),
84+
pic_url: pd(it, '.loading&&data-original'),
85+
desc: pdfh(it, '.name&&Text'),
86+
url: pd(it, 'a&&href'),
87+
content: pdfh(it, ''),
88+
})
89+
});
90+
return setResult(d);
91+
},
92+
lazy: async function (flag, id, flags) {
93+
let {input, pdfa, pdfh, pd} = this;
94+
let html = await request(input);
95+
// log(html);
96+
html = JSON.parse(html.match(/r player_.*?=(.*?)</)[1]);
97+
let url = html.url;
98+
if (html.encrypt == "1") {
99+
url = unescape(url)
100+
return {parse: 0, url: url}
101+
} else if (html.encrypt == "2") {
102+
url = unescape(base64Decode(url))
103+
return {parse: 0, url: url}
104+
}
105+
if (/m3u8|mp4/.test(url)) {
106+
input = url
107+
return {parse: 0, url: input}
108+
} else {
109+
return {parse: 0, url: input}
110+
}
111+
}
112+
}

0 commit comments

Comments
 (0)