Skip to content

Commit 95ff0f5

Browse files
committed
update:小优化
1 parent b7b8099 commit 95ff0f5

9 files changed

+214
-12
lines changed

Diff for: .gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,3 @@ dist
132132
!README.md
133133
.idea
134134
/config/env.json
135-
/js/玩偶哥哥[].js

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ nodejs作为服务端的drpy实现。全面升级异步写法
1515

1616
## 更新记录
1717

18-
### 20241231
18+
### 20250101
1919

20-
更新至V1.0.27
20+
更新至V1.0.28
2121

22-
1. Ai多样化
23-
2. 接口授权支持
22+
1. basic授权可以不启用
23+
2. 设置中心优化AI的回复
2424

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

Diff for: docs/updateRecord.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# drpyS更新记录
22

3+
### 20250101
4+
5+
更新至V1.0.28
6+
7+
元旦快乐
8+
9+
1. 设置AI功能回复优化,明确知道是哪个AI
10+
2. basic授权机制调整,未配置 `.env` 文件的这两个属性任意一个时不启用此功能
11+
3. 增加`玩偶哥哥[盘].js`,隔壁老三套娃自写,配套筛选
12+
313
### 20241231
414

515
更新至V1.0.27

Diff for: js/玩偶哥哥[盘].js

+184
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
const {getHtml} = $.require('./_lib.request.js')
2+
const {
3+
formatPlayUrl,
4+
} = misc;
5+
var rule = {
6+
title: '玩偶哥哥[盘]',
7+
host: 'https://www.wogg.net',
8+
//url: '/index.php/vod/show/id/fyclass/page/fypage.html',
9+
url: '/vodshow/fyclass-fyfilter.html',
10+
filter_url: '{{fl.area}}-{{fl.by or "time"}}-{{fl.class}}-----fypage---{{fl.year}}',
11+
searchUrl: '/vodsearch/**--------fypage---.html',
12+
filter: 'H4sIAAAAAAAAA+2aW08bRxTHv0rlZx5mISFpvkqVBzey1KhpKkFaCUVIgDHY5mKDCMS1wdzMrdgY7BCzju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5XKdXCGgTA6arh3eUpXQ3ASK79IxwLAPncC1nbQ58G6q94Y5xLNVDcVlk16V5BA8W1Wiqd89xNPl8OmWgemodhJcV50EBtXC8E86sYreEraxw7v77SfVsF+8/qk831NtfbXG/m+okHyvVR+TzqjtVPVoMDrBEA1Ob6mZ/HQQOQL7/nX9IdpAba5kXceQb53WAd720BqM39A1nEsxbAKOcpVXKNe1QN1F/ELWLUHbKsh9OELxnA9FUahq/CZ07/uOt9wvtXAD6/lWW6iHEa+NO5kVWsjwDUZjGrClggAHhermVvh+ZlAP+jc1hUhYg8U0VUnW87b9kziK1Lti79a12afKjbva2P/UOsEwC0FCsN9gHQ9jHZka0F3D5q4DZLsrZPbQ6A2rxreu0jbFMDxZ33gtssxmmguIhfqcJ0zHdyAKzhy3d5QX5V1nap1g2A9C2vhacS1KdhlPrZn1sKDrFGAlB/hbyaX8H+NFBcpsljAaD+jte89jL2p4G092peGzMtgE2XNl3adDl8ZfNQdzb2/y94nPb/L6BN+/8X9lci+yuR3XLYLYfdcsCWY/YvHu9OoPQpAAA=',
13+
cate_exclude: '网址|专题|全部影片',
14+
// tab_rename: {'KUAKE1': '夸克1', 'KUAKE11': '夸克2', 'YOUSEE1': 'UC1', 'YOUSEE11': 'UC2',},
15+
play_parse: true,
16+
searchable: 1,
17+
filterable: 1,
18+
quickSearch: 0,
19+
class_parse: async () => {
20+
let classes = [{
21+
type_id: '1',
22+
type_name: '玩偶电影',
23+
}, {
24+
type_id: '2',
25+
type_name: '玩偶剧集',
26+
}, {
27+
type_id: '44',
28+
type_name: '臻彩视界',
29+
}, {
30+
type_id: '6',
31+
type_name: '玩偶短剧',
32+
}, {
33+
type_id: '3',
34+
type_name: '玩偶动漫',
35+
}, {
36+
type_id: '4',
37+
type_name: '玩偶综艺',
38+
}, {
39+
type_id: '5',
40+
type_name: '玩偶音乐',
41+
}];
42+
return {
43+
class: classes,
44+
}
45+
},
46+
预处理: async () => {
47+
return []
48+
},
49+
推荐: async () => {
50+
return []
51+
},
52+
一级: async function (tid, pg, filter, extend) {
53+
let {MY_CATE, input} = this;
54+
let html = (await getHtml(input)).data
55+
const $ = pq(html)
56+
let videos = []
57+
$('.module-items .module-item').each((index, item) => {
58+
const a = $(item).find('a:first')[0];
59+
const img = $(item).find('img:first')[0];
60+
const content = $(item).find('.video-text:first').text();
61+
videos.push({
62+
"vod_name": a.attribs.title,
63+
"vod_id": a.attribs.href,
64+
"vod_remarks": content,
65+
"vod_pic": img.attribs['data-src']
66+
})
67+
})
68+
return videos
69+
},
70+
二级: async function (ids) {
71+
let {input} = this;
72+
let html = (await getHtml(input)).data
73+
const $ = pq(html)
74+
let vod = {
75+
"vod_name": $('h1.page-title').text(),
76+
"vod_id": input,
77+
"vod_remarks": $('.video-info-item').text(),
78+
"vod_pic": $('.lazyload').attr('data-src'),
79+
"vod_content": $('p.sqjj_a').text(),
80+
}
81+
let playform = []
82+
let playurls = []
83+
for (const item of $('.module-row-title')) {
84+
const a = $(item).find('p:first')[0];
85+
let link = a.children[0].data.trim()
86+
if (/drive.uc.cn/.test(link)) {
87+
const shareData = UC.getShareData(link);
88+
if (shareData) {
89+
const videos = await UC.getFilesByShareUrl(shareData);
90+
if (videos.length > 0) {
91+
playform.push('UC-' + shareData.shareId);
92+
playurls.push(videos.map((v) => {
93+
const list = [shareData.shareId, v.stoken, v.fid, v.share_fid_token, v.subtitle ? v.subtitle.fid : '', v.subtitle ? v.subtitle.share_fid_token : ''];
94+
return v.file_name + '$' + list.join('*');
95+
}).join('#'))
96+
} else {
97+
playform.push('UC-' + shareData.shareId);
98+
playurls.push("资源已经失效,请访问其他资源")
99+
}
100+
}
101+
}
102+
if (/pan.quark.cn/.test(link)) {
103+
const shareData = Quark.getShareData(link);
104+
if (shareData) {
105+
const videos = await Quark.getFilesByShareUrl(shareData);
106+
if (videos.length > 0) {
107+
playform.push('Quark-' + shareData.shareId);
108+
playurls.push(videos.map((v) => {
109+
const list = [shareData.shareId, v.stoken, v.fid, v.share_fid_token, v.subtitle ? v.subtitle.fid : '', v.subtitle ? v.subtitle.share_fid_token : ''];
110+
return v.file_name + '$' + list.join('*');
111+
}).join('#'))
112+
} else {
113+
playform.push('Quark-' + shareData.shareId);
114+
playurls.push("资源已经失效,请访问其他资源")
115+
}
116+
}
117+
}
118+
}
119+
vod.vod_play_from = playform.join("$$$")
120+
vod.vod_play_url = playurls.join("$$$")
121+
return vod
122+
},
123+
搜索: async function (wd, quick, pg) {
124+
let {input} = this
125+
let html = (await getHtml(input)).data
126+
const $ = pq(html)
127+
let videos = []
128+
$('.module-items .module-search-item').each((index, item) => {
129+
const a = $(item).find('a:first')[0];
130+
const img = $(item).find('img:first')[0];
131+
const content = $(item).find('.video-text:first').text();
132+
videos.push({
133+
"vod_name": a.attribs.title,
134+
"vod_id": a.attribs.href,
135+
"vod_remarks": content,
136+
"vod_pic": img.attribs['data-src']
137+
})
138+
})
139+
return videos
140+
},
141+
lazy: async function (flag, id, flags) {
142+
let {input} = this;
143+
const ids = input.split('*');
144+
const urls = [];
145+
let UCDownloadingCache = {};
146+
let UCTranscodingCache = {};
147+
if (flag.startsWith('Quark-')) {
148+
console.log("夸克网盘解析开始")
149+
const down = await Quark.getDownload(ids[0], ids[1], ids[2], ids[3], true);
150+
urls.push("原画", down.download_url + '#fastPlayMode##threads=10#')
151+
const transcoding = (await Quark.getLiveTranscoding(ids[0], ids[1], ids[2], ids[3])).filter((t) => t.accessable);
152+
transcoding.forEach((t) => {
153+
urls.push(t.resolution === 'low' ? "流畅" : t.resolution === 'high' ? "高清" : t.resolution === 'super' ? "超清" : t.resolution, t.video_info.url)
154+
});
155+
return {
156+
parse: 0,
157+
url: urls,
158+
header: {
159+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
160+
'origin': 'https://pan.quark.cn',
161+
'referer': 'https://pan.quark.cn/',
162+
'Cookie': Quark.cookie
163+
}
164+
}
165+
} else if (flag.startsWith('UC-')) {
166+
console.log("UC网盘解析开始")
167+
if (!UCDownloadingCache[ids[1]]) {
168+
const down = await UC.getDownload(ids[0], ids[1], ids[2], ids[3], true);
169+
if (down) UCDownloadingCache[ids[1]] = down;
170+
}
171+
downUrl = UCDownloadingCache[ids[1]].download_url;
172+
urls.push("UC原画", downUrl);
173+
return {
174+
parse: 0,
175+
url: urls,
176+
header: {
177+
"Referer": "https://drive.uc.cn/",
178+
"cookie": UC.cookie,
179+
"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) quark-cloud-drive/2.5.20 Chrome/100.0.4896.160 Electron/18.3.5.4-b478491100 Safari/537.36 Channel/pckk_other_ch'
180+
},
181+
}
182+
}
183+
},
184+
}

Diff for: js/设置中心.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ var rule = {
341341
toast: '你要去看视频了'
342342
});
343343
}
344+
let user1 = '你';
345+
let user2 = 'AI';
344346
let replyContent = prompt;
345347
if (ENV.get('spark_ai_authKey')) {
346348
if (rule.askLock) {
@@ -360,16 +362,19 @@ var rule = {
360362
authKey: ENV.get('spark_ai_authKey'),
361363
baseURL: 'https://spark-api-open.xf-yun.com',
362364
});
365+
user2 = '讯飞星火';
363366
break;
364367
case '2':
365368
AI = new AIS.DeepSeek({
366369
apiKey: ENV.get('deepseek_apiKey'),
367370
});
371+
user2 = 'deepSeek';
368372
break;
369373
case '3':
370374
const sparkBotObject = ENV.get('sparkBotObject', {}, 1);
371375
// log('sparkBotObject:', sparkBotObject);
372376
AI = new AIS.SparkAIBot(sparkBotObject.appId, sparkBotObject.uid, sparkBotObject.assistantId);
377+
user2 = '讯飞智能体';
373378
break;
374379
}
375380
if (!AI) {
@@ -386,7 +391,7 @@ var rule = {
386391
return JSON.stringify({
387392
action: {
388393
actionId: '__keep__',
389-
msg: '你:' + prompt + '\n' + 'AI:' + replyContent,
394+
msg: `${user1}:` + prompt + '\n' + `${user2}:` + replyContent,
390395
reset: true,
391396
msgType: 'long_text',
392397
},

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drpy-node",
3-
"version": "1.0.27",
3+
"version": "1.0.28",
44
"main": "index.js",
55
"type": "module",
66
"scripts": {

Diff for: package.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
EXCLUDE_DIRS = ['.git', '.idea', 'soft', 'drop_code', 'jstest', 'local', 'logs', '对话1.txt']
66

77
# 要排除的文件列表
8-
EXCLUDE_FILES = ['config/env.json', '.env', 'js/玩偶哥哥[盘].js']
8+
EXCLUDE_FILES = ['config/env.json', '.env']
99

1010
def compress_directory():
1111
# 获取当前目录名

Diff for: public/index.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ <h1 id="drpysdrpy-node">drpyS(drpy-node)</h1>
2121
<li><a href="/robots.txt">本站防止爬虫协议</a></li>
2222
</ul>
2323
<h2 id="更新记录">更新记录</h2>
24-
<h3 id="20241231">20241231</h3>
25-
<p>更新至V1.0.27</p>
24+
<h3 id="20250101">20250101</h3>
25+
<p>更新至V1.0.28</p>
2626
<ol>
27-
<li>Ai多样化</li>
28-
<li>接口授权支持</li>
27+
<li>basic授权可以不启用</li>
28+
<li>设置中心优化AI的回复</li>
2929
</ol>
3030
<p><a href="docs/updateRecord.md">点此查看完整更新记录</a></p>
3131
<h2 id="基础框架">基础框架</h2>

Diff for: utils/api_validate.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
// 接口basic验证
22
export const validateBasicAuth = (request, reply, done) => {
3+
if (!process.env.hasOwnProperty('API_AUTH_NAME') && !process.env.hasOwnProperty('API_AUTH_CODE')) {
4+
done();
5+
return
6+
}
37
// console.log('进入了basic验证');
48
const authHeader = request.headers.authorization;
59

0 commit comments

Comments
 (0)