Skip to content

Commit cb1cdc3

Browse files
author
Hyseen
committed
添加[哈啰出行]签到脚本
1 parent e110baf commit cb1cdc3

File tree

2 files changed

+405
-0
lines changed

2 files changed

+405
-0
lines changed

hellobike/README.md

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# 哈啰出行
2+
3+
> 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可
4+
5+
## 配置 (Surge)
6+
7+
```properties
8+
[MITM]
9+
gameapi.hellobike.com
10+
11+
[Script]
12+
http-request ^https:\/\/gameapi\.hellobike\.com\/api script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/hellobike/hellobike.js, requires-body=true
13+
cron "5 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/hellobike/hellobike.js
14+
```
15+
16+
## 配置 (QuanX)
17+
18+
```properties
19+
[MITM]
20+
gameapi.hellobike.com
21+
22+
[rewrite_local]
23+
# [商店版]
24+
^https:\/\/gameapi\.hellobike\.com\/api url script-request-body hellobike/hellobike.js
25+
26+
# [TestFlight]
27+
^https:\/\/gameapi\.hellobike\.com\/api url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/hellobike/hellobike.js
28+
29+
[task_local]
30+
# [商店版]
31+
5 0 * * * hellobike/hellobike.js
32+
33+
# [TestFlight]
34+
5 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/hellobike/hellobike.js
35+
```
36+
37+
## 说明
38+
39+
1. 先把`gameapi.hellobike.com`加到`[MITM]`
40+
2. 再配置重写规则:
41+
- Surge: 把远程脚本放到`[Script]`
42+
- QuanX: 把`hellobike.js`传到`On My iPhone - Quantumult X - Scripts - hellobike` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关)
43+
3. 打开 APP 进入签到页面: `我的` > `有哈有车`
44+
4. 系统提示: `首次写入 哈啰出行 Token 成功 🎉`
45+
5. 把获取 Cookie 的脚本注释掉
46+
6. 运行一次脚本, 如果提示重复签到, 那就算成功了!
47+
48+
> 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie.
49+
50+
> 第 2 条脚本是签到脚本, 每天`00:05`执行一次.
51+
52+
## 常见问题
53+
54+
1. 无法写入 Cookie
55+
56+
- 检查 Surge 系统通知权限放开了没
57+
- 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴)
58+
59+
2. 写入 Cookie 成功, 但签到不成功
60+
61+
- 看看是不是在登录前就写入 Cookie 了
62+
- 如果是,请确保在登录成功后,再尝试写入 Cookie
63+
64+
3. 为什么有时成功有时失败
65+
66+
- 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败)
67+
- 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学):
68+
69+
- `Surge`配置:
70+
71+
```properties
72+
# 没有什么是一顿饭解决不了的:
73+
cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次
74+
# 如果有,那就两顿:
75+
cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次
76+
# 实在不行,三顿也能接受:
77+
cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次
78+
79+
# 再粗暴点,直接:
80+
cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次
81+
```
82+
83+
- `QuanX`配置:
84+
85+
```properties
86+
[task_local]
87+
1 0 * * * xxx.js # 每天00:01执行一次
88+
2 0 * * * xxx.js # 每天00:02执行一次
89+
3 0 * * * xxx.js # 每天00:03执行一次
90+
91+
*/60 * * * * xxx.js # 每60分执行一次
92+
```
93+
94+
## 感谢
95+
96+
[@NobyDa](https://github.com/NobyDa)
97+
98+
[@lhie1](https://github.com/lhie1)
99+
100+
[@ConnersHua](https://github.com/ConnersHua)
101+
102+
[@GideonSenku](https://github.com/GideonSenku)

0 commit comments

Comments
 (0)