Skip to content

Commit 81f0955

Browse files
committed
Merge branch 'master' of https://github.com/chavyleung/scripts
2 parents c6087d4 + 4558ce2 commit 81f0955

17 files changed

Lines changed: 1217 additions & 11 deletions

‎QuantumultX_AppStore_Local_Cookie.conf‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 本配置适用于: QuanX 商店版 v1.0.6-build194 及之前版本
22
# 如果你是TF版, 请使用: QuantumultX_Local_Cookie.conf
33

4-
hostname = maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, act.10010.com, api-takumi.mihoyo.com, gdws.nsenz.com, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, *.weixinjia.net, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, v.qq.com, mobwsa.ximalaya.com, *.you.163.com, *.rrys2019.com, ios.zmzapi.com
4+
hostname = daojia.jd.com, app.nio.com, wxprdapplet.gac-nio.com, maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, act.10010.com, api-takumi.mihoyo.com, gdws.nsenz.com, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, *.weixinjia.net, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, v.qq.com, mobwsa.ximalaya.com, *.you.163.com, *.rrys2019.com, ios.zmzapi.com
55

66
# 电信营业厅
77
^https:\/\/wapside.189.cn:9001\/api\/home\/homeInfo url script-request-header chavyleung/10000/10000.cookie.js
@@ -98,4 +98,13 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc
9898
^https://group\.baicizhan\.com/group/rewards? url script-request-header chavyleung/bcz/bcz.cookie.js
9999

100100
# 叮咚买菜
101-
^https:\/\/maicai.api.ddxq.mobi\/point\/home url script-request-header chavyleung/mcdd/mcdd.cookie.js
101+
^https:\/\/maicai.api.ddxq.mobi\/point\/home url script-request-header chavyleung/mcdd/mcdd.cookie.js
102+
103+
#合创
104+
^https:\/\/wxprdapplet\.gac-nio\.com\/community\/userSignIn\/simpleAuth\/front\/v3\.1\.3\.5\/signV2$ url script-request-header hycan.cookie.js
105+
106+
#蔚来
107+
^https:\/\/app\.nio\.com\/api\/1\/app\/daily_checkin url script-request-header chavyleung/nio/nio.cookie.js
108+
109+
#京东到家
110+
^https:\/\/daojia.jd.com/client(.*?)functionId=signin(.*?)userSigninNew url script-request-header chavyleung/jddj/jddj.cookie.js

‎QuantumultX_Local_Cookie.conf‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 本配置适用于: QuanX TestFlight v1.0.6-build195 及以后版本
22
# 如果你是商店版, 请使用: QuantumultX_AppStore_Local_Cookie.conf
33

4-
hostname = api.dushu.io, pm.m.fenqile.com, maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, i.meituan.com, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, act.10010.com, api-takumi.mihoyo.com, m.gdoil.cn, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, *.weixinjia.net, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, v.qq.com, mobwsa.ximalaya.com, *.you.163.com, *.rrys2019.com, ios.zmzapi.com
4+
hostname = daojia.jd.com, app.nio.com, wxprdapplet.gac-nio.com, node.kg.qq.com, api.dushu.io, pm.m.fenqile.com, maicai.api.ddxq.mobi, group.baicizhan.com, api.everphoto.cn, i.meituan.com, promotion.waimai.meituan.com, wx.10086.cn, www.maomicd.com, act.10010.com, api-takumi.mihoyo.com, m.gdoil.cn, credits.bz.mgtv.com, *.csdn.net, wapside.189.cn, *.acfun.cn, apk.tw, *.bilibili.com, api.dongqiudi.com, *.feng.com, www.flyertea.com, music.163.com, *.m.163.com, user.qunar.com, *.rr.tv, *.weixinjia.net, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, v.qq.com, mobwsa.ximalaya.com, *.you.163.com, *.rrys2019.com, ios.zmzapi.com
55

66
# 电信营业厅
77
^https:\/\/wapside.189.cn:9001\/api\/home\/homeInfo url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js
@@ -107,8 +107,16 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc
107107
^https://pm\.m\.fenqile\.com/route0014/star/sign/sign.json url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.cookie.js
108108

109109
#樊登读书
110-
<<<<<<< HEAD
111110
^https://api\.dushu\.io/CheckIn url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/fandeng/fandeng.cookie.js
112-
=======
113-
^https://api\.dushu\.io/CheckIn url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/pandeng/pandeng.cookie.js
114-
>>>>>>> origin/master
111+
112+
#全民K歌
113+
^https://node\.kg\.qq\.com/webapp/proxy? url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/qmkg/qmkg.cookie.js
114+
115+
#蔚来
116+
^https:\/\/app\.nio\.com\/api\/1\/app\/daily_checkin url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/nip/nio.cookie.js
117+
118+
#合创
119+
^https:\/\/wxprdapplet\.gac-nio\.com\/community\/userSignIn\/simpleAuth\/front\/v3\.1\.3\.5\/signV2$ url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/hycan/hycan.cookie.js
120+
121+
#京东到家
122+
^https:\/\/daojia.jd.com/client(.*?)functionId=signin(.*?)userSigninNew url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/jddj/jddj.cookie.js

‎QuantumultX_Local_Task.conf‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[task_local]
22
# @chavyleung
3+
# @GideonSenku
4+
# @barrymchen
5+
# @danchaw
36
# 电信营业厅
47
5 0 * * * chavyleung/10000/10000.js
58
# AcFun
@@ -65,8 +68,12 @@
6568
# 分期乐
6669
1 0 * * * chavyleung/fenqile/fenqile.js
6770
#樊登读书
68-
<<<<<<< HEAD
6971
1 0 * * * chavyleung/fandeng/fandeng.js
70-
=======
71-
1 0 * * * chavyleung/pandeng/pandeng.js
72-
>>>>>>> origin/master
72+
#全民K歌
73+
1 0 * * * chavyleung/qmkg/qmkg.js
74+
#合创
75+
1 0 * * * chavyleung/hycan/hycan.js
76+
#蔚来
77+
1 0 * * * chavyleung/nio/nio.js
78+
#京东到家
79+
1 0 * * * chavyleung/jddj/jddj.js

‎haidilao/README.md‎

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

‎haidilao/hdl.js‎

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
const cookieName = '海底捞'
2+
const signurlKey = 'signurl_hdl'
3+
const signheaderKey = 'signheader_hdl'
4+
const signbodyKey = 'signbody_hdl'
5+
const hdl = init()
6+
7+
let isGetCookie = typeof $request !== 'undefined'
8+
9+
if (isGetCookie) {
10+
getcookie()
11+
} else {
12+
sign()
13+
}
14+
15+
function getcookie() {
16+
if ($request && $request.method == 'POST') {
17+
const signurlVal = $request.url
18+
const signheaderVal = JSON.stringify($request.headers)
19+
const signbodyVal = $request.body
20+
21+
if (signurlVal) hdl.setdata(signurlVal, signurlKey)
22+
if (signheaderVal) hdl.setdata(signheaderVal, signheaderKey)
23+
if (signbodyVal) hdl.setdata(signbodyVal, signbodyKey)
24+
hdl.msg(cookieName, `获取Cookie: 成功, 请禁用该脚本`, ``)
25+
}
26+
hdl.done()
27+
}
28+
29+
function sign() {
30+
const signurlVal = hdl.getdata(signurlKey)
31+
const signheaderVal = hdl.getdata(signheaderKey)
32+
const signbodyVal = hdl.getdata(signbodyKey)
33+
const url = { url: signurlVal, headers: JSON.parse(signheaderVal), body: signbodyVal }
34+
hdl.post(url, (error, response, data) => {
35+
hdl.log(`${cookieName}, data: ${data}`)
36+
const title = `${cookieName}`
37+
let subTitle = ''
38+
let detail = ''
39+
const result = JSON.parse(data)
40+
if (result.success == true && result.signInfoVO.todaySigned == true) {
41+
subTitle = `签到结果: 成功`
42+
detail = `签到奖励: ${result.customInfo.foodNum}火柴, 连签: ${result.signInfoVO.continueDay}天`
43+
} else if (result.success == false && result.signInfoVO.todaySigned == true) {
44+
subTitle = `签到结果: 成功 (重复签到)`
45+
detail = `连签: ${result.signInfoVO.continueDay}天`
46+
} else {
47+
subTitle = `签到结果: 失败`
48+
detail = `说明: ${result.message}, 请重新获取`
49+
}
50+
hdl.msg(title, subTitle, detail)
51+
hdl.done()
52+
})
53+
}
54+
55+
function init() {
56+
isSurge = () => {
57+
return undefined === this.$httpClient ? false : true
58+
}
59+
isQuanX = () => {
60+
return undefined === this.$task ? false : true
61+
}
62+
getdata = (key) => {
63+
if (isSurge()) return $persistentStore.read(key)
64+
if (isQuanX()) return $prefs.valueForKey(key)
65+
}
66+
setdata = (key, val) => {
67+
if (isSurge()) return $persistentStore.write(key, val)
68+
if (isQuanX()) return $prefs.setValueForKey(key, val)
69+
}
70+
msg = (title, subtitle, body) => {
71+
if (isSurge()) $notification.post(title, subtitle, body)
72+
if (isQuanX()) $notify(title, subtitle, body)
73+
}
74+
log = (message) => console.log(message)
75+
get = (url, cb) => {
76+
if (isSurge()) {
77+
$httpClient.get(url, cb)
78+
}
79+
if (isQuanX()) {
80+
url.method = 'GET'
81+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
82+
}
83+
}
84+
post = (url, cb) => {
85+
if (isSurge()) {
86+
$httpClient.post(url, cb)
87+
}
88+
if (isQuanX()) {
89+
url.method = 'POST'
90+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
91+
}
92+
}
93+
put = (url, cb) => {
94+
if (isSurge()) {
95+
$httpClient.put(url, cb)
96+
}
97+
if (isQuanX()) {
98+
url.method = 'PUT'
99+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
100+
}
101+
}
102+
done = (value = {}) => {
103+
$done(value)
104+
}
105+
return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, put, done }
106+
}

‎hycan/README.md‎

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

0 commit comments

Comments
 (0)