mirror of
https://github.com/hmjz100/LinkSwift.git
synced 2026-09-20 19:07:06 +08:00
Compare commits
133 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88f775d84a | ||
|
|
c99b4dba62 | ||
|
|
417ea5e28a | ||
|
|
5ddaee64d3 | ||
|
|
7744ac5945 | ||
|
|
78adc569b5 | ||
|
|
8946be21ce | ||
|
|
958960a535 | ||
|
|
a52ac965ff | ||
|
|
2e94035b9c | ||
|
|
e845aad5f8 | ||
|
|
066d9c582a | ||
|
|
572c130858 | ||
|
|
7eeaa23c73 | ||
|
|
615731fa4e | ||
|
|
5c867a14d2 | ||
|
|
72a9230396 | ||
|
|
91f4be5e4f | ||
|
|
5b1a03a0d0 | ||
|
|
fa66fa1581 | ||
|
|
f1ce34acaa | ||
|
|
e2f7886006 | ||
|
|
6155ad4209 | ||
|
|
65749feb0b | ||
|
|
3fdadfe5aa | ||
|
|
92533ea54b | ||
|
|
9b4ffec622 | ||
|
|
3b1d677ff3 | ||
|
|
7f46cbaeaa | ||
|
|
75033579d9 | ||
|
|
aa0c37b8c7 | ||
|
|
16c9adb19b | ||
|
|
5b2bd3b171 | ||
|
|
1653f68aeb | ||
|
|
bc13636cbf | ||
|
|
7ebfdde55a | ||
|
|
11a406e9b6 | ||
|
|
c621b90a5c | ||
|
|
41a0deb82c | ||
|
|
f2c44d3bdb | ||
|
|
9151770e56 | ||
|
|
bc5a184ff7 | ||
|
|
22fcb0c96c | ||
|
|
aca8cc818d | ||
|
|
48d9313f4d | ||
|
|
b4628bb936 | ||
|
|
09cc9d436d | ||
|
|
8b26f3c968 | ||
|
|
f63bad6bda | ||
|
|
d3c37bbd0a | ||
|
|
5efbc291a5 | ||
|
|
52322b2f0a | ||
|
|
a4a92deb1f | ||
|
|
a6176b2f31 | ||
|
|
f2e4f7e915 | ||
|
|
38e90abaca | ||
|
|
cc6e473a6f | ||
|
|
6c2e43d795 | ||
|
|
8774a8bde3 | ||
|
|
42c71cdbcd | ||
|
|
bb4a3065a0 | ||
|
|
0268cfd216 | ||
|
|
6ce5542a1b | ||
|
|
f2e6918b2a | ||
|
|
de2e386054 | ||
|
|
36c82b0c68 | ||
|
|
055f95f59e | ||
|
|
c17f0ce462 | ||
|
|
f3b3dc339d | ||
|
|
bfc5bfbcd7 | ||
|
|
ccc506f5e1 | ||
|
|
6e84bdaf43 | ||
|
|
5a4e5adad5 | ||
|
|
cc30e966e3 | ||
|
|
418ddf0aff | ||
|
|
d163fecd33 | ||
|
|
117a0d031e | ||
|
|
d0e7b423e2 | ||
|
|
3ed88c5ba6 | ||
|
|
839ade0d1e | ||
|
|
817c9523bd | ||
|
|
0be7dce0d8 | ||
|
|
9c02a994ab | ||
|
|
2505f0c1d7 | ||
|
|
33f73a288d | ||
|
|
df5016d480 | ||
|
|
6a5cbcd0d3 | ||
|
|
efe584db25 | ||
|
|
32d379bdc0 | ||
|
|
790f5c6e3a | ||
|
|
5215167bc3 | ||
|
|
fd9b7b8d85 | ||
|
|
12c81bd7d6 | ||
|
|
66693e8d57 | ||
|
|
66cbe6001e | ||
|
|
5aed791110 | ||
|
|
008017bef9 | ||
|
|
7b5d5d7187 | ||
|
|
fe0b9da3e1 | ||
|
|
661d0d2edd | ||
|
|
a62bd7f170 | ||
|
|
ebac943901 | ||
|
|
f04d924027 | ||
|
|
16d58791d7 | ||
|
|
c2b8ed500a | ||
|
|
af7fb760b2 | ||
|
|
56a6a09d07 | ||
|
|
6ff4663193 | ||
|
|
94ead16da8 | ||
|
|
0e77a8037c | ||
|
|
ca05489be3 | ||
|
|
8122505c68 | ||
|
|
5202953008 | ||
|
|
1ff4cda1f8 | ||
|
|
dc19fcc8e4 | ||
|
|
0fe1d212e2 | ||
|
|
b1ce4ebfe6 | ||
|
|
8e301f29cb | ||
|
|
a35674ffb4 | ||
|
|
49a47dbb3c | ||
|
|
0b0a1fc126 | ||
|
|
7f720c5f74 | ||
|
|
e6c8733653 | ||
|
|
b2cf485bb5 | ||
|
|
0651348718 | ||
|
|
c690cdc371 | ||
|
|
a606d8e375 | ||
|
|
547a39d2ed | ||
|
|
df157cb1ec | ||
|
|
07387f1215 | ||
|
|
f7e1e70cd1 | ||
|
|
273a2ea83a | ||
|
|
67317e7431 |
80
.github/CODE_OF_CONDUCT.md
vendored
Normal file
80
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
# 贡献者公约 & 行为准则
|
||||
|
||||
## 我们的承诺
|
||||
|
||||
我们作为成员、贡献者和领导者承诺,让社区参与者免遭骚扰,无论其年龄、体型、可见或不可见的残疾、族裔、性征、性别认同和表达、经验水平、教育程度、社会地位、国籍、外貌、种族、宗教或性取向如何。
|
||||
|
||||
我们承诺以有助于建立开放、友善、多元、包容、健康社区的方式行事和互动。
|
||||
|
||||
## 我们的标准
|
||||
|
||||
有助于为我们的社区创造积极环境的行为包括:
|
||||
|
||||
* 对他人的同理心和善意
|
||||
* 尊重不同的意见、观点和经验
|
||||
* 给予并优雅地接受建设性反馈
|
||||
* 承担责任并向受我们错误影响的人道歉,并从经验中学习
|
||||
* 关注不仅对个人最有利,而且对整个社区最有利的事情
|
||||
|
||||
不可接受的行为包括:
|
||||
|
||||
* 使用性化的语言或图像,以及任何形式的性关注或接近
|
||||
* 挑衅、侮辱或贬损的评论,以及个人或政治攻击
|
||||
* 公开或私下的骚扰
|
||||
* 未经他人明确许可,发布他人的私人信息,例如物理地址或电子邮件地址
|
||||
* 在专业场合下可能被合理视为不适当的其他行为
|
||||
|
||||
## 执行责任
|
||||
|
||||
社区领导者有责任澄清和执行我们的可接受行为标准,并将对任何他们认为不当、威胁、冒犯或有害的行为采取适当和公平的纠正措施。
|
||||
|
||||
社区领导者有权和责任删除、编辑或拒绝不符合本行为准则的评论、提交、代码、Wiki 编辑、问题和其他贡献,并将在适当时沟通管理决策的理由。
|
||||
|
||||
## 适用范围
|
||||
|
||||
本行为准则适用于所有社区空间,并且当个人在公共空间中正式代表社区时也同样适用。代表社区的示例包括使用官方电子邮件地址、通过官方社交媒体帐户发帖、或在在线或线下活动中担任指定代表。
|
||||
|
||||
## 执行
|
||||
|
||||
对于虐待、骚扰或其他不可接受行为的实例,可向负责执行的社区领导者报告。
|
||||
所有投诉都将得到及时和公平的审查和调查。
|
||||
|
||||
所有社区领导者都有义务尊重任何事件报告者的隐私和安全。
|
||||
|
||||
## 执行指南
|
||||
|
||||
社区领导者将遵循以下社区影响指南来确定他们视为违反本行为准则的行为的后果:
|
||||
|
||||
### 1. 纠正
|
||||
|
||||
**社区影响**:使用不恰当的语言或其他在社区中被认为不专业或不受欢迎的行为。
|
||||
|
||||
**后果**:社区领导者的私下书面警告,明确说明违规行为的性质并解释行为为何不当。可能会要求公开道歉。
|
||||
|
||||
### 2. 警告
|
||||
|
||||
**社区影响**:通过单次事件或一系列行为违反。
|
||||
|
||||
**后果**:带有持续行为后果的警告。在规定时间内,禁止与相关人员进行互动,包括与执行行为准则的人员未经请求的互动。这包括避免在社区空间以及社交媒体等外部渠道中的互动。违反这些条款可能会导致临时或永久封禁。
|
||||
|
||||
### 3. 临时封禁
|
||||
|
||||
**社区影响**:严重违反社区标准,包括持续的不当行为。
|
||||
|
||||
**后果**:在规定时间内,禁止与社区进行任何形式的互动或公开交流。在此期间,不允许与相关人员进行公开或私下互动,包括与执行行为准则的人员未经请求的互动。违反这些条款可能会导致永久封禁。
|
||||
|
||||
### 4. 永久封禁
|
||||
|
||||
**社区影响**:表现出违反社区标准的模式,包括持续的不当行为、骚扰个人、或对个体或群体进行攻击或贬损。
|
||||
|
||||
**后果**:永久禁止在社区内进行任何形式的公共互动。
|
||||
|
||||
## 来源
|
||||
|
||||
本行为准则改编自 [贡献者公约][homepage] 2.0 版,可在 https://www.contributor-covenant.org/version/2/0/code_of_conduct.html 获取。
|
||||
|
||||
社区影响指南受 [Mozilla 行为准则执行阶梯](https://github.com/mozilla/diversity) 的启发。
|
||||
|
||||
[主页]: https://www.contributor-covenant.org
|
||||
|
||||
关于本行为准则的常见问题解答,请参阅 https://www.contributor-covenant.org/faq。其他语言的翻译可在 https://www.contributor-covenant.org/translations 获取。
|
||||
128
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
128
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
name: 错误报告
|
||||
description: 反馈发现的 Bug、问题……
|
||||
title: "[错误报告] 请修改我为您的问题"
|
||||
labels: ["bug/漏洞"]
|
||||
assignees:
|
||||
- hmjz100
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
感谢您花时间填写此错误报告。
|
||||
请**务必**确认您的问题无重复,且不是因为您的操作、网络或运行脚本的程序问题。
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: 确认
|
||||
description: 您必须确认、同意并勾选以下事项。
|
||||
options:
|
||||
- label: |
|
||||
我已确认阅读并同意 [AGPL-3.0 第 15 条](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=15.%20Disclaimer%20of%20Warranty.) 。
|
||||
本项目不提供任何明示或暗示的担保,使用风险由您自行承担。
|
||||
required: true
|
||||
- label: |
|
||||
我已确认阅读并同意 [AGPL-3.0 第 16 条](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=16.%20Limitation%20of%20Liability.) 。
|
||||
无论何种情况,版权持有人或其他分发者均不对使用本程序所造成的任何损失承担责任。
|
||||
required: true
|
||||
- label: 我已确认是此脚本的问题,而不是其他原因(例如网络、脚本依赖或操作)。
|
||||
required: true
|
||||
- label: 我已安装金丝雀版,并且确认金丝雀版未修复此问题。
|
||||
- label: 我已查找过其他议题,确认没有重复的疑问或讨论。
|
||||
required: true
|
||||
- label: 我已修改上方标题的 “请修改我为您的问题” 为自己的问题。
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: os-version
|
||||
attributes:
|
||||
label: 操作系统
|
||||
description: 运行浏览器程序使用的操作系统
|
||||
options:
|
||||
- Windows 11
|
||||
- Windows 10
|
||||
- Windows 8
|
||||
- Windows 7
|
||||
- Windows XP
|
||||
- iOS
|
||||
- Mac (x86)
|
||||
- Mac (arm)
|
||||
- Android
|
||||
- Linux
|
||||
- 其他
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: browser-version
|
||||
attributes:
|
||||
label: 浏览器及版本
|
||||
description: 使用的是什么浏览器?版本?架构?Chromium 内核版本(如有)
|
||||
placeholder: Edge 143.0.3650.96 (正式版) (64 位) ,Chromium 143.0.7499.147
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: userscript-manager
|
||||
attributes:
|
||||
label: 用户脚本管理器
|
||||
description: 使用的用户脚本管理器是?
|
||||
options:
|
||||
- 篡改猴 / Tampermonkey
|
||||
- 篡改猴测试版 / Tampermonkey Beta
|
||||
- 篡改猴 (MV2 经典版) / Tampermonkey Legacy
|
||||
- 暴力猴 / Violentmonkey
|
||||
- 脚本猫 / ScriptCat
|
||||
- 脚本猫 Beta / ScriptCat Beta
|
||||
- Via
|
||||
- 其他(请在下方输入)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: userscript-manager-other
|
||||
attributes:
|
||||
label: 用户脚本管理器(其他)
|
||||
description: 如果在上方选择了 “其他”,请在这里填写,输入你使用的用户脚本管理器名称
|
||||
|
||||
- type: input
|
||||
id: userscript-manager-version
|
||||
attributes:
|
||||
label: 用户脚本管理器版本
|
||||
description: 使用的用户脚本管理器版本?(如是 Via 请输入浏览器版本)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: userscript-version
|
||||
attributes:
|
||||
label: 脚本版本
|
||||
description: 非必须,用户脚本的版本
|
||||
placeholder: 使用的 LinkSwift 的版本是?
|
||||
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: 问题详情
|
||||
description: 简洁清晰的问题描述
|
||||
placeholder: 发生了什么?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: reproduce-steps
|
||||
attributes:
|
||||
label: 复现步骤
|
||||
description: 非必须,如何复现此问题的步骤
|
||||
placeholder: |
|
||||
1. [第一步]
|
||||
2. [第二步]
|
||||
3. [...]
|
||||
|
||||
- type: textarea
|
||||
id: proof-items
|
||||
attributes:
|
||||
label: 参考数据
|
||||
description: 非必须,帮助诊断的截图或者其他资料
|
||||
placeholder: |
|
||||
日志、网页截图、F12 控制台截图或 DevTools 快照
|
||||
**截图可以直接 Ctrl-V 粘贴哦~**
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: 问题和讨论
|
||||
url: https://github.com/hmjz100/LinkSwift/discussions
|
||||
about: 对脚本、各大网盘的讨论、问题、想法、投票等可在此社区发布
|
||||
58
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
58
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: 功能请求
|
||||
description: 请求新功能
|
||||
title: "[功能请求] 请修改我为您的问题"
|
||||
labels: ["enhancement/新功能"]
|
||||
assignees:
|
||||
- hmjz100
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
感谢您花时间填写此报告。
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: 确认
|
||||
description: 您必须确认、同意并勾选以下事项。
|
||||
options:
|
||||
- label: |
|
||||
我已确认阅读并同意 [AGPL-3.0 第 15 条](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=15.%20Disclaimer%20of%20Warranty.) 。
|
||||
本项目不提供任何明示或暗示的担保,使用风险由您自行承担。
|
||||
required: true
|
||||
- label: |
|
||||
我已确认阅读并同意 [AGPL-3.0 第 16 条](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=16.%20Limitation%20of%20Liability.) 。
|
||||
无论何种情况,版权持有人或其他分发者均不对使用本程序所造成的任何损失承担责任。
|
||||
required: true
|
||||
- label: 我已确认此脚本不存在此功能,而不是因其他原因(例如网络、脚本依赖或操作)造成的无功能。
|
||||
required: true
|
||||
- label: 我已安装金丝雀版,并且确认金丝雀版未实现此功能。
|
||||
required: true
|
||||
- label: 我已查找过其他议题,确认没有重复的功能请求。
|
||||
required: true
|
||||
- label: 我已修改上方标题的 “请修改我为您的问题” 为自己的问题。
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: issue-today
|
||||
attributes:
|
||||
label: 存在问题
|
||||
description: 目前存在什么问题
|
||||
placeholder: 脚本目前不能……
|
||||
|
||||
- type: textarea
|
||||
id: target-tomorrow
|
||||
attributes:
|
||||
label: 目标愿景
|
||||
description: 希望实现的目标
|
||||
placeholder: 希望能……
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: advice-if
|
||||
attributes:
|
||||
label: 参考建议
|
||||
description: 可供参考的建议、思路或者示例
|
||||
placeholder: |
|
||||
有什么实现思路,或者参考的样例?
|
||||
**截图可以直接 Ctrl-V 粘贴哦~**
|
||||
37
.github/contributing.md
vendored
Normal file
37
.github/contributing.md
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# 贡献指南
|
||||
|
||||
## 开发环境
|
||||
|
||||
编者的环境如下:
|
||||
|
||||
- 开发工具
|
||||
Visual Studio Code、TRAE CN、Github Desktop、Git
|
||||
|
||||
- AI 辅助(按常用排序,纯聊天及古法CV,无助理)
|
||||
Google Gemini(网页)、TRAE CN 包含的模型(IDE 内聊天)、阿里 通义千问、深度求索 DeepSeek、OpenAI ChatGPT、Microsoft Copilot
|
||||
|
||||
- 浏览器(按常用排序,除第一位外不常访问)
|
||||
Microsoft Edge > Supermium > 百分浏览器
|
||||
|
||||
- 浏览器插件(有冲突时会适配)
|
||||
脚本管理器、uBlock Origin、ZeroOmega、Dark Reader、Header Editor
|
||||
|
||||
- 脚本管理器(按常用排序,除第一位外不常访问)
|
||||
暴力猴 > 脚本猫 > Via > 篡改猴
|
||||
|
||||
- 使用的网盘
|
||||
脚本中有提到的均有在使用,但不常用
|
||||
|
||||
## 开发指南
|
||||
|
||||
首先,克隆本项目的 dev 分支……然后开始编码……
|
||||
|
||||
为 base 编写的函数记得署上自己的帐号名/昵称,并加上 description……
|
||||
|
||||
不需要修改脚本版本,只需要做好自己想做的功能即可……
|
||||
|
||||
余下待编。总之编好后提交拉取请求 **到 dev 分支** 即可。
|
||||
|
||||
---
|
||||
|
||||
silence is golden.
|
||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
temp/
|
||||
node_modules
|
||||
package-lock.json
|
||||
104
README-ScriptCat.md
Normal file
104
README-ScriptCat.md
Normal file
File diff suppressed because one or more lines are too long
129
README.md
129
README.md
@@ -1,61 +1,118 @@
|
||||

|
||||
> [!IMPORTANT]
|
||||
> 如果您是从 GreasyFork 找到这的,建议前往下方的 [安装](#安装) 选择一个合适的源覆盖安装,避免因脚本失效或 GF 黑产刷子导致无法及时更新。
|
||||
|
||||

|
||||
|
||||
<p align="center">“出淤泥而不染,濯清涟而不妖”</p>
|
||||
<hr>
|
||||
<p align="center">
|
||||
<img alt="GreasyFork Version" src="https://img.shields.io/badge/dynamic/json?label=%e7%89%88%e6%9c%ac&url=https%3A%2F%2Fgreasyfork.org%2Fscripts%2F449291.json&query=version&logo=greasyfork&logoColor=white&labelColor=%23670000&color=%23574AB8&style=for-the-badge&cacheSeconds=10">
|
||||
<img alt="GreasyFork Good Rings" src="https://img.shields.io/badge/dynamic/json?label=%e5%a5%bd%e8%af%84&url=https%3A%2F%2Fgreasyfork.org%2Fscripts%2F449291.json&query=good_ratings&logo=greasyfork&logoColor=white&labelColor=%23670000&color=gold&style=for-the-badge&cacheSeconds=10">
|
||||
<img alt="Github Stargazers" src="https://img.shields.io/github/stars/hmjz100/Online-disk-direct-link-download-assistant?label=%e6%98%9f%e6%a0%87&logo=github&logoColor=white&labelColor=black&color=gold&style=for-the-badge&cacheSeconds=10">
|
||||
<img alt="GreasyFork Daily Install" src="https://img.shields.io/badge/dynamic/json?label=%e6%97%a5%e8%a3%85&url=https%3A%2F%2Fgreasyfork.org%2Fscripts%2F449291.json&query=daily_installs&logo=greasyfork&logoColor=white&labelColor=%23670000&color=blue&style=for-the-badge&cacheSeconds=10">
|
||||
<img alt="GreasyFork Total Install" src="https://img.shields.io/badge/dynamic/json?label=%e6%80%bb%e8%a3%85&url=https%3A%2F%2Fgreasyfork.org%2Fscripts%2F449291.json&query=total_installs&logo=greasyfork&logoColor=white&labelColor=%23670000&color=blue&style=for-the-badge&cacheSeconds=10">
|
||||
<img alt="Github Forks" src="https://img.shields.io/github/forks/hmjz100/Online-disk-direct-link-download-assistant?label=%e5%a4%8d%e5%88%bb&logo=github&logoColor=white&labelColor=black&color=grey&style=for-the-badge&cacheSeconds=10">
|
||||
搭配使用,效果更佳!👋扩展脚本
|
||||
<br/>
|
||||
<img alt="Github Licence" src="https://img.shields.io/github/license/hmjz100/Online-disk-direct-link-download-assistant?label=%e8%ae%b8%e5%8f%af&logo=github&logoColor=white&labelColor=black&color=grey&style=for-the-badge&cacheSeconds=10">
|
||||
<img alt="GreasyFork Licence" src="https://img.shields.io/greasyfork/l/449291?label=%e8%ae%b8%e5%8f%af&logo=greasyfork&logoColor=white&labelColor=%23670000&color=grey&style=for-the-badge&cacheSeconds=10">
|
||||
<a href="https://github.com/hmjz100/123panYouthMember#安装">123 云盘会员青春版</a> | <a href="#安装">百度网盘会员青春版</a> | <a href="https://scriptcat.org/script-show-page/2470" target="_blank">阿里云盘会员青春版</a>
|
||||
<br/>
|
||||
<img alt="Starchart" src="https://starchart.cc/hmjz100/Online-disk-direct-link-download-assistant.svg?variant=adaptive&line=%23574ab8">
|
||||
↓ ↓ ↓ ↓ ↓
|
||||
</p>
|
||||
<p align="center">
|
||||
不仅能够精简网盘界面,还支持美化网盘界面主题色
|
||||
<img alt="Github Stargazers" src="https://img.shields.io/github/stars/hmjz100/LinkSwift.svg?label=%e6%98%9f%e6%a0%87&logo=github&logoColor=white&labelColor=black&color=gold&style=for-the-badge&cacheSeconds=10">
|
||||
<img alt="Github Forks" src="https://img.shields.io/github/forks/hmjz100/LinkSwift?label=%e5%a4%8d%e5%88%bb&logo=github&logoColor=white&labelColor=black&color=grey&style=for-the-badge&cacheSeconds=10">
|
||||
<img alt="Github Licence" src="https://img.shields.io/github/license/hmjz100/LinkSwift?label=%e8%ae%b8%e5%8f%af&logo=github&logoColor=white&labelColor=black&color=grey&style=for-the-badge&cacheSeconds=10">
|
||||
<br/>
|
||||
<a href="https://trendshift.io/repositories/13630" target="_blank"><img src="https://trendshift.io/api/badge/repositories/13630" alt="hmjz100%2FLinkSwift | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
<br/>
|
||||
<img src="https://img.shields.io/chrome-web-store/v/gcalenpjmijncebpfijmoaglllgpjagf.svg?label=Tampermonkey%20BETA%20%E7%AF%A1%E6%94%B9%E7%8C%B4%E6%B5%8B%E8%AF%95%E7%89%88&logo=tampermonkey&logoColor=red&color=red&style=for-the-badge" alt="Tampermonkey BETA 篡改猴测试版">
|
||||
<img src="https://img.shields.io/chrome-web-store/v/dhdgffkkebhmkfjojejmpbldmpobfkfo.svg?label=Tampermonkey%20%E7%AF%A1%E6%94%B9%E7%8C%B4&logo=tampermonkey&logoColor=white&color=brightgreen&style=for-the-badge" alt="TamperMonkey 篡改猴">
|
||||
<br/>
|
||||
<img src="https://img.shields.io/badge/Google_Chrome-≥76.0-yellow.svg?style=for-the-badge" alt="Google Chrome-≥76.0">
|
||||
<img src="https://img.shields.io/badge/Microsoft_Edge-≥88.0-blue.svg?style=for-the-badge" alt="Microsoft Edge-≥88.0">
|
||||
<img src="https://img.shields.io/badge/支持平台-Windows_|_Mac_|_Linux_|_Android-blueviolet.svg?style=for-the-badge" alt="支持平台">
|
||||
</p>
|
||||
|
||||
## 介绍
|
||||
|
||||
支持 百度网盘 / 阿里云盘 / 中国移动云盘 / 天翼云盘 / 迅雷云盘 / 光鸭云盘 / 夸克网盘 / UC网盘 / 123云盘 九大网盘
|
||||
相比较原脚本,增加了更多功能~
|
||||
|
||||
## 安装
|
||||
- LinkSwift
|
||||
https://github.moeyy.xyz/https://github.com/hmjz100/LinkSwift/raw/main/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js
|
||||
- (改)百度网盘会员青春版
|
||||
https://github.moeyy.xyz/https://github.com/hmjz100/LinkSwift/raw/main/%EF%BC%88%E6%94%B9%EF%BC%89%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98%E4%BC%9A%E5%91%98%E9%9D%92%E6%98%A5%E7%89%88.user.js
|
||||
|
||||
根据需要选择合适的源,点击链接即可安装
|
||||
|
||||
### LinkSwift
|
||||
直链获取、UI 美化、支持多种下载器
|
||||
|
||||
#### 正式版
|
||||
- Github 国际: [hmjz100/LinkSwift/(改)网盘直链下载助手.user.js](https://github.com/hmjz100/LinkSwift/raw/main/(改)网盘直链下载助手.user.js)
|
||||
- OpenUserJS 国际(更新不及时): [hmjz100/LinkSwift.user.js](https://openuserjs.org/install/hmjz100/LinkSwift.user.js)
|
||||
- 脚本猫 国内: [hmjz100/1604/LinkSwift.user.js](https://scriptcat.org/scripts/code/1604/LinkSwift.user.js)
|
||||
|
||||
#### 金丝雀版
|
||||
此版本可能不稳定,但有着最新的功能、修复等。
|
||||
|
||||
- Github 国际: [hmjz100/LinkSwift/(改)网盘直链下载助手.user.js](https://github.com/hmjz100/LinkSwift/raw/dev/(改)网盘直链下载助手.user.js)
|
||||
|
||||
## 说明
|
||||
|
||||
> [!IMPORTANT]
|
||||
> 本项目所获取的下载链接均基于各大网盘服务商公开的 API 接口获取。
|
||||
> 项目未以任何形式承诺、宣传或实现对网盘限速机制、功能的破解。
|
||||
>
|
||||
> 若在实际使用过程中获得较快的下载速度,通常系由于服务商接口策略、用户本地网络环境或服务商阶段性下发的带宽限制调整所致,
|
||||
> 请勿将其误解为本项目具备破解限速的能力或提供相应服务。
|
||||
|
||||
> [!IMPORTANT]
|
||||
> 本项目始终遵循合规与克制的原则,坚持技术中立,不触及、不损害任何网盘服务商的核心利益,
|
||||
> 仅为协助无法或不便使用官方客户端的用户实现合法的文件下载需求。
|
||||
>
|
||||
> 任何第三方在推广、转载或介绍本项目过程中所作出的夸大、误导性宣传*,均不代表本项目立场。
|
||||
> 由此产生的一切后果与责任,与本项目无关,须由相关行为主体自行承担。
|
||||
> *(包括但不限于 “加速下载”“速度起飞”“限速破解” 等表述)
|
||||
|
||||
基于[【网盘直链下载助手】](https://www.baiduyun.wiki/install.html)修改
|
||||
- 原作者:[油小猴](https://www.youxiaohou.com/)
|
||||
- 原仓库:[https://github.com/syhyz1990/baiduyun](https://github.com/syhyz1990/baiduyun)
|
||||
- 本脚本发布至 GreasyFork:[https://greasyfork.org/scripts/449291](https://greasyfork.org/scripts/449291)
|
||||
- 还有脚本猫:[https://scriptcat.org/script-show-page/1604](https://scriptcat.org/script-show-page/1604)
|
||||
|
||||
## 简介
|
||||
|
||||
支持百度阿里天翼迅雷夸克移动六大网盘,相比较原脚本,增加了更多功能~
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
- 原作者: [油小猴](https://www.youxiaohou.com/)
|
||||
- 原仓库: [https://github.com/syhyz1990/baiduyun](https://github.com/syhyz1990/baiduyun)
|
||||
- 本脚本发布至脚本猫: [https://scriptcat.org/script-show-page/1604](https://scriptcat.org/script-show-page/1604)
|
||||
- 还有 OpenUserJS: [https://openuserjs.org/scripts/hmjz100/LinkSwift](https://openuserjs.org/scripts/hmjz100/LinkSwift)
|
||||
|
||||
#### 卑微的小标题
|
||||
|
||||
这个脚本只有一个人在修改\~如果喜欢的话还请留个 Star 哦\~
|
||||
- 如有bug等问题请在这发[议题反馈](https://github.com/hmjz100/Online-disk-direct-link-download-assistant/issues)
|
||||
~~这个脚本只有一个人在修改\~~~ 如果喜欢的话还请留个 Star 哦\~
|
||||
- 为确保高效处理反馈,如有 Bug 等问题请在此平台[发布议题反馈](https://github.com/hmjz100/LinkSwift/issues),其余平台的反馈将不会被受理。
|
||||
|
||||
## 贡献者
|
||||
|
||||
感谢下列为本项目做过贡献的开发者!
|
||||
|
||||
<a href="https://github.com/hmjz100/LinkSwift/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=hmjz100/LinkSwift" />
|
||||
</a>
|
||||
|
||||
## 版本号
|
||||
V. 1.1.0(改自 6.2.7 版本)
|
||||
本脚本目前仅在 Github 与 GreasyFork 还有 脚本猫 发布,如果您是在其他渠道获取到本脚本的,请不要安装。
|
||||
|
||||
正式版:v1.1.3
|
||||
测试版:v1.1.4
|
||||
本脚本目前仅在 Github、Gitee、脚本猫脚本站 与 OpenUserJS 发布;
|
||||
如果您是在其他渠道获取到本脚本的,安装后所带来的问题开发者概不负责。
|
||||
|
||||
## 更新日志
|
||||
|
||||
| 版本号 | 创建日期 | 更新日志 |
|
||||
| -------- | -------- | -------- |
|
||||
| 1.1.4 | 2026年09月09日 | (测试版,非最终品质)<br/>残暑未消风先快,一叶轻舟过万重。🍂🥮<br/>告别了繁杂与沉闷,LinkSwift 带来以下更新:<br/>1、新增 - 支持光鸭云盘;<br/>2、适配 - 变来变去的 123 云盘;<br/>3、优化 - 网络请求头标准化;<br/>4、优化 - 调样式,改类名,优逻辑;<br/>5、优化 - 使用 eslint 处理与检查脚本代码问题;<br/>6、优化 - 夸克网盘 Cookie 传递;<br/>(感谢 <a href="https://github.com/kwkvh" target="_blank">kwkvh</a> 提供的想法)<br/>7、修复 - 迅雷云盘样式调整导致脚本弹窗异常变大;<br/>8、修复 - 推送到 ABDM 下载器实际成功却显示失败。 |
|
||||
| 1.1.3 | 2026年02月16日 | LinkSwift 开发者在此祝您新春快乐!<br/>爆竹声中一岁除,春风送暖入屠苏。LinkSwift 迎来功能更新:<br/>1、新增 - IDM 客户端设置;<br/>2、优化 - 链接缓存、浮动提示框;<br/>3、适配 - 百度网盘分享页。 |
|
||||
| 1.1.2.1 | 2025年12月28日 | 1、新增 - API 下载的推送到 IDM 功能;<br/>(感谢 <a href="https://github.com/Night-stars-1" target="_blank">Night Stars</a> 的帮助)<br/>2、修复 - 复制 Aria2、cURL 命令行错误。 |
|
||||
| 1.1.2 | 2025年12月26日 | 1、适配 - 123 云盘新策略;<br/>2、适配 - 夸克、UC 网盘分享页;<br/>3、新增 - 增强下载的多块多线程支持;<br/>4、优化 - 页面绿化的部分匹配规则;<br/>5、优化 - 增强下载进度条样式。 |
|
||||
| 1.1.1.9 | 2025年09月13日 | 1、修复 - 123 云盘下载视频变为缩略图。 |
|
||||
| 1.1.1.8 | 2025年09月11日 | 1、修复 - 适配新版 123 云盘分享页。 |
|
||||
| 1.1.1.7 | 2025年08月02日 | 1、修复 - 缺失声明 (at)connect 导致的问题。 |
|
||||
| 1.1.1.6 | 2025年07月28日 | 1、废弃 - 百度网盘 BDUSS Cookie 相关代码,转向使用更安全的 AccessToken;<br/>2、废弃 - 百度网盘分享页面下载相关代码;<br/>3、优化 - 下载窗口可在设置改变后动态修改界面。 |
|
||||
| 1.1.1.5 | 2025年07月21日 | 1、增加 AB Download Manager 下载方式;<br/>2、支持从设置页面一键返回下载窗口,无需重复获取链接。 |
|
||||
| 1.1.1.4 | 2025年07月19日 | 1、适配 123 云盘新版页面。 |
|
||||
| 1.1.1.3 | 2025年06月19日 | 1、修复夸克网盘无法获取下载链接的 Bug;<br/>2、修复 API 下载无法复制全部链接。 |
|
||||
| 1.1.1.2 | 2025年06月08日 | 1、修复无法删除第一项远程配置的 Bug。 |
|
||||
| 1.1.1.1 | 2025年06月02日 | 1、修复推送到 Aria2 时推送成功但报错的 Bug。 |
|
||||
| 1.1.1 | 2025年06月01日 | 六一儿童节快乐!萌萌哒更新~<br/>1、配置文件格式更新,支持添加、删除、切换多个服务配置;<br/>2、支持比特彗星推送下载,原 RPC 已并入 Aria2 下载;<br/>3、界面增加 Font Awesome 图标!更好看啦;<br/>4、优化脚本代码、界面,运行更轻快;<br/>5、修复上个版本遗存的问题。 |
|
||||
| 1.1.0.1 | 2025年05月09日 | 1、修复查看 RPC 下载任务的 Bug。 |
|
||||
| 1.1.0 | 2025年05月08日 | 1、支持 UC 网盘、123 云盘;<br/>2、改进了网盘主题的注入方式;<br/>3、聚合并重构了部分重复函数,对整体脚本逻辑进行了梳理和精简;<br/>4、将脚本执行阶段从 document-body 适配为 document-start。 |
|
||||
| 1.0.9.7 | 2025年02月13日 | 1、修复移动云盘下载错误;<br/>2、优化代码,更好的错误识别;<br/>3、去除了游小猴云服务。 |
|
||||
| 1.0.9.7 | 2025年02月13日 | 1、修复移动云盘下载错误;<br/>2、优化代码,更好的错误识别;<br/>3、去除了油小猴云服务。 |
|
||||
| 1.0.9.6 | 2024年10月28日 | 1、支持在百度网盘中选择文件夹下载;<br/>2、优化部分提示。 |
|
||||
| 1.0.9.5 | 2024年10月14日 | 1、修复因代码逻辑错误而无法获取链接的 Bug。 |
|
||||
| 1.0.9.4 | 2024年10月09日 | 1、修复因百度网盘 AccessToken 过期导致无法获取链接的 Bug。 |
|
||||
@@ -91,9 +148,9 @@ V. 1.1.0(改自 6.2.7 版本)
|
||||
| 1.0.6.4 | 2023年06月02日 | 1、跟进官方V6.1.1版本,修复阿里云盘获取下载链接时的问题。 |
|
||||
| 1.0.6.3 | 2023年05月19日 | 1、照顾小屏幕用户,将始终显示复制全部链接的按钮;<br>2、增加取消下载时的动画。 |
|
||||
| 1.0.6.2 | 2023年05月08日 | 1、修复部分界面错位,实现CSS内置;<br>2、百度网盘界面将变得更加简洁。 |
|
||||
| 1.0.6.1 | 2023年05月06日 | 1、新增百度云盘API下载支持复制链接;<br>2、为了照顾手机浏览器用户,增大项目之间间隙,新增隐藏IDM提示选项,可在助手设置中启用;<br>3、修改CSS,界面会出现更多的主题色;<br>4、支持在游小猴官网查看暗号;<br>5、修复部分语法错误。 |
|
||||
| 1.0.6.1 | 2023年05月06日 | 1、新增百度云盘API下载支持复制链接;<br>2、为了照顾手机浏览器用户,增大项目之间间隙,新增隐藏IDM提示选项,可在助手设置中启用;<br>3、修改CSS,界面会出现更多的主题色;<br>4、支持在油小猴官网查看暗号;<br>5、修复部分语法错误。 |
|
||||
| 1.0.6 | 2023年04月15日 | 1、修复了打开阿里云盘分享连接时因下载移动端广告导致只能点击API下载;<br>2、跟进官方6.0.4版本,修复夸克网盘获取下载链接失效、支持移动云盘。 |
|
||||
| 1.0.5.5 | 2023年04月01日 | 1、感谢[Night-stars](https://github.com/Night-stars-1)的帮助,修复因为原作者服务器导致的初始化暗号识别错误;<br>2、修改一些文本以及提供给服务器的信息。 |
|
||||
| 1.0.5.5 | 2023年04月01日 | 1、感谢[Night Stars](https://github.com/Night-stars-1)的帮助,修复因为原作者服务器导致的初始化暗号识别错误;<br>2、修改一些文本以及提供给服务器的信息。 |
|
||||
| 1.0.5.4 | 2023年03月13日 | 1、小修小改css,让主题色出现在更多地方;<br>2、修改下载链接获取失败的提示;<br>3、增加更多的主题色,可在助手设置查看;<br>4、homo彩蛋被删去力(悲)。 |
|
||||
| 1.0.5.3 | 2023年03月10日 | 1、阿里云盘可以摸到下载菜单了。 |
|
||||
| 1.0.5.2 | 2022年10月04日 | 1、增加脚本信息菜单;<br>2、优化阿里云盘显示svg图片;<br>3、修改弹窗按钮颜色。 |
|
||||
|
||||
45
eslint.config.mjs
Normal file
45
eslint.config.mjs
Normal file
@@ -0,0 +1,45 @@
|
||||
import js from "@eslint/js";
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
{
|
||||
files: ["**/*.user.js"],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2022,
|
||||
sourceType: "script", // 适配油猴脚本的非模块化特性
|
||||
globals: {
|
||||
// 基础环境
|
||||
window: "readonly", document: "readonly", console: "readonly",
|
||||
location: "readonly", navigator: "readonly", history: "readonly",
|
||||
localStorage: "readonly", sessionStorage: "readonly",
|
||||
setTimeout: "readonly", setInterval: "readonly",
|
||||
clearTimeout: "readonly", clearInterval: "readonly",
|
||||
fetch: "readonly", URL: "readonly", URLSearchParams: "readonly",
|
||||
Blob: "readonly", File: "readonly", FormData: "readonly",
|
||||
alert: "readonly", confirm: "readonly", prompt: "readonly",
|
||||
requestAnimationFrame: "readonly", cancelAnimationFrame: "readonly",
|
||||
MutationObserver: "readonly", HTMLElement: "readonly",
|
||||
btoa: "readonly", atob: "readonly", structuredClone: "readonly",
|
||||
|
||||
// GM 环境
|
||||
GM: "readonly", GM_info: "readonly", GM_getValue: "readonly", GM_setValue: "readonly",
|
||||
GM_deleteValue: "readonly", GM_listValues: "readonly", GM_addStyle: "readonly",
|
||||
GM_xmlhttpRequest: "readonly", GM_registerMenuCommand: "readonly",
|
||||
GM_openInTab: "readonly", GM_setClipboard: "readonly",
|
||||
GM_getResourceText: "readonly", unsafeWindow: "readonly",
|
||||
|
||||
// 第三方库
|
||||
$: "readonly", jQuery: "readonly", Swal: "readonly", md5: "readonly"
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
"prefer-const": ["error", { "destructuring": "all" }],
|
||||
"no-unused-vars": "warn",
|
||||
"no-empty": "off",
|
||||
"no-useless-escape": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
"no-control-regex": "off",
|
||||
"no-irregular-whitespace": "off"
|
||||
}
|
||||
}
|
||||
];
|
||||
38
package.json
Normal file
38
package.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "linkswift",
|
||||
"version": "1.1.3.1",
|
||||
"description": "一个基于 JavaScript 的网盘文件下载地址获取工具",
|
||||
"main": "eslint.config.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"check": "npx eslint . --fix"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/hmjz100/LinkSwift.git"
|
||||
},
|
||||
"keywords": [
|
||||
"linkswift",
|
||||
"link",
|
||||
"swift",
|
||||
"download",
|
||||
"file",
|
||||
"address",
|
||||
"get"
|
||||
],
|
||||
"author": "hmjz100",
|
||||
"license": "AGPL-3.0",
|
||||
"type": "commonjs",
|
||||
"bugs": {
|
||||
"url": "https://github.com/hmjz100/LinkSwift/issues"
|
||||
},
|
||||
"homepage": "https://github.com/hmjz100/LinkSwift#readme",
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"eslint": "^10.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"eslint": "^10.6.0"
|
||||
}
|
||||
}
|
||||
@@ -2,861 +2,30 @@
|
||||
// @name (改)百度网盘会员青春版
|
||||
// @author Hmjz100、Gwen
|
||||
// @namespace github.com/hmjz100
|
||||
// @version 1.2.6.2
|
||||
// @version 1.2.6.3.1
|
||||
// @description 《也许同类型中最好用?》系列、LinkSwift 官方扩展 - 显示百度网盘身份信息为会员,支持使用视频倍速、生成字幕、下载AI字幕、关闭AI聊天、修改头像、修改用户名等功能,自定义程度超高!需要修改头部代码来配置显示内容(非常简单!)
|
||||
// @icon data:image/png;base64,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
|
||||
// @license MIT
|
||||
// @match *://pan.baidu.com/*
|
||||
// @match *://yun.baidu.com/*
|
||||
// @grant GM_addStyle
|
||||
// @grant GM_openInTab
|
||||
// @grant unsafeWindow
|
||||
// @run-at document-start
|
||||
// @require https://unpkg.com/jquery@3.6.0/dist/jquery.min.js
|
||||
// @downloadURL https://github.com/hmjz100/BaiduNetDiskYouthMember/raw/main/%EF%BC%88%E6%94%B9%EF%BC%89%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98%E4%BC%9A%E5%91%98%E9%9D%92%E6%98%A5%E7%89%88.user.js
|
||||
// @updateURL https://github.com/hmjz100/BaiduNetDiskYouthMember/raw/main/%EF%BC%88%E6%94%B9%EF%BC%89%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98%E4%BC%9A%E5%91%98%E9%9D%92%E6%98%A5%E7%89%88.user.js
|
||||
// ==/UserScript==
|
||||
|
||||
// (改)百度网盘会员青春版 迁移到新仓库啦!
|
||||
// 请前往新仓库 https://github.com/hmjz100/BaiduNetDiskYouthMember
|
||||
// 或者打开 https://github.com/hmjz100/BaiduNetDiskYouthMember/raw/main/%EF%BC%88%E6%94%B9%EF%BC%89%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98%E4%BC%9A%E5%91%98%E9%9D%92%E6%98%A5%E7%89%88.user.js
|
||||
// 安装新版脚本~
|
||||
// 请尽快迁移,hmjz100/LinkSwift 存储的 "(改)百度网盘会员青春版" 文件将在不久后删除!
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
unsafeWindow 检测
|
||||
代码为自创
|
||||
*/
|
||||
if (typeof unsafeWindow === 'undefined') {
|
||||
window.unsafeWindow = window;
|
||||
}
|
||||
|
||||
/*
|
||||
防止代码因其他原因被执行多次
|
||||
代码出自 “Via 轻插件”,作者谷花泰
|
||||
*/
|
||||
const key = encodeURIComponent('百度网盘会员青春版:主代码');
|
||||
if (window[key]) return;
|
||||
window[key] = true;
|
||||
|
||||
let mount = idontknow("LinkSwiftBaiduYouthMember")
|
||||
|
||||
var user = {
|
||||
// 以下设置项中,常规项目(就是以//开头注释的项目)除非特殊说明,否则一般 0 为关闭,1 为开启
|
||||
vip: 1, // 开启会员修改(总开关)
|
||||
svip: 1, // 显示为超级会员,建议 1
|
||||
previous: 0, // 显示为会员过期,建议 0,变为仅修改历史最高的会员类型、等级
|
||||
|
||||
// 以下是自定义项目(以/*开头注释的项目),修改也非常简单
|
||||
/*
|
||||
自定义用户名与头像,留空则使用已登录账号数据
|
||||
*/
|
||||
name: "百湿不得其解",
|
||||
photo: "https://bkimg.cdn.bcebos.com/pic/cdbf6c81800a19d8bc3e5cfd95ab958ba61ea9d3e8b3",
|
||||
/*
|
||||
会员等级与成长值,可留空为""
|
||||
普通会员等级最高为 10 (以前是 8)
|
||||
超级会员等级最高为 10
|
||||
超级会员 1~10 的成长值分别为 0 1000 3000 7000 15000 27000 43000 56000 88000 152000,后两个值为猜测
|
||||
*/
|
||||
level: 10,
|
||||
point: 152000,
|
||||
/*
|
||||
自定义会员ID,留空则使用已登录账号数据
|
||||
据网上观察应为六位数,现在亦可输入文本
|
||||
*/
|
||||
vip_id: "000001 - What's your problem?",
|
||||
/*
|
||||
会员过期时间 格式为Unix时间戳,可留空为""
|
||||
1562118175 - 2019-07-03 09:42:55 (宏彦获水时)
|
||||
2147483648 - 2038-01-19 11:14:08 (2038问题时)
|
||||
253402185600 - 9999-12-31 00:00:00 (终极时)
|
||||
*/
|
||||
endtime: 253402185600,
|
||||
|
||||
// 以下的常规项目(就是以//开头注释的项目)均为独立功能,不受总开关控制
|
||||
aiChat: 0, // 显示云一朵 AI 聊天的相关功能,建议 0,相关功能大多数都是在右上角的 AI 聊天的右侧边栏入口中
|
||||
aiCollect: 0, // 显示百度网盘 AI 看的相关入口,建议 0,作用于左侧边栏
|
||||
versionSwitchButton: 1, // 显示百度网盘的新旧版界面切换按钮,建议 1
|
||||
feedbackButton: 0, // 显示百度网盘的反馈录屏工具的相关入口,建议 0
|
||||
pfileView: 1, // 在线打开文档时,使用新版在线文档查看器,而不是旧版的在线 WPS 文档查看器,建议 1
|
||||
analytics: 0, // 允许百度网盘网页分析浏览信息,建议 0,分析原理是以 new Image 或 document.createElement("img") 的形式让浏览器访问特殊的图片来给服务器传递信息
|
||||
adTime: 0.0001, // 视频播放时的广告(等待)时间,建议 0.0001
|
||||
debug: 0, // 显示本脚本的调试信息到 JavaScript 控制台中,建议 0,另外,1 显示所有,2 仅显示 Hook 修改参数,3 仅显示禁用网页分析
|
||||
|
||||
// 以下是关键参数,不能修改
|
||||
adToken: null,
|
||||
}
|
||||
|
||||
var originalOpen = XMLHttpRequest.prototype.open;
|
||||
unsafeWindow.XMLHttpRequest.prototype.open = function (method, url) {
|
||||
url = new URL(url, window.location.origin).href
|
||||
if (url.includes('/api/loginStatus')) {
|
||||
this.addEventListener('readystatechange', function () {
|
||||
if (this.readyState == 4) {
|
||||
let res, oriRes
|
||||
try {
|
||||
res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText)
|
||||
} catch (e) {
|
||||
res = this.response, oriRes = this.response
|
||||
}
|
||||
res?.login_info?.vip_type && user.vip === 1 && user.previous === 0 ? res.login_info.vip_type = `${user.svip === 1 ? 2 : 1}1` : ""
|
||||
res?.login_info?.vip_identity && user.vip === 1 && user.previous === 0 ? res.login_info.vip_identity = Number(`${user.svip === 1 ? 2 : 1}1`) : ""
|
||||
res?.login_info?.vip_level && user.vip === 1 && user.previous === 0 ? res.login_info.vip_level = user.level : ""
|
||||
res?.login_info?.vip_point && user.vip === 1 && user.previous === 0 ? res.login_info.vip_point = user.point : ""
|
||||
res.login_info["photo_url"] && user.photo ? res.login_info["photo_url"] = user.photo : ""
|
||||
res?.login_info?.username && user.name ? res.login_info.username = user.name : ""
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", res)
|
||||
Object.defineProperty(this, "responseText", {
|
||||
writable: true,
|
||||
});
|
||||
this.responseText = JSON.stringify(res)
|
||||
Object.defineProperty(this, "responseText", {
|
||||
writable: false,
|
||||
});
|
||||
}
|
||||
})
|
||||
originalOpen.apply(this, arguments);
|
||||
} else if (url.includes('/user/info')) {
|
||||
user.vip === 1 && user.previous === 0 ? this.addEventListener('readystatechange', function () {
|
||||
if (this.readyState == 4) {
|
||||
let res, oriRes
|
||||
try {
|
||||
res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText)
|
||||
} catch (e) {
|
||||
res = this.response, oriRes = this.response
|
||||
}
|
||||
res.user_info.is_vip ? res.user_info.is_vip = user.vip : ""
|
||||
res.user_info.is_svip ? res.user_info.is_svip = user.svip : ""
|
||||
res.user_info.is_plus_buy ? res.user_info.is_plus_buy = user.svip : ""
|
||||
res.user_info.plus_buy_hit ? res.user_info.plus_buy_hit = user.svip : ""
|
||||
res.user_info.is_vip_v2 && user.level && user.level >= 2 ? res.user_info.is_vip_v2 = user.vip : "";
|
||||
res.user_info.is_vip_v2_new && user.level && user.level >= 2 ? res.user_info.is_vip_v2_new = user.vip : "";
|
||||
res.user_info.username && user.name ? res.user_info.username = user.name : "";
|
||||
res.user_info.photo && user.photo ? res.user_info.photo = user.photo : "";
|
||||
res.user_info.vipsid && user.vip_id ? res.user_info.vipsid = user.vip_id : "";
|
||||
res.user_info.phone ? res.user_info.phone = "01095099" : "";
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", res)
|
||||
Object.defineProperty(this, "responseText", {
|
||||
writable: true,
|
||||
});
|
||||
Object.defineProperty(this, "response", {
|
||||
writable: true,
|
||||
});
|
||||
this.response = JSON.stringify(res)
|
||||
this.responseText = JSON.stringify(res)
|
||||
}
|
||||
}) : ""
|
||||
originalOpen.apply(this, arguments);
|
||||
} else if (url.includes('/membership/user') && !url.includes('method=rights')) {
|
||||
this.addEventListener('readystatechange', function () {
|
||||
if (this.readyState == 4) {
|
||||
let res, oriRes
|
||||
try {
|
||||
res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText)
|
||||
} catch (e) {
|
||||
res = this.response, oriRes = this.response
|
||||
}
|
||||
// 决定网页显示会员标识
|
||||
user.vip === 1 && user.previous === 0 ? res.current_product = {
|
||||
"cluster": "vip",
|
||||
"detail_cluster": user.svip === 1 ? "svip" : "vip", // 决定修改会员标签
|
||||
"product_type": user.svip === 1 ? `vip2_1m_auto` : `vip_1m_auto`,
|
||||
"product_id": "12187135090581539740"
|
||||
} : ""
|
||||
user.vip === 1 && user.previous === 0 ? res.current_product_v2 = {
|
||||
"cluster": "vip",
|
||||
"detail_cluster": user.svip === 1 ? "svip" : "vip", // 决定修改会员标签
|
||||
"product_type": user.svip === 1 ? `vip2_1m_auto` : `vip_1m_auto`,
|
||||
"product_id": "12187135090581539740"
|
||||
} : ""
|
||||
|
||||
// 决定网页显示会员等级
|
||||
user.vip === 1 ? res.level_info = {
|
||||
...res.level_info,
|
||||
"current_value": user.point, // 决定所有会员标签
|
||||
"current_level": user.level, // 决定所有会员标签
|
||||
"history_value": user.point,
|
||||
"history_level": user.level,
|
||||
"v10_id": user.vip_id ? user.vip_id : "",
|
||||
"last_manual_collection_time": 0
|
||||
} : ""
|
||||
|
||||
if (user.vip === 1 && res.privilege_list) {
|
||||
[...res.privilege_list].forEach(item => {
|
||||
item.free_count = 100
|
||||
})
|
||||
}
|
||||
|
||||
// 决定网页展示会员剩余时间
|
||||
user.vip === 1 && user.previous === 0 && user.svip === 0 ? res.reminder = {
|
||||
...res.reminder,
|
||||
"vip": {
|
||||
"leftseconds": ((user.endtime ? user.endtime : 2147483648) * 1000 - Date.now()) / 1000,
|
||||
"nextState": "normal"
|
||||
}
|
||||
} : user.svip === 1 && user.previous === 0 ? res.reminder = {
|
||||
...res.reminder,
|
||||
"svip": {
|
||||
"leftseconds": ((user.endtime ? user.endtime : 2147483648) * 1000 - Date.now()) / 1000,
|
||||
"nextState": "normal"
|
||||
}
|
||||
} : ""
|
||||
|
||||
// 其它(已有套餐、之前套餐)
|
||||
user.vip === 1 && user.previous === 0 && res.product_infos ? res.product_infos = [{
|
||||
"product_id": "12187135090581539740",
|
||||
"buy_time": "946656000",
|
||||
"start_time": 946656000,
|
||||
"end_time": user.endtime ? user.endtime : 2147483648,
|
||||
"cluster": "vip",
|
||||
"detail_cluster": user.svip === 1 ? "svip" : "vip",
|
||||
"product_name": user.svip === 1 ? "svip2_nd" : "vip1_nd",
|
||||
"cur_svip_type": "year",
|
||||
"function_num": 8,
|
||||
"status": 0,
|
||||
"buy_description": "超级SVIP套餐(永久)",
|
||||
"product_description": "自打百度一诞生我就买了!"
|
||||
}, ...res.product_infos] : ""
|
||||
user.vip === 1 ? res.previous_product = {
|
||||
"cluster": "vip",
|
||||
"detail_cluster": user.svip === 1 ? "svip" : "vip", // 决定之前会员标签
|
||||
"product_type": user.svip === 1 ? `vip2_1m_auto` : `vip_1m_auto`,
|
||||
"expired_time": 946656000
|
||||
} : ""
|
||||
user.vip === 1 ? res.previous_product_v2 = {
|
||||
"cluster": "vip",
|
||||
"detail_cluster": user.svip === 1 ? "svip" : "vip", // 决定之前会员标签
|
||||
"product_type": user.svip === 1 ? `vip2_1m_auto` : `vip_1m_auto`,
|
||||
"expired_time": 946656000
|
||||
} : ""
|
||||
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", res)
|
||||
|
||||
Object.defineProperty(this, "response", {
|
||||
writable: true,
|
||||
});
|
||||
Object.defineProperty(this, "responseText", {
|
||||
writable: true,
|
||||
});
|
||||
this.response = JSON.stringify(res)
|
||||
this.responseText = JSON.stringify(res)
|
||||
}
|
||||
})
|
||||
originalOpen.apply(this, arguments);
|
||||
} else if (url.includes('/api/streaming') && !url.includes('M3U8_SUBTITLE_SRT')) { //获取视频m3u8接口
|
||||
let pureURL = url.replace(/vip=\d+/, 'vip=0').replace(/_1080&/, '_720&')
|
||||
if (user.adToken) {
|
||||
pureURL += ('&adToken=' + encodeURIComponent(user.adToken))
|
||||
this.adToken = user.adToken
|
||||
user.adToken = null
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook XHR", "\n请求地址:", url, "\n修改地址:", pureURL)
|
||||
originalOpen.call(this, method, pureURL, false);
|
||||
} else {
|
||||
this.addEventListener('readystatechange', function () {
|
||||
if (this.readyState == 4 && this.responseText[0] == '{') {
|
||||
let res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText), log
|
||||
user.adToken = res.adToken
|
||||
|
||||
let m3uRequest = new XMLHttpRequest();
|
||||
m3uRequest.open(method, pureURL, false);
|
||||
m3uRequest.send();
|
||||
let m3uText = m3uRequest.responseText
|
||||
|
||||
Object.defineProperty(this, "status", {
|
||||
writable: true,
|
||||
});
|
||||
this.status = m3uRequest.status;
|
||||
|
||||
if (m3uText.startsWith('#EXTM3U')) {
|
||||
log = "M3U8预览\n" + m3uText.split('\n').slice(0, 5).join('\n')
|
||||
res = m3uText
|
||||
} else {
|
||||
res = JSON.parse(m3uText)
|
||||
res.errno = 133
|
||||
user.adTime ? (res.ltime = user.adTime) : (res.ltime = 0.0001)
|
||||
user.adTime ? (res.adTime = user.adTime) : (res.adTime = 0.0001)
|
||||
}
|
||||
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", log || res)
|
||||
|
||||
Object.defineProperty(this, "responseText", {
|
||||
writable: true,
|
||||
});
|
||||
this.responseText = res;
|
||||
}
|
||||
})
|
||||
originalOpen.call(this, method, pureURL);
|
||||
}
|
||||
} else if (url.includes('/api/streaming') && url.includes('M3U8_SUBTITLE_SRT')) {
|
||||
this.addEventListener('readystatechange', function () {
|
||||
if (this.readyState == 4 && this.responseText.includes('#EXT-X-MEDIA:TYPE=SUBTITLES')) {
|
||||
let res = this.response;
|
||||
console.log("【(改)百度网盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", res);
|
||||
|
||||
// 使用正则表达式提取所有字幕信息
|
||||
var subsMatch = [...res.matchAll(/#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="([^"]+)",DEFAULT=[^,]+,AUTOSELECT=[^,]+,LANGUAGE="([^"]+)",VIDEO-LAN=[^,]+,AI-SUB=\s*([^,\s]+)\s*(https?:\/\/[^\s]+)/g)];
|
||||
|
||||
var subsHTML = $(`<span class="${mount}"><h1>[独家功能] AI字幕均为逐句分割而非整段分割</h1></span>`); // 用于存储所有按钮的HTML
|
||||
|
||||
// 遍历所有字幕项,生成对应的下载按钮
|
||||
let index = 1
|
||||
subsMatch.forEach(subInfo => {
|
||||
console.log(subInfo)
|
||||
var subName = subInfo[1]; // 字幕名称
|
||||
var language = subInfo[2]; // 字幕语言
|
||||
var aiSub = subInfo[3] === 'YES' ? 'AI-' : ''; // 是否为AI生成
|
||||
var subUrl = subInfo[4]; // 字幕下载地址
|
||||
|
||||
let buttons = $(`<div>
|
||||
<button class="downloadSubtitle beta" data-index="${index}" data-name="${aiSub}${subName}.srt" data-url="${subUrl}"><i class="u-icon-download-bold" style="vertical-align: text-bottom;"></i>下载 ${aiSub}${subName} (测试)</button>
|
||||
<a class="downloadSubtitle listener-tip" href="${subUrl}" title="默认命名是乱码,重命名的时候别忘了加上后缀 .srt 哦" data-title="默认命名是乱码,重命名的时候别忘了加上后缀 .srt 哦" target="_blank"><i class="u-icon-download-bold" style="vertical-align: text-bottom;"></i>普通下载 ${aiSub}${subName}</a>
|
||||
</div>`)
|
||||
|
||||
subsHTML.append(buttons);
|
||||
index++;
|
||||
});
|
||||
|
||||
waitForKeyElements(`aside.vp-aside div.vp-tabs div.vp-tabs__content`, function (element) {
|
||||
$(`.${mount}`).remove();
|
||||
element.after(subsHTML);
|
||||
subsHTML.find(".downloadSubtitle.beta").on('click', async function (event) {
|
||||
event.preventDefault();
|
||||
let element = $(this);
|
||||
let oriHTML = element.html()
|
||||
let ins = {};
|
||||
let progress = {};
|
||||
let index = element.data('index');
|
||||
|
||||
element.prop('disabled', true);
|
||||
|
||||
ins[index] = setInterval(function () {
|
||||
let prog = +progress[index] || 0;
|
||||
if (prog === 0) {
|
||||
element.html('<i class="u-icon-download-bold" style="vertical-align: text-bottom;"></i> 正在下载...');
|
||||
} else {
|
||||
element.html('<i class="u-icon-download-bold" style="vertical-align: text-bottom;"></i> 已下载 ' + prog + '%');
|
||||
}
|
||||
}, 10);
|
||||
|
||||
try {
|
||||
let response = await fetch(element.data("url"));
|
||||
if (!response.ok) throw new Error('网络响应失败');
|
||||
|
||||
let totalSize = response.headers.get('Content-Length') || 0;
|
||||
let reader = response.body.getReader();
|
||||
let receivedLength = 0;
|
||||
let chunks = [];
|
||||
|
||||
while (true) {
|
||||
const { done, value } = await reader.read();
|
||||
if (done) break;
|
||||
chunks.push(value);
|
||||
receivedLength += value.length;
|
||||
progress[index] = ((receivedLength / totalSize) * 100).toFixed(1);
|
||||
}
|
||||
|
||||
const blob = new Blob(chunks);
|
||||
|
||||
clearInterval(ins[index]);
|
||||
progress[index] = 100;
|
||||
element.html('<i class="u-icon-download-bold" style="vertical-align: text-bottom;"></i> 下载完成,浏览器弹框中');
|
||||
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = element.data("name");
|
||||
a.style.display = 'none';
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
|
||||
setTimeout(() => {
|
||||
URL.revokeObjectURL(url);
|
||||
document.body.removeChild(a);
|
||||
}, 1000);
|
||||
|
||||
setTimeout(function () {
|
||||
element.html(oriHTML);
|
||||
$(this).prop('disabled', false);
|
||||
}.bind(this), 3000);
|
||||
} catch (error) {
|
||||
clearInterval(ins[index]);
|
||||
console.error("下载失败:", error);
|
||||
element.html('<i class="u-icon-download-bold" style="vertical-align: text-bottom;"></i> 下载失败,点击重试?');
|
||||
$(this).prop('disabled', false).one('click', async function () {
|
||||
$(this).trigger('click');
|
||||
});
|
||||
}
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
});
|
||||
originalOpen.apply(this, arguments);
|
||||
} else if (url.includes('/msg/streaming') || url.includes('/share/streaming')) {
|
||||
this.addEventListener('readystatechange', function () {
|
||||
if (this.readyState == 4 && this.responseText[0] == '{') {
|
||||
let res, oriRes
|
||||
try {
|
||||
res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText)
|
||||
} catch (e) {
|
||||
res = this.response, oriRes = this.response
|
||||
}
|
||||
user.adTime ? (res.ltime = user.adTime) : (res.ltime = 0.0001)
|
||||
user.adTime ? (res.adTime = user.adTime) : (res.adTime = 0.0001)
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", res)
|
||||
Object.defineProperty(this, 'responseText', {
|
||||
writable: true,
|
||||
})
|
||||
this.responseText = JSON.stringify(res)
|
||||
}
|
||||
})
|
||||
originalOpen.apply(this, arguments);
|
||||
} else if (url.includes('/api/getsyscfg') && url.includes('huge_upgrade')) {
|
||||
this.addEventListener('readystatechange', function () {
|
||||
if (this.readyState == 4) {
|
||||
let res, oriRes
|
||||
try {
|
||||
res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText)
|
||||
} catch (e) {
|
||||
res = this.response, oriRes = this.response
|
||||
}
|
||||
res.huge_upgrade.cfg_list[1].show_features = (user.feedbackButton === 0 ? "0" : "1")
|
||||
res.huge_upgrade.cfg_list[0].new_nav_show = (user.versionSwitchButton === 0 ? "0" : "1")
|
||||
res.huge_upgrade.cfg_list[0].new_nav_href = "https://pan.baidu.com/disk/main"
|
||||
res.huge_upgrade.cfg_list[0].old_nav_show = (user.versionSwitchButton === 0 ? "0" : "1")
|
||||
res.huge_upgrade.cfg_list[0].old_nav_href = "https://pan.baidu.com/disk/home?stayAtHome=true"
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", res)
|
||||
Object.defineProperty(this, "response", {
|
||||
writable: true,
|
||||
});
|
||||
Object.defineProperty(this, "responseText", {
|
||||
writable: true,
|
||||
});
|
||||
this.response = JSON.stringify(res)
|
||||
this.responseText = JSON.stringify(res)
|
||||
}
|
||||
})
|
||||
originalOpen.apply(this, arguments);
|
||||
} else if (url.includes('/api/getsyscfg') && url.includes('netdisk_docchat_config')) {
|
||||
user.aiChat === 0 ? this.addEventListener('readystatechange', function () {
|
||||
if (this.readyState == 4) {
|
||||
let res, oriRes
|
||||
try {
|
||||
res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText)
|
||||
} catch (e) {
|
||||
res = this.response, oriRes = this.response
|
||||
}
|
||||
res.netdisk_docchat_config.cfg_list[0].is_chat_show = "0"
|
||||
res.netdisk_docchat_config.cfg_list[0].is_docview_chat_auto_show = "0"
|
||||
res.netdisk_docchat_config.cfg_list[0].is_docview_chat_show = "0"
|
||||
res.netdisk_docchat_config.cfg_list[0].is_home_need_out_sug = "0"
|
||||
res.netdisk_docchat_config.cfg_list[0].is_main_chat_show = "0"
|
||||
res.netdisk_docchat_config.cfg_list[0].is_videoview_chat_auto_show = "0"
|
||||
res.netdisk_docchat_config.cfg_list[0].is_videoview_chat_show = "0"
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", res)
|
||||
Object.defineProperty(this, "response", {
|
||||
writable: true,
|
||||
});
|
||||
Object.defineProperty(this, "responseText", {
|
||||
writable: true,
|
||||
});
|
||||
this.response = JSON.stringify(res)
|
||||
this.responseText = JSON.stringify(res)
|
||||
}
|
||||
}) : ""
|
||||
originalOpen.apply(this, arguments);
|
||||
} else if (url.includes('/api/getsyscfg') && url.includes('ai_collect')) {
|
||||
user.aiCollect === 0 ? this.addEventListener('readystatechange', function () {
|
||||
if (this.readyState == 4) {
|
||||
let res, oriRes
|
||||
try {
|
||||
res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText)
|
||||
} catch (e) {
|
||||
res = this.response, oriRes = this.response
|
||||
}
|
||||
res.ai_collect.cfg_list[0].is_ai_collect_show = "0"
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", res)
|
||||
Object.defineProperty(this, "response", {
|
||||
writable: true,
|
||||
});
|
||||
Object.defineProperty(this, "responseText", {
|
||||
writable: true,
|
||||
});
|
||||
this.response = JSON.stringify(res)
|
||||
this.responseText = JSON.stringify(res)
|
||||
}
|
||||
}) : ""
|
||||
originalOpen.apply(this, arguments);
|
||||
} else if (url.includes('/api/getsyscfg') && url.includes('netdisk_docview_config')) {
|
||||
this.addEventListener('readystatechange', function () {
|
||||
if (this.readyState == 4) {
|
||||
let res, oriRes
|
||||
try {
|
||||
res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText)
|
||||
} catch (e) {
|
||||
res = this.response, oriRes = this.response
|
||||
}
|
||||
res.netdisk_docview_config.cfg_list[0].auto_search_to_ai = (user.aiChat === 0 ? "0" : "1")
|
||||
res.netdisk_docview_config.cfg_list[0].use_pfile_for_doc = (user.pfileView === 0 ? "0" : "1")
|
||||
res.netdisk_docview_config.cfg_list[0].use_pfile_for_ppt = (user.pfileView === 0 ? "0" : "1")
|
||||
res.netdisk_docview_config.cfg_list[0].use_pfile_reader = (user.pfileView === 0 ? "0" : "1")
|
||||
res.netdisk_docview_config.cfg_list[0].use_wps_reader = (user.pfileView === 0 ? "1" : "0")
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", res)
|
||||
Object.defineProperty(this, "response", {
|
||||
writable: true,
|
||||
});
|
||||
Object.defineProperty(this, "responseText", {
|
||||
writable: true,
|
||||
});
|
||||
this.response = JSON.stringify(res)
|
||||
this.responseText = JSON.stringify(res)
|
||||
}
|
||||
})
|
||||
originalOpen.apply(this, arguments);
|
||||
} else {
|
||||
originalOpen.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
var hookedOpen = unsafeWindow.XMLHttpRequest.prototype.open
|
||||
|
||||
GM_addStyle(`
|
||||
/* 帮助百度网盘修正错误的会员色 */
|
||||
dt.level-1 {
|
||||
background: #fd6d65 !important;
|
||||
}
|
||||
dt.level-2 {
|
||||
background: #f3a723 !important;
|
||||
}
|
||||
dt.level-1 i.desc-arrow {
|
||||
border-bottom: 10px solid #dd6966 !important;
|
||||
}
|
||||
dt.level-2 i.desc-arrow {
|
||||
border-bottom: 10px solid #d29633 !important;
|
||||
}
|
||||
|
||||
.${mount} {
|
||||
margin: 15px 0 15px 20px;
|
||||
display: grid;
|
||||
grid-gap: 5px;
|
||||
}
|
||||
|
||||
.${mount} h1 {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .${mount} h1 {
|
||||
color: white;
|
||||
}
|
||||
|
||||
a.downloadSubtitle, button.downloadSubtitle {
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
font-size: 12px;
|
||||
background: #0095ff;
|
||||
color: #fff;
|
||||
padding: 5px;
|
||||
width: fit-content;
|
||||
white-space: nowrap;
|
||||
text-decoration:none;
|
||||
}
|
||||
a.downloadSubtitle:hover, a.downloadSubtitle:disabled, button.downloadSubtitle:hover, button.downloadSubtitle:disabled {
|
||||
background: #0095ffD0;
|
||||
}
|
||||
`)
|
||||
|
||||
// 禁止分析网页信息
|
||||
if (user.analytics === 0) unsafeWindow.Image = function () {
|
||||
const img = new Image();
|
||||
return new Proxy(img, {
|
||||
set(target, prop, value) {
|
||||
if (prop === 'src' && (value.includes('analytics') || value.includes('ztbox'))) {
|
||||
let url = new URL(value, location.origin);
|
||||
if (user.debug === 1 || user.debug === 3) console.warn("【(改)百度网盘会员青春版】unAnalytics", '\n类型:new Image\n禁止网页分析信息:', url.href);
|
||||
return true; // 阻止设置
|
||||
}
|
||||
target[prop] = value; // 设置其他属性
|
||||
return true;
|
||||
},
|
||||
get(target, prop) {
|
||||
return target[prop]; // 获取属性值
|
||||
}
|
||||
});
|
||||
};
|
||||
const originalCreateElement = document.createElement;
|
||||
if (user.analytics === 0) unsafeWindow.document.createElement = function (tagName) {
|
||||
const element = originalCreateElement.call(unsafeWindow.document, tagName);
|
||||
if (tagName.toLowerCase() === 'img') {
|
||||
Object.defineProperty(element, 'src', {
|
||||
set(value) {
|
||||
if (value.includes('analytics') || value.includes('ztbox')) {
|
||||
let url = new URL(value, location.origin);
|
||||
if (user.debug === 1 || user.debug === 3) console.warn("【(改)百度网盘会员青春版】unAnalytics", '\n类型:document.createElement("img")\n禁止网页分析信息:', url.href)
|
||||
return true;
|
||||
} else {
|
||||
element.setAttribute('src', value)
|
||||
}
|
||||
},
|
||||
get() {
|
||||
return element.getAttribute('src');
|
||||
}
|
||||
});
|
||||
}
|
||||
return element;
|
||||
};
|
||||
|
||||
waitForKeyElements(`.vp-video__control-bar--playback-rates button, vp-video__control-bar--video-subtitles-select-item`, function (element) {
|
||||
element.on('click', function () {
|
||||
XMLHttpRequest.prototype.open = originalOpen;
|
||||
setTimeout(function () {
|
||||
XMLHttpRequest.prototype.open = hookedOpen;
|
||||
}, 20)
|
||||
})
|
||||
})
|
||||
|
||||
let localsTimer = setInterval(() => {
|
||||
if (!unsafeWindow.locals) return
|
||||
clearInterval(localsTimer)
|
||||
let locals = unsafeWindow.locals
|
||||
let originalSet = locals.set
|
||||
locals.set = function (...args) {
|
||||
if (typeof args[1] == 'number' || typeof args[1] == 'string') {
|
||||
let oriarg = args[1]
|
||||
if (args[0].includes('is_vip')) {
|
||||
args[1] = user.vip === 1 && user.previous === 0 ? 1 : 0
|
||||
} else if (args[0].includes('is_svip')) {
|
||||
args[1] = user.svip === 1 && user.previous === 0 ? 1 : 0;
|
||||
} else if (args[0] === 'vip_level') {
|
||||
user.level ? args[1] = user.level : "";
|
||||
} else if (args[0] === 'v10_id') {
|
||||
user.vip_id ? args[1] = user.vip_id : "";
|
||||
} else if (args[0] === 'username') {
|
||||
user.name ? args[1] = user.name : "";
|
||||
} else if (args[0] === 'photo') {
|
||||
user.photo ? args[1] = user.photo : "";
|
||||
}
|
||||
if (oriarg !== args[1]) {
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook Locals", "\n原始数据:", args[0], "-", oriarg, "\n修改数据:", args[0], "-", args[1]);
|
||||
}
|
||||
}
|
||||
originalSet.apply(this, args);
|
||||
}
|
||||
if (/\/s\/.*?\?fid=.*?/.test(location.href)) unsafeWindow.locals.self = 1
|
||||
if (locals.userInfo) {
|
||||
user.vip === 1 && user.previous === 0 ? locals.userInfo.vip_identity = Number(`${user.svip === 1 ? 2 : 1}1`) : ""
|
||||
user.name ? locals.userInfo.username = user.name : ""
|
||||
user.photo ? locals.userInfo["photo_url"] = user.photo : ""
|
||||
user.level ? locals.userInfo.vip_level = user.level : ""
|
||||
user.vip_id ? locals.userInfo.svip10_id = user.vip_id : ""
|
||||
} else if (locals.mset && user.vip === 1 && user.previous === 0) {
|
||||
locals.mset({
|
||||
'is_vip': user.vip === 1 && user.previous === 0 ? 1 : 0,
|
||||
'is_svip': user.svip === 1 && user.previous === 0 ? 1 : 0,
|
||||
'vip_level': user.level ? user.level : "",
|
||||
'svip10_id': user.vip_id ? user.vip_id : "",
|
||||
'show_vip_ad': 0
|
||||
})
|
||||
} else {
|
||||
user.level ? locals.vip_level = user.level : ""
|
||||
locals.is_vip = user.vip === 1 && user.previous === 0 ? 1 : 0
|
||||
locals.is_svip = user.svip === 1 && user.previous === 0 ? 1 : 0
|
||||
user.vip === 1 && user.previous === 0 ? locals.show_vip_ad = 0 : ""
|
||||
user.photo ? locals.photo = user.photo : ""
|
||||
user.name ? locals.username = user.name : ""
|
||||
}
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook", "\nLocals:", locals)
|
||||
}, 1)
|
||||
|
||||
let yunDataTimer = setInterval(() => {
|
||||
if (!unsafeWindow.yunData) return;
|
||||
clearInterval(yunDataTimer)
|
||||
let yunData = unsafeWindow.yunData
|
||||
|
||||
let originalSet = yunData.setData;
|
||||
yunData.setData = function (...args) {
|
||||
if (typeof args[0] === 'object') {
|
||||
let oriargs = { ...args[0] }
|
||||
let newargs = args[0]
|
||||
if (oriargs.hasOwnProperty('is_vip')) {
|
||||
newargs.is_vip = user.vip === 1 && user.previous === 0 ? 1 : 0;
|
||||
}
|
||||
if (oriargs.hasOwnProperty('is_svip')) {
|
||||
newargs.is_svip = user.svip === 1 && user.previous === 0 ? 1 : 0;
|
||||
}
|
||||
if (oriargs.hasOwnProperty('vip_level')) {
|
||||
user.level ? newargs.vip_level = user.level : "";
|
||||
}
|
||||
if (oriargs.hasOwnProperty('v10_id')) {
|
||||
user.vip_id ? newargs.v10_id = user.vip_id : "";
|
||||
}
|
||||
if (oriargs.hasOwnProperty('photo')) {
|
||||
user.photo ? newargs.photo = user.photo : "";
|
||||
}
|
||||
if (oriargs.hasOwnProperty('username')) {
|
||||
user.name ? newargs.username = user.name : "";
|
||||
}
|
||||
if (JSON.stringify(oriargs) !== JSON.stringify(newargs)) {
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook yunData", "\n原始数据:", oriargs, "\n修改数据:", newargs);
|
||||
}
|
||||
} else {
|
||||
let oriarg = args[1]
|
||||
if (args[0].includes('is_vip')) {
|
||||
args[1] = user.vip === 1 && user.previous === 0 ? 1 : 0
|
||||
} else if (args[0].includes('is_svip')) {
|
||||
args[1] = user.svip === 1 && user.previous === 0 ? 1 : 0;
|
||||
} else if (args[0] === 'vip_level') {
|
||||
user.level ? args[1] = user.level : "";
|
||||
} else if (args[0] === 'v10_id') {
|
||||
user.vip_id ? args[1] = user.vip_id : "";
|
||||
} else if (args[0] === 'username') {
|
||||
user.name ? args[1] = user.name : "";
|
||||
} else if (args[0] === 'photo') {
|
||||
user.photo ? args[1] = user.photo : "";
|
||||
}
|
||||
if (oriarg !== args[1]) {
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook yunData", "\n原始数据:", args[0], "-", oriarg, "\n修改数据:", args[0], "-", args[1]);
|
||||
}
|
||||
}
|
||||
originalSet.apply(this, args);
|
||||
}
|
||||
user.name ? yunData.username = user.name : ""
|
||||
user.name ? yunData.MYNAME = user.name : ""
|
||||
user.photo ? yunData.MYAVATAR = user.photo : ""
|
||||
user.photo ? yunData.photo = user.photo : ""
|
||||
user.level ? yunData.vip_level = user.level : ""
|
||||
yunData.ISVIP = user.vip === 1 && user.previous === 0 ? 1 : 0
|
||||
yunData.ISSVIP = user.svip === 1 ? 1 : 0
|
||||
user.vip ? yunData.ISYEARVIP = 1 : ""
|
||||
yunData.is_vip = user.vip === 1 && user.previous === 0 ? 1 : 0
|
||||
yunData.is_svip = user.svip === 1 ? 1 : 0
|
||||
yunData.is_vip_v2 = user.vip === 1 && user.previous === 0 ? 1 : 0
|
||||
yunData.is_svip_v2_new = user.svip === 1 ? 1 : 0
|
||||
user.vip ? yunData.show_vip_ad = 0 : ""
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook", "\nyunData:", yunData)
|
||||
}, 1)
|
||||
|
||||
let yunDataRequireTimer = setInterval(() => {
|
||||
if (!unsafeWindow.require) return;
|
||||
clearInterval(yunDataRequireTimer)
|
||||
require.async('pan-center:widget/data/yunData', function (yunData) {
|
||||
let originalSet = yunData.setData;
|
||||
yunData.setData = function (...args) {
|
||||
if (typeof args[0] === 'object') {
|
||||
let oriargs = { ...args[0] }
|
||||
let newargs = args[0]
|
||||
if (oriargs.hasOwnProperty('is_vip')) {
|
||||
user.vip === 1 && user.previous === 0 ? newargs.is_vip = 1 : newargs.is_vip = 0;
|
||||
}
|
||||
if (oriargs.hasOwnProperty('is_svip')) {
|
||||
user.svip === 1 && user.previous === 0 ? newargs.is_svip = 1 : newargs.is_svip = 0;
|
||||
}
|
||||
if (oriargs.hasOwnProperty('is_evip')) {
|
||||
user.svip === 1 && user.previous === 0 ? newargs.is_evip = 1 : newargs.is_evip = 0;
|
||||
}
|
||||
if (oriargs.hasOwnProperty('vip_level')) {
|
||||
user.level ? newargs.vip_level = user.level : "";
|
||||
}
|
||||
if (oriargs.hasOwnProperty('v10_id')) {
|
||||
user.vip_id ? newargs.v10_id = user.vip_id : "";
|
||||
}
|
||||
if (oriargs.hasOwnProperty('has_3V1_coupon')) {
|
||||
user.svip === 1 && user.previous === 0 ? newargs.has_3V1_coupon = 1 : newargs.has_3V1_coupon = 0;
|
||||
}
|
||||
if (oriargs.hasOwnProperty('photo')) {
|
||||
user.photo ? newargs.photo = user.photo : "";
|
||||
}
|
||||
if (oriargs.hasOwnProperty('username')) {
|
||||
user.name ? newargs.username = user.name : "";
|
||||
}
|
||||
if (JSON.stringify(oriargs) !== JSON.stringify(newargs)) {
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook yunDataModule", "\n原始数据:", oriargs, "\n修改数据:", newargs);
|
||||
}
|
||||
} else {
|
||||
let oriarg = args[1]
|
||||
if (args[0].includes('is_vip')) {
|
||||
args[1] = user.vip === 1 && user.previous === 0 ? 1 : 0
|
||||
} else if (args[0].includes('is_svip')) {
|
||||
args[1] = user.svip === 1 && user.previous === 0 ? 1 : 0;
|
||||
} else if (args[0] === 'vip_level') {
|
||||
user.level ? args[1] = user.level : "";
|
||||
} else if (args[0] === 'v10_id') {
|
||||
user.vip_id ? args[1] = user.vip_id : "";
|
||||
} else if (args[0] === 'username') {
|
||||
user.name ? args[1] = user.name : "";
|
||||
} else if (args[0] === 'photo') {
|
||||
user.photo ? args[1] = user.photo : "";
|
||||
}
|
||||
if (oriarg !== args[1]) {
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook yunDataModule", "\n原始数据:", args[0], "-", oriarg, "\n修改数据:", args[0], "-", args[1]);
|
||||
}
|
||||
}
|
||||
originalSet.apply(this, args);
|
||||
}
|
||||
if (user.debug === 1 || user.debug === 2) console.log("【(改)百度网盘会员青春版】Hook", "\nyunDataModule:", yunData)
|
||||
})
|
||||
}, 1)
|
||||
|
||||
/**
|
||||
* waitForKeyElements
|
||||
* @description 监测动态加载的 DOM 元素并在元素出现时执行回调函数。适用于 AJAX/iframe 内容。
|
||||
* @param {string} selectorTxt - jQuery 选择器字符串,用于定位目标元素
|
||||
* @param {function} actionFunction - 回调函数,会将 jQuery 元素对象作为参数返回。在函数中 `return true` 可以取消后续查找
|
||||
* @param {boolean} [bWaitOnce=true] - 找到元素后是否仅执行一次回调函数
|
||||
* @param {string} [iframeSelector] - 可选,iframe 元素选择器
|
||||
* @example
|
||||
* waitForKeyElements(".comments", (jNode) => {
|
||||
* jNode.text("内容已修改");
|
||||
* // return true; // 取消后续检测
|
||||
* });
|
||||
* @requires jQuery
|
||||
*/
|
||||
function waitForKeyElements(selectorTxt, actionFunction, bWaitOnce, iframeSelector) {
|
||||
var targetNodes, btargetsFound;
|
||||
|
||||
if (typeof iframeSelector == "undefined")
|
||||
targetNodes = $(selectorTxt);
|
||||
else
|
||||
targetNodes = $(iframeSelector).contents().find(selectorTxt);
|
||||
|
||||
if (targetNodes && targetNodes.length > 0) {
|
||||
btargetsFound = true;
|
||||
targetNodes.each(function () {
|
||||
var jThis = $(this);
|
||||
var alreadyFound = jThis.data('alreadyFound') || false;
|
||||
|
||||
if (!alreadyFound) {
|
||||
var cancelFound = actionFunction(jThis);
|
||||
if (cancelFound)
|
||||
btargetsFound = false;
|
||||
else {
|
||||
jThis.data('alreadyFound');
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
btargetsFound = false;
|
||||
}
|
||||
|
||||
var controlObj = waitForKeyElements.controlObj || {};
|
||||
var controlKey = selectorTxt.replace(/[^\w]/g, "_") + actionFunction.toString().replace(/[^\w]/g, "_");
|
||||
var timeControl = controlObj[controlKey];
|
||||
|
||||
if (btargetsFound && bWaitOnce && timeControl) {
|
||||
clearInterval(timeControl);
|
||||
delete controlObj[controlKey]
|
||||
} else {
|
||||
if (!timeControl) {
|
||||
timeControl = setInterval(() => {
|
||||
waitForKeyElements(selectorTxt, actionFunction, bWaitOnce, iframeSelector);
|
||||
}, 1000);
|
||||
controlObj[controlKey] = timeControl;
|
||||
}
|
||||
}
|
||||
waitForKeyElements.controlObj = controlObj;
|
||||
}
|
||||
|
||||
// 这是啥?我不到啊
|
||||
function idontknow(input) {
|
||||
let charArray = input.split('');
|
||||
// Fisher-Yates 洗牌算法
|
||||
for (let i = charArray.length - 1; i > 0; i--) {
|
||||
let j = Math.floor(Math.random() * (i + 1));
|
||||
[charArray[i], charArray[j]] = [charArray[j], charArray[i]];
|
||||
}
|
||||
return charArray.join('');
|
||||
}
|
||||
// (改)百度网盘会员青春版 迁移到新仓库啦!
|
||||
// 请前往新仓库 https://github.com/hmjz100/BaiduNetDiskYouthMember
|
||||
// 或者打开 https://github.com/hmjz100/BaiduNetDiskYouthMember/raw/main/%EF%BC%88%E6%94%B9%EF%BC%89%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98%E4%BC%9A%E5%91%98%E9%9D%92%E6%98%A5%E7%89%88.user.js
|
||||
// 安装新版脚本~
|
||||
// 请尽快迁移,hmjz100/LinkSwift 存储的 "(改)百度网盘会员青春版" 文件将在不久后删除!
|
||||
alert(`(改)百度网盘会员青春版 迁移到新仓库啦!\n\n请前往新仓库: https://github.com/hmjz100/BaiduNetDiskYouthMember\n或者点击下面的 "确认" 按钮打开新仓库的安装链接\n以安装新版本的脚本~`)
|
||||
window.location.href = `https://github.com/hmjz100/BaiduNetDiskYouthMember/raw/main/%EF%BC%88%E6%94%B9%EF%BC%89%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98%E4%BC%9A%E5%91%98%E9%9D%92%E6%98%A5%E7%89%88.user.js`;
|
||||
})()
|
||||
13560
(改)网盘直链下载助手.user.js
13560
(改)网盘直链下载助手.user.js
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user