Skip to content

Commit 279222f

Browse files
author
GideonSenku
committed
添加[京东到家]签到脚本
1 parent 81e452e commit 279222f

8 files changed

+267
-6
lines changed

QuantumultX_AppStore_Local_Cookie.conf

+11-2
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? url script-request-header chavyleung/jddj/jddj.cookie.js

QuantumultX_Local_Cookie.conf

+11-2
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 = 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
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
@@ -110,4 +110,13 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc
110110
^https://api\.dushu\.io/CheckIn url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/fandeng/fandeng.cookie.js
111111

112112
#全民K歌
113-
^https://node\.kg\.qq\.com/webapp/proxy? url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/qmkg/qmkg.cookie.js
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? url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/jddj/jddj.cookie.js

QuantumultX_Local_Task.conf

+9
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
@@ -68,3 +71,9 @@
6871
1 0 * * * chavyleung/fandeng/fandeng.js
6972
#全民K歌
7073
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

jddj/README.md

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# 京东到家
2+
3+
> 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可
4+
> 感谢 [@barry](https://t.me/barrymchen) 编写
5+
> 感谢 [@GideonSenku](https://github.com/GideonSenku) 对代码优化
6+
7+
## 配置 (Surge)
8+
9+
```properties
10+
[MITM]
11+
daojia.jd.com
12+
13+
[Script]
14+
http-request ^https:\/\/daojia\.jd\.com\/client? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/jddj/jddj.cookie.js, requires-body=true
15+
16+
cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/jddj/jddj.js
17+
```
18+
19+
## 配置 (QuanX)
20+
21+
```properties
22+
[MITM]
23+
daojia.jd.com
24+
25+
[rewrite_local]
26+
27+
# [商店版] QuanX v1.0.6-build194 及更早版本
28+
# ^https:\/\/daojia\.jd\.com\/client? url script-request-header jddj.cookie.js
29+
30+
# [TestFlight] QuanX v1.0.6-build195 及以后版本
31+
^https:\/\/daojia\.jd\.com\/client? url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/jddj/jddj.cookie.js
32+
33+
[task_local]
34+
1 0 * * * jddj.js
35+
```
36+
37+
## 说明
38+
39+
1. 先把`daojia.jd.com`加到`[MITM]`
40+
2. 再配置重写规则:
41+
- Surge: 把两条远程脚本放到`[Script]`
42+
- QuanX: 把`jddj.cookie.js``jddj.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关)
43+
3. 打开 APP 手动签到一次: `首页` > `签到`
44+
4. 系统提示: `获取Cookie: 成功`
45+
5. 把获取 Cookie 的脚本注释掉
46+
6. 运行一次脚本, 如果提示重复签到, 那就算成功了!
47+
48+
> 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie.
49+
50+
> 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次.
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+
[@barry](https://t.me/barrymchen)
103+
104+
[@GideonSenku](https://github.com/GideonSenku)

jddj/jddj.cookie.js

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
const cookieName = '京东到家'
2+
const signurlKey = 'chen_signurl_jddj'
3+
const signheaderKey = 'chen_signheader_jddj'
4+
const chen = init()
5+
const requrl = $request.url
6+
if ($request && $request.method != 'OPTIONS') {
7+
const signurlVal = requrl
8+
const signheaderVal = JSON.stringify($request.headers)
9+
const flag = requrl.includes('functionId=signin')
10+
if (signurlVal&&signheaderVal&&flag) {
11+
chen.setdata(signurlVal, signurlKey)
12+
chen.setdata(signheaderVal, signheaderKey)
13+
chen.msg(cookieName, `获取Cookie: 成功`, ``)
14+
}
15+
}
16+
function init() {
17+
isSurge = () => {
18+
return undefined === this.$httpClient ? false : true
19+
}
20+
isQuanX = () => {
21+
return undefined === this.$task ? false : true
22+
}
23+
getdata = (key) => {
24+
if (isSurge()) return $persistentStore.read(key)
25+
if (isQuanX()) return $prefs.valueForKey(key)
26+
}
27+
setdata = (key, val) => {
28+
if (isSurge()) return $persistentStore.write(key, val)
29+
if (isQuanX()) return $prefs.setValueForKey(key, val)
30+
}
31+
msg = (title, subtitle, body) => {
32+
if (isSurge()) $notification.post(title, subtitle, body)
33+
if (isQuanX()) $notify(title, subtitle, body)
34+
}
35+
log = (message) => console.log(message)
36+
get = (url, cb) => {
37+
if (isSurge()) {
38+
$httpClient.get(url, cb)
39+
}
40+
if (isQuanX()) {
41+
url.method = 'GET'
42+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
43+
}
44+
}
45+
post = (url, cb) => {
46+
if (isSurge()) {
47+
$httpClient.post(url, cb)
48+
}
49+
if (isQuanX()) {
50+
url.method = 'POST'
51+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
52+
}
53+
}
54+
done = (value = {}) => {
55+
$done(value)
56+
}
57+
return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done }
58+
}
59+
chen.done()

jddj/jddj.js

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
const cookieName ='京东到家'
2+
const signurlKey = 'chen_signurl_jddj'
3+
const signheaderKey = 'chen_signheader_jddj'
4+
const chen = init()
5+
const signurlVal = chen.getdata(signurlKey)
6+
const signheaderVal = chen.getdata(signheaderKey)
7+
sign()
8+
function sign() {
9+
let url = {url: signurlVal,headers: JSON.parse(signheaderVal)}
10+
chen.get(url, (error, response, data) => {
11+
chen.log(`${cookieName}, data: ${data}`)
12+
let res = JSON.parse(data)
13+
const title = `${cookieName}`
14+
let subTitle = ``
15+
let detail = ``
16+
if (res.success) {
17+
subTitle = `签到结果:成功`
18+
detail = `获取鲜豆:${res.result.points}`
19+
} else if(res.success==false){
20+
subTitle = `签到结果: 重复签到`
21+
detail = `说明: ${res.msg}`
22+
}
23+
chen.msg(title, subTitle, detail)
24+
chen.log(`${res.totalBalanceAmount}`)
25+
})
26+
chen.done()
27+
}
28+
29+
function init() {
30+
isSurge = () => {
31+
return undefined === this.$httpClient ? false : true
32+
}
33+
isQuanX = () => {
34+
return undefined === this.$task ? false : true
35+
}
36+
getdata = (key) => {
37+
if (isSurge()) return $persistentStore.read(key)
38+
if (isQuanX()) return $prefs.valueForKey(key)
39+
}
40+
setdata = (key, val) => {
41+
if (isSurge()) return $persistentStore.write(key, val)
42+
if (isQuanX()) return $prefs.setValueForKey(key, val)
43+
}
44+
msg = (title, subtitle, body) => {
45+
if (isSurge()) $notification.post(title, subtitle, body)
46+
if (isQuanX()) $notify(title, subtitle, body)
47+
}
48+
log = (message) => console.log(message)
49+
get = (url, cb) => {
50+
if (isSurge()) {
51+
$httpClient.get(url, cb)
52+
}
53+
if (isQuanX()) {
54+
url.method = 'GET'
55+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
56+
}
57+
}
58+
post = (url, cb) => {
59+
if (isSurge()) {
60+
$httpClient.post(url, cb)
61+
}
62+
if (isQuanX()) {
63+
url.method = 'POST'
64+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
65+
}
66+
}
67+
done = (value = {}) => {
68+
$done(value)
69+
}
70+
return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done }
71+
}

nio/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ app.nio.com
2222
[rewrite_local]
2323

2424
# [商店版] QuanX v1.0.6-build194 及更早版本
25-
# ^https:\/\/app\.nio\.com\/api\/1\/app\/daily_checkin url script-request-header nil.cookie.js
25+
# ^https:\/\/app\.nio\.com\/api\/1\/app\/daily_checkin url script-request-header nio.cookie.js
2626

2727
# [TestFlight] QuanX v1.0.6-build195 及以后版本
2828
^https:\/\/app\.nio\.com\/api\/1\/app\/daily_checkin url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/nip/nio.cookie.js

qmkg/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ node.kg.qq.com
4242
2. 再配置重写规则:
4343
- Surge: 把两条远程脚本放到`[Script]`
4444
- QuanX: 把`qmkg.cookie.js``qmkg.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关)
45-
3. 打开 APP 手动签到一次: 访问下右下角 `我的` > `乐星` > `签到`
45+
3. 打开 APP 手动签到一次: 访问下右下角 `我的` > `任务中心` > `签到`
4646
4. 系统提示: `获取Cookie: 成功`
4747
5. 把获取 Cookie 的脚本注释掉
4848
6. 运行一次脚本, 如果提示重复签到, 那就算成功了!

0 commit comments

Comments
 (0)