Rules-For-Quantumult-X/Scripts/SignIn/NeteaseMusic/README.md

91 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 网易云音乐
> 2020.6.15
>
> 1. 增加自动重试机制 (BoxJs 可调整次数及间隔)
> 2. 增加等级显示 (需按新方式获取会话)
## 配置 (Surge & Loon)
```properties
[MITM]
music.163.com
[Script]
http-request ^https:\/\/music.163.com\/weapi\/user\/level script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.cookie.js,requires-body=true
cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.js
```
## 配置 QuanX
```properties
[MITM]
music.163.com
[rewrite_local]
^https:\/\/music.163.com\/weapi\/user\/level url script-request-body neteasemusic.cookie.js
[task_local]
1 0 * * * neteasemusic.js
```
## 说明
1. 先登录: <https://music.163.com/m/login>
2. 再访问: <https://music.163.com/#/user/level>
3. 提示: `获取会话: 成功!`
> 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie.
> 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次.
## 常见问题
1. 无法写入 Cookie
- 检查 Surge 系统通知权限放开了没
- 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴)
2. 写入 Cookie 成功, 但签到不成功
- 看看是不是在登录前就写入 Cookie 了
- 如果是,请确保在登录成功后,再尝试写入 Cookie
3. 为什么有时成功有时失败
- 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败)
- 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学):
- `Surge`配置:
```properties
# 没有什么是一顿饭解决不了的:
cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次
# 如果有,那就两顿:
cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次
# 实在不行,三顿也能接受:
cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次
# 再粗暴点,直接:
cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次
```
- `QuanX`配置:
```properties
[task_local]
1 0 * * * xxx.js # 每天00:01执行一次
2 0 * * * xxx.js # 每天00:02执行一次
3 0 * * * xxx.js # 每天00:03执行一次
*/60 * * * * xxx.js # 每60分执行一次
```
## 感谢
[@NobyDa](https://github.com/NobyDa)
[@lhie1](https://github.com/lhie1)
[@ConnersHua](https://github.com/ConnersHua)