Skip to content

Commit 8f1dbcf

Browse files
committed
update:修复一些细节问题,增加解密工具
1 parent 947acf6 commit 8f1dbcf

File tree

8 files changed

+102
-26
lines changed

8 files changed

+102
-26
lines changed

Diff for: controllers/decoder.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import {getOriginalJs} from '../libs/drpyS.js';
2+
import {readFileSync, existsSync} from 'fs';
3+
import path from "path";
4+
5+
// 仅仅支持json post 如: {"code":"xxx"}
6+
export default (fastify, options, done) => {
7+
// 注册 POST 路由
8+
fastify.post('/decoder', async (request, reply) => {
9+
const {auth_code, code} = request.body;
10+
11+
if (!code || !auth_code) {
12+
return reply.status(400).send({error: 'Missing required parameters: code and auth_code'});
13+
}
14+
const authFilePath = path.join(options.rootDir, '.nomedia');
15+
16+
// 检查文件是否存在
17+
if (!existsSync(authFilePath)) {
18+
return reply.status(404).send({error: '.nomedia file not found'});
19+
}
20+
const local_auto_code = readFileSync(authFilePath, 'utf-8').trim();
21+
console.log('local_auto_code:',local_auto_code);
22+
console.log('auth_code:',auth_code);
23+
if (auth_code !== local_auto_code) {
24+
return reply.status(200).send({error: 'your auth_code is not correct'});
25+
}
26+
27+
try {
28+
let result = getOriginalJs(code);
29+
reply.send({success: true, result});
30+
} catch (error) {
31+
reply.status(500).send({error: error.message});
32+
}
33+
});
34+
done();
35+
};

Diff for: controllers/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import configController from './config.js';
33
import apiController from './api.js';
44
import rootController from './root.js';
55
import encoderController from './encoder.js';
6+
import decoderController from './decoder.js';
67
import webController from './web.js';
78

89
export const registerRoutes = (fastify, options) => {
@@ -11,5 +12,6 @@ export const registerRoutes = (fastify, options) => {
1112
fastify.register(apiController, options);
1213
fastify.register(rootController, options);
1314
fastify.register(encoderController, options);
15+
fastify.register(decoderController, options);
1416
fastify.register(webController, options);
1517
};

Diff for: custom.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,55 @@
44
"key": "drpyS_人人视频",
55
"name": "人人视频(drpyS)",
66
"type": 4,
7-
"api": "http://localhost:5757/api/人人视频",
7+
"api": "http://192.168.31.49:5757/api/人人视频",
88
"searchable": 1,
99
"ext": ""
1010
},
1111
{
1212
"key": "drpyS_星芽短剧",
1313
"name": "星芽短剧(drpyS)",
1414
"type": 4,
15-
"api": "http://localhost:5757/api/星芽短剧",
15+
"api": "http://192.168.31.49:5757/api/星芽短剧",
1616
"searchable": 1,
1717
"ext": ""
1818
},
1919
{
2020
"key": "drpyS_番茄小说[书]",
2121
"name": "番茄小说[书](drpyS)",
2222
"type": 4,
23-
"api": "http://localhost:5757/api/番茄小说[书]",
23+
"api": "http://192.168.31.49:5757/api/番茄小说[书]",
2424
"searchable": 1,
2525
"ext": ""
2626
},
2727
{
2828
"key": "drpyS_色花堂[密+]",
2929
"name": "色花堂[密+](drpyS)",
3030
"type": 4,
31-
"api": "http://localhost:5757/api/色花堂[密+]",
31+
"api": "http://192.168.31.49:5757/api/色花堂[密+]",
3232
"searchable": 1,
3333
"ext": ""
3434
},
3535
{
3636
"key": "drpyS_草榴社区[密]",
3737
"name": "草榴社区[密](drpyS)",
3838
"type": 4,
39-
"api": "http://localhost:5757/api/草榴社区[密]",
39+
"api": "http://192.168.31.49:5757/api/草榴社区[密]",
4040
"searchable": 1,
4141
"ext": ""
4242
},
4343
{
4444
"key": "drpyS_金牌影院",
4545
"name": "金牌影院(drpyS)",
4646
"type": 4,
47-
"api": "http://localhost:5757/api/金牌影院",
47+
"api": "http://192.168.31.49:5757/api/金牌影院",
4848
"searchable": 1,
4949
"ext": ""
5050
},
5151
{
5252
"key": "drpyS_黑料不打烊[密]",
5353
"name": "黑料不打烊[密](drpyS)",
5454
"type": 4,
55-
"api": "http://localhost:5757/api/黑料不打烊[密]",
55+
"api": "http://192.168.31.49:5757/api/黑料不打烊[密]",
5656
"searchable": 1,
5757
"ext": ""
5858
}

Diff for: docs/updateRecord.md

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
5. 暴露更多函数给drpyS源使用。如gzip、ungzip等等
1212
6. 增加源加密功能
1313
7. 根目录增加.nomedia规避手机相册识别ts文件为媒体图片问题
14+
8. 修复金牌影视代理播放不支持海阔引擎的问题
15+
9. 增加会员解密功能
16+
10. 修复pupWebview没引入成功的问题
1417

1518
### 20241205
1619

Diff for: index.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,55 @@
44
"key": "drpyS_人人视频",
55
"name": "人人视频(drpyS)",
66
"type": 4,
7-
"api": "http://localhost:5757/api/人人视频",
7+
"api": "http://192.168.31.49:5757/api/人人视频",
88
"searchable": 1,
99
"ext": ""
1010
},
1111
{
1212
"key": "drpyS_星芽短剧",
1313
"name": "星芽短剧(drpyS)",
1414
"type": 4,
15-
"api": "http://localhost:5757/api/星芽短剧",
15+
"api": "http://192.168.31.49:5757/api/星芽短剧",
1616
"searchable": 1,
1717
"ext": ""
1818
},
1919
{
2020
"key": "drpyS_番茄小说[书]",
2121
"name": "番茄小说[书](drpyS)",
2222
"type": 4,
23-
"api": "http://localhost:5757/api/番茄小说[书]",
23+
"api": "http://192.168.31.49:5757/api/番茄小说[书]",
2424
"searchable": 1,
2525
"ext": ""
2626
},
2727
{
2828
"key": "drpyS_色花堂[密+]",
2929
"name": "色花堂[密+](drpyS)",
3030
"type": 4,
31-
"api": "http://localhost:5757/api/色花堂[密+]",
31+
"api": "http://192.168.31.49:5757/api/色花堂[密+]",
3232
"searchable": 1,
3333
"ext": ""
3434
},
3535
{
3636
"key": "drpyS_草榴社区[密]",
3737
"name": "草榴社区[密](drpyS)",
3838
"type": 4,
39-
"api": "http://localhost:5757/api/草榴社区[密]",
39+
"api": "http://192.168.31.49:5757/api/草榴社区[密]",
4040
"searchable": 1,
4141
"ext": ""
4242
},
4343
{
4444
"key": "drpyS_金牌影院",
4545
"name": "金牌影院(drpyS)",
4646
"type": 4,
47-
"api": "http://localhost:5757/api/金牌影院",
47+
"api": "http://192.168.31.49:5757/api/金牌影院",
4848
"searchable": 1,
4949
"ext": ""
5050
},
5151
{
5252
"key": "drpyS_黑料不打烊[密]",
5353
"name": "黑料不打烊[密](drpyS)",
5454
"type": 4,
55-
"api": "http://localhost:5757/api/黑料不打烊[密]",
55+
"api": "http://192.168.31.49:5757/api/黑料不打烊[密]",
5656
"searchable": 1,
5757
"ext": ""
5858
}

Diff for: js/金牌影院.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ var rule = {
165165
tsUrls.push(line)
166166
}
167167
})
168-
m3u8_text = tsUrls.join('\n')
168+
let m3u8_text = tsUrls.join('\n')
169169
return [200,'application/vnd.apple.mpegurl', m3u8_text];
170170
}
171171
},

Diff for: libs/drpyS.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ let pupWebview = null;
3737
if (typeof fetchByHiker === 'undefined') { // 判断是海阔直接放弃导入puppeteer
3838
try {
3939
// 尝试动态导入模块puppeteerHelper
40-
const {puppeteerHelper} = await import('../utils/headless-util'); // 使用动态 import
40+
const {puppeteerHelper} = await import('../utils/headless-util.js'); // 使用动态 import
4141
pupWebview = new puppeteerHelper();
4242
console.log('puppeteerHelper imported successfully');
4343
} catch (error) {

Diff for: views/encoder.html

+46-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>drpyS源加密工具</title>
6+
<title>drpyS源加解密工具</title>
77
<script src="/public/jquery.min.js"></script>
88
<style>
99
/* 通用样式 */
@@ -114,7 +114,7 @@
114114
<body>
115115

116116
<div class="container">
117-
<h2>drpyS源加密工具</h2>
117+
<h2>drpyS源加解密工具</h2>
118118

119119
<!-- 输入框 -->
120120
<textarea class="input-box" id="input-code" placeholder="在此输入待加密的文本..."></textarea>
@@ -135,16 +135,17 @@ <h2>drpyS源加密工具</h2>
135135
<button class="clear-btn" id="clear-input-btn">清空输入</button>
136136
<button class="clear-btn" id="clear-output-btn">清空输出</button>
137137
<button class="copy-btn" id="copy-result-btn">复制加密结果</button>
138+
<button class="copy-btn" id="decrypt-btn">解密</button>
138139
</div>
139140

140141
<!-- 加密结果 -->
141142
<textarea class="result-box" id="result-code" placeholder="加密后的结果将显示在此..."></textarea>
142143
</div>
143144

144145
<script>
145-
$(document).ready(function() {
146+
$(document).ready(function () {
146147
// 加密按钮点击事件
147-
$('#encrypt-btn').click(function() {
148+
$('#encrypt-btn').click(function () {
148149
// 获取输入的内容和加密类型
149150
const code = $('#input-code').val();
150151
const type = $('#encryption-type').val();
@@ -159,33 +160,33 @@ <h2>drpyS源加密工具</h2>
159160
url: '/encoder',
160161
method: 'POST',
161162
contentType: 'application/json',
162-
data: JSON.stringify({ code, type }),
163-
success: function(response) {
163+
data: JSON.stringify({code, type}),
164+
success: function (response) {
164165
// 显示加密后的结果
165166
if (response.success) {
166167
$('#result-code').val(response.result);
167168
} else {
168169
alert('加密失败:' + response.error);
169170
}
170171
},
171-
error: function(xhr, status, error) {
172+
error: function (xhr, status, error) {
172173
alert('请求失败,请稍后再试。');
173174
}
174175
});
175176
});
176177

177178
// 清空输入框按钮点击事件
178-
$('#clear-input-btn').click(function() {
179+
$('#clear-input-btn').click(function () {
179180
$('#input-code').val('');
180181
});
181182

182183
// 清空输出框按钮点击事件
183-
$('#clear-output-btn').click(function() {
184+
$('#clear-output-btn').click(function () {
184185
$('#result-code').val('');
185186
});
186187

187188
// 复制加密结果按钮点击事件
188-
$('#copy-result-btn').click(function() {
189+
$('#copy-result-btn').click(function () {
189190
const resultText = $('#result-code').val();
190191
if (resultText) {
191192
// 创建临时文本框来复制文本
@@ -200,6 +201,41 @@ <h2>drpyS源加密工具</h2>
200201
alert('没有加密结果可以复制');
201202
}
202203
});
204+
205+
// 解密按钮点击事件
206+
$('#decrypt-btn').click(function () {
207+
const code = $('#result-code').val();
208+
if (!code) {
209+
alert("请填写密文!");
210+
return;
211+
}
212+
// 弹窗提示用户支付凭证
213+
if (confirm("此功能仅限会员使用,V我50开启,是否继续?")) {
214+
const authCode = prompt("请输入您的支付凭证:");
215+
216+
if (authCode) {
217+
// 发送解密请求
218+
$.ajax({
219+
url: '/decoder',
220+
method: 'POST',
221+
contentType: 'application/json',
222+
data: JSON.stringify({auth_code: authCode, code}),
223+
success: function (response) {
224+
if (response.success) {
225+
// 解密成功,将结果放入待加密框
226+
$('#input-code').val(response.result);
227+
} else {
228+
alert("解密失败:" + response.error);
229+
}
230+
},
231+
error: function (xhr, status, error) {
232+
alert("解密请求失败,请稍后再试。" + error);
233+
}
234+
});
235+
}
236+
}
237+
});
238+
203239
});
204240
</script>
205241

0 commit comments

Comments
 (0)