Skip to content

Commit 8c51d25

Browse files
committed
update:发布1.1.1版本
1 parent ad72eb2 commit 8c51d25

36 files changed

+2370
-385
lines changed

Diff for: README.md

+38-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# drpyS(drpy-node)
22

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

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

1717
## 更新记录
1818

19-
### 20250104
19+
### 20250105
2020

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

23-
1. 支持采王
23+
1. 增加了一些源,小改了框架功能
2424

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

27+
**注意事项**
28+
29+
总是有人遇到各种奇葩问题,像什么没弹幕,访问/config/1服务马上崩溃等等,能自行解决最好,解决不了我建议你使用下方安装教程 `3.道长腾讯轻量云服务器安装方案`
30+
跟我一样还有问题那就不可能了,我能用你即能用
31+
2732
## 基础框架
2833

2934
todo:
@@ -36,7 +41,7 @@ todo:
3641

3742
精简去除的库:
3843

39-
1. axios
44+
1. axios(这个去不掉,刚需,后端请求才能拿到set-cookie)
4045
2. jsonpath
4146
3. underscore
4247
4. pino-pretty
@@ -78,3 +83,31 @@ todo:
7883
`echo "30 7 * * * bash /path/autorun.sh >> /path/logfile.log 2>&1" | crontab -`
7984

8085
命令说明 /patch 为脚本存放路径(脚本放在与源码同级的自定义目录中)
86+
87+
3.道长腾讯轻量云服务器安装方案
88+
89+
```shell
90+
mkdir /home/node_work
91+
cd /home/node_work
92+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
93+
source ~/.bashrc
94+
nvm install 22
95+
npm config set registry https://registry.npmmirror.com
96+
npm i -g cnpm --registry=https://registry.npmmirror.com
97+
npm i -g pm2 [email protected]
98+
git clone https://github.com/hjdhnx/drpy-node.git
99+
cd drpy-node
100+
yarn
101+
yarn pm2
102+
pm2 logs drpys
103+
pm2 ls
104+
pm2 stop drpys
105+
pm2 start drpys
106+
pm2 restart drpys
107+
```
108+
109+
## 代理转发功能测试
110+
111+
* [代理转发ds](/req/https://github.com/hjdhnx/drpy-node)
112+
* [代理转发百度](/req/https://www.baidu.com)
113+
* [代理转发范冰冰直播源](/req/https://live.fanmingming.com/tv/m3u/ipv6.m3u)

Diff for: controllers/api.js

+21-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@ export default (fastify, options, done) => {
4545
return proxyUrl
4646
};
4747
return {
48-
proxyUrl, publicUrl, jsonUrl, httpUrl, mediaProxyUrl, hostUrl, fServer, getProxyUrl, ext: moduleExt
48+
proxyUrl,
49+
publicUrl,
50+
jsonUrl,
51+
httpUrl,
52+
mediaProxyUrl,
53+
hostUrl,
54+
hostname,
55+
fServer,
56+
getProxyUrl,
57+
ext: moduleExt
4958
}
5059
}
5160

@@ -212,6 +221,7 @@ export default (fastify, options, done) => {
212221
httpUrl,
213222
mediaProxyUrl,
214223
hostUrl,
224+
hostname,
215225
fServer,
216226
getProxyUrl,
217227
ext: moduleExt
@@ -310,7 +320,16 @@ export default (fastify, options, done) => {
310320
return proxyUrl
311321
};
312322
return {
313-
proxyUrl, publicUrl, jsonUrl, httpUrl, mediaProxyUrl, hostUrl, getProxyUrl, fServer, ext: moduleExt
323+
proxyUrl,
324+
publicUrl,
325+
jsonUrl,
326+
httpUrl,
327+
mediaProxyUrl,
328+
hostUrl,
329+
hostname,
330+
getProxyUrl,
331+
fServer,
332+
ext: moduleExt
314333
}
315334
}
316335

Diff for: controllers/config.js

+12
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@ async function generateSiteJSON(jsDir, configDir, requestHost, sub, subFilePath,
104104
});
105105
// 等待所有的文件处理完成
106106
await Promise.all(filePromises);
107+
// 订阅再次处理别名的情况
108+
if (sub) {
109+
if (sub.mode === 0) {
110+
sites = sites.filter(it => (new RegExp(sub.reg || '.*')).test(it.name));
111+
} else if (sub.mode === 1) {
112+
sites = sites.filter(it => !(new RegExp(sub.reg || '.*')).test(it.name));
113+
}
114+
}
115+
// 青少年模式再次处理自定义别名的情况
116+
if (ENV.get('hide_adult') === '1') {
117+
sites = sites.filter(it => !(new RegExp('\\[[密]\\]|密+')).test(it.name));
118+
}
107119
sites = naturalSort(sites, 'name', sort_list);
108120
return {sites};
109121
}

Diff for: controllers/http.js

+41
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import axios from 'axios';
22
import http from 'http';
33
import https from 'https';
4+
import {ENV} from '../utils/env.js';
45

56
const AgentOption = {keepAlive: true, maxSockets: 64, timeout: 30000}; // 最大连接数64,30秒定期清理空闲连接
67
// const AgentOption = {keepAlive: true};
@@ -82,5 +83,45 @@ export default (fastify, options, done) => {
8283
}
8384
});
8485

86+
fastify.all('/req/*', async (request, reply) => {
87+
// 非VERCEL环境可在设置中心控制此功能是否开启
88+
if (!process.env.VERCEL) {
89+
if (ENV.get('allow_forward') !== '1') {
90+
return reply.code(403).send({error: 'Forward api is not allowed by owner'});
91+
}
92+
}
93+
try {
94+
const targetUrl = request.params['*'];
95+
if (!/^https?:\/\//.test(targetUrl)) {
96+
return reply.code(400).send({error: 'Invalid URL. Must start with http:// or https://'});
97+
}
98+
console.log(`Forwarding request to: ${targetUrl}`);
99+
delete request.headers['host'];
100+
const response = await _axios({
101+
method: request.method,
102+
url: targetUrl,
103+
headers: request.headers,
104+
data: request.body,
105+
params: request.query,
106+
timeout: 10000,
107+
});
108+
109+
reply
110+
.code(response.status)
111+
.headers(response.headers)
112+
.send(response.data);
113+
} catch (error) {
114+
console.error('Error forwarding request:', error.message);
115+
if (error.response) {
116+
reply
117+
.code(error.response.status)
118+
.headers(error.response.headers)
119+
.send(error.response.data);
120+
} else {
121+
reply.code(500).send({error: `Internal Server Error:${error.message}`});
122+
}
123+
}
124+
});
125+
85126
done();
86127
};

Diff for: custom.json

+111-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"sites_count": 50,
2+
"sites_count": 61,
33
"sites": [
44
{
55
"key": "drpyS_设置中心",
@@ -96,6 +96,16 @@
9696
"quickSearch": 0,
9797
"ext": "H4sIAAAAAAAAA9PT088qzs/Tfzp5ytPJK59NnfmiaZMeSAQAgv7xPBkAAAA="
9898
},
99+
{
100+
"key": "drpyS_哔哩影视[官]",
101+
"name": "哔哩影视[官](DS)",
102+
"type": 4,
103+
"api": "http://localhost:5757/api/哔哩影视[官]",
104+
"searchable": 1,
105+
"filterable": 1,
106+
"quickSearch": 0,
107+
"ext": ""
108+
},
99109
{
100110
"key": "drpyS_哔哩直播[官]",
101111
"name": "哔哩直播[官](DS)",
@@ -106,6 +116,16 @@
106116
"quickSearch": 0,
107117
"ext": ""
108118
},
119+
{
120+
"key": "drpyS_播剧网",
121+
"name": "播剧网(DS)",
122+
"type": 4,
123+
"api": "http://localhost:5757/api/播剧网",
124+
"searchable": 1,
125+
"filterable": 1,
126+
"quickSearch": 0,
127+
"ext": ""
128+
},
109129
{
110130
"key": "drpyS_采王成人[密]",
111131
"name": "采王成人[密](DS)",
@@ -216,6 +236,16 @@
216236
"quickSearch": 0,
217237
"ext": ""
218238
},
239+
{
240+
"key": "drpyS_虎斑[盘]",
241+
"name": "虎斑[盘](DS)",
242+
"type": 4,
243+
"api": "http://localhost:5757/api/虎斑[盘]",
244+
"searchable": 0,
245+
"filterable": 0,
246+
"quickSearch": 0,
247+
"ext": ""
248+
},
219249
{
220250
"key": "drpyS_火车太堵",
221251
"name": "火车太堵(DS)",
@@ -286,6 +316,46 @@
286316
"quickSearch": 0,
287317
"ext": ""
288318
},
319+
{
320+
"key": "drpyS_美颜怪[擦]",
321+
"name": "美颜怪[擦](DS)",
322+
"type": 4,
323+
"api": "http://localhost:5757/api/美颜怪[擦]",
324+
"searchable": 0,
325+
"filterable": 0,
326+
"quickSearch": 0,
327+
"ext": ""
328+
},
329+
{
330+
"key": "drpyS_木偶[盘]",
331+
"name": "木偶[盘](DS)",
332+
"type": 4,
333+
"api": "http://localhost:5757/api/木偶[盘]",
334+
"searchable": 1,
335+
"filterable": 1,
336+
"quickSearch": 0,
337+
"ext": ""
338+
},
339+
{
340+
"key": "drpyS_欧哥[盘]",
341+
"name": "欧哥[盘](DS)",
342+
"type": 4,
343+
"api": "http://localhost:5757/api/欧哥[盘]",
344+
"searchable": 1,
345+
"filterable": 1,
346+
"quickSearch": 0,
347+
"ext": ""
348+
},
349+
{
350+
"key": "drpyS_皮皮虾[优]",
351+
"name": "皮皮虾[优](DS)",
352+
"type": 4,
353+
"api": "http://localhost:5757/api/皮皮虾[优]",
354+
"searchable": 2,
355+
"filterable": 1,
356+
"quickSearch": 0,
357+
"ext": ""
358+
},
289359
{
290360
"key": "drpyS_七度空间[密]",
291361
"name": "七度空间[密](DS)",
@@ -356,6 +426,16 @@
356426
"quickSearch": 0,
357427
"ext": ""
358428
},
429+
{
430+
"key": "drpyS_特下饭[盘]",
431+
"name": "特下饭[盘](DS)",
432+
"type": 4,
433+
"api": "http://localhost:5757/api/特下饭[盘]",
434+
"searchable": 1,
435+
"filterable": 1,
436+
"quickSearch": 0,
437+
"ext": ""
438+
},
359439
{
360440
"key": "drpyS_团长资源[盘]",
361441
"name": "团长资源[盘](DS)",
@@ -426,6 +506,16 @@
426506
"quickSearch": 0,
427507
"ext": ""
428508
},
509+
{
510+
"key": "drpyS_樱漫[漫]",
511+
"name": "樱漫[漫](DS)",
512+
"type": 4,
513+
"api": "http://localhost:5757/api/樱漫[漫]",
514+
"searchable": 1,
515+
"filterable": 0,
516+
"quickSearch": 0,
517+
"ext": ""
518+
},
429519
{
430520
"key": "drpyS_直播转点播[合]",
431521
"name": "直播转点播[合](DS)",
@@ -486,6 +576,16 @@
486576
"quickSearch": 0,
487577
"ext": ""
488578
},
579+
{
580+
"key": "drpyS_Nyafun[漫]",
581+
"name": "Nyafun[漫](DS)",
582+
"type": 4,
583+
"api": "http://localhost:5757/api/Nyafun[漫]",
584+
"searchable": 1,
585+
"filterable": 0,
586+
"quickSearch": 1,
587+
"ext": ""
588+
},
489589
{
490590
"key": "drpyS_OmoFun[漫]",
491591
"name": "OmoFun[漫](DS)",
@@ -506,6 +606,16 @@
506606
"quickSearch": 0,
507607
"ext": ""
508608
},
609+
{
610+
"key": "drpyS_TVB云播",
611+
"name": "TVB云播(DS)",
612+
"type": 4,
613+
"api": "http://localhost:5757/api/TVB云播",
614+
"searchable": 2,
615+
"filterable": 1,
616+
"quickSearch": 2,
617+
"ext": ""
618+
},
509619
{
510620
"key": "drpyS_x草榴社区[密]",
511621
"name": "x草榴社区[密](DS)",

0 commit comments

Comments
 (0)