Skip to content

Commit ef021d5

Browse files
author
Taois
committed
feat: 发布新版本,修复致命性bug
1 parent d29cb7e commit ef021d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2155
-538
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,4 @@ dist
154154
/.plugins.js
155155
/clipboard.txt
156156
/clipboard.txt.bak
157+
/apps/cat/

README.md

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

33
nodejs作为服务端的drpy实现。全面升级异步写法
4-
~~积极开发中,每日一更~~,当前进度 `93%`
4+
~~积极开发中,每日一更~~,当前进度 `95%`
55
~~找工作中,随缘更新~~
66
上班当牛马,下班要带娃,阶段性佛系趁娃睡觉熬夜更新
77

config/map.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@ getapp3.4.4@@{"host": "https://sykjw.xyz", "key": "sicnagduxbSfisnz", "api": 2}@
6363
getapp3.4.4@@{"host": "https://guowaiju.com", "key": "7xv16h7qgkrs9b1p"}@@外剧[AG³]
6464
getapp3.4.4@@{"host": "https://appcms.xy4k.com", "key": "7SDWjknU34zqFbVr"}@@小野[AG³]
6565
getapp3.4.4@@{"host": "http://tvb.yy-fun.cc", "key": "jcTz6Jda2aKrH8Tk"}@@掌上追剧[AG³]
66+
AppHs@@{"host": "https://dy.jmzp.net.cn", "app_id": "shiguang", "deviceid": "", "versionCode": "10000", "UMENG_CHANNEL": "guan"}@@拾光视频[Hs]
67+
AppHs@@{"host": "https://dy.jszdzs.com", "app_id": "xuebao", "deviceid": "", "versionCode": "21300", "UMENG_CHANNEL": "share"}@@雪豹视频[Hs]
68+
AppHs@@{"host": "https://dy.stxbed.com", "app_id": "haigou", "deviceid": "", "versionCode": "20100", "UMENG_CHANNEL": "zhuan"}@@海狗视频[Hs]

controllers/api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default (fastify, options, done) => {
5454

5555
// console.log(`proxyUrl:${proxyUrl}`);
5656
function getEnv(moduleName) {
57-
const proxyUrl = `${protocol}://${hostname}/proxy/${moduleName}/?do=${query.do||'ds'}`;
57+
const proxyUrl = `${protocol}://${hostname}/proxy/${moduleName}/?do=${query.do||'ds'}&extend=${encodeURIComponent(moduleExt)}`;
5858
const getProxyUrl = function () {
5959
return proxyUrl
6060
};
@@ -227,7 +227,7 @@ export default (fastify, options, done) => {
227227
const fServer = fastify.server;
228228

229229
function getEnv(moduleName) {
230-
const proxyUrl = `${protocol}://${hostname}/proxy/${moduleName}/?do=${query.do||'ds'}`;
230+
const proxyUrl = `${protocol}://${hostname}/proxy/${moduleName}/?do=${query.do||'ds'}&extend=${encodeURIComponent(moduleExt)}`;
231231
const getProxyUrl = function () {
232232
return proxyUrl
233233
};
@@ -332,7 +332,7 @@ export default (fastify, options, done) => {
332332
const fServer = fastify.server;
333333

334334
function getEnv(moduleName) {
335-
const proxyUrl = `${protocol}://${hostname}${request.url}`.split('?')[0].replace('/parse/', '/proxy/') + `/?do=${query.do||"ds"}`;
335+
const proxyUrl = `${protocol}://${hostname}${request.url}`.split('?')[0].replace('/parse/', '/proxy/') + `/?do=${query.do||"ds"}&extend=${encodeURIComponent(moduleExt)}`;
336336
const getProxyUrl = function () {
337337
return proxyUrl
338338
};

controllers/http.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
import axios from 'axios';
2-
import http from 'http';
3-
import https from 'https';
41
import {ENV} from '../utils/env.js';
52
import {keysToLowerCase} from '../utils/utils.js';
3+
import createAxiosInstance from "../utils/createAxiosAgent.js";
64

7-
const AgentOption = {keepAlive: true, maxSockets: 64, timeout: 30000}; // 最大连接数64,30秒定期清理空闲连接
8-
// const AgentOption = {keepAlive: true};
9-
const httpAgent = new http.Agent(AgentOption);
10-
const httpsAgent = new https.Agent({rejectUnauthorized: false, ...AgentOption});
11-
12-
// 配置 axios 使用代理
13-
const _axios = axios.create({
14-
httpAgent, // 用于 HTTP 请求的代理
15-
httpsAgent, // 用于 HTTPS 请求的代理
16-
});
5+
const maxSockets = 64;
6+
const _axios = createAxiosInstance({maxSockets: maxSockets});
177

188
export default (fastify, options, done) => {
199
// 读取 views 目录下的 encoder.html 文件并返回
@@ -29,7 +19,7 @@ export default (fastify, options, done) => {
2919
if (!Object.keys(headers).includes('accept')) {
3020
headers['accept'] = '*/*';
3121
}
32-
console.log('http headers:', headers);
22+
console.log(`[httpController] url: ${url} | method: ${method} | params: ${JSON.stringify(params)} | data: ${JSON.stringify(data)} | headers: ${JSON.stringify(headers)}`);
3323
try {
3424
const response = await _axios({
3525
url,

controllers/mediaProxy.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,14 @@ import '../utils/random-http-ua.js'
33
import {keysToLowerCase} from '../utils/utils.js';
44
import {ENV} from "../utils/env.js";
55
import chunkStream, {testSupport} from '../utils/chunk.js';
6-
import http from 'http';
7-
import https from 'https';
8-
import axios from 'axios';
9-
10-
const AgentOption = {keepAlive: true, maxSockets: 64, timeout: 30000}; // 最大连接数64,30秒定期清理空闲连接
11-
// const AgentOption = {keepAlive: true};
12-
const httpAgent = new http.Agent(AgentOption);
13-
// const httpsAgent = new https.Agent({rejectUnauthorized: false, ...AgentOption});
14-
// 代理媒体还是保证一下证书正确
15-
const httpsAgent = new https.Agent(AgentOption);
16-
17-
// 配置 axios 使用代理
18-
const _axios = axios.create({
19-
httpAgent, // 用于 HTTP 请求的代理
20-
httpsAgent, // 用于 HTTPS 请求的代理
21-
});
6+
import createAxiosInstance from '../utils/createAxiosAgent.js';
7+
8+
const maxSockets = 64;
9+
const _axios = createAxiosInstance({
10+
maxSockets: maxSockets,
11+
rejectUnauthorized: true // 不忽略证书错误
12+
},
13+
);
2214

2315
export default (fastify, options, done) => {
2416
// 用法同 https://github.com/Zhu-zi-a/mediaProxy

data/cat/index.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ module.exports = __toCommonJS(index_config_exports);
2525
var index_config_default = {
2626
drpyS: {
2727
config_url: "$config_url",
28-
// 本地ds 支持
29-
// config_url: 'http://localhost:5707/config/0?sub=dzyyds', // 本地hipy-t4 支持
3028
home_site: "$host/api/设置中心",
3129
enable_dspush: 1,
3230
enable_home_site: 0,

data/cat/index.js

Lines changed: 106 additions & 106 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/updateRecord.md

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

3+
### 20250905
4+
5+
更新至V1.2.25
6+
7+
1. 更新 `百度盘` 插件及相关资源
8+
2. 增加几个ds源
9+
3. 增加一个Hipy模板
10+
4. 修复设置中心扫码类动作错误
11+
5. 完善hipy测试用例文件: `base_test.py`
12+
6. 全部T4本地代理接口传入`extend` 参数保证模板源可以正常代理
13+
7. 修复猫爪兼容性问题,完美支持hipy t4
14+
8. 制定新Hipy标准-所有模板类hipy源(即map.txt传参源),重新规范所有hipy模板源代码。
15+
必须写下面代码,禁止直接定义类共享变量防止多个实例同时使用出问题,其他非模板源允许定义类共享变量:
16+
17+
```python
18+
def __init__(self, query_params=None, t4_api=None):
19+
super().__init__(query_params=query_params, t4_api=t4_api)
20+
self.自定义变量 = {}
21+
```
22+
323
### 20250903
424

525
更新至V1.2.24

libs_drpy/drpyBatchFetch.js

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
import PQueue from 'p-queue';
22
import Queue from 'queue';
3-
import http from 'http';
4-
import https from 'https';
5-
import axios from 'axios';
3+
import createAxiosInstance from '../utils/createAxiosAgent.js';
4+
5+
const maxSockets = 16;
6+
const _axios = createAxiosInstance({maxSockets:maxSockets});
67

7-
const batchSockets = 16;
88

99
export const batchFetch1 = async (items, maxWorkers = 5, timeoutConfig = 5000) => {
1010
let t1 = (new Date()).getTime();
11-
const AgentOption = {keepAlive: true, maxSockets: batchSockets, timeout: 30000}; // 最大连接数64,30秒定期清理空闲连接
12-
// const AgentOption = {keepAlive: true};
13-
const httpAgent = new http.Agent(AgentOption);
14-
const httpsAgent = new https.Agent({rejectUnauthorized: false, ...AgentOption});
15-
16-
// 配置 axios 使用代理
17-
const _axios = axios.create({
18-
httpAgent, // 用于 HTTP 请求的代理
19-
httpsAgent, // 用于 HTTPS 请求的代理
20-
});
2111
const queue = new PQueue({concurrency: maxWorkers});
2212

2313
// 获取全局 timeout 设置
@@ -51,16 +41,6 @@ export const batchFetch1 = async (items, maxWorkers = 5, timeoutConfig = 5000) =
5141

5242
export const batchFetch2 = async (items, maxWorkers = 5, timeoutConfig = 5000) => {
5343
let t1 = (new Date()).getTime();
54-
const AgentOption = {keepAlive: true, maxSockets: batchSockets, timeout: 30000}; // 最大连接数64,30秒定期清理空闲连接
55-
// const AgentOption = {keepAlive: true};
56-
const httpAgent = new http.Agent(AgentOption);
57-
const httpsAgent = new https.Agent({rejectUnauthorized: false, ...AgentOption});
58-
59-
// 配置 axios 使用代理
60-
const _axios = axios.create({
61-
httpAgent, // 用于 HTTP 请求的代理
62-
httpsAgent, // 用于 HTTPS 请求的代理
63-
});
6444
const queue = new Queue({concurrency: maxWorkers, autostart: true});
6545

6646
// 获取全局 timeout 设置

0 commit comments

Comments
 (0)