Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
danchaw committed Mar 17, 2020
2 parents b410c4a + 09285fc commit 9ba357c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
1 change: 1 addition & 0 deletions QuantumultX_AppStore_Local_Cookie.conf
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc

# 分期乐
^https://pm\.m\.fenqile\.com/route0014/star/sign/sign.json url script-request-body chavyleung/fenqile/fenqile.cookie.js
^https:\/\/pm\.m\.fenqile\.com/route0014\/app\/tab\/privilege\/convertTaskReward.json url script-request-body chavyleung/fenqile/fenqile.cookie.js

# 美团
^https:\/\/i.meituan.com\/evolve\/signin\/signpost\/ url script-request-body chavyleung/meituan/meituan.cookie.js
Expand Down
1 change: 1 addition & 0 deletions QuantumultX_Local_Cookie.conf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc

# 分期乐
^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
^https:\/\/pm\.m\.fenqile\.com/route0014\/app\/tab\/privilege\/convertTaskReward.json url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.cookie.js

#樊登读书
^https://api\.dushu\.io/CheckIn url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/fandeng/fandeng.cookie.js
Expand Down
9 changes: 7 additions & 2 deletions fenqile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
> 感谢 [@GideonSenku](https://github.com/GideonSenku) Commit
> 2020.03.18 添加超级乐星日/天天领乐星
## 配置 (Surge)

```properties
Expand All @@ -15,6 +16,9 @@ pm.m.fenqile.com
[Script]
http-request ^https://pm\.m\.fenqile\.com/route0014/star/sign/sign.json script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.cookie.js, requires-body=true

http-request ^https:\/\/pm\.m\.fenqile\.com/route0014\/app\/tab\/privilege\/convertTaskReward.json script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.cookie.js, requires-body=true


cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.js
```

Expand All @@ -27,10 +31,11 @@ pm.m.fenqile.com
[rewrite_local]

# [商店版] QuanX v1.0.6-build194 及更早版本
# 不支持
# 支持request-body 脚本可食用,换成本地

# [TestFlight] QuanX v1.0.6-build195 及以后版本
^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
^https:\/\/pm\.m\.fenqile\.com/route0014\/app\/tab\/privilege\/convertTaskReward.json url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/fenqile/fenqile.cookie.js

[task_local]
1 0 * * * fenqile.js
Expand All @@ -42,7 +47,7 @@ pm.m.fenqile.com
2. 再配置重写规则:
- Surge: 把两条远程脚本放到`[Script]`
- QuanX: 把`fenqile.cookie.js``fenqile.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关)
3. 打开 APP 手动签到一次: 访问下右下角 `我的` > `乐星` > `签到`
3. 打开 APP 手动签到一次: 访问下右下角 `我的` > `乐星` > `签到`,`我的` > `账单点击` > `超级乐星日/天天领乐星`
4. 系统提示: `获取Cookie: 成功`
5. 把获取 Cookie 的脚本注释掉
6. 运行一次脚本, 如果提示重复签到, 那就算成功了!
Expand Down
16 changes: 11 additions & 5 deletions fenqile/fenqile.cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@ const cookieName = '分期乐'
const signurlKey = 'senku_signurl_fenqile'
const signheaderKey = 'senku_signheader_fenqile'
const signbodyKey = 'senku_signbody_fenqile'
const signDailyKey = 'senku_signDailyKey_fenqile'
const signDailyUrlKey = 'senku_signDailyUrlKey_fenqile'
const senku = init()

const requrl = $request.url
if ($request && $request.method != 'OPTIONS') {
if ($request && $request.method != 'OPTIONS' && requrl.match(/\/route0014\/star\/sign\//)) {
const signurlVal = requrl
const signheaderVal = JSON.stringify($request.headers)
const signbodyVal = $request.body
senku.log(`signurlVal:${signurlVal}`)
senku.log(`signheaderVal:${signheaderVal}`)
senku.log(`signbodyVal:${signbodyVal}`)
if (signurlVal) senku.setdata(signurlVal, signurlKey)
if (signheaderVal) senku.setdata(signheaderVal, signheaderKey)
if (signbodyVal) senku.setdata(signbodyVal, signbodyKey)
senku.msg(cookieName, `获取Cookie: 成功`, ``)
senku.msg(cookieName, `获取Cookie: 成功`, `签到领乐星`)
} else {
const signDailyUrlVal = $request.url
const signDailyVal = $request.body;
if (signDailyUrlVal) senku.setdata(signDailyUrlVal,signDailyUrlKey)
if (signDailyVal) senku.setdata(signDailyVal,signDailyKey)
senku.msg(cookieName, `获取Cookie: 成功`, `天天领乐星`)
senku.log()
}

function init() {
Expand Down
12 changes: 9 additions & 3 deletions fenqile/fenqile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ const cookieName = '分期乐'
const signurlKey = 'senku_signurl_fenqile'
const signheaderKey = 'senku_signheader_fenqile'
const signbodyKey = 'senku_signbody_fenqile'
const signDailyKey = 'senku_signDailyKey_fenqile'
const signDailyUrlKey = 'senku_signDailyUrlKey_fenqile'
const senku = init()

const signurlVal = senku.getdata(signurlKey)
const signheaderVal = senku.getdata(signheaderKey)
const signBodyVal = senku.getdata(signbodyKey)
const signDailyUrlVal = senku.getdata(signDailyUrlKey)
const signDailyVal = senku.getdata(signDailyKey)

const signinfo = {}


Expand All @@ -20,15 +26,15 @@ function check(){
function sign() {
const url = { url: signurlVal, headers: JSON.parse(signheaderVal), body: signBodyVal }
senku.post(url, (error, response, data) => {
senku.log(`${cookieName}, sing--data: ${data}`)
senku.log(`${cookieName}, 🔔sign--data: ${data}`)
signinfo.sign = JSON.parse(data)
})
}

function signDaily(){
const url = { url: `https://pm.m.fenqile.com/route0014/app/tab/privilege/convertTaskReward.json`, headers: JSON.parse(signheaderVal), body: signBodyVal }
const url = { url: signDailyUrlVal, headers: JSON.parse(signheaderVal), body: signDailyVal }
senku.post(url, (error, response, data) => {
senku.log(`${cookieName}, signDaily--data: ${data}`)
senku.log(`${cookieName}, 🔔signDaily--data: ${data}`)
signinfo.signDaily = JSON.parse(data)
})
}
Expand Down

0 comments on commit 9ba357c

Please sign in to comment.