Skip to content

Commit 251323d

Browse files
committed
更新[网易云音乐]签到脚本&说明
1 parent 4c87b00 commit 251323d

3 files changed

Lines changed: 24 additions & 8 deletions

File tree

‎neteasemusic/README.md‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
music.163.com
88

99
[Script]
10-
http-request ^http://music.163.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.cookie.js
10+
http-request ^http:\/\/music\.163\.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.cookie.js
1111
cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.js
1212
```
1313

@@ -16,14 +16,27 @@ cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scr
1616
1. 先把`music.163.com`加到`[MITM]`
1717
2. 再把两条远程脚本放到`[Script]`
1818
3. 浏览器访问并登录: https://music.163.com/m/login
19-
4. 再用浏览器访问下: http://music.163.com (注意了, 是 http, 没有 s)
19+
4. 打开浏览器访问: http://music.163.com (注意了, 是 http, 没有 s)
2020
5. `Surge`提示: `Cookie [网易云音乐] 写入成功`
2121
6. 最后就可以把第 1 条脚本注释掉了
2222

23-
> 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了
23+
> 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie.
2424
2525
> 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次.
2626
27+
## 常见问题
28+
29+
1. 无法写入 Cookie
30+
31+
- 检查 Surge 系统通知权限放开了没
32+
- 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴)
33+
- 注意: 写入 Cookie 的网址是`http`开头的(不是 https, 没有 s, 没有 s, 没有要)
34+
35+
2. 写入 Cookie 成功, 但签到不成功
36+
37+
- 看看是不是在登录前就写入 Cookie 了
38+
- 如果是,请确保在登录成功后,再尝试写入 Cookie
39+
2740
## 感谢
2841

2942
[@NobyDa](https://github.com/NobyDa)

‎neteasemusic/neteasemusic.cookie.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* music.163.com
55
*
66
* [Script]
7-
* http-request ^http://music.163.com script-path=scripts/neteasemusic/neteasemusic.cookie.js
7+
* http-request ^http:\/\/music\.163\.com script-path=scripts/neteasemusic/neteasemusic.cookie.js
88
* cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.js
99
*
1010
*/

‎neteasemusic/neteasemusic.js‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* music.163.com
55
*
66
* [Script]
7-
* http-request ^http://music.163.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.cookie.js
7+
* http-request ^http:\/\/music\.163\.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.cookie.js
88
* cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.js
99
*
1010
*/
@@ -41,10 +41,13 @@ function log(title, data) {
4141
let result = JSON.parse(data)
4242
if (result.code == 200) {
4343
console.log(`签到成功: ${title}`)
44+
$notification.post('签到成功', title, '')
45+
} else if (result.code == -2) {
46+
console.log(`签到跳过: ${title}, 编码: ${result.code}, 原因: ${result.msg}`)
47+
$notification.post('签到跳过', title, `原因: ${result.msg}`)
4448
} else {
45-
console.log(
46-
`签到失败: ${title}, 错误编码: ${result.code}, 错误原因: ${result.msg}`
47-
)
49+
console.log(`签到失败: ${title}, 编码: ${result.code}, 原因: ${result.msg}`)
50+
$notification.post('签到失败', title, `原因: ${result.msg}`)
4851
}
4952
}
5053

0 commit comments

Comments
 (0)