Skip to content

Commit 9fd3140

Browse files
committed
添加[米读极速版],首发尝鲜版
1 parent 56fbeea commit 9fd3140

7 files changed

Lines changed: 301 additions & 6 deletions

‎QuantumultX_AppStore_Local_Cookie.conf‎

Lines changed: 5 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 = api.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.ctrip.com, 110.43.90.61, zt.wps.cn, 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, m.client.10010.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, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, mobwsa.ximalaya.com, *.you.163.com, *.rrys2019.com, ios.zmzapi.com
4+
hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.ctrip.com, 110.43.90.61, zt.wps.cn, 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, m.client.10010.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, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.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
@@ -149,4 +149,7 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc
149149
# 趣头条
150150
^https:\/\/api\.1sapp\.com\/sign\/info? url script-request-header chavyleung/qtt/qtt.cookie.js
151151
^https:\/\/api\.1sapp\.com\/content\/readV2? url script-request-header chavyleung/qtt/qtt.cookie.js
152-
^https:\/\/api\.1sapp\.com\/x\/feed\/getReward? url script-request-header chavyleung/qtt/qtt.cookie.js
152+
^https:\/\/api\.1sapp\.com\/x\/feed\/getReward? url script-request-header chavyleung/qtt/qtt.cookie.js
153+
154+
# 米读
155+
^https:\/\/apiwz\.midukanshu\.com\/user\/readTimeBase\/readTime url script-request-body chavyleung/midu/midu.cookie.js

‎QuantumultX_Local_Cookie.conf‎

Lines changed: 5 additions & 2 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.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.ctrip.com, 110.43.90.61, zt.wps.cn, m-bean.kaola.com, 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, m.client.10010.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, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.qq.com, mobwsa.ximalaya.com, *.you.163.com, *.rrys2019.com, ios.zmzapi.com
4+
hostname = apiwz.midukanshu.com, api.1sapp.com, frodo.douban.com, luckman.suning.com, passport.suning.com, sign.suning.com, gameapi.suning.com, m.ctrip.com, 110.43.90.61, zt.wps.cn, m-bean.kaola.com, 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, m.client.10010.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, sf-integral-sign-in.weixinjia.net, mcs-mimp-web.sf-express.com, *.smzdm.com, tieba.baidu.com, *.v2ex.com, *.video.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
@@ -145,4 +145,7 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc
145145
# 趣头条
146146
^https:\/\/api\.1sapp\.com\/sign\/info? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js
147147
^https:\/\/api\.1sapp\.com\/content\/readV2? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js
148-
^https:\/\/api\.1sapp\.com\/x\/feed\/getReward? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js
148+
^https:\/\/api\.1sapp\.com\/x\/feed\/getReward? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js
149+
150+
# 米读
151+
^https:\/\/apiwz\.midukanshu\.com\/user\/readTimeBase\/readTime url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/midu/midu.cookie.js

‎QuantumultX_Local_Task.conf‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,6 @@
9090
# 豆瓣时间
9191
1 0 * * * chavyleung/dbsj/dbsj.js
9292
# 趣头条
93-
1 0 * * * chavyleung/qtt/qtt.js
93+
1 0 * * * chavyleung/qtt/qtt.js
94+
# 米读
95+
*/1 * * * * chavyleung/midu/midu.js

‎QuantumultX_Remote_Task.conf‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,8 @@
183183
# 我的 > 右上角签到
184184
# 首页 > 金币奖励
185185
# 阅读文章或者播放视频
186-
1 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.js
186+
1 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.js
187+
188+
# 米读
189+
# 书城 > 任意文章阅读
190+
*/1 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/midu/midu.js

‎midu/README.md‎

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

‎midu/midu.cookie.js‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
const cookieName = '米读'
2+
const readTimeurlKey = 'senku_readTimeurl_midu'
3+
const readTimeheaderKey = 'senku_readTimeheader_midu'
4+
const readTimebodyKey = 'senku_readTimebody_midu'
5+
const senku = init()
6+
7+
const requrl = $request.url
8+
9+
if ($request && $request.method != 'OPTIONS' && requrl.match(/\/user\/readTimeBase\/readTime/)) {
10+
try {
11+
const readTimeurlVal = requrl
12+
const readTimebodyVal = $request.body
13+
const readTimeheaderVal = $request.headers
14+
if (readTimeurlVal && readTimebodyVal && readTimeheaderVal) {
15+
senku.setdata(readTimeurlVal, readTimeurlKey)
16+
senku.setdata(readTimeheaderVal, readTimeheaderKey)
17+
senku.setdata(readTimebodyVal, readTimebodyKey)
18+
senku.msg(cookieName, `阅读时长,获取Cookie: 成功`, ``)
19+
senku.log(`🔔${readTimeurlVal},🔔${readTimeheaderVal},🔔${readTimebodyVal}`)
20+
}
21+
} catch (error) {
22+
senku.log(`❌error:${error}`)
23+
}
24+
}
25+
26+
function init() {
27+
isSurge = () => {
28+
return undefined === this.$httpClient ? false : true
29+
}
30+
isQuanX = () => {
31+
return undefined === this.$task ? false : true
32+
}
33+
getdata = (key) => {
34+
if (isSurge()) return $persistentStore.read(key)
35+
if (isQuanX()) return $prefs.valueForKey(key)
36+
}
37+
setdata = (key, val) => {
38+
if (isSurge()) return $persistentStore.write(key, val)
39+
if (isQuanX()) return $prefs.setValueForKey(key, val)
40+
}
41+
msg = (title, subtitle, body) => {
42+
if (isSurge()) $notification.post(title, subtitle, body)
43+
if (isQuanX()) $notify(title, subtitle, body)
44+
}
45+
log = (message) => console.log(message)
46+
get = (url, cb) => {
47+
if (isSurge()) {
48+
$httpClient.get(url, cb)
49+
}
50+
if (isQuanX()) {
51+
url.method = 'GET'
52+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
53+
}
54+
}
55+
post = (url, cb) => {
56+
if (isSurge()) {
57+
$httpClient.post(url, cb)
58+
}
59+
if (isQuanX()) {
60+
url.method = 'POST'
61+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
62+
}
63+
}
64+
done = (value = {}) => {
65+
$done(value)
66+
}
67+
return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done }
68+
}
69+
senku.done()

‎midu/midu.js‎

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// 赞赏:邀请码`A1040276307`
2+
// 链接`http://html34.qukantoutiao.net/qpr2/bBmQ.html?pid=5eb14518`
3+
// 农妇山泉 -> 有点咸
4+
5+
const cookieName = '米读'
6+
const readTimeurlKey = 'senku_readTimeurl_midu'
7+
const readTimeheaderKey = 'senku_readTimeheader_midu'
8+
const readTimebodyKey = 'senku_readTimebody_midu'
9+
const senku = init()
10+
const readTimeurlVal = senku.getdata(readTimeurlKey)
11+
const readTimeheaderVal = senku.getdata(readTimeheaderKey)
12+
const readTimebodyVal = senku.getdata(readTimebodyKey)
13+
const signinfo = {}
14+
let subTitle = ''
15+
let detail = ''
16+
; (sign = async () => {
17+
senku.log(`🔔 ${cookieName}`)
18+
await readTime()
19+
// showmsg()
20+
senku.done()
21+
})().catch((e) => senku.log(`❌ ${cookieName} 签到失败: ${e}`), senku.done())
22+
23+
24+
function readTime() {
25+
return new Promise((resolve, reject) => {
26+
const url = { url: readTimeurlVal, headers: readTimeheaderVal, body: readTimebodyVal }
27+
senku.post(url, (error, response, data) => {
28+
try {
29+
senku.log(`❕ ${cookieName} readTime - response: ${JSON.stringify(response)}`)
30+
signinfo.readTime = JSON.parse(data)
31+
if (signinfo.readTime && signinfo.readTime.code == 0) {
32+
const coin = signinfo.readTime.data.coin
33+
const readTotalMinute = signinfo.readTime.data.readTotalMinute
34+
coin == 0 ? detail += `` : detail += `【阅读时长】获得${coin}💰`
35+
if (readTotalMinute % 40 == 0) {
36+
detail += ` 阅读时长${readTotalMinute / 2}分钟\n`
37+
senku.msg(cookieName, subTitle, detail)
38+
}
39+
} else if (signinfo.readTime.code != 0) {
40+
detail += `【阅读时长】错误代码${signinfo.readTime.code},错误信息${signinfo.readTime.message}\n`
41+
senku.msg(cookieName, subTitle, detail)
42+
} else {
43+
detail += '【阅读时长】失败\n'
44+
senku.msg(cookieName, subTitle, detail)
45+
}
46+
resolve()
47+
} catch (e) {
48+
senku.msg(cookieName, `阅读时长: 失败`, `说明: ${e}`)
49+
senku.log(`❌ ${cookieName} readTime - 签到失败: ${e}`)
50+
senku.log(`❌ ${cookieName} readTime - response: ${JSON.stringify(response)}`)
51+
resolve()
52+
}
53+
})
54+
})
55+
}
56+
57+
function showmsg() {
58+
subTitle += ''
59+
detail += ''
60+
61+
senku.msg(cookieName, subTitle, detail)
62+
senku.done()
63+
}
64+
65+
function init() {
66+
isSurge = () => {
67+
return undefined === this.$httpClient ? false : true
68+
}
69+
isQuanX = () => {
70+
return undefined === this.$task ? false : true
71+
}
72+
getdata = (key) => {
73+
if (isSurge()) return $persistentStore.read(key)
74+
if (isQuanX()) return $prefs.valueForKey(key)
75+
}
76+
setdata = (key, val) => {
77+
if (isSurge()) return $persistentStore.write(key, val)
78+
if (isQuanX()) return $prefs.setValueForKey(key, val)
79+
}
80+
msg = (title, subtitle, body) => {
81+
if (isSurge()) $notification.post(title, subtitle, body)
82+
if (isQuanX()) $notify(title, subtitle, body)
83+
}
84+
log = (message) => console.log(message)
85+
get = (url, cb) => {
86+
if (isSurge()) {
87+
$httpClient.get(url, cb)
88+
}
89+
if (isQuanX()) {
90+
url.method = 'GET'
91+
$task.fetch(url).then((resp) => cb(null, resp, resp.body))
92+
}
93+
}
94+
post = (url, cb) => {
95+
if (isSurge()) {
96+
$httpClient.post(url, cb)
97+
}
98+
if (isQuanX()) {
99+
url.method = 'POST'
100+
$task.fetch(url).then((resp) => cb(null, resp, resp.body))
101+
}
102+
}
103+
done = (value = {}) => {
104+
$done(value)
105+
}
106+
return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done }
107+
}

0 commit comments

Comments
 (0)