Skip to content

Commit 2b3e2a7

Browse files
authored
Merge branch 'main' into main
2 parents 0a4ac00 + 46e0b73 commit 2b3e2a7

File tree

12 files changed

+575
-40
lines changed

12 files changed

+575
-40
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ pm2 restart drpys
180180
* [源动力-老](https://sourcepower.top/index)
181181
* [电竞专业反应测试](https://www.arealme.com/brain-memory-game/zh/)
182182
* [桌面启动器](https://wwbty.lanzouv.com/iDZaP3d3i5ud)
183+
* [不知名获取网盘CK工具](http://sspa8.top:8100/pan/admin/index.php)
183184

184185
## AI接入
185186

apps/cookie-butler/index.html

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,21 @@
1212
<script src="./static/js/crypto-js.min.js"></script>
1313
<script src="./static/js/core.js"></script>
1414
<script src="./static/js/cookie.js"></script>
15+
<script src="./static/js/jsencrypt.min.js"></script>
1516
</head>
1617
<body class="bg-gray-100 font-sans">
1718
<div class="artboard phone-2 box p-4">
1819
<!-- Navigation Menu -->
1920
<ul class="menu menu-horizontal lg:menu-horizontal bg-base-200 rounded-box mb-4">
2021
<li><a class="btn-scan" data-platform="ali">阿里</a></li>
2122
<li><a class="btn-scan" data-platform="quark">夸克</a></li>
23+
<li><a class="btn-scan" data-platform="quark_token">夸克TV</a></li>
2224
<li><a class="btn-scan" data-platform="uc">UC</a></li>
2325
<li><a class="btn-scan" data-platform="uc_token">UC_TOKEN</a></li>
2426
<li><a class="btn-scan" data-platform="bili">哔哩哔哩</a></li>
27+
<li><a class="btn-scan" data-platform="yun">移动</a></li>
2528
<li><a class="btn-scan" data-platform="baidu">百度</a></li>
29+
<li><a class="btn-scan" data-platform="pikpak">PikPak</a></li>
2630
</ul>
2731

2832
<!-- QR Code -->
@@ -93,28 +97,67 @@
9397
const textValue = document.getElementById("cookie-res").value || '';
9498
const active_name = activeLi.textContent.trim();
9599
const active_key = activeLi.getAttribute('data-platform').trim();
96-
const save_key = active_key === 'ali' ? active_key + '_token' : active_key + '_cookie';
100+
let save_key = ''
101+
if (/ali|pikpak/.test(active_key)) {
102+
save_key = active_key + '_token'
103+
} else {
104+
save_key = active_key + '_cookie';
105+
}
106+
97107
console.log(`准备入库cookie:${active_name} ${save_key},值为:${textValue}`);
98108

99109
const cookie_auth_code = prompt('cookie入库功能需要管理员授权码,请你正确输入后继续');
100110
if (cookie_auth_code) {
101-
// 使用 axios 发送 POST 请求
102-
axios.post('/admin/cookie-set', {
103-
cookie_auth_code: cookie_auth_code,
104-
key: save_key,
105-
value: textValue.trim().replaceAll('\n', '')
106-
})
107-
.then(response => {
111+
if (save_key.includes('pikpak')) {
112+
// 使用 axios 发送 POST 请求
113+
axios.post('/admin/cookie-set', {
114+
cookie_auth_code: cookie_auth_code,
115+
key: save_key,
116+
value: textValue.split(';')[0].trim().replaceAll('\n', '')
117+
}).then(response => {
108118
if (response.data.success) {
109119
alert(`Cookie 入库成功:${active_name} (${save_key})`);
110120
} else {
111121
alert(`入库失败:${response.data.message}`);
112122
}
113-
})
114-
.catch(error => {
123+
}).catch(error => {
124+
console.error('请求失败:', error);
125+
alert(`入库失败,服务器出现问题,请稍后再试。\n${error.response.data.message}`);
126+
});
127+
axios.post('/admin/cookie-set', {
128+
cookie_auth_code: cookie_auth_code,
129+
key: save_key.replace('token', 'refresh_token'),
130+
value: textValue.split(';')[1].trim().replaceAll('\n', '')
131+
}).then(response => {
132+
if (response.data.success) {
133+
alert(`Cookie 入库成功:${active_name} (${save_key.replace('token', 'refresh_token')})`);
134+
} else {
135+
alert(`入库失败:${response.data.message}`);
136+
}
137+
}).catch(error => {
115138
console.error('请求失败:', error);
116139
alert(`入库失败,服务器出现问题,请稍后再试。\n${error.response.data.message}`);
117140
});
141+
} else {
142+
// 使用 axios 发送 POST 请求
143+
axios.post('/admin/cookie-set', {
144+
cookie_auth_code: cookie_auth_code,
145+
key: save_key,
146+
value: textValue.trim().replaceAll('\n', '')
147+
})
148+
.then(response => {
149+
if (response.data.success) {
150+
alert(`Cookie 入库成功:${active_name} (${save_key})`);
151+
} else {
152+
alert(`入库失败:${response.data.message}`);
153+
}
154+
})
155+
.catch(error => {
156+
console.error('请求失败:', error);
157+
alert(`入库失败,服务器出现问题,请稍后再试。\n${error.response.data.message}`);
158+
});
159+
}
160+
118161
}
119162
} else {
120163
alert('至少选中一个cookie入库项目');

apps/cookie-butler/static/js/cookie.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function showToast(message, type = 'success') {
2020
// 初始化页面
2121
async function initializePage() {
2222
// 加载cookie
23-
const platforms = ['ali', 'quark', 'uc', 'uc_token', 'bili', 'baidu'];
23+
const platforms = ['ali', 'quark', 'quark_token', 'uc', 'uc_token', 'bili', 'yun', 'baidu', 'pikpak'];
2424

2525
// 绑定按钮事件
2626
platforms.forEach(platform => {

apps/cookie-butler/static/js/jsencrypt.min.js

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

controllers/config.js

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,12 @@ async function generateSiteJSON(options, requestHost, sub, pwd) {
327327
}
328328

329329
fileSites.forEach((fileSite) => {
330-
if (enable_dr2 === '1') {
330+
if (enable_dr2 === '1' || enable_dr2 === '2') {
331331
// dr2ApiType=0 使用接口drpy2 dr2ApiType=1 使用壳子内置的drpy2
332332
let api = dr2ApiType ? `assets://js/lib/drpy2.js` : `${requestHost}/public/drpy/drpy2.min.js`;
333+
if (enable_dr2 === '2') {
334+
api = `${requestHost}/public/drpy/drpy2-fast.min.js`;
335+
}
333336
let ext = `${requestHost}/js/${file}`;
334337
if (pwd) {
335338
ext += `?pwd=${pwd}`;
@@ -348,31 +351,33 @@ async function generateSiteJSON(options, requestHost, sub, pwd) {
348351
ext: ext || "", // 固定为空字符串
349352
};
350353
sites.push(site);
351-
} else if (enable_dr2 === '2') {
352-
// 模式2:只启用T3脚本的T4风格API配置
353-
const t4site = {
354-
key: fileSite.key,
355-
name: fileSite.name,
356-
type: 4, // 固定值
357-
api: `${requestHost}/api/${baseName}`,
358-
...ruleMeta,
359-
ext: "", // 固定为空字符串
360-
};
361-
// 添加isdr2参数到API URL
362-
if (pwd) {
363-
t4site.api += `?pwd=${pwd}&do=dr`;
364-
} else {
365-
t4site.api += `?do=dr`;
366-
}
367-
368-
// 处理传参源的API参数
369-
if (fileSite.queryStr) {
370-
const separator = t4site.api.includes('?') ? '&' : '?';
371-
site.api += `${separator}extend=${encodeURIComponent(fileSite.queryStr)}`;
372-
}
373-
374-
sites.push(t4site);
375354
}
355+
// else if (enable_dr2 === '2') {
356+
//
357+
// // 模式2:只启用T3脚本的T4风格API配置
358+
// const t4site = {
359+
// key: fileSite.key,
360+
// name: fileSite.name,
361+
// type: 4, // 固定值
362+
// api: `${requestHost}/api/${baseName}`,
363+
// ...ruleMeta,
364+
// ext: "", // 固定为空字符串
365+
// };
366+
// // 添加isdr2参数到API URL
367+
// if (pwd) {
368+
// t4site.api += `?pwd=${pwd}&do=dr`;
369+
// } else {
370+
// t4site.api += `?do=dr`;
371+
// }
372+
//
373+
// // 处理传参源的API参数
374+
// if (fileSite.queryStr) {
375+
// const separator = t4site.api.includes('?') ? '&' : '?';
376+
// site.api += `${separator}extend=${encodeURIComponent(fileSite.queryStr)}`;
377+
// }
378+
//
379+
// sites.push(t4site);
380+
// }
376381
});
377382
},
378383
param: {file, dr2Dir, requestHost, pwd, drpyS, SitesMap},

public/drpy/drpy2-fast.min.js

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

0 commit comments

Comments
 (0)