├── 10000 ├── 10000.cookie.js ├── 10000.js └── README.md ├── 10010 ├── 10010.cookie.js ├── 10010.js └── README.md ├── 10086 ├── 10086.cookie.js ├── 10086.fee.cookie.js ├── 10086.fee.js ├── 10086.js └── README.md ├── BOXJS.png ├── BoxJS.gif ├── Env.js ├── Env.min.js ├── LICENSE ├── Loon.cookie.conf ├── Loon.task.conf ├── QuantumultX_AppStore_Local_Cookie.conf ├── QuantumultX_Local_Cookie.conf ├── QuantumultX_Local_Task.conf ├── QuantumultX_Remote_Task.conf ├── README.md ├── acfun ├── README.md ├── acfun.cookie.js └── acfun.js ├── apktw ├── README.md ├── apktw.cookie.js └── apktw.js ├── bcz ├── README.md ├── bcz.cookie.js └── bcz.js ├── bilibili ├── README.md ├── bilibili.cookie.js ├── bilibili.js └── bilibili.silver2coin.js ├── box ├── chavy.boxjs.html ├── chavy.boxjs.js ├── chavy.boxjs.json ├── icons │ ├── BoxJs.png │ ├── BoxSetting.mini.png │ ├── BoxSetting.png │ ├── BoxSwitcher.mini.png │ └── BoxSwitcher.png ├── release │ ├── box.release.json │ └── box.release.tf.json ├── rewrite │ ├── boxjs.rewrite.loon.plugin │ ├── boxjs.rewrite.loon.tf.plugin │ ├── boxjs.rewrite.quanx.conf │ ├── boxjs.rewrite.quanx.tf.conf │ ├── boxjs.rewrite.surge.sgmodule │ └── boxjs.rewrite.surge.tf.sgmodule ├── scripts │ ├── boxjs.revert.baks.js │ ├── boxjs.revert.boxjs.js │ ├── boxjs.revert.caches.js │ ├── boxjs.revert.usercfgs.favapps.js │ ├── boxjs.revert.usercfgs.httpbackend.js │ ├── boxjs.revert.usercfgs.js │ └── boxjs.revert.usercfgs.sessions.js └── switcher │ └── box.switcher.js ├── bubei ├── README.md └── bubei.js ├── chavy.box.js ├── chavy.js ├── csdn ├── README.md ├── csdn.cookie.js └── csdn.js ├── dbsj ├── README.md ├── dbsj.cookie.js └── dbsj.js ├── dongqiudi ├── README.md ├── dongqiudi.cookie.js └── dongqiudi.js ├── duokan ├── README.md ├── duokan.cookie.js └── duokan.js ├── everphoto ├── README.md ├── everphoto.cookie.js └── everphoto.js ├── fandeng ├── README.md ├── fandeng.cookie.js └── fandeng.js ├── feng ├── README.md ├── feng.cookie.js └── feng.js ├── fenqile ├── README.md ├── fenqile.cookie.js └── fenqile.js ├── flyertea ├── README.md ├── flyertea.cookie.js └── flyertea.js ├── gdoil ├── README.md ├── gdoil.cookie.js └── gdoil.js ├── haidilao ├── README.md └── hdl.js ├── hellobike ├── README.md └── hellobike.js ├── hycan ├── README.md ├── hycan.cookie.js └── hycan.js ├── ithome ├── ithome.cookie.js └── ithome.js ├── jd ├── JD_BaiTiao.js ├── jd.618.adapt.js ├── jd.618.boom.js ├── jd.618.cookie.js ├── jd.618.cookie.sgmodule ├── jd.618.js └── jd.618.sgmodule ├── jddj ├── README.md ├── jddj.cookie.js └── jddj.js ├── maomicd ├── README.md ├── maomicd.cookie.js └── maomicd.js ├── mcdd ├── README.md ├── mcdd.cookie.js └── mcdd.js ├── meituan ├── README.md ├── meituan.cookie.js └── meituan.js ├── mgtv ├── README.md ├── mgtv.cookie.js └── mgtv.js ├── midu ├── README.md ├── midu.cookie.js ├── miduRead.js ├── miduRead.py ├── miduSign.js └── miduSign.py ├── mihoyo ├── README.md ├── mihoyo.cookie.js └── mihoyo.js ├── neteasemusic ├── README.md ├── neteasemusic.cookie.js ├── neteasemusic.js └── quanx │ ├── neteasemusic.cookie.js │ └── neteasemusic.js ├── neteasenews ├── README.md ├── neteasenews.cookie.js ├── neteasenews.js └── 抓包步骤 │ ├── 第10步.png │ ├── 第1步.png │ ├── 第2步.png │ ├── 第3步.png │ ├── 第4-5步.png │ ├── 第6步.png │ ├── 第7步.png │ ├── 第8步.png │ └── 第9步.png ├── nfzm ├── nfzm.cookie.js └── nfzm.js ├── nio ├── README.md ├── nio.cookie.js └── nio.js ├── noteyoudao ├── noteyoudao.cookie.js └── noteyoudao.js ├── package.json ├── pagoda ├── pagoda.cookie.js └── pagoda.js ├── qimao ├── README.md └── qmnovel.js ├── qmkg ├── README.md ├── qmkg.cookie.js └── qmkg.js ├── qqmusic ├── README.md ├── qqmusic.cookie.js └── qqmusic.js ├── qtt ├── .DS_Store ├── README.md ├── qtt.cookie.js └── qtt.js ├── qunar ├── README.md ├── qunar.cookie.js └── qunar.js ├── rrtv ├── README.md ├── rrtv.cookie.js └── rrtv.js ├── sfexpress ├── README.md ├── sfexpress.cookie.js └── sfexpress.js ├── smzdm ├── README.md ├── quanx │ ├── README.md │ ├── smzdm.cookie.js │ └── smzdm.js ├── smzdm.cookie.js └── smzdm.js ├── suning ├── README.md ├── suning.cookie.js └── suning.js ├── surge.cookies.sgmodule ├── surge.tasks.sgmodule ├── tieba ├── README.md ├── tieba.cookie.js └── tieba.js ├── tncj ├── README.md └── tncj.min.js ├── v2ex ├── README.md ├── quanx │ ├── README.md │ ├── v2ex.cookie.js │ └── v2ex.js ├── v2ex.cookie.js └── v2ex.js ├── videoqq ├── README.md ├── videoqq.cookie.js └── videoqq.js ├── wanda ├── wanda.cookie.js └── wanda.js ├── wmmeituan ├── README.md ├── wmmeituan.cookie.js └── wmmeituan.js ├── wps ├── README.md ├── wps.cookie.js └── wps.js ├── wykl ├── README.md ├── wykl.cookie.js └── wykl.js ├── ximalaya ├── README.md ├── ximalaya.cookie.js └── ximalaya.js ├── yanxuan ├── README.md ├── yanxuan.cookie.js └── yanxuan.js ├── yarn.lock ├── zaker ├── README.md └── zaker.js ├── zimuzu ├── README.md ├── zimuzu.cookie.js └── zimuzu.js ├── zsfc ├── README.md └── zsfc.js └── zxhc ├── README.md ├── zxhc.cookie.js └── zxhc.js /10000/10000.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '电信营业厅' 2 | const KEY_signheader = 'chavy_signheader_10000' 3 | const KEY_signbody = 'chavy_signbody_10000' 4 | const KEY_mobile = 'chavy_mobile_10000' 5 | const chavy = init() 6 | if (this.$request && this.$request.headers && this.$request.body) { 7 | const VAL_signheader = JSON.stringify($request.headers) 8 | const VAL_signbody = this.$request.body 9 | if (VAL_signheader) chavy.setdata(VAL_signheader, KEY_signheader) 10 | if (VAL_signbody) chavy.setdata(VAL_signbody, KEY_signbody) 11 | chavy.msg(cookieName, `获取Cookie: 成功`, ``) 12 | } 13 | 14 | function init() { 15 | isSurge = () => { 16 | return undefined === this.$httpClient ? false : true 17 | } 18 | isQuanX = () => { 19 | return undefined === this.$task ? false : true 20 | } 21 | getdata = (key) => { 22 | if (isSurge()) return $persistentStore.read(key) 23 | if (isQuanX()) return $prefs.valueForKey(key) 24 | } 25 | setdata = (key, val) => { 26 | if (isSurge()) return $persistentStore.write(key, val) 27 | if (isQuanX()) return $prefs.setValueForKey(key, val) 28 | } 29 | msg = (title, subtitle, body) => { 30 | if (isSurge()) $notification.post(title, subtitle, body) 31 | if (isQuanX()) $notify(title, subtitle, body) 32 | } 33 | log = (message) => console.log(message) 34 | get = (url, cb) => { 35 | if (isSurge()) { 36 | $httpClient.get(url, cb) 37 | } 38 | if (isQuanX()) { 39 | url.method = 'GET' 40 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 41 | } 42 | } 43 | post = (url, cb) => { 44 | if (isSurge()) { 45 | $httpClient.post(url, cb) 46 | } 47 | if (isQuanX()) { 48 | url.method = 'POST' 49 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 50 | } 51 | } 52 | done = (value = {}) => { 53 | $done(value) 54 | } 55 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 56 | } 57 | chavy.done() 58 | -------------------------------------------------------------------------------- /10000/README.md: -------------------------------------------------------------------------------- 1 | # 电信营业厅 2 | 3 | > 2020.5.6 更新签到脚本 (正则和 rewrite 类型都有变化, 需要重取 Cookie) 4 | > 2020.8.7 更新获取金币body 5 | 6 | ## 配置 (Surge) 7 | 8 | ```properties 9 | [MITM] 10 | wapside.189.cn:9001 11 | 12 | [Script] 13 | http-request ^https:\/\/wapside.189.cn:9001\/api\/home\/homeInfo script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js, requires-body=true 14 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.js 15 | ``` 16 | 17 | ## 配置 (QuanX) 18 | 19 | ```properties 20 | [MITM] 21 | wapside.189.cn 22 | 23 | [rewrite_local] 24 | # 190及以后版本 25 | ^https:\/\/wapside.189.cn:9001\/api\/home\/homeInfo url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js 26 | 27 | [task_local] 28 | 1 0 * * * 10000.js 29 | ``` 30 | 31 | ## 说明 32 | 33 | > 先在登录成功后, 再打开获取 Cookie 的脚本 34 | 35 | 1. 先配置`[MITM]` 36 | - Surge: wapside.189.cn:9001 37 | - QuanX: wapside.189.cn 38 | 2. 再配置重写规则: 39 | - Surge: 把两条远程脚本放到`[Script]` 40 | - QuanX: 把`10000.cookie.js`和`10000.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 41 | 3. 打开 APP 手动签到一次: 访问下右下角 `我` > `签到` (头像下面) 42 | 4. 系统提示: `获取Cookie: 成功` 43 | 5. 最后就可以把第 1 条脚本注释掉了 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 | [@sazs34](https://github.com/sazs34/) 100 | -------------------------------------------------------------------------------- /10086/10086.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '中国移动' 2 | const tokenurlKey = 'chavy_tokenurl_10086' 3 | const tokenheaderKey = 'chavy_tokenheader_10086' 4 | const signurlKey = 'chavy_signurl_10086' 5 | const signheaderKey = 'chavy_signheader_10086' 6 | const chavy = init() 7 | 8 | const requrl = $request.url 9 | const reqRef = $request.headers.Referer 10 | if ($request && $request.method != 'OPTIONS' && requrl.indexOf('website/taskCenter/index') >= 0 && requrl.indexOf('mobile=') >= 0) { 11 | const tokenurlVal = requrl 12 | const tokenheaderVal = JSON.stringify($request.headers) 13 | if (tokenurlVal) chavy.setdata(tokenurlVal, tokenurlKey) 14 | if (tokenheaderVal) chavy.setdata(tokenheaderVal, tokenheaderKey) 15 | title = chavy.msg(cookieName, `获取刷新链接: 成功`, ``) 16 | } else if ($request && $request.method != 'OPTIONS' && requrl.indexOf('website/taskCenter/sign') >= 0) { 17 | const signurlVal = requrl 18 | const signheaderVal = JSON.stringify($request.headers) 19 | if (signurlVal) chavy.setdata(signurlVal, signurlKey) 20 | if (signheaderVal) chavy.setdata(signheaderVal, signheaderKey) 21 | title = chavy.msg(cookieName, `获取Cookie: 成功`, ``) 22 | } 23 | 24 | function init() { 25 | isSurge = () => { 26 | return undefined === this.$httpClient ? false : true 27 | } 28 | isQuanX = () => { 29 | return undefined === this.$task ? false : true 30 | } 31 | getdata = (key) => { 32 | if (isSurge()) return $persistentStore.read(key) 33 | if (isQuanX()) return $prefs.valueForKey(key) 34 | } 35 | setdata = (key, val) => { 36 | if (isSurge()) return $persistentStore.write(key, val) 37 | if (isQuanX()) return $prefs.setValueForKey(key, val) 38 | } 39 | msg = (title, subtitle, body) => { 40 | if (isSurge()) $notification.post(title, subtitle, body) 41 | if (isQuanX()) $notify(title, subtitle, body) 42 | } 43 | log = (message) => console.log(message) 44 | get = (url, cb) => { 45 | if (isSurge()) { 46 | $httpClient.get(url, cb) 47 | } 48 | if (isQuanX()) { 49 | url.method = 'GET' 50 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 51 | } 52 | } 53 | post = (url, cb) => { 54 | if (isSurge()) { 55 | $httpClient.post(url, cb) 56 | } 57 | if (isQuanX()) { 58 | url.method = 'POST' 59 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 60 | } 61 | } 62 | done = (value = {}) => { 63 | $done(value) 64 | } 65 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 66 | } 67 | chavy.done() 68 | -------------------------------------------------------------------------------- /10086/README.md: -------------------------------------------------------------------------------- 1 | # 中国移动 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > 注意: 中国移动是指名字为`10086`这款的 APP [点这里下载](https://apps.apple.com/cn/app/10086-%E4%B8%AD%E5%9B%BD%E7%A7%BB%E5%8A%A8%E5%87%BA%E5%93%81/id1004816017) 6 | 7 | ## 配置 (Surge) 8 | 9 | ```properties 10 | [MITM] 11 | wx.10086.cn 12 | 13 | [Script] 14 | # 注意获取Cookie有两条脚本 15 | http-request ^http:\/\/wx.10086.cn\/website\/taskCenter\/index\? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.cookie.js 16 | http-request ^http:\/\/wx.10086.cn\/website\/taskCenter\/sign\? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.cookie.js 17 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10086/10086.js 18 | ``` 19 | 20 | ## 配置 (QuanX) 21 | 22 | ```properties 23 | [MITM] 24 | wx.10086.cn 25 | 26 | [rewrite_local] 27 | # 注意获取Cookie有两条脚本 28 | ^http:\/\/wx.10086.cn\/website\/taskCenter\/index\? url script-request-header 10086.cookie.js 29 | ^http:\/\/wx.10086.cn\/website\/taskCenter\/sign\? url script-request-header 10086.cookie.js 30 | 31 | [task_local] 32 | 1 0 * * * 10086.js 33 | ``` 34 | 35 | ## 说明 36 | 37 | 1. 先把`wx.10086.cn`加到`[MITM]` 38 | 2. 再配置重写规则: 39 | - Surge: 把两条远程脚本放到`[Script]` 40 | - QuanX: 把`10086.cookie.js`和`10086.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 41 | 3. 打开 APP , 进入签到页面, 系统提示: `获取刷新链接: 成功` 42 | 4. 然后手动签到 1 次, 系统提示: `获取Cookie: 成功` 43 | 5. 把获取 Cookie 的脚本注释掉 44 | 6. 运行一次脚本, 如果提示重复签到, 那就算成功了! 45 | 46 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 47 | 48 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 49 | 50 | ## 常见问题 51 | 52 | 1. 无法写入 Cookie 53 | 54 | - 检查 Surge 系统通知权限放开了没 55 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 56 | 57 | 2. 写入 Cookie 成功, 但签到不成功 58 | 59 | - 看看是不是在登录前就写入 Cookie 了 60 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 61 | 62 | 3. 为什么有时成功有时失败 63 | 64 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 65 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 66 | 67 | - `Surge`配置: 68 | 69 | ```properties 70 | # 没有什么是一顿饭解决不了的: 71 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 72 | # 如果有,那就两顿: 73 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 74 | # 实在不行,三顿也能接受: 75 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 76 | 77 | # 再粗暴点,直接: 78 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 79 | ``` 80 | 81 | - `QuanX`配置: 82 | 83 | ```properties 84 | [task_local] 85 | 1 0 * * * xxx.js # 每天00:01执行一次 86 | 2 0 * * * xxx.js # 每天00:02执行一次 87 | 3 0 * * * xxx.js # 每天00:03执行一次 88 | 89 | */60 * * * * xxx.js # 每60分执行一次 90 | ``` 91 | 92 | ## 感谢 93 | 94 | [@NobyDa](https://github.com/NobyDa) 95 | 96 | [@lhie1](https://github.com/lhie1) 97 | 98 | [@ConnersHua](https://github.com/ConnersHua) 99 | -------------------------------------------------------------------------------- /BOXJS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/BOXJS.png -------------------------------------------------------------------------------- /BoxJS.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/BoxJS.gif -------------------------------------------------------------------------------- /QuantumultX_Local_Task.conf: -------------------------------------------------------------------------------- 1 | [task_local] 2 | # @chavyleung 3 | # @GideonSenku 4 | # @barrymchen 5 | # @danchaw 6 | # 电信营业厅 7 | 5 0 * * * chavyleung/10000/10000.js 8 | # AcFun 9 | 3 0 * * * chavyleung/acfun/acfun.js 10 | # APK.TW 11 | 10 0 * * * chavyleung/apktw/apktw.js 12 | # bilibili 13 | 2 0 * * * chavyleung/bilibili/bilibili.js 14 | # bilibili 如需银瓜子转硬币,添加下方内容 15 | 1 0 * * * chavyleung/bilibili/bilibili.silver2coin.js 16 | # 懂球帝 17 | 4 0 * * * chavyleung/dongqiudi/dongqiudi.js 18 | # 威锋网 19 | # 3 0 * * * chavyleung/feng/feng.js 20 | # 飞客茶馆 21 | 4 0 * * * chavyleung/flyertea/flyertea.js 22 | # 网易云音乐 23 | 2 0 * * * chavyleung/neteasemusic/quanx/neteasemusic.js 24 | # 网易新闻 25 | 4 0 * * * chavyleung/neteasenews/neteasenews.js 26 | # 去哪儿 27 | 4 0 * * * chavyleung/qunar/qunar.js 28 | # 人人视频 29 | 10 0 * * * chavyleung/rrtv/rrtv.js 30 | # 顺丰速运 31 | 10 0 * * * chavyleung/sfexpress/sfexpress.js 32 | # 什么值得买 33 | 2 0 * * * chavyleung/smzdm/quanx/smzdm.js 34 | # 百度签到 35 | 1,5,6 0 * * * chavyleung/tieba/tieba.js 36 | # V2EX 37 | 2 9 * * * chavyleung/v2ex/quanx/v2ex.js 38 | # 腾讯视频 39 | 3 0 * * * chavyleung/videoqq/videoqq.js 40 | # 喜马拉雅 41 | 4 0 * * * chavyleung/ximalaya/ximalaya.js 42 | # 网易严选 43 | # 4 0 * * * chavyleung/yanxuan/yanxuan.js 44 | # 字幕组 45 | 3 0 * * * chavyleung/zimuzu/zimuzu.js 46 | # CSDN 47 | 4 0 * * * chavyleung/csdn/csdn.js 48 | # 加油广东 49 | 1 7 * * * chavyleung/gdoil/gdoil.js 50 | # 芒果TV 51 | 2 0 * * * chavyleung/mgtv/mgtv.js 52 | # 米游社 53 | 2 0 * * * chavyleung/mihoyo/mihoyo.js 54 | # 中国联通 55 | 9 0 * * * chavyleung/10010/10010.js 56 | # 猫咪音乐网 57 | 2 0 * * * chavyleung/maomicd/maomicd.js 58 | # 中国移动 59 | 7 0 * * * chavyleung/10086/10086.js 60 | # 美团外卖 61 | 8 0 * * * chavyleung/wmmeituan/wmmeituan.js 62 | # 美团 63 | 7 0 * * * chavyleung/meituan/meituan.js 64 | # 时光相册 65 | 7 0 * * * chavyleung/everphoto/everphoto.js 66 | # 百词斩 67 | 50 23 * * * chavyleung/bcz/bcz.js 68 | # 叮咚买菜 69 | 7 0 * * * chavyleung/mcdd/mcdd.js 70 | # 分期乐 71 | 1 0 * * * chavyleung/fenqile/fenqile.js 72 | #樊登读书 73 | 1 0 * * * chavyleung/fandeng/fandeng.js 74 | #全民K歌 75 | 1 0 * * * chavyleung/qmkg/qmkg.js 76 | #合创 77 | 1 0 * * * chavyleung/hycan/hycan.js 78 | #蔚来 79 | 1 0 * * * chavyleung/nio/nio.js 80 | #京东到家 81 | 1 0 * * * chavyleung/jddj/jddj.js 82 | #网易考拉 83 | 1 0 * * * chavyleung/wykl/wykl.js 84 | # WPS 85 | 0 9 * * * chavyleung/wps/wps.js 86 | #智行火车 87 | 1 0 * * * chavyleung/zxhc/zxhc.js 88 | # 苏宁易购 89 | 7 0 * * * chavyleung/suning/suning.js 90 | # 豆瓣时间 91 | 1 0 * * * chavyleung/dbsj/dbsj.js 92 | # 趣头条 93 | 1 0 * * * chavyleung/qtt/qtt.js 94 | # 米读 95 | */1 * * * * chavyleung/midu/miduRead.js 96 | 1 0 * * * chavyleung/midu/miduSign.js -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chavy Scripts 2 | ![](https://img.shields.io/badge/license-GPL-blueviolet.svg) 3 | ![GitHub release (latest by date)](https://img.shields.io/github/v/release/chavyleung/scripts?color=%23c694ff) 4 | ![](https://badgen.net/github/stars/chavyleung/scripts) 5 | ![](https://tokei.rs/b1/github/chavyleung/scripts?category=code) 6 | ![GitHub contributors](https://img.shields.io/github/contributors/chavyleung/scripts) 7 | # BoxJs 8 | A SPA Appliction be used for scripts utils 9 | 10 | 11 | 12 | [Scripts Vote](https://t.me/chavyscripts) 13 | 14 | # LICENSE 15 | Copyright © 2019-present chavyleung. This project is [GPL](https://github.com/chavyleung/scripts/blob/master/LICENSE) licensed. 16 | -------------------------------------------------------------------------------- /acfun/README.md: -------------------------------------------------------------------------------- 1 | # AcFun 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > 只支持 APP 端签到 (什么? 你想用 Mac 签? emm...看需求人数吧...) 6 | 7 | > 测试版有可能出现任何情况, 如虫子(bug)、cookie(有效期)等各种问题, 希望大家能抱着共同完善的心态来玩 8 | 9 | > 2020.1.11 QuanX 在`190`版本开始, 获取 Cookie 方式需要从`script-response-body`改为`script-request-header` 10 | 11 | ## 配置 (Surge) 12 | 13 | ```properties 14 | [MITM] 15 | *.acfun.cn 16 | 17 | [Script] 18 | 19 | http-request ^https:\/\/api\-new\.app\.acfun\.cn\/rest\/app\/user\/personalInfo script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/acfun/acfun.cookie.js 20 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/acfun/acfun.js 21 | ``` 22 | 23 | ## 配置 (QuanX) 24 | 25 | ```properties 26 | [MITM] 27 | *.acfun.cn 28 | 29 | [rewrite_local] 30 | # 189及以前版本 31 | ^https:\/\/api\-new\.app\.acfun\.cn\/rest\/app\/user\/personalInfo url script-response-body acfun.cookie.js 32 | # 190及以后版本 33 | ^https:\/\/api\-new\.app\.acfun\.cn\/rest\/app\/user\/personalInfo url script-request-header acfun.cookie.js 34 | 35 | [task_local] 36 | 1 0 * * * acfun.js 37 | ``` 38 | 39 | ## 说明 40 | 41 | 1. 先把`*.acfun.cn`加到`[MITM]` 42 | 2. 再配置重写规则: 43 | - Surge: 把两条远程脚本放到`[Script]` 44 | - QuanX: 把`acfun.cookie.js`和`acfun.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 45 | 3. 打开 APP, 访问下`我的` 46 | 4. 系统提示: `获取Cookie: 成功` & `获取Token: 成功`(如果不提示获取成功, 尝试杀进程再进我的) 47 | 5. 最后就可以把第 1 条脚本注释掉了 48 | 49 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 50 | 51 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 52 | 53 | ## 常见问题 54 | 55 | 1. 无法写入 Cookie 56 | 57 | - 检查 Surge 系统通知权限放开了没 58 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 59 | 60 | 2. 写入 Cookie 成功, 但签到不成功 61 | 62 | - 看看是不是在登录前就写入 Cookie 了 63 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 64 | 65 | 3. 为什么有时成功有时失败 66 | 67 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 68 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 69 | 70 | - `Surge`配置: 71 | 72 | ```properties 73 | # 没有什么是一顿饭解决不了的: 74 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 75 | # 如果有,那就两顿: 76 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 77 | # 实在不行,三顿也能接受: 78 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 79 | 80 | # 再粗暴点,直接: 81 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 82 | ``` 83 | 84 | - `QuanX`配置: 85 | 86 | ```properties 87 | [task_local] 88 | 1 0 * * * xxx.js # 每天00:01执行一次 89 | 2 0 * * * xxx.js # 每天00:02执行一次 90 | 3 0 * * * xxx.js # 每天00:03执行一次 91 | 92 | */60 * * * * xxx.js # 每60分执行一次 93 | ``` 94 | 95 | ## 感谢 96 | 97 | [@NobyDa](https://github.com/NobyDa) 98 | 99 | [@lhie1](https://github.com/lhie1) 100 | 101 | [@ConnersHua](https://github.com/ConnersHua) 102 | -------------------------------------------------------------------------------- /acfun/acfun.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = 'AcFun' 2 | const cookieKey = 'chavy_cookie_acfun' 3 | const tokenKey = 'chavy_token_acfun' 4 | const chavy = init() 5 | const cookieVal = $request.headers['Cookie'] 6 | const tokenVal = $request.headers['access_token'] 7 | if (cookieVal) { 8 | if (chavy.setdata(cookieVal, cookieKey)) { 9 | chavy.msg(`${cookieName}`, '获取Cookie: 成功', '') 10 | chavy.log(`[${cookieName}] 获取Cookie: 成功, cookie: ${cookieVal}`) 11 | } 12 | if (chavy.setdata(tokenVal, tokenKey)) { 13 | chavy.msg(`${cookieName}`, '获取Token: 成功', '') 14 | chavy.log(`[${cookieName}] 获取Token: 成功, token: ${tokenVal}`) 15 | } 16 | } 17 | 18 | function init() { 19 | isSurge = () => { 20 | return undefined === this.$httpClient ? false : true 21 | } 22 | isQuanX = () => { 23 | return undefined === this.$task ? false : true 24 | } 25 | getdata = (key) => { 26 | if (isSurge()) return $persistentStore.read(key) 27 | if (isQuanX()) return $prefs.valueForKey(key) 28 | } 29 | setdata = (key, val) => { 30 | if (isSurge()) return $persistentStore.write(key, val) 31 | if (isQuanX()) return $prefs.setValueForKey(key, val) 32 | } 33 | msg = (title, subtitle, body) => { 34 | if (isSurge()) $notification.post(title, subtitle, body) 35 | if (isQuanX()) $notify(title, subtitle, body) 36 | } 37 | log = (message) => console.log(message) 38 | get = (url, cb) => { 39 | if (isSurge()) { 40 | $httpClient.get(url, cb) 41 | } 42 | if (isQuanX()) { 43 | url.method = 'GET' 44 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 45 | } 46 | } 47 | post = (url, cb) => { 48 | if (isSurge()) { 49 | $httpClient.post(url, cb) 50 | } 51 | if (isQuanX()) { 52 | url.method = 'POST' 53 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 54 | } 55 | } 56 | done = (value = {}) => { 57 | $done(value) 58 | } 59 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 60 | } 61 | chavy.done() 62 | -------------------------------------------------------------------------------- /apktw/README.md: -------------------------------------------------------------------------------- 1 | # APK.TW 2 | 3 | > 调整获取会话正则 (使用账号密码登录获取) 4 | 5 | ## 配置 (Surge) 6 | 7 | ```properties 8 | [MITM] 9 | apk.tw 10 | 11 | [Script] 12 | http-request ^https://apk.tw\/member.php(.*?)action=login script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/apktw/apktw.cookie.js,requires-body=true 13 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/apktw/apktw.js 14 | ``` 15 | 16 | ## 配置 (QuanX) 17 | 18 | ```properties 19 | [MITM] 20 | apk.tw 21 | 22 | [rewrite_local] 23 | ^https://apk.tw\/member.php(.*?)action=login url script-request-body apktw.cookie.js 24 | 25 | [task_local] 26 | 1 0 * * * apktw.js 27 | ``` 28 | 29 | ## 说明 30 | 31 | 1. 访问: `https://apk.tw/` (如果你已经登录, 请先注销) 32 | 2. 使用账号密码登录 33 | 3. 系统提示: `获取会话: 成功` (以登录成功后弹出的通知为准!) 34 | 35 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 36 | 37 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 38 | 39 | ## 常见问题 40 | 41 | 1. 无法写入 Cookie 42 | 43 | - 检查 Surge 系统通知权限放开了没 44 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 45 | 46 | 2. 写入 Cookie 成功, 但签到不成功 47 | 48 | - 看看是不是在登录前就写入 Cookie 了 49 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 50 | 51 | 3. 为什么有时成功有时失败 52 | 53 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 54 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 55 | 56 | - `Surge`配置: 57 | 58 | ```properties 59 | # 没有什么是一顿饭解决不了的: 60 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 61 | # 如果有,那就两顿: 62 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 63 | # 实在不行,三顿也能接受: 64 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 65 | 66 | # 再粗暴点,直接: 67 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 68 | ``` 69 | 70 | - `QuanX`配置: 71 | 72 | ```properties 73 | [task_local] 74 | 1 0 * * * xxx.js # 每天00:01执行一次 75 | 2 0 * * * xxx.js # 每天00:02执行一次 76 | 3 0 * * * xxx.js # 每天00:03执行一次 77 | 78 | */60 * * * * xxx.js # 每60分执行一次 79 | ``` 80 | 81 | ## 感谢 82 | 83 | [@NobyDa](https://github.com/NobyDa) 84 | 85 | [@lhie1](https://github.com/lhie1) 86 | 87 | [@ConnersHua](https://github.com/ConnersHua) 88 | -------------------------------------------------------------------------------- /apktw/apktw.cookie.js: -------------------------------------------------------------------------------- 1 | const $ = new Env('ApkTw') 2 | 3 | !(async () => { 4 | $.log('', `🔔 ${$.name}, 获取会话: 开始!`, '') 5 | const session = {} 6 | session.url = $request.url 7 | session.body = $request.body 8 | session.headers = $request.headers 9 | delete session.headers['Content-Length'] 10 | delete session.headers['Cookie'] 11 | $.log('', `url: ${session.url}`, `body: ${session.body}`, `headers: ${JSON.stringify(session.headers)}`) 12 | if ($.setdata(JSON.stringify(session), 'chavy_cookie_apktw')) { 13 | $.subt = '获取会话: 成功!' 14 | } else { 15 | $.subt = '获取会话: 失败!' 16 | } 17 | })() 18 | .catch((e) => { 19 | $.subt = '获取会话: 失败!' 20 | $.desc = `原因: ${e}` 21 | $.log(`❌ ${$.name}, 获取会话: 失败! 原因: ${e}!`) 22 | }) 23 | .finally(() => { 24 | $.msg($.name, $.subt, $.desc), $.log('', `🔔 ${$.name}, 获取会话: 结束!`, ''), $.done() 25 | }) 26 | 27 | // prettier-ignore 28 | function Env(t){this.name=t,this.logs=[],this.isSurge=(()=>"undefined"!=typeof $httpClient),this.isQuanX=(()=>"undefined"!=typeof $task),this.log=((...t)=>{this.logs=[...this.logs,...t],t?console.log(t.join("\n")):console.log(this.logs.join("\n"))}),this.msg=((t=this.name,s="",i="")=>{this.isSurge()&&$notification.post(t,s,i),this.isQuanX()&&$notify(t,s,i);const e=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t&&e.push(t),s&&e.push(s),i&&e.push(i),console.log(e.join("\n"))}),this.getdata=(t=>this.isSurge()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):void 0),this.setdata=((t,s)=>this.isSurge()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):void 0),this.get=((t,s)=>this.send(t,"GET",s)),this.wait=((t,s=t)=>i=>setTimeout(()=>i(),Math.floor(Math.random()*(s-t+1)+t))),this.post=((t,s)=>this.send(t,"POST",s)),this.send=((t,s,i)=>{if(this.isSurge()){const e="POST"==s?$httpClient.post:$httpClient.get;e(t,(t,s,e)=>{s&&(s.body=e,s.statusCode=s.status),i(t,s,e)})}this.isQuanX()&&(t.method=s,$task.fetch(t).then(t=>{t.status=t.statusCode,i(null,t,t.body)},t=>i(t.error,t,t)))}),this.done=((t={})=>$done(t))} 29 | -------------------------------------------------------------------------------- /bcz/README.md: -------------------------------------------------------------------------------- 1 | # 百词斩 2 | 3 | > 参考 chavy 签到脚本制作的百词斩领取铜板的脚本 4 | 5 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 6 | 7 | > 不需要手动编辑脚本 (获取 Cookie 和手机号码都由脚本自动完成) 8 | 9 | > 感谢 [@GideonSenku](https://github.com/GideonSenku) PR 10 | 11 | ## 配置 (Surge) 12 | 13 | ```properties 14 | [MITM] 15 | group.baicizhan.com 16 | 17 | [Script] 18 | http-request ^https://group\.baicizhan\.com/group/rewards? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bcz/bcz.cookie.js 19 | 20 | cron "0 50 23 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bcz/bcz.js 21 | ``` 22 | 23 | ## 配置 (QuanX) 24 | 25 | ```properties 26 | [MITM] 27 | group.baicizhan.com 28 | 29 | [rewrite_local] 30 | # 190及以后版本 31 | ^https://group\.baicizhan\.com/group/rewards? url script-request-header bcz.cookie.js 32 | 33 | [task_local] 34 | 50 23 * * * bcz.js 35 | ``` 36 | 37 | ## 说明 38 | 39 | > 先在登录成功后, 再打开获取 Cookie 的脚本 40 | 41 | 1. 先配置`[MITM]` 42 | - Surge&QuanX: group.baicizhan.com 43 | 2. 再配置重写规则: 44 | - Surge: 把两条远程脚本放到`[Script]` 45 | - QuanX: 把`bcz.cookie.js`和`bcz.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 46 | 3. 打开 APP 手动签到一次: 访问下右下角 `我` > `我的铜板` > `加入百词斩小班` > `去查看` > `我的小班进去 领铜板` 47 | 4. 系统提示: `获取Cookie: 成功` 48 | 5. 最后就可以把第 1 条脚本注释掉了 49 | 50 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 51 | 52 | > 第 2 条脚本是签到脚本, 每天`23:50`执行一次. 53 | 7. 也可将脚本的cron语法自行更改,如我设置成 `0 */4 * * *` 则每4小时可提醒我背单词 54 | 55 | ## 常见问题 56 | 57 | 1. 无法写入 Cookie 58 | 59 | - 检查 Surge 系统通知权限放开了没 60 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 61 | 62 | 2. 写入 Cookie 成功, 但签到不成功 63 | 64 | - 看看是不是在登录前就写入 Cookie 了 65 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 66 | 67 | 3. 为什么有时成功有时失败 68 | 69 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 70 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 71 | 72 | - `Surge`配置: 73 | 74 | ```properties 75 | # 没有什么是一顿饭解决不了的: 76 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 77 | # 如果有,那就两顿: 78 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 79 | # 实在不行,三顿也能接受: 80 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 81 | 82 | # 再粗暴点,直接: 83 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 84 | ``` 85 | 86 | - `QuanX`配置: 87 | 88 | ```properties 89 | [task_local] 90 | 1 0 * * * xxx.js # 每天00:01执行一次 91 | 2 0 * * * xxx.js # 每天00:02执行一次 92 | 3 0 * * * xxx.js # 每天00:03执行一次 93 | 94 | */60 * * * * xxx.js # 每60分执行一次 95 | ``` 96 | 97 | ## 感谢 98 | 99 | [@NobyDa](https://github.com/NobyDa) 100 | 101 | [@lhie1](https://github.com/lhie1) 102 | 103 | [@ConnersHua](https://github.com/ConnersHua) 104 | 105 | [@GideonSenku](https://github.com/GideonSenku) 106 | -------------------------------------------------------------------------------- /bcz/bcz.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '百词斩' 2 | const cookieKey = 'senku_cookie_bcz' 3 | const shareKey = 'senku_key_bcz' 4 | const senku = init() 5 | 6 | if (this.$request && this.$request.headers) { 7 | const cookieVal = $request.headers['Cookie'] 8 | const url = $request.url 9 | const index1 = url.indexOf('=') 10 | const index2 = url.indexOf('&') 11 | const shareVal = url.substring(index1 + 1, index2) 12 | if (cookieVal && shareVal) { 13 | if (senku.setdata(cookieVal, cookieKey) && senku.setdata(shareVal, shareKey)) { 14 | senku.msg(`${cookieName}`, '获取Cookie: 成功', '') 15 | senku.log(`[${cookieName}] 获取Cookie: 成功, cookie: ${cookieVal}`) 16 | } 17 | } 18 | } 19 | function init() { 20 | isSurge = () => { 21 | return undefined === this.$httpClient ? false : true 22 | } 23 | isQuanX = () => { 24 | return undefined === this.$task ? false : true 25 | } 26 | getdata = (key) => { 27 | if (isSurge()) return $persistentStore.read(key) 28 | if (isQuanX()) return $prefs.valueForKey(key) 29 | } 30 | setdata = (key, val) => { 31 | if (isSurge()) return $persistentStore.write(key, val) 32 | if (isQuanX()) return $prefs.setValueForKey(key, val) 33 | } 34 | msg = (title, subtitle, body) => { 35 | if (isSurge()) $notification.post(title, subtitle, body) 36 | if (isQuanX()) $notify(title, subtitle, body) 37 | } 38 | log = (message) => console.log(message) 39 | get = (url, cb) => { 40 | if (isSurge()) { 41 | $httpClient.get(url, cb) 42 | } 43 | if (isQuanX()) { 44 | url.method = 'GET' 45 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 46 | } 47 | } 48 | post = (url, cb) => { 49 | if (isSurge()) { 50 | $httpClient.post(url, cb) 51 | } 52 | if (isQuanX()) { 53 | url.method = 'POST' 54 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 55 | } 56 | } 57 | done = (value = {}) => { 58 | $done(value) 59 | } 60 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 61 | } 62 | senku.done() 63 | -------------------------------------------------------------------------------- /bcz/bcz.js: -------------------------------------------------------------------------------- 1 | const cookieName = '百词斩' 2 | const cookieKey = 'senku_cookie_bcz' 3 | const shareKey = 'senku_key_bcz' 4 | const senku = init() 5 | const cookieVal = senku.getdata(cookieKey) 6 | const shareVal = senku.getdata(shareKey) 7 | 8 | let signinfo = {} 9 | senku.log() 10 | check() 11 | function check(cb) { 12 | const url = { url: `https://group.baicizhan.com/group/apply_reward`, headers: { Cookie: cookieVal } } 13 | url.headers['Content-Type'] = `text/plain;charset=utf-8` 14 | url.headers['User-Agent'] = `Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.10(0x17000a21) NetType/4G Language/zh_CN` 15 | const key = { share_key: shareVal } 16 | url.body = JSON.stringify(key) 17 | senku.log(url.body) 18 | senku.post(url, (error, response, data) => { 19 | signinfo = JSON.parse(data) 20 | senku.log(JSON.stringify(signinfo)) 21 | const title = `${cookieName}` 22 | let subTitle = `` 23 | let detail = '' 24 | if (signinfo.code == 1) { 25 | if (signinfo.data.is_new) { 26 | subTitle += `成功` 27 | detail = `获取铜板数${signinfo.data.reward[2]}` 28 | } else { 29 | subTitle += `今天的铜板已经领取,但是单词还是可以继续背的` 30 | } 31 | } else { 32 | detail = `状态: 还玩手机?快去背单词` 33 | subTitle += '失败' 34 | } 35 | senku.msg(title, subTitle, detail) 36 | senku.done() 37 | }) 38 | } 39 | 40 | function init() { 41 | isSurge = () => { 42 | return undefined === this.$httpClient ? false : true 43 | } 44 | isQuanX = () => { 45 | return undefined === this.$task ? false : true 46 | } 47 | getdata = (key) => { 48 | if (isSurge()) return $persistentStore.read(key) 49 | if (isQuanX()) return $prefs.valueForKey(key) 50 | } 51 | setdata = (key, val) => { 52 | if (isSurge()) return $persistentStore.write(key, val) 53 | if (isQuanX()) return $prefs.setValueForKey(key, val) 54 | } 55 | msg = (title, subtitle, body) => { 56 | if (isSurge()) $notification.post(title, subtitle, body) 57 | if (isQuanX()) $notify(title, subtitle, body) 58 | } 59 | log = (message) => console.log(message) 60 | get = (url, cb) => { 61 | if (isSurge()) { 62 | $httpClient.get(url, cb) 63 | } 64 | if (isQuanX()) { 65 | url.method = 'GET' 66 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 67 | } 68 | } 69 | post = (url, cb) => { 70 | if (isSurge()) { 71 | $httpClient.post(url, cb) 72 | } 73 | if (isQuanX()) { 74 | url.method = 'POST' 75 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 76 | } 77 | } 78 | done = (value = {}) => { 79 | $done(value) 80 | } 81 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 82 | } 83 | -------------------------------------------------------------------------------- /bilibili/bilibili.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = 'bilibili' 2 | const cookieKey = 'chavy_cookie_bilibili' 3 | const chavy = init() 4 | const cookieVal = $request.headers['Cookie'] 5 | if (cookieVal) { 6 | if (chavy.setdata(cookieVal, cookieKey)) { 7 | chavy.msg(`${cookieName}`, '获取Cookie: 成功', '') 8 | chavy.log(`[${cookieName}] 获取Cookie: 成功, cookie: ${cookieVal}`) 9 | } 10 | } 11 | function init() { 12 | isSurge = () => { 13 | return undefined === this.$httpClient ? false : true 14 | } 15 | isQuanX = () => { 16 | return undefined === this.$task ? false : true 17 | } 18 | getdata = (key) => { 19 | if (isSurge()) return $persistentStore.read(key) 20 | if (isQuanX()) return $prefs.valueForKey(key) 21 | } 22 | setdata = (key, val) => { 23 | if (isSurge()) return $persistentStore.write(key, val) 24 | if (isQuanX()) return $prefs.setValueForKey(key, val) 25 | } 26 | msg = (title, subtitle, body) => { 27 | if (isSurge()) $notification.post(title, subtitle, body) 28 | if (isQuanX()) $notify(title, subtitle, body) 29 | } 30 | log = (message) => console.log(message) 31 | get = (url, cb) => { 32 | if (isSurge()) { 33 | $httpClient.get(url, cb) 34 | } 35 | if (isQuanX()) { 36 | url.method = 'GET' 37 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 38 | } 39 | } 40 | post = (url, cb) => { 41 | if (isSurge()) { 42 | $httpClient.post(url, cb) 43 | } 44 | if (isQuanX()) { 45 | url.method = 'POST' 46 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 47 | } 48 | } 49 | done = (value = {}) => { 50 | $done(value) 51 | } 52 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 53 | } 54 | chavy.done() 55 | -------------------------------------------------------------------------------- /bilibili/bilibili.silver2coin.js: -------------------------------------------------------------------------------- 1 | const cookieName = 'bilibili' 2 | const cookieKey = 'chavy_cookie_bilibili' 3 | const chavy = init() 4 | const cookieVal = chavy.getdata(cookieKey) 5 | 6 | sign() 7 | 8 | function sign() { 9 | let url = { 10 | url: `https://api.live.bilibili.com/pay/v1/Exchange/silver2coin`, 11 | headers: { 12 | Cookie: cookieVal 13 | } 14 | } 15 | url.headers['Origin'] = 'api.live.bilibili.com' 16 | url.headers['Referer'] = 'http://live.bilibili.com/' 17 | url.headers['Accept'] = 'application/json, text/javascript, */*; q=0.01' 18 | url.headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15' 19 | 20 | chavy.get(url, (error, response, data) => { 21 | let result = JSON.parse(data) 22 | let title = `${cookieName} 银瓜子转硬币` 23 | // 兑换成功 24 | if (result && result.code == 0) { 25 | let subTitle = `${result.message}` 26 | let detail = `成功兑换: ${result.data.coin} 个硬币\n当前银瓜子: ${result.data.silver} , 当前金瓜子: ${result.data.gold}` 27 | chavy.msg(title, subTitle, detail) 28 | } 29 | // 兑换中止(重复兑换&银瓜子不足) 30 | else if (result && result.code == 403) { 31 | let subTitle = `未成功兑换` 32 | let detail = `${result.message}` 33 | chavy.msg(title, subTitle, detail) 34 | } 35 | // 兑换失败 36 | else { 37 | let subTitle = `兑换失败` 38 | let detail = `说明: ${result.message}` 39 | chavy.msg(title, subTitle, detail) 40 | } 41 | chavy.log(`${cookieName}, data: ${data}`) 42 | }) 43 | 44 | chavy.done() 45 | } 46 | function init() { 47 | isSurge = () => { 48 | return undefined === this.$httpClient ? false : true 49 | } 50 | isQuanX = () => { 51 | return undefined === this.$task ? false : true 52 | } 53 | getdata = (key) => { 54 | if (isSurge()) return $persistentStore.read(key) 55 | if (isQuanX()) return $prefs.valueForKey(key) 56 | } 57 | setdata = (key, val) => { 58 | if (isSurge()) return $persistentStore.write(key, val) 59 | if (isQuanX()) return $prefs.setValueForKey(key, val) 60 | } 61 | msg = (title, subtitle, body) => { 62 | if (isSurge()) $notification.post(title, subtitle, body) 63 | if (isQuanX()) $notify(title, subtitle, body) 64 | } 65 | log = (message) => console.log(message) 66 | get = (url, cb) => { 67 | if (isSurge()) { 68 | $httpClient.get(url, cb) 69 | } 70 | if (isQuanX()) { 71 | url.method = 'GET' 72 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 73 | } 74 | } 75 | post = (url, cb) => { 76 | if (isSurge()) { 77 | $httpClient.post(url, cb) 78 | } 79 | if (isQuanX()) { 80 | url.method = 'POST' 81 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 82 | } 83 | } 84 | done = (value = {}) => { 85 | $done(value) 86 | } 87 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 88 | } 89 | -------------------------------------------------------------------------------- /box/icons/BoxJs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/box/icons/BoxJs.png -------------------------------------------------------------------------------- /box/icons/BoxSetting.mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/box/icons/BoxSetting.mini.png -------------------------------------------------------------------------------- /box/icons/BoxSetting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/box/icons/BoxSetting.png -------------------------------------------------------------------------------- /box/icons/BoxSwitcher.mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/box/icons/BoxSwitcher.mini.png -------------------------------------------------------------------------------- /box/icons/BoxSwitcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/box/icons/BoxSwitcher.png -------------------------------------------------------------------------------- /box/rewrite/boxjs.rewrite.loon.plugin: -------------------------------------------------------------------------------- 1 | [Script] 2 | http-request ^https?://boxjs.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/chavy.box.js, requires-body=true, timeout=120, tag=BoxJs -------------------------------------------------------------------------------- /box/rewrite/boxjs.rewrite.loon.tf.plugin: -------------------------------------------------------------------------------- 1 | [Script] 2 | http-request ^https?://boxjs.net script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/box/chavy.boxjs.js, requires-body=true, timeout=120, tag=BoxJs.net 3 | -------------------------------------------------------------------------------- /box/rewrite/boxjs.rewrite.quanx.conf: -------------------------------------------------------------------------------- 1 | ^https?://boxjs.com url script-analyze-echo-response https://raw.githubusercontent.com/chavyleung/scripts/master/chavy.box.js -------------------------------------------------------------------------------- /box/rewrite/boxjs.rewrite.quanx.tf.conf: -------------------------------------------------------------------------------- 1 | ^https?://boxjs.net url script-analyze-echo-response https://raw.githubusercontent.com/chavyleung/scripts/master/box/chavy.boxjs.js -------------------------------------------------------------------------------- /box/rewrite/boxjs.rewrite.surge.sgmodule: -------------------------------------------------------------------------------- 1 | #!name=BoxJs 2 | #!desc=http://boxjs.com 3 | 4 | [Script] 5 | Rewrite: BoxJs = type=http-request,pattern=^https?://boxjs.com,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/chavy.box.js, requires-body=true, timeout=120 -------------------------------------------------------------------------------- /box/rewrite/boxjs.rewrite.surge.tf.sgmodule: -------------------------------------------------------------------------------- 1 | #!name=BoxJs.net 2 | #!desc=http://boxjs.net 3 | 4 | [Script] 5 | Rewrite: BoxJs = type=http-request,pattern=^https?://boxjs.net,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/box/chavy.boxjs.js, requires-body=true, timeout=120 6 | -------------------------------------------------------------------------------- /chavy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * [main.js] 3 | * const cookieVal = $persistentStore.read(cookieKey) 4 | * => 5 | * const chavy = init() 6 | * const cookieVal = chavy.getdata(cookieKey) 7 | * 8 | * $httpClient.get => chavy.get 9 | * $httpClient.post => chavy.post 10 | * $notification.post => chavy.msg 11 | * console.log => chavy.log 12 | * $done({}) => chavy.done() 13 | * 14 | * [main.cookie.js] 15 | * const cookieVal = $request.headers['Cookie'] 16 | * => 17 | * const chavy = init() 18 | * const cookieVal = $request.headers['Cookie'] 19 | * 20 | * $persistentStore.write => chavy.setdata 21 | * $notification.post => chavy.msg 22 | * console.log => chavy.log 23 | * $done({}) => chavy.done() 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 | -------------------------------------------------------------------------------- /csdn/csdn.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = 'CSDN' 2 | const tokenurlKey = 'chavy_tokenurl_csdn' 3 | const tokenheaderKey = 'chavy_tokenheader_csdn' 4 | const signurlKey = 'chavy_signurl_csdn' 5 | const signheaderKey = 'chavy_signheader_csdn' 6 | const chavy = init() 7 | 8 | let title = `` 9 | let detail = `` 10 | if ($request && $request.method != 'OPTIONS' && $request.headers.Host == 'passport.csdn.net') { 11 | const tokenurlVal = $request.url 12 | const tokenheaderVal = JSON.stringify($request.headers) 13 | if (tokenurlVal) chavy.setdata(tokenurlVal, tokenurlKey) 14 | if (tokenheaderVal) chavy.setdata(tokenheaderVal, tokenheaderKey) 15 | title = `获取刷新链接: 成功` 16 | detail = `请进入 "我的>签到" 并手动签到1次` 17 | chavy.msg(`${cookieName}`, title, detail) 18 | } else if ($request && $request.method != 'OPTIONS' && $request.headers.Host == 'gw.csdn.net') { 19 | const signurlVal = $request.url 20 | const signheaderVal = JSON.stringify($request.headers) 21 | if (signurlVal) chavy.setdata(signurlVal, signurlKey) 22 | if (signheaderVal) chavy.setdata(signheaderVal, signheaderKey) 23 | title = `获取Cookie: 成功 (手动签到)` 24 | chavy.msg(`${cookieName}`, title, detail) 25 | } 26 | 27 | function init() { 28 | isSurge = () => { 29 | return undefined === this.$httpClient ? false : true 30 | } 31 | isQuanX = () => { 32 | return undefined === this.$task ? false : true 33 | } 34 | getdata = (key) => { 35 | if (isSurge()) return $persistentStore.read(key) 36 | if (isQuanX()) return $prefs.valueForKey(key) 37 | } 38 | setdata = (key, val) => { 39 | if (isSurge()) return $persistentStore.write(key, val) 40 | if (isQuanX()) return $prefs.setValueForKey(key, val) 41 | } 42 | msg = (title, subtitle, body) => { 43 | if (isSurge()) $notification.post(title, subtitle, body) 44 | if (isQuanX()) $notify(title, subtitle, body) 45 | } 46 | log = (message) => console.log(message) 47 | get = (url, cb) => { 48 | if (isSurge()) { 49 | $httpClient.get(url, cb) 50 | } 51 | if (isQuanX()) { 52 | url.method = 'GET' 53 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 54 | } 55 | } 56 | post = (url, cb) => { 57 | if (isSurge()) { 58 | $httpClient.post(url, cb) 59 | } 60 | if (isQuanX()) { 61 | url.method = 'POST' 62 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 63 | } 64 | } 65 | done = (value = {}) => { 66 | $done(value) 67 | } 68 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 69 | } 70 | chavy.done() 71 | -------------------------------------------------------------------------------- /dbsj/dbsj.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '豆瓣时间' 2 | const signurlKey = 'senku_signurl_dbsj' 3 | const signheaderKey = 'senku_signheader_dbsj' 4 | const signbodyKey = 'senku_signbody_dbsj' 5 | const senku = init() 6 | 7 | const requrl = $request.url 8 | if ($request && $request.method != 'OPTIONS') { 9 | const signurlVal = requrl 10 | const signheaderVal = JSON.stringify($request.headers) 11 | 12 | if (signurlVal) senku.setdata(signurlVal, signurlKey) 13 | if (signheaderVal) senku.setdata(signheaderVal, signheaderKey) 14 | senku.msg(cookieName, `获取Cookie: 成功`, ``) 15 | } 16 | 17 | function init() { 18 | isSurge = () => { 19 | return undefined === this.$httpClient ? false : true 20 | } 21 | isQuanX = () => { 22 | return undefined === this.$task ? false : true 23 | } 24 | getdata = (key) => { 25 | if (isSurge()) return $persistentStore.read(key) 26 | if (isQuanX()) return $prefs.valueForKey(key) 27 | } 28 | setdata = (key, val) => { 29 | if (isSurge()) return $persistentStore.write(key, val) 30 | if (isQuanX()) return $prefs.setValueForKey(key, val) 31 | } 32 | msg = (title, subtitle, body) => { 33 | if (isSurge()) $notification.post(title, subtitle, body) 34 | if (isQuanX()) $notify(title, subtitle, body) 35 | } 36 | log = (message) => console.log(message) 37 | get = (url, cb) => { 38 | if (isSurge()) { 39 | $httpClient.get(url, cb) 40 | } 41 | if (isQuanX()) { 42 | url.method = 'GET' 43 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 44 | } 45 | } 46 | post = (url, cb) => { 47 | if (isSurge()) { 48 | $httpClient.post(url, cb) 49 | } 50 | if (isQuanX()) { 51 | url.method = 'POST' 52 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 53 | } 54 | } 55 | done = (value = {}) => { 56 | $done(value) 57 | } 58 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 59 | } 60 | senku.done() 61 | -------------------------------------------------------------------------------- /dbsj/dbsj.js: -------------------------------------------------------------------------------- 1 | const cookieName = '豆瓣时间' 2 | const signurlKey = 'senku_signurl_dbsj' 3 | const signheaderKey = 'senku_signheader_dbsj' 4 | const signbodyKey = 'senku_signbody_dbsj' 5 | const senku = init() 6 | const signurlVal = senku.getdata(signurlKey) 7 | const signheaderVal = senku.getdata(signheaderKey) 8 | 9 | sign() 10 | 11 | function sign() { 12 | 13 | const url = { url: signurlVal, headers: JSON.parse(signheaderVal)} 14 | senku.get(url, (error, response, data) => { 15 | const result = JSON.parse(data) 16 | let subTitle = `` 17 | let detail = `` 18 | const has_checked = result.today_status.has_checked 19 | const continuous_check_in_count = result.continuous_check_in_count 20 | const status = result.auto_check.status 21 | if (status == "success") { 22 | subTitle = `签到结果: 成功` 23 | detail = `连续签到天数${continuous_check_in_count}天` 24 | } else if (has_checked == 1) { 25 | const date = result.today_check.created_at 26 | subTitle = `签到结果: 重复 签到时间${date}` 27 | } 28 | senku.msg(cookieName, subTitle, detail) 29 | senku.done() 30 | }) 31 | } 32 | 33 | 34 | function init() { 35 | isSurge = () => { 36 | return undefined === this.$httpClient ? false : true 37 | } 38 | isQuanX = () => { 39 | return undefined === this.$task ? false : true 40 | } 41 | getdata = (key) => { 42 | if (isSurge()) return $persistentStore.read(key) 43 | if (isQuanX()) return $prefs.valueForKey(key) 44 | } 45 | setdata = (key, val) => { 46 | if (isSurge()) return $persistentStore.write(key, val) 47 | if (isQuanX()) return $prefs.setValueForKey(key, val) 48 | } 49 | msg = (title, subtitle, body) => { 50 | if (isSurge()) $notification.post(title, subtitle, body) 51 | if (isQuanX()) $notify(title, subtitle, body) 52 | } 53 | log = (message) => console.log(message) 54 | get = (url, cb) => { 55 | if (isSurge()) { 56 | $httpClient.get(url, cb) 57 | } 58 | if (isQuanX()) { 59 | url.method = 'GET' 60 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 61 | } 62 | } 63 | post = (url, cb) => { 64 | if (isSurge()) { 65 | $httpClient.post(url, cb) 66 | } 67 | if (isQuanX()) { 68 | url.method = 'POST' 69 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 70 | } 71 | } 72 | done = (value = {}) => { 73 | $done(value) 74 | } 75 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 76 | } 77 | -------------------------------------------------------------------------------- /dongqiudi/README.md: -------------------------------------------------------------------------------- 1 | # 懂球帝 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | ## 配置 (Surge) 6 | 7 | ```properties 8 | [MITM] 9 | api.dongqiudi.com 10 | 11 | [Script] 12 | http-request ^https:\/\/api\.dongqiudi\.com\/v2\/user\/is_login script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/dongqiudi/dongqiudi.cookie.js 13 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/dongqiudi/dongqiudi.js 14 | ``` 15 | 16 | ## 配置 (QuanX) 17 | 18 | ```properties 19 | [MITM] 20 | api.dongqiudi.com 21 | 22 | [rewrite_local] 23 | # 189及以前版本 24 | ^https:\/\/api\.dongqiudi\.com\/v2\/user\/is_login url script-response-body dongqiudi.cookie.js 25 | # 190及以后版本 26 | ^https:\/\/api\.dongqiudi\.com\/v2\/user\/is_login url script-request-header dongqiudi.cookie.js 27 | 28 | [task_local] 29 | 1 0 * * * dongqiudi.js 30 | ``` 31 | 32 | ## 说明 33 | 34 | 1. 先把`api.dongqiudi.com`加到`[MITM]` 35 | 2. 再配置重写规则: 36 | - Surge: 把两条远程脚本放到`[Script]` 37 | - QuanX: 把`dongqiudi.cookie.js`和`dongqiudi.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 38 | 3. 打开懂球帝 (打开前先杀掉 APP) 39 | 4. 系统提示: `获取Cookie: 成功` (如果不提示获取成功, 尝试杀进程再进个人中心) 40 | 5. 最后就可以把第 1 条脚本注释掉了 41 | 42 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 43 | 44 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 45 | 46 | ## 常见问题 47 | 48 | 1. 无法写入 Cookie 49 | 50 | - 检查 Surge 系统通知权限放开了没 51 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 52 | 53 | 2. 写入 Cookie 成功, 但签到不成功 54 | 55 | - 看看是不是在登录前就写入 Cookie 了 56 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 57 | 58 | 3. 为什么有时成功有时失败 59 | 60 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 61 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 62 | 63 | - `Surge`配置: 64 | 65 | ```properties 66 | # 没有什么是一顿饭解决不了的: 67 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 68 | # 如果有,那就两顿: 69 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 70 | # 实在不行,三顿也能接受: 71 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 72 | 73 | # 再粗暴点,直接: 74 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 75 | ``` 76 | 77 | - `QuanX`配置: 78 | 79 | ```properties 80 | [task_local] 81 | 1 0 * * * xxx.js # 每天00:01执行一次 82 | 2 0 * * * xxx.js # 每天00:02执行一次 83 | 3 0 * * * xxx.js # 每天00:03执行一次 84 | 85 | */60 * * * * xxx.js # 每60分执行一次 86 | ``` 87 | 88 | ## 感谢 89 | 90 | [@NobyDa](https://github.com/NobyDa) 91 | 92 | [@lhie1](https://github.com/lhie1) 93 | 94 | [@ConnersHua](https://github.com/ConnersHua) 95 | -------------------------------------------------------------------------------- /dongqiudi/dongqiudi.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '懂球帝' 2 | const cookieKey = 'chavy_cookie_dongqiudi' 3 | const chavy = init() 4 | const cookieVal = JSON.stringify({ 5 | UUID: $request.headers['UUID'], 6 | Authorization: $request.headers['Authorization'] 7 | }) 8 | if (cookieVal && chavy.setdata(cookieVal, cookieKey)) { 9 | chavy.msg(`${cookieName}`, '获取Cookie: 成功', '') 10 | chavy.log(`[${cookieName}] 获取Cookie: 成功, cookie: ${cookieVal}`) 11 | } 12 | function init() { 13 | isSurge = () => { 14 | return undefined === this.$httpClient ? false : true 15 | } 16 | isQuanX = () => { 17 | return undefined === this.$task ? false : true 18 | } 19 | getdata = (key) => { 20 | if (isSurge()) return $persistentStore.read(key) 21 | if (isQuanX()) return $prefs.valueForKey(key) 22 | } 23 | setdata = (key, val) => { 24 | if (isSurge()) return $persistentStore.write(key, val) 25 | if (isQuanX()) return $prefs.setValueForKey(key, val) 26 | } 27 | msg = (title, subtitle, body) => { 28 | if (isSurge()) $notification.post(title, subtitle, body) 29 | if (isQuanX()) $notify(title, subtitle, body) 30 | } 31 | log = (message) => console.log(message) 32 | get = (url, cb) => { 33 | if (isSurge()) { 34 | $httpClient.get(url, cb) 35 | } 36 | if (isQuanX()) { 37 | url.method = 'GET' 38 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 39 | } 40 | } 41 | post = (url, cb) => { 42 | if (isSurge()) { 43 | $httpClient.post(url, cb) 44 | } 45 | if (isQuanX()) { 46 | url.method = 'POST' 47 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 48 | } 49 | } 50 | done = (value = {}) => { 51 | $done(value) 52 | } 53 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 54 | } 55 | chavy.done() 56 | -------------------------------------------------------------------------------- /duokan/README.md: -------------------------------------------------------------------------------- 1 | # 多看阅读 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > QuanX 需要: v1.0.6-build195 及以后版本 (TestFlight) 6 | 7 | ## 配置 (Surge) 8 | 9 | ```properties 10 | [MITM] 11 | www.duokan.com 12 | 13 | [Script] 14 | http-request ^https:\/\/www\.duokan\.com\/checkin\/v0\/status script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/duokan/duokan.cookie.js, requires-body=true 15 | 16 | cron "0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/duokan/duokan.js 17 | ``` 18 | 19 | ## 配置 (QuanX) 20 | 21 | ```properties 22 | [MITM] 23 | www.duokan.com 24 | 25 | [rewrite_local] 26 | # [商店版] QuanX v1.0.6-build194 及更早版本 27 | ^https:\/\/www\.duokan\.com\/checkin\/v0\/status url script-request-body duokan.cookie.js 28 | 29 | # [TestFlight] QuanX v1.0.6-build195 及以后版本 30 | ^https:\/\/www\.duokan\.com\/checkin\/v0\/status url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/duokan/duokan.cookie.js 31 | 32 | [task_local] 33 | 0 0 * * * duokan.js 34 | ``` 35 | 36 | ## 说明 37 | 1. 先把 `www.duokan.com` 加到 `[MITM]` 38 | 2. 再配置重写规则: 39 | - Surge: 把两条远程脚本放到 `[Script]` 40 | - QuanX: 把 `duokan.cookie.js` 和 `duokan.js` 传到 `On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 41 | 3. 获取 Cookie: `我的` > `签到任务` 等到提示获取 Cookie 成功即可 42 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 43 | 44 | > 第 2 条脚本是签到脚本, 每天 `00:00` 执行一次. 45 | 46 | ## 常见问题 47 | 48 | 1. 无法写入 Cookie 49 | 50 | - 检查 Surge 系统通知权限放开了没 51 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 52 | 53 | 2. 写入 Cookie 成功, 但签到不成功 54 | 55 | - 看看是不是在登录前就写入 Cookie 了 56 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 57 | 58 | 3. 为什么有时成功有时失败 59 | 60 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 61 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 62 | 63 | - `Surge`配置: 64 | 65 | ```properties 66 | # 没有什么是一顿饭解决不了的: 67 | cron "10 0 0 * * *" script-path=xxx.js # 每天 00:00:10 执行一次 68 | # 如果有,那就两顿: 69 | cron "20 0 0 * * *" script-path=xxx.js # 每天 00:00:20 执行一次 70 | # 实在不行,三顿也能接受: 71 | cron "30 0 0 * * *" script-path=xxx.js # 每天 00:00:30 执行一次 72 | 73 | # 再粗暴点,直接: 74 | cron "* */60 * * * *" script-path=xxx.js # 每 60 分执行一次 75 | ``` 76 | 77 | - `QuanX`配置: 78 | 79 | ```properties 80 | [task_local] 81 | 1 0 * * * xxx.js # 每天 00:01 执行一次 82 | 2 0 * * * xxx.js # 每天 00:02 执行一次 83 | 3 0 * * * xxx.js # 每天 00:03 执行一次 84 | 85 | */60 * * * * xxx.js # 每 60 分执行一次 86 | ``` 87 | 88 | ## 感谢 89 | 90 | [@NobyDa](https://github.com/NobyDa) 91 | 92 | [@lhie1](https://github.com/lhie1) 93 | 94 | [@ConnersHua](https://github.com/ConnersHua) -------------------------------------------------------------------------------- /duokan/duokan.cookie.js: -------------------------------------------------------------------------------- 1 | const DUOKAN_COOKIE_KEY = 'duokan_cookie' 2 | const DUOKAN_DEVICE_ID_KEY = 'duokan_device_id' 3 | 4 | let $util = init() 5 | 6 | if (typeof $request !== 'undefined') { 7 | getCookie() 8 | } 9 | $util.done({}) 10 | 11 | function getCookie() { 12 | let cookieVal = $request.headers['Cookie'] 13 | $util.log(`cookie: ${cookieVal}`) 14 | if (cookieVal.indexOf('token=') !== -1 && cookieVal.indexOf('device_id=') !== -1) { 15 | let regexp = /device_id=(.*?);/g 16 | let matched = regexp.exec(cookieVal) 17 | if (matched) { 18 | let deviceId = matched[1] 19 | $util.log(`deviceId: ${deviceId}`) 20 | if ($util.setdata(cookieVal, DUOKAN_COOKIE_KEY) && $util.setdata(deviceId, DUOKAN_DEVICE_ID_KEY)) { 21 | $util.msg(`获取多看阅读 Cookie 成功 🎉`) 22 | } 23 | } 24 | } 25 | } 26 | 27 | function init() { 28 | isSurge = () => { 29 | return undefined !== this.$httpClient 30 | } 31 | isQuanX = () => { 32 | return undefined !== this.$task 33 | } 34 | getdata = (key) => { 35 | if (isSurge()) return $persistentStore.read(key) 36 | if (isQuanX()) return $prefs.valueForKey(key) 37 | } 38 | setdata = (key, val) => { 39 | if (isSurge()) return $persistentStore.write(key, val) 40 | if (isQuanX()) return $prefs.setValueForKey(key, val) 41 | } 42 | msg = (title, subtitle = '', body = '') => { 43 | if (isSurge()) $notification.post(title, subtitle, body) 44 | if (isQuanX()) $notify(title, subtitle, body) 45 | } 46 | log = (msg) => { 47 | console.log(`${msg}\n`) 48 | } 49 | get = (options, callback) => { 50 | if (isQuanX()) { 51 | if (typeof options == 'string') options = { url: options } 52 | options['method'] = 'GET' 53 | return $task.fetch(options).then( 54 | (response) => { 55 | response['status'] = response.statusCode 56 | callback(null, response, response.body) 57 | }, 58 | (reason) => callback(reason.error, null, null) 59 | ) 60 | } 61 | if (isSurge()) return $httpClient.get(options, callback) 62 | } 63 | post = (options, callback) => { 64 | if (isQuanX()) { 65 | if (typeof options == 'string') options = { url: options } 66 | options['method'] = 'POST' 67 | $task.fetch(options).then( 68 | (response) => { 69 | response['status'] = response.statusCode 70 | callback(null, response, response.body) 71 | }, 72 | (reason) => callback(reason.error, null, null) 73 | ) 74 | } 75 | if (isSurge()) $httpClient.post(options, callback) 76 | } 77 | done = (value = {}) => { 78 | $done(value) 79 | } 80 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 81 | } 82 | -------------------------------------------------------------------------------- /everphoto/README.md: -------------------------------------------------------------------------------- 1 | # 时光相册 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | ## 配置 (Surge) 6 | 7 | ```properties 8 | [MITM] 9 | api.everphoto.cn 10 | 11 | [Script] 12 | http-request ^https:\/\/api.everphoto.cn\/users\/self\/checkin\/v2 script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/everphoto/everphoto.cookie.js 13 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/everphoto/everphoto.js 14 | ``` 15 | 16 | ## 配置 (QuanX) 17 | 18 | ```properties 19 | [MITM] 20 | api.everphoto.cn 21 | 22 | [rewrite_local] 23 | ^https:\/\/api.everphoto.cn\/users\/self\/checkin\/v2 url script-request-header everphoto.cookie.js 24 | 25 | [task_local] 26 | 1 0 * * * everphoto.js 27 | ``` 28 | 29 | ## 说明 30 | 31 | 1. 先把`api.everphoto.cn`加到`[MITM]` 32 | 2. 再配置重写规则: 33 | - Surge: 把两条远程脚本放到`[Script]` 34 | - QuanX: 把`everphoto.cookie.js`和`everphoto.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 35 | 3. 打开 APP 然后手动签到 1 次, 系统提示: `获取Cookie: 成功` 36 | 4. 最后就可以把第 1 条脚本注释掉了 37 | 5. 运行一次脚本, 如果提示重复签到, 那就算成功了! 38 | 39 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 40 | 41 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 42 | 43 | ## 常见问题 44 | 45 | 1. 无法写入 Cookie 46 | 47 | - 检查 Surge 系统通知权限放开了没 48 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 49 | 50 | 2. 写入 Cookie 成功, 但签到不成功 51 | 52 | - 看看是不是在登录前就写入 Cookie 了 53 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 54 | 55 | 3. 为什么有时成功有时失败 56 | 57 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 58 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 59 | 60 | - `Surge`配置: 61 | 62 | ```properties 63 | # 没有什么是一顿饭解决不了的: 64 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 65 | # 如果有,那就两顿: 66 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 67 | # 实在不行,三顿也能接受: 68 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 69 | 70 | # 再粗暴点,直接: 71 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 72 | ``` 73 | 74 | - `QuanX`配置: 75 | 76 | ```properties 77 | [task_local] 78 | 1 0 * * * xxx.js # 每天00:01执行一次 79 | 2 0 * * * xxx.js # 每天00:02执行一次 80 | 3 0 * * * xxx.js # 每天00:03执行一次 81 | 82 | */60 * * * * xxx.js # 每60分执行一次 83 | ``` 84 | 85 | ## 感谢 86 | 87 | [@NobyDa](https://github.com/NobyDa) 88 | 89 | [@lhie1](https://github.com/lhie1) 90 | 91 | [@ConnersHua](https://github.com/ConnersHua) 92 | -------------------------------------------------------------------------------- /everphoto/everphoto.cookie.js: -------------------------------------------------------------------------------- 1 | const chavy = init() 2 | const cookieName = '时光相册' 3 | const KEY_signurl = 'chavy_sign_url_everphoto' 4 | const KEY_signheader = 'chavy_sign_header_everphoto' 5 | 6 | if ($request && $request.method != 'OPTIONS') { 7 | try { 8 | chavy.log(`🔔 ${cookieName} 开始获取: Cookies`) 9 | const VAL_signurl = $request.url 10 | const VAL_signheader = JSON.stringify($request.headers) 11 | if (VAL_signurl) { 12 | chavy.setdata(VAL_signurl, KEY_signurl) 13 | chavy.log(`❕ ${cookieName} VAL_signurl: ${VAL_signurl}`) 14 | } 15 | if (VAL_signheader) { 16 | chavy.setdata(VAL_signheader, KEY_signheader) 17 | chavy.log(`❕ ${cookieName} VAL_signheader: ${VAL_signheader}`) 18 | } 19 | chavy.msg(cookieName, `获取Cookie: 成功`, ``) 20 | } catch (e) { 21 | chavy.msg(cookieName, `获取Cookie: 失败`, e) 22 | chavy.log(`❌ ${cookieName} 获取Cookie: 失败: ${e}`) 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 | chavy.done() 70 | -------------------------------------------------------------------------------- /fandeng/README.md: -------------------------------------------------------------------------------- 1 | # 樊登读书 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > QuanX 需要: v1.0.6-build195 及以后版本 (TestFlight) 6 | 7 | > 感谢 [@GideonSenku](https://github.com/GideonSenku) Commit 8 | 9 | ## 配置 (Surge) 10 | 11 | ```properties 12 | [MITM] 13 | api.dushu.io 14 | 15 | [Script] 16 | http-request ^https://api\.dushu\.io/CheckIn script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fandeng/fandeng.cookie.js, requires-body=true 17 | 18 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/fandeng/fandeng.js 19 | ``` 20 | 21 | ## 配置 (QuanX) 22 | 23 | ```properties 24 | [MITM] 25 | api.dushu.io 26 | 27 | [rewrite_local] 28 | 29 | # [商店版] QuanX v1.0.6-build194 及更早版本 30 | # 不支持 31 | 32 | # [TestFlight] QuanX v1.0.6-build195 及以后版本 33 | ^https://api\.dushu\.io/CheckIn url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/fandeng/fandeng.cookie.js 34 | 35 | [task_local] 36 | 1 0 * * * fandeng.js 37 | ``` 38 | 39 | ## 说明 40 | 41 | 1. 先把`api.dushu.io`加到`[MITM]` 42 | 2. 再配置重写规则: 43 | - Surge: 把两条远程脚本放到`[Script]` 44 | - QuanX: 把`fandeng.cookie.js`和`fandeng.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 45 | 3. 打开 APP 手动签到一次: 访问下右下角 `我的` > `签到` 46 | 4. 系统提示: `获取Cookie: 成功` 47 | 5. 把获取 Cookie 的脚本注释掉 48 | 6. 运行一次脚本, 如果提示重复签到, 那就算成功了! 49 | 50 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 51 | 52 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 53 | 54 | ## 常见问题 55 | 56 | 1. 无法写入 Cookie 57 | 58 | - 检查 Surge 系统通知权限放开了没 59 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 60 | 61 | 2. 写入 Cookie 成功, 但签到不成功 62 | 63 | - 看看是不是在登录前就写入 Cookie 了 64 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 65 | 66 | 3. 为什么有时成功有时失败 67 | 68 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 69 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 70 | 71 | - `Surge`配置: 72 | 73 | ```properties 74 | # 没有什么是一顿饭解决不了的: 75 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 76 | # 如果有,那就两顿: 77 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 78 | # 实在不行,三顿也能接受: 79 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 80 | 81 | # 再粗暴点,直接: 82 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 83 | ``` 84 | 85 | - `QuanX`配置: 86 | 87 | ```properties 88 | [task_local] 89 | 1 0 * * * xxx.js # 每天00:01执行一次 90 | 2 0 * * * xxx.js # 每天00:02执行一次 91 | 3 0 * * * xxx.js # 每天00:03执行一次 92 | 93 | */60 * * * * xxx.js # 每60分执行一次 94 | ``` 95 | 96 | ## 感谢 97 | 98 | [@NobyDa](https://github.com/NobyDa) 99 | 100 | [@lhie1](https://github.com/lhie1) 101 | 102 | [@ConnersHua](https://github.com/ConnersHua) 103 | 104 | [@GideonSenku](https://github.com/GideonSenku) 105 | -------------------------------------------------------------------------------- /fandeng/fandeng.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '樊登读书' 2 | const signurlKey = 'senku_signurl_pandeng' 3 | const signheaderKey = 'senku_signheader_pandeng' 4 | const signbodyKey = 'senku_signbody_pandeng' 5 | const senku = init() 6 | 7 | const requrl = $request.url 8 | if ($request && $request.method != 'OPTIONS') { 9 | const signurlVal = requrl 10 | const signheaderVal = JSON.stringify($request.headers) 11 | const signbodyVal = $request.body 12 | senku.log(`signurlVal:${signurlVal}`) 13 | senku.log(`signheaderVal:${signheaderVal}`) 14 | senku.log(`signbodyVal:${signbodyVal}`) 15 | if (signurlVal) senku.setdata(signurlVal, signurlKey) 16 | if (signheaderVal) senku.setdata(signheaderVal, signheaderKey) 17 | if (signbodyVal) senku.setdata(signbodyVal, signbodyKey) 18 | senku.msg(cookieName, `获取Cookie: 成功`, ``) 19 | } 20 | 21 | function init() { 22 | isSurge = () => { 23 | return undefined === this.$httpClient ? false : true 24 | } 25 | isQuanX = () => { 26 | return undefined === this.$task ? false : true 27 | } 28 | getdata = (key) => { 29 | if (isSurge()) return $persistentStore.read(key) 30 | if (isQuanX()) return $prefs.valueForKey(key) 31 | } 32 | setdata = (key, val) => { 33 | if (isSurge()) return $persistentStore.write(key, val) 34 | if (isQuanX()) return $prefs.setValueForKey(key, val) 35 | } 36 | msg = (title, subtitle, body) => { 37 | if (isSurge()) $notification.post(title, subtitle, body) 38 | if (isQuanX()) $notify(title, subtitle, body) 39 | } 40 | log = (message) => console.log(message) 41 | get = (url, cb) => { 42 | if (isSurge()) { 43 | $httpClient.get(url, cb) 44 | } 45 | if (isQuanX()) { 46 | url.method = 'GET' 47 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 48 | } 49 | } 50 | post = (url, cb) => { 51 | if (isSurge()) { 52 | $httpClient.post(url, cb) 53 | } 54 | if (isQuanX()) { 55 | url.method = 'POST' 56 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 57 | } 58 | } 59 | done = (value = {}) => { 60 | $done(value) 61 | } 62 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 63 | } 64 | senku.done() 65 | -------------------------------------------------------------------------------- /fandeng/fandeng.js: -------------------------------------------------------------------------------- 1 | const cookieName = '樊登读书' 2 | const signurlKey = 'senku_signurl_pandeng' 3 | const signheaderKey = 'senku_signheader_pandeng' 4 | const signbodyKey = 'senku_signbody_pandeng' 5 | const senku = init() 6 | const signurlVal = senku.getdata(signurlKey) 7 | const signheaderVal = senku.getdata(signheaderKey) 8 | const signBodyVal = senku.getdata(signbodyKey) 9 | 10 | sign() 11 | 12 | function sign() { 13 | const url = { url: signurlVal, headers: JSON.parse(signheaderVal), body: signBodyVal } 14 | senku.post(url, (error, response, data) => { 15 | senku.log(`${cookieName}, data: ${data}`) 16 | const res = JSON.parse(data) 17 | let subTitle = `` 18 | let detail = `` 19 | if (res.status == 1) { 20 | subTitle = `签到结果: 成功` 21 | } else { 22 | subTitle = `签到结果: 失败` 23 | detail = `状态: ${res.message}` 24 | } 25 | senku.msg(cookieName, subTitle, detail) 26 | senku.done() 27 | }) 28 | } 29 | 30 | function init() { 31 | isSurge = () => { 32 | return undefined === this.$httpClient ? false : true 33 | } 34 | isQuanX = () => { 35 | return undefined === this.$task ? false : true 36 | } 37 | getdata = (key) => { 38 | if (isSurge()) return $persistentStore.read(key) 39 | if (isQuanX()) return $prefs.valueForKey(key) 40 | } 41 | setdata = (key, val) => { 42 | if (isSurge()) return $persistentStore.write(key, val) 43 | if (isQuanX()) return $prefs.setValueForKey(key, val) 44 | } 45 | msg = (title, subtitle, body) => { 46 | if (isSurge()) $notification.post(title, subtitle, body) 47 | if (isQuanX()) $notify(title, subtitle, body) 48 | } 49 | log = (message) => console.log(message) 50 | get = (url, cb) => { 51 | if (isSurge()) { 52 | $httpClient.get(url, cb) 53 | } 54 | if (isQuanX()) { 55 | url.method = 'GET' 56 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 57 | } 58 | } 59 | post = (url, cb) => { 60 | if (isSurge()) { 61 | $httpClient.post(url, cb) 62 | } 63 | if (isQuanX()) { 64 | url.method = 'POST' 65 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 66 | } 67 | } 68 | done = (value = {}) => { 69 | $done(value) 70 | } 71 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 72 | } 73 | -------------------------------------------------------------------------------- /feng/README.md: -------------------------------------------------------------------------------- 1 | # 威锋网 (APP) 2 | 3 | ## 配置 (Surge) 4 | 5 | ```properties 6 | [MITM] 7 | 49.234.36.200:9091 8 | 9 | [Script] 10 | Rewrite: feng = type=http-request,pattern=^http:\/\/49.234.36.200:9091\/v1\/auth\/signin,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.cookie.js,requires-body=true 11 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.js 12 | ``` 13 | 14 | ## 配置 (QuanX) 15 | 16 | ```properties 17 | [MITM] 18 | 49.234.36.200:9091 19 | 20 | [rewrite_local] 21 | ^http:\/\/49.234.36.200:9091\/v1\/auth\/signin url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.cookie.js 22 | 23 | [task_local] 24 | 1 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.js 25 | ``` 26 | 27 | ## 配置 (Loon) 28 | 29 | ```properties 30 | [MITM] 31 | 49.234.36.200:9091 32 | 33 | [rewrite_local] 34 | http-request ^http:\/\/49.234.36.200:9091\/v1\/auth\/signin script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.cookie.js, requires-body=true, tag=Rewrite: feng 35 | 36 | [task_local] 37 | cron "1 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/feng/feng.js 38 | ``` 39 | 40 | ## 说明 41 | 42 | 1. 配置重写 43 | 2. 在 `威锋网` APP 下使用 账号密码 方式登录 44 | 3. 提示 `获取会话: 成功` 45 | 4. 注释重写 46 | 47 | ## 感谢 48 | 49 | [@wangfei021325](https://github.com/wangfei021325) 50 | -------------------------------------------------------------------------------- /fenqile/fenqile.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '分期乐' 2 | const signurlKey = 'senku_signurl_fenqile' 3 | const signheaderKey = 'senku_signheader_fenqile' 4 | const signbodyKey = 'senku_signbody_fenqile' 5 | const signDailyKey = 'senku_signDailyKey_fenqile' 6 | const signDailyUrlKey = 'senku_signDailyUrlKey_fenqile' 7 | const senku = init() 8 | 9 | const requrl = $request.url 10 | if ($request && $request.method != 'OPTIONS' && requrl.match(/\/route0014\/star\/sign\//)) { 11 | const signurlVal = requrl 12 | const signheaderVal = JSON.stringify($request.headers) 13 | const signbodyVal = $request.body 14 | if (signurlVal) senku.setdata(signurlVal, signurlKey) 15 | if (signheaderVal) senku.setdata(signheaderVal, signheaderKey) 16 | if (signbodyVal) senku.setdata(signbodyVal, signbodyKey) 17 | senku.msg(cookieName, `获取Cookie: 成功`, `签到领乐星`) 18 | } else { 19 | const signDailyUrlVal = $request.url 20 | const signDailyVal = $request.body; 21 | if (signDailyUrlVal) senku.setdata(signDailyUrlVal,signDailyUrlKey) 22 | if (signDailyVal) senku.setdata(signDailyVal,signDailyKey) 23 | senku.msg(cookieName, `获取Cookie: 成功`, `天天领乐星`) 24 | senku.log() 25 | } 26 | 27 | function init() { 28 | isSurge = () => { 29 | return undefined === this.$httpClient ? false : true 30 | } 31 | isQuanX = () => { 32 | return undefined === this.$task ? false : true 33 | } 34 | getdata = (key) => { 35 | if (isSurge()) return $persistentStore.read(key) 36 | if (isQuanX()) return $prefs.valueForKey(key) 37 | } 38 | setdata = (key, val) => { 39 | if (isSurge()) return $persistentStore.write(key, val) 40 | if (isQuanX()) return $prefs.setValueForKey(key, val) 41 | } 42 | msg = (title, subtitle, body) => { 43 | if (isSurge()) $notification.post(title, subtitle, body) 44 | if (isQuanX()) $notify(title, subtitle, body) 45 | } 46 | log = (message) => console.log(message) 47 | get = (url, cb) => { 48 | if (isSurge()) { 49 | $httpClient.get(url, cb) 50 | } 51 | if (isQuanX()) { 52 | url.method = 'GET' 53 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 54 | } 55 | } 56 | post = (url, cb) => { 57 | if (isSurge()) { 58 | $httpClient.post(url, cb) 59 | } 60 | if (isQuanX()) { 61 | url.method = 'POST' 62 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 63 | } 64 | } 65 | done = (value = {}) => { 66 | $done(value) 67 | } 68 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 69 | } 70 | senku.done() 71 | -------------------------------------------------------------------------------- /flyertea/README.md: -------------------------------------------------------------------------------- 1 | # 飞客茶馆 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > 2020.1.11 QuanX 在`190`版本开始, 获取 Cookie 方式需要从`script-response-body`改为`script-request-header` 6 | 7 | ## 配置 (Surge) 8 | 9 | ```properties 10 | [MITM] 11 | www.flyert.com 12 | 13 | [Script] 14 | http-request ^https:\/\/www\.flyert\.com\/source\/plugin\/mobile\/mobile\.php\?module=getdata&.* script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/flyertea/flyertea.cookie.js 15 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/flyertea/flyertea.js 16 | ``` 17 | 18 | ## 配置 (QuanX) 19 | 20 | ```properties 21 | [MITM] 22 | www.flyert.com 23 | 24 | [rewrite_local] 25 | # 189及以前版本 26 | ^https:\/\/www\.flyert\.com\/source\/plugin\/mobile\/mobile\.php\?module=getdata&.* url script-response-body flyertea.cookie.js 27 | # 190及以后版本 28 | ^https:\/\/www\.flyert\.com\/source\/plugin\/mobile\/mobile\.php\?module=getdata&.* url script-request-header flyertea.cookie.js 29 | 30 | [task_local] 31 | 1 0 * * * flyertea.js 32 | ``` 33 | 34 | ## 说明 35 | 36 | 1. 先把`www.flyert.com`加到`[MITM]` 37 | 2. 再配置重写规则: 38 | - Surge: 把两条远程脚本放到`[Script]` 39 | - QuanX: 把`flyertea.cookie.js`和`flyertea.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 40 | 3. 打开 APP, 访问下`个人中心` 41 | 4. 系统提示: `获取Cookie: 成功` (如果不提示获取成功, 尝试杀进程再进个人中心) 42 | 5. 最后就可以把第 1 条脚本注释掉了 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 | -------------------------------------------------------------------------------- /flyertea/flyertea.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '飞客茶馆' 2 | const cookieKey = 'chavy_cookie_flyertea' 3 | const tokenKey = 'chavy_token_flyertea' 4 | const chavy = init() 5 | const cookieVal = $request.headers['Cookie'] 6 | if (cookieVal) { 7 | if (chavy.setdata(cookieVal, cookieKey)) { 8 | chavy.msg(`${cookieName}`, '获取Cookie: 成功', '') 9 | chavy.log(`[${cookieName}] 获取Cookie: 成功, cookie: ${cookieVal}`) 10 | } 11 | } 12 | 13 | const queryparam = $request.url.split('?')[1] 14 | if (queryparam) { 15 | const params = {} 16 | for (param of $request.url.split('?')[1].split('&')) { 17 | params[param.split('=')[0]] = param.split('=')[1] 18 | } 19 | const token = JSON.stringify(params) 20 | if (chavy.setdata(token, tokenKey)) { 21 | chavy.msg(`${cookieName}`, '获取Token: 成功', '') 22 | chavy.log(`[${cookieName}] 获取Token: 成功, token: ${token}`) 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 | chavy.done() 70 | -------------------------------------------------------------------------------- /gdoil/README.md: -------------------------------------------------------------------------------- 1 | # 加油广东 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > 2020.2.28 更新域名: gdws.nsenz.com > m.gdoil.cn 6 | 7 | ## 配置 (Surge) 8 | 9 | ```properties 10 | [MITM] 11 | m.gdoil.cn 12 | 13 | [Script] 14 | http-request ^https:\/\/m.gdoil.cn\/webapi\/usersign\/addusersign script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/gdoil/gdoil.cookie.js 15 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/gdoil/gdoil.js 16 | ``` 17 | 18 | ## 配置 (QuanX) 19 | 20 | ```properties 21 | [MITM] 22 | m.gdoil.cn 23 | 24 | [rewrite_local] 25 | ^https:\/\/m.gdoil.cn\/webapi\/usersign\/addusersign url script-request-header gdoil.cookie.js 26 | 27 | [task_local] 28 | 1 0 * * * gdoil.js 29 | ``` 30 | 31 | ## 说明 32 | 33 | 1. 先把`m.gdoil.cn`加到`[MITM]` 34 | 2. 再配置重写规则: 35 | - Surge: 把两条远程脚本放到`[Script]` 36 | - QuanX: 把`gdoil.cookie.js`和`gdoil.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 37 | 3. 打开 APP 然后手动签到 1 次, 系统提示: `获取Cookie: 成功` 38 | 4. 最后就可以把第 1 条脚本注释掉了 39 | 5. 运行一次脚本, 如果提示重复签到, 那就算成功了! 40 | 41 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 42 | 43 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 44 | 45 | ## 常见问题 46 | 47 | 1. 无法写入 Cookie 48 | 49 | - 检查 Surge 系统通知权限放开了没 50 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 51 | 52 | 2. 写入 Cookie 成功, 但签到不成功 53 | 54 | - 看看是不是在登录前就写入 Cookie 了 55 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 56 | 57 | 3. 为什么有时成功有时失败 58 | 59 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 60 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 61 | 62 | - `Surge`配置: 63 | 64 | ```properties 65 | # 没有什么是一顿饭解决不了的: 66 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 67 | # 如果有,那就两顿: 68 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 69 | # 实在不行,三顿也能接受: 70 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 71 | 72 | # 再粗暴点,直接: 73 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 74 | ``` 75 | 76 | - `QuanX`配置: 77 | 78 | ```properties 79 | [task_local] 80 | 1 0 * * * xxx.js # 每天00:01执行一次 81 | 2 0 * * * xxx.js # 每天00:02执行一次 82 | 3 0 * * * xxx.js # 每天00:03执行一次 83 | 84 | */60 * * * * xxx.js # 每60分执行一次 85 | ``` 86 | 87 | ## 感谢 88 | 89 | [@NobyDa](https://github.com/NobyDa) 90 | 91 | [@lhie1](https://github.com/lhie1) 92 | 93 | [@ConnersHua](https://github.com/ConnersHua) 94 | -------------------------------------------------------------------------------- /gdoil/gdoil.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '加油广东' 2 | const signurlKey = 'chavy_signurl_gdoil' 3 | const signheaderKey = 'chavy_signheader_gdoil' 4 | const chavy = init() 5 | 6 | if ($request && $request.method != 'OPTIONS') { 7 | const signurlVal = $request.url 8 | const signheaderVal = JSON.stringify($request.headers) 9 | if (signurlVal) chavy.setdata(signurlVal, signurlKey) 10 | if (signheaderVal) chavy.setdata(signheaderVal, signheaderKey) 11 | chavy.msg(cookieName, `获取Cookie: 成功`, ``) 12 | } 13 | 14 | function init() { 15 | isSurge = () => { 16 | return undefined === this.$httpClient ? false : true 17 | } 18 | isQuanX = () => { 19 | return undefined === this.$task ? false : true 20 | } 21 | getdata = (key) => { 22 | if (isSurge()) return $persistentStore.read(key) 23 | if (isQuanX()) return $prefs.valueForKey(key) 24 | } 25 | setdata = (key, val) => { 26 | if (isSurge()) return $persistentStore.write(key, val) 27 | if (isQuanX()) return $prefs.setValueForKey(key, val) 28 | } 29 | msg = (title, subtitle, body) => { 30 | if (isSurge()) $notification.post(title, subtitle, body) 31 | if (isQuanX()) $notify(title, subtitle, body) 32 | } 33 | log = (message) => console.log(message) 34 | get = (url, cb) => { 35 | if (isSurge()) { 36 | $httpClient.get(url, cb) 37 | } 38 | if (isQuanX()) { 39 | url.method = 'GET' 40 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 41 | } 42 | } 43 | post = (url, cb) => { 44 | if (isSurge()) { 45 | $httpClient.post(url, cb) 46 | } 47 | if (isQuanX()) { 48 | url.method = 'POST' 49 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 50 | } 51 | } 52 | done = (value = {}) => { 53 | $done(value) 54 | } 55 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 56 | } 57 | chavy.done() 58 | -------------------------------------------------------------------------------- /gdoil/gdoil.js: -------------------------------------------------------------------------------- 1 | const cookieName = '加油广东' 2 | const signurlKey = 'chavy_signurl_gdoil' 3 | const signheaderKey = 'chavy_signheader_gdoil' 4 | const chavy = init() 5 | const signurlVal = chavy.getdata(signurlKey) 6 | const signheaderVal = chavy.getdata(signheaderKey) 7 | 8 | sign() 9 | 10 | function sign() { 11 | const url = { url: signurlVal, headers: JSON.parse(signheaderVal) } 12 | url.body = '{}' 13 | chavy.post(url, (error, response, data) => { 14 | chavy.log(`${cookieName}, data: ${data}`) 15 | const result = JSON.parse(data) 16 | const title = `${cookieName}` 17 | let subTitle = '' 18 | let detail = '' 19 | if (result.result == true) { 20 | subTitle = `签到结果: 成功` 21 | } else { 22 | if (result.msg.indexOf('已经签到') >= 0) subTitle = `签到结果: 成功 (重复签到)` 23 | else subTitle = `签到结果: 失败` 24 | detail = `说明: ${result.msg}` 25 | } 26 | chavy.msg(title, subTitle, detail) 27 | chavy.done() 28 | }) 29 | } 30 | 31 | function init() { 32 | isSurge = () => { 33 | return undefined === this.$httpClient ? false : true 34 | } 35 | isQuanX = () => { 36 | return undefined === this.$task ? false : true 37 | } 38 | getdata = (key) => { 39 | if (isSurge()) return $persistentStore.read(key) 40 | if (isQuanX()) return $prefs.valueForKey(key) 41 | } 42 | setdata = (key, val) => { 43 | if (isSurge()) return $persistentStore.write(key, val) 44 | if (isQuanX()) return $prefs.setValueForKey(key, val) 45 | } 46 | msg = (title, subtitle, body) => { 47 | if (isSurge()) $notification.post(title, subtitle, body) 48 | if (isQuanX()) $notify(title, subtitle, body) 49 | } 50 | log = (message) => console.log(message) 51 | get = (url, cb) => { 52 | if (isSurge()) { 53 | $httpClient.get(url, cb) 54 | } 55 | if (isQuanX()) { 56 | url.method = 'GET' 57 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 58 | } 59 | } 60 | post = (url, cb) => { 61 | if (isSurge()) { 62 | $httpClient.post(url, cb) 63 | } 64 | if (isQuanX()) { 65 | url.method = 'POST' 66 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 67 | } 68 | } 69 | done = (value = {}) => { 70 | $done(value) 71 | } 72 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 73 | } 74 | -------------------------------------------------------------------------------- /hellobike/README.md: -------------------------------------------------------------------------------- 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) 103 | -------------------------------------------------------------------------------- /hycan/hycan.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = 'HYCAN合创' 2 | const signurlKey = 'signurl_hycan' 3 | const signheaderKey = 'signheader_hycan' 4 | const hycan = init() 5 | 6 | if ($request && $request.method == 'POST') { 7 | const signurlVal = $request.url 8 | const signheaderVal = JSON.stringify($request.headers) 9 | 10 | if (signurlVal) hycan.setdata(signurlVal, signurlKey) 11 | if (signheaderVal) hycan.setdata(signheaderVal, signheaderKey) 12 | hycan.msg(cookieName, `获取Cookie: 成功`, ``) 13 | } 14 | 15 | function init() { 16 | isSurge = () => { 17 | return undefined === this.$httpClient ? false : true 18 | } 19 | isQuanX = () => { 20 | return undefined === this.$task ? false : true 21 | } 22 | getdata = (key) => { 23 | if (isSurge()) return $persistentStore.read(key) 24 | if (isQuanX()) return $prefs.valueForKey(key) 25 | } 26 | setdata = (key, val) => { 27 | if (isSurge()) return $persistentStore.write(key, val) 28 | if (isQuanX()) return $prefs.setValueForKey(key, val) 29 | } 30 | msg = (title, subtitle, body) => { 31 | if (isSurge()) $notification.post(title, subtitle, body) 32 | if (isQuanX()) $notify(title, subtitle, body) 33 | } 34 | log = (message) => console.log(message) 35 | get = (url, cb) => { 36 | if (isSurge()) { 37 | $httpClient.get(url, cb) 38 | } 39 | if (isQuanX()) { 40 | url.method = 'GET' 41 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 42 | } 43 | } 44 | post = (url, cb) => { 45 | if (isSurge()) { 46 | $httpClient.post(url, cb) 47 | } 48 | if (isQuanX()) { 49 | url.method = 'POST' 50 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 51 | } 52 | } 53 | put = (url, cb) => { 54 | if (isSurge()) { 55 | $httpClient.put(url, cb) 56 | } 57 | if (isQuanX()) { 58 | url.method = 'PUT' 59 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 60 | } 61 | } 62 | done = (value = {}) => { 63 | $done(value) 64 | } 65 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, put, done } 66 | } 67 | hycan.done() -------------------------------------------------------------------------------- /hycan/hycan.js: -------------------------------------------------------------------------------- 1 | const cookieName = 'HYCAN合创' 2 | const signurlKey = 'signurl_hycan' 3 | const signheaderKey = 'signheader_hycan' 4 | const hycan = init() 5 | const signurlVal = hycan.getdata(signurlKey) 6 | const signheaderVal = hycan.getdata(signheaderKey) 7 | 8 | sign() 9 | 10 | function sign() { 11 | const url = { url: signurlVal, headers: JSON.parse(signheaderVal) } 12 | hycan.post(url, (error, response, data) => { 13 | hycan.log(`${cookieName}, data: ${data}`) 14 | const title = `${cookieName}` 15 | let subTitle = '' 16 | let detail = '' 17 | const result = JSON.parse(data) 18 | if (result.data.addScore == true) { 19 | subTitle = `签到结果: 成功` 20 | detail = `签到积分: ${result.data.score}, 签到详情: ${result.data.msg}` 21 | } else if (result.data.addScore == false) { 22 | subTitle = `签到结果: 成功 (重复签到)` 23 | } else { 24 | subTitle = `签到结果: 失败` 25 | detail = `说明: token失效, ${result.msg}` 26 | } 27 | hycan.msg(title, subTitle, detail) 28 | hycan.done() 29 | }) 30 | } 31 | 32 | function init() { 33 | isSurge = () => { 34 | return undefined === this.$httpClient ? false : true 35 | } 36 | isQuanX = () => { 37 | return undefined === this.$task ? false : true 38 | } 39 | getdata = (key) => { 40 | if (isSurge()) return $persistentStore.read(key) 41 | if (isQuanX()) return $prefs.valueForKey(key) 42 | } 43 | setdata = (key, val) => { 44 | if (isSurge()) return $persistentStore.write(key, val) 45 | if (isQuanX()) return $prefs.setValueForKey(key, val) 46 | } 47 | msg = (title, subtitle, body) => { 48 | if (isSurge()) $notification.post(title, subtitle, body) 49 | if (isQuanX()) $notify(title, subtitle, body) 50 | } 51 | log = (message) => console.log(message) 52 | get = (url, cb) => { 53 | if (isSurge()) { 54 | $httpClient.get(url, cb) 55 | } 56 | if (isQuanX()) { 57 | url.method = 'GET' 58 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 59 | } 60 | } 61 | post = (url, cb) => { 62 | if (isSurge()) { 63 | $httpClient.post(url, cb) 64 | } 65 | if (isQuanX()) { 66 | url.method = 'POST' 67 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 68 | } 69 | } 70 | put = (url, cb) => { 71 | if (isSurge()) { 72 | $httpClient.put(url, cb) 73 | } 74 | if (isQuanX()) { 75 | url.method = 'PUT' 76 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 77 | } 78 | } 79 | done = (value = {}) => { 80 | $done(value) 81 | } 82 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, put, done } 83 | } 84 | -------------------------------------------------------------------------------- /jd/jd.618.cookie.sgmodule: -------------------------------------------------------------------------------- 1 | #!name=Chavy iOS JD618 Cookies Module 2 | #!desc=获取京东 618 活动会话信息 3 | #!system=ios 4 | 5 | [Script] 6 | Rewrite: JD618 = type=http-request,pattern=^https:\/\/api.m.jd.com\/client.action\?functionId=cakebaker_getHomeData,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/jd/jd.618.cookie.js,requires-body=true,debug=true 7 | 8 | [MITM] 9 | hostname = %INSERT%, api.m.jd.com -------------------------------------------------------------------------------- /jd/jd.618.sgmodule: -------------------------------------------------------------------------------- 1 | #!name=Chavy iOS JD618 Task Module 2 | #!desc=执行京东 618 活动任务 3 | #!system=ios 4 | 5 | [Script] 6 | Tasks: JD618 = type=cron,cronexp="10,30,50 0,1 * * *",script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/jd/jd.618.adapt.js,wake-system=true,timeout=1200 7 | Tasks: JD618.Boom = type=cron,cronexp="0 10,12,18,20,21 * * *",script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/jd/jd.618.boom.js,wake-system=true 8 | Tasks: JD618.Boom = type=cron,cronexp="30 21 * * *",script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/jd/jd.618.boom.js,wake-system=true -------------------------------------------------------------------------------- /jddj/jddj.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '京东到家' 2 | const signheaderKey = 'chen_signheader_jddj' 3 | const chen = init() 4 | if (this.$request) { 5 | const signheaderVal = JSON.stringify($request.headers) 6 | if (signheaderVal) { 7 | chen.setdata(signheaderVal, signheaderKey) 8 | chen.msg(cookieName, `获取Cookie: 成功`, ``) 9 | } 10 | } 11 | function init() { 12 | isSurge = () => { 13 | return undefined === this.$httpClient ? false : true 14 | } 15 | isQuanX = () => { 16 | return undefined === this.$task ? false : true 17 | } 18 | getdata = (key) => { 19 | if (isSurge()) return $persistentStore.read(key) 20 | if (isQuanX()) return $prefs.valueForKey(key) 21 | } 22 | setdata = (key, val) => { 23 | if (isSurge()) return $persistentStore.write(key, val) 24 | if (isQuanX()) return $prefs.setValueForKey(key, val) 25 | } 26 | msg = (title, subtitle, body) => { 27 | if (isSurge()) $notification.post(title, subtitle, body) 28 | if (isQuanX()) $notify(title, subtitle, body) 29 | } 30 | log = (message) => console.log(message) 31 | get = (url, cb) => { 32 | if (isSurge()) { 33 | $httpClient.get(url, cb) 34 | } 35 | if (isQuanX()) { 36 | url.method = 'GET' 37 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 38 | } 39 | } 40 | post = (url, cb) => { 41 | if (isSurge()) { 42 | $httpClient.post(url, cb) 43 | } 44 | if (isQuanX()) { 45 | url.method = 'POST' 46 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 47 | } 48 | } 49 | done = (value = {}) => { 50 | $done(value) 51 | } 52 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 53 | } 54 | chen.done() 55 | -------------------------------------------------------------------------------- /jddj/jddj.js: -------------------------------------------------------------------------------- 1 | const cookieName ='京东到家' 2 | const signheaderKey = 'chen_signheader_jddj' 3 | const chen = init() 4 | const signheaderVal = chen.getdata(signheaderKey) 5 | sign() 6 | function sign() { 7 | let url = {url: `https://daojia.jd.com/client?functionId=signin%2FuserSigninNew&body=%7B%7D`,headers: JSON.parse(signheaderVal)} 8 | chen.get(url, (error, response, data) => { 9 | chen.log(`${cookieName}, data: ${data}`) 10 | let res = JSON.parse(data) 11 | const title = `${cookieName}` 12 | let subTitle = `` 13 | let detail = `` 14 | if (res.success&&res.result.points!='undefined') { 15 | subTitle = `签到结果:成功` 16 | detail = `获取鲜豆:${res.result.points}` 17 | } else if(!res.success&&res.code==202){ 18 | subTitle = `签到结果: 失败` 19 | detail = `说明: ${res.msg}` 20 | } 21 | else if (!res.success&&res.code==-1){ 22 | subTitle = `签到成功,请勿重复操作` 23 | } 24 | else{ 25 | subTitle = `未知错误,截图日志` 26 | } 27 | chen.msg(title, subTitle, detail) 28 | chen.done() 29 | }) 30 | } 31 | 32 | function init() { 33 | isSurge = () => { 34 | return undefined === this.$httpClient ? false : true 35 | } 36 | isQuanX = () => { 37 | return undefined === this.$task ? false : true 38 | } 39 | getdata = (key) => { 40 | if (isSurge()) return $persistentStore.read(key) 41 | if (isQuanX()) return $prefs.valueForKey(key) 42 | } 43 | setdata = (key, val) => { 44 | if (isSurge()) return $persistentStore.write(key, val) 45 | if (isQuanX()) return $prefs.setValueForKey(key, val) 46 | } 47 | msg = (title, subtitle, body) => { 48 | if (isSurge()) $notification.post(title, subtitle, body) 49 | if (isQuanX()) $notify(title, subtitle, body) 50 | } 51 | log = (message) => console.log(message) 52 | get = (url, cb) => { 53 | if (isSurge()) { 54 | $httpClient.get(url, cb) 55 | } 56 | if (isQuanX()) { 57 | url.method = 'GET' 58 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 59 | } 60 | } 61 | post = (url, cb) => { 62 | if (isSurge()) { 63 | $httpClient.post(url, cb) 64 | } 65 | if (isQuanX()) { 66 | url.method = 'POST' 67 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 68 | } 69 | } 70 | done = (value = {}) => { 71 | $done(value) 72 | } 73 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 74 | } 75 | -------------------------------------------------------------------------------- /maomicd/README.md: -------------------------------------------------------------------------------- 1 | # 猫咪音乐网 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | ## 配置 (Surge) 6 | 7 | ```properties 8 | [MITM] 9 | www.maomicd.com 10 | 11 | [Script] 12 | http-request https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/maomicd/maomicd.cookie.js 13 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/maomicd/maomicd.js 14 | ``` 15 | 16 | ## 配置 (QuanX) 17 | 18 | ```properties 19 | [MITM] 20 | www.maomicd.com 21 | 22 | [rewrite_local] 23 | https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url script-request-header maomicd.cookie.js 24 | 25 | [task_local] 26 | 1 0 * * * maomicd.js 27 | ``` 28 | 29 | ## 说明 30 | 31 | 1. 先把`www.maomicd.com`加到`[MITM]` 32 | 2. 再配置重写规则: 33 | - Surge: 把两条远程脚本放到`[Script]` 34 | - QuanX: 把`maomicd.cookie.js`和`maomicd.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 35 | 3. 打开 网站 `https://www.maomicd.com` 然后手动签到 1 次, 系统提示: `获取Cookie: 成功` 36 | 4. 最后就可以把获取 Cookie 的脚本注释掉了 37 | 5. 运行一次脚本, 如果提示重复签到, 那就算成功了! 38 | 39 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 40 | 41 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 42 | 43 | ## 常见问题 44 | 45 | 1. 无法写入 Cookie 46 | 47 | - 检查 Surge 系统通知权限放开了没 48 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 49 | 50 | 2. 写入 Cookie 成功, 但签到不成功 51 | 52 | - 看看是不是在登录前就写入 Cookie 了 53 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 54 | 55 | 3. 为什么有时成功有时失败 56 | 57 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 58 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 59 | 60 | - `Surge`配置: 61 | 62 | ```properties 63 | # 没有什么是一顿饭解决不了的: 64 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 65 | # 如果有,那就两顿: 66 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 67 | # 实在不行,三顿也能接受: 68 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 69 | 70 | # 再粗暴点,直接: 71 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 72 | ``` 73 | 74 | - `QuanX`配置: 75 | 76 | ```properties 77 | [task_local] 78 | 1 0 * * * xxx.js # 每天00:01执行一次 79 | 2 0 * * * xxx.js # 每天00:02执行一次 80 | 3 0 * * * xxx.js # 每天00:03执行一次 81 | 82 | */60 * * * * xxx.js # 每60分执行一次 83 | ``` 84 | 85 | ## 感谢 86 | 87 | [@NobyDa](https://github.com/NobyDa) 88 | 89 | [@lhie1](https://github.com/lhie1) 90 | 91 | [@ConnersHua](https://github.com/ConnersHua) 92 | -------------------------------------------------------------------------------- /maomicd/maomicd.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '猫咪音乐网' 2 | const signurlKey = 'chavy_signurl_maomicd' 3 | const signheaderKey = 'chavy_signheader_maomicd' 4 | const chavy = init() 5 | 6 | if ($request && $request.method != 'OPTIONS') { 7 | const signurlVal = $request.url 8 | const signheaderVal = JSON.stringify($request.headers) 9 | if (signurlVal) chavy.setdata(signurlVal, signurlKey) 10 | if (signheaderVal) chavy.setdata(signheaderVal, signheaderKey) 11 | chavy.msg(cookieName, `获取Cookie: 成功`, ``) 12 | } 13 | 14 | function init() { 15 | isSurge = () => { 16 | return undefined === this.$httpClient ? false : true 17 | } 18 | isQuanX = () => { 19 | return undefined === this.$task ? false : true 20 | } 21 | getdata = (key) => { 22 | if (isSurge()) return $persistentStore.read(key) 23 | if (isQuanX()) return $prefs.valueForKey(key) 24 | } 25 | setdata = (key, val) => { 26 | if (isSurge()) return $persistentStore.write(key, val) 27 | if (isQuanX()) return $prefs.setValueForKey(key, val) 28 | } 29 | msg = (title, subtitle, body) => { 30 | if (isSurge()) $notification.post(title, subtitle, body) 31 | if (isQuanX()) $notify(title, subtitle, body) 32 | } 33 | log = (message) => console.log(message) 34 | get = (url, cb) => { 35 | if (isSurge()) { 36 | $httpClient.get(url, cb) 37 | } 38 | if (isQuanX()) { 39 | url.method = 'GET' 40 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 41 | } 42 | } 43 | post = (url, cb) => { 44 | if (isSurge()) { 45 | $httpClient.post(url, cb) 46 | } 47 | if (isQuanX()) { 48 | url.method = 'POST' 49 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 50 | } 51 | } 52 | done = (value = {}) => { 53 | $done(value) 54 | } 55 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 56 | } 57 | chavy.done() 58 | -------------------------------------------------------------------------------- /maomicd/maomicd.js: -------------------------------------------------------------------------------- 1 | const cookieName = '猫咪音乐网' 2 | const signurlKey = 'chavy_signurl_maomicd' 3 | const signheaderKey = 'chavy_signheader_maomicd' 4 | const chavy = init() 5 | const signurlVal = chavy.getdata(signurlKey) 6 | const signheaderVal = chavy.getdata(signheaderKey) 7 | 8 | sign() 9 | 10 | function sign() { 11 | const url = { url: signurlVal, headers: JSON.parse(signheaderVal) } 12 | chavy.get(url, (error, response, data) => { 13 | chavy.log(`${cookieName}, data: ${data}`) 14 | let subTitle = `` 15 | let detail = `` 16 | let result = data.match(/()<\/root>/) 17 | if (result) { 18 | result = result[2] 19 | if (result == '') subTitle = `签到结果: 成功` 20 | else if (result.indexOf('今日已签') >= 0) subTitle = `签到结果: 成功 (重复签到)` 21 | else (subTitle = `签到结果: 未知`), (detail = `说明: ${result}`) 22 | } else { 23 | subTitle = `签到结果: 失败` 24 | } 25 | chavy.msg(cookieName, subTitle, detail) 26 | chavy.done() 27 | }) 28 | } 29 | 30 | function init() { 31 | isSurge = () => { 32 | return undefined === this.$httpClient ? false : true 33 | } 34 | isQuanX = () => { 35 | return undefined === this.$task ? false : true 36 | } 37 | getdata = (key) => { 38 | if (isSurge()) return $persistentStore.read(key) 39 | if (isQuanX()) return $prefs.valueForKey(key) 40 | } 41 | setdata = (key, val) => { 42 | if (isSurge()) return $persistentStore.write(key, val) 43 | if (isQuanX()) return $prefs.setValueForKey(key, val) 44 | } 45 | msg = (title, subtitle, body) => { 46 | if (isSurge()) $notification.post(title, subtitle, body) 47 | if (isQuanX()) $notify(title, subtitle, body) 48 | } 49 | log = (message) => console.log(message) 50 | get = (url, cb) => { 51 | if (isSurge()) { 52 | $httpClient.get(url, cb) 53 | } 54 | if (isQuanX()) { 55 | url.method = 'GET' 56 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 57 | } 58 | } 59 | post = (url, cb) => { 60 | if (isSurge()) { 61 | $httpClient.post(url, cb) 62 | } 63 | if (isQuanX()) { 64 | url.method = 'POST' 65 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 66 | } 67 | } 68 | done = (value = {}) => { 69 | $done(value) 70 | } 71 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 72 | } 73 | -------------------------------------------------------------------------------- /mcdd/README.md: -------------------------------------------------------------------------------- 1 | # 叮咚买菜 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | ## 配置 (Surge) 6 | 7 | ```properties 8 | [MITM] 9 | maicai.api.ddxq.mobi 10 | 11 | [Script] 12 | http-request ^https:\/\/maicai.api.ddxq.mobi\/point\/home script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mcdd/mcdd.cookie.js 13 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mcdd/mcdd.js 14 | ``` 15 | 16 | ## 配置 (QuanX) 17 | 18 | ```properties 19 | [MITM] 20 | maicai.api.ddxq.mobi 21 | 22 | [rewrite_local] 23 | ^https:\/\/maicai.api.ddxq.mobi\/point\/home url script-request-header mcdd.cookie.js 24 | 25 | [task_local] 26 | 1 0 * * * mcdd.js 27 | ``` 28 | 29 | ## 说明 30 | 31 | 1. 先把`maicai.api.ddxq.mobi`加到`[MITM]` 32 | 2. 再配置重写规则: 33 | - Surge: 把两条远程脚本放到`[Script]` 34 | - QuanX: 把`mcdd.cookie.js`和`mcdd.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 35 | 3. 打开 APP, 访问下`我的`>`积分` 36 | 4. 系统提示: `获取Cookie: 成功` (如果不提示获取成功, 尝试杀进程再进个人中心) 37 | 5. 最后就可以把第 1 条脚本注释掉了 38 | 39 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 40 | 41 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 42 | 43 | ## 常见问题 44 | 45 | 1. 无法写入 Cookie 46 | 47 | - 检查 Surge 系统通知权限放开了没 48 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 49 | 50 | 2. 写入 Cookie 成功, 但签到不成功 51 | 52 | - 看看是不是在登录前就写入 Cookie 了 53 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 54 | 55 | 3. 为什么有时成功有时失败 56 | 57 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 58 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 59 | 60 | - `Surge`配置: 61 | 62 | ```properties 63 | # 没有什么是一顿饭解决不了的: 64 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 65 | # 如果有,那就两顿: 66 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 67 | # 实在不行,三顿也能接受: 68 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 69 | 70 | # 再粗暴点,直接: 71 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 72 | ``` 73 | 74 | - `QuanX`配置: 75 | 76 | ```properties 77 | [task_local] 78 | 1 0 * * * xxx.js # 每天00:01执行一次 79 | 2 0 * * * xxx.js # 每天00:02执行一次 80 | 3 0 * * * xxx.js # 每天00:03执行一次 81 | 82 | */60 * * * * xxx.js # 每60分执行一次 83 | ``` 84 | 85 | ## 感谢 86 | 87 | [@NobyDa](https://github.com/NobyDa) 88 | 89 | [@lhie1](https://github.com/lhie1) 90 | 91 | [@ConnersHua](https://github.com/ConnersHua) 92 | -------------------------------------------------------------------------------- /mcdd/mcdd.cookie.js: -------------------------------------------------------------------------------- 1 | const chavy = init() 2 | const cookieName = '叮咚买菜' 3 | const KEY_homeurl = 'chavy_home_url_mcdd' 4 | const KEY_homeheader = 'chavy_home_header_mcdd' 5 | 6 | if ($request && $request.method != 'OPTIONS') { 7 | try { 8 | chavy.log(`🔔 ${cookieName} 开始获取: Cookies`) 9 | const VAL_homeurl = $request.url 10 | const VAL_homeheader = JSON.stringify($request.headers) 11 | if (VAL_homeurl) { 12 | chavy.setdata(VAL_homeurl, KEY_homeurl) 13 | chavy.log(`❕ ${cookieName} VAL_homeurl: ${VAL_homeurl}`) 14 | } 15 | if (VAL_homeheader) { 16 | chavy.setdata(VAL_homeheader, KEY_homeheader) 17 | chavy.log(`❕ ${cookieName} VAL_homeheader: ${VAL_homeheader}`) 18 | } 19 | chavy.msg(cookieName, `获取Cookie: 成功`, ``) 20 | } catch (e) { 21 | chavy.msg(cookieName, `获取Cookie: 失败`, e) 22 | chavy.log(`❌ ${cookieName} 获取Cookie: 失败: ${e}`) 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 | chavy.done() 70 | -------------------------------------------------------------------------------- /meituan/README.md: -------------------------------------------------------------------------------- 1 | # 美团 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > QuanX 需要: v1.0.6-build195 及以后版本 (TestFlight) 6 | 7 | ## 配置 (Surge) 8 | 9 | ```properties 10 | [MITM] 11 | hostname = i.meituan.com 12 | 13 | [Script] 14 | http-request ^https:\/\/i.meituan.com\/evolve\/signin\/signpost\/ script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/meituan/meituan.cookie.js, requires-body=true 15 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/meituan/meituan.js 16 | ``` 17 | 18 | ## 配置 (QuanX) 19 | 20 | ```properties 21 | [MITM] 22 | i.meituan.com 23 | 24 | [rewrite_local] 25 | 26 | # [商店版] QuanX v1.0.6-build194 及更早版本 27 | # 不支持 28 | 29 | # [TestFlight] QuanX v1.0.6-build195 及以后版本 30 | ^https:\/\/i.meituan.com\/evolve\/signin\/signpost\/ url script-request-body meituan.cookie.js 31 | 32 | [task_local] 33 | 1 0 * * * meituan.js 34 | ``` 35 | 36 | ## 说明 37 | 38 | 1. 先把`i.meituan.com`加到`[MITM]` 39 | 2. 再配置重写规则: 40 | - Surge: 把两条远程脚本放到`[Script]` 41 | - QuanX: 把`meituan.cookie.js`和`meituan.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 42 | 3. 打开 APP , 然后手动签到 1 次, 系统提示: `获取Cookie: 成功` (`首页` > `红包签到`) 43 | 4. 把获取 Cookie 的脚本注释掉 44 | 5. 运行一次脚本, 如果提示重复签到, 那就算成功了! 45 | 46 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 47 | 48 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 49 | 50 | ## 常见问题 51 | 52 | 1. 无法写入 Cookie 53 | 54 | - 检查 Surge 系统通知权限放开了没 55 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 56 | 57 | 2. 写入 Cookie 成功, 但签到不成功 58 | 59 | - 看看是不是在登录前就写入 Cookie 了 60 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 61 | 62 | 3. 为什么有时成功有时失败 63 | 64 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 65 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 66 | 67 | - `Surge`配置: 68 | 69 | ```properties 70 | # 没有什么是一顿饭解决不了的: 71 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 72 | # 如果有,那就两顿: 73 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 74 | # 实在不行,三顿也能接受: 75 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 76 | 77 | # 再粗暴点,直接: 78 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 79 | ``` 80 | 81 | - `QuanX`配置: 82 | 83 | ```properties 84 | [task_local] 85 | 1 0 * * * xxx.js # 每天00:01执行一次 86 | 2 0 * * * xxx.js # 每天00:02执行一次 87 | 3 0 * * * xxx.js # 每天00:03执行一次 88 | 89 | */60 * * * * xxx.js # 每60分执行一次 90 | ``` 91 | 92 | ## 感谢 93 | 94 | [@NobyDa](https://github.com/NobyDa) 95 | 96 | [@lhie1](https://github.com/lhie1) 97 | 98 | [@ConnersHua](https://github.com/ConnersHua) 99 | -------------------------------------------------------------------------------- /meituan/meituan.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '美团' 2 | const tokenurlKey = 'chavy_tokenurl_meituan' 3 | const tokenheaderKey = 'chavy_tokenheader_meituan' 4 | const signurlKey = 'chavy_signurl_meituan' 5 | const signheaderKey = 'chavy_signheader_meituan' 6 | const signbodyKey = 'chavy_signbody_meituan' 7 | const chavy = init() 8 | 9 | const requrl = $request.url 10 | if ($request && $request.method != 'OPTIONS' && requrl.match(/\/evolve\/signin\/signpost\//)) { 11 | const signurlVal = requrl 12 | const signheaderVal = JSON.stringify($request.headers) 13 | const signbodyVal = $request.body 14 | if (signurlVal) chavy.setdata(signurlVal, signurlKey) 15 | if (signheaderVal) chavy.setdata(signheaderVal, signheaderKey) 16 | if (signbodyVal) chavy.setdata(signbodyVal, signbodyKey) 17 | chavy.msg(cookieName, `获取Cookie: 成功`, ``) 18 | } 19 | 20 | function init() { 21 | isSurge = () => { 22 | return undefined === this.$httpClient ? false : true 23 | } 24 | isQuanX = () => { 25 | return undefined === this.$task ? false : true 26 | } 27 | getdata = (key) => { 28 | if (isSurge()) return $persistentStore.read(key) 29 | if (isQuanX()) return $prefs.valueForKey(key) 30 | } 31 | setdata = (key, val) => { 32 | if (isSurge()) return $persistentStore.write(key, val) 33 | if (isQuanX()) return $prefs.setValueForKey(key, val) 34 | } 35 | msg = (title, subtitle, body) => { 36 | if (isSurge()) $notification.post(title, subtitle, body) 37 | if (isQuanX()) $notify(title, subtitle, body) 38 | } 39 | log = (message) => console.log(message) 40 | get = (url, cb) => { 41 | if (isSurge()) { 42 | $httpClient.get(url, cb) 43 | } 44 | if (isQuanX()) { 45 | url.method = 'GET' 46 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 47 | } 48 | } 49 | post = (url, cb) => { 50 | if (isSurge()) { 51 | $httpClient.post(url, cb) 52 | } 53 | if (isQuanX()) { 54 | url.method = 'POST' 55 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 56 | } 57 | } 58 | done = (value = {}) => { 59 | $done(value) 60 | } 61 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 62 | } 63 | chavy.done() 64 | -------------------------------------------------------------------------------- /mgtv/README.md: -------------------------------------------------------------------------------- 1 | # 芒果 TV 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | ## 配置 (Surge) 6 | 7 | ```properties 8 | [MITM] 9 | credits.bz.mgtv.com 10 | 11 | [Script] 12 | http-request ^https:\/\/credits.bz.mgtv.com\/user\/creditsTake script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mgtv/mgtv.cookie.js 13 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mgtv/mgtv.js 14 | ``` 15 | 16 | ## 配置 (QuanX) 17 | 18 | ```properties 19 | [MITM] 20 | credits.bz.mgtv.com 21 | 22 | [rewrite_local] 23 | ^https:\/\/credits.bz.mgtv.com\/user\/creditsTake url script-request-header mgtv.cookie.js 24 | 25 | [task_local] 26 | 1 0 * * * mgtv.js 27 | ``` 28 | 29 | ## 说明 30 | 31 | 1. 先把`credits.bz.mgtv.com`加到`[MITM]` 32 | 2. 再配置重写规则: 33 | - Surge: 把两条远程脚本放到`[Script]` 34 | - QuanX: 把`mgtv.cookie.js`和`mgtv.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 35 | 3. 打开 APP 然后手动签到 1 次, 系统提示: `获取Cookie: 成功` 36 | 4. 最后就可以把第 1 条脚本注释掉了 37 | 5. 运行一次脚本, 如果提示重复签到, 那就算成功了! 38 | 39 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 40 | 41 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 42 | 43 | ## 常见问题 44 | 45 | 1. 无法写入 Cookie 46 | 47 | - 检查 Surge 系统通知权限放开了没 48 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 49 | 50 | 2. 写入 Cookie 成功, 但签到不成功 51 | 52 | - 看看是不是在登录前就写入 Cookie 了 53 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 54 | 55 | 3. 为什么有时成功有时失败 56 | 57 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 58 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 59 | 60 | - `Surge`配置: 61 | 62 | ```properties 63 | # 没有什么是一顿饭解决不了的: 64 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 65 | # 如果有,那就两顿: 66 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 67 | # 实在不行,三顿也能接受: 68 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 69 | 70 | # 再粗暴点,直接: 71 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 72 | ``` 73 | 74 | - `QuanX`配置: 75 | 76 | ```properties 77 | [task_local] 78 | 1 0 * * * xxx.js # 每天00:01执行一次 79 | 2 0 * * * xxx.js # 每天00:02执行一次 80 | 3 0 * * * xxx.js # 每天00:03执行一次 81 | 82 | */60 * * * * xxx.js # 每60分执行一次 83 | ``` 84 | 85 | ## 感谢 86 | 87 | [@NobyDa](https://github.com/NobyDa) 88 | 89 | [@lhie1](https://github.com/lhie1) 90 | 91 | [@ConnersHua](https://github.com/ConnersHua) 92 | -------------------------------------------------------------------------------- /mgtv/mgtv.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '芒果TV' 2 | const signurlKey = 'chavy_signurl_mgtv' 3 | const signheaderKey = 'chavy_signheader_mgtv' 4 | const chavy = init() 5 | 6 | if ($request && $request.method != 'OPTIONS') { 7 | const signurlVal = $request.url 8 | const signheaderVal = JSON.stringify($request.headers) 9 | if (signurlVal) chavy.setdata(signurlVal, signurlKey) 10 | if (signheaderVal) chavy.setdata(signheaderVal, signheaderKey) 11 | chavy.msg(cookieName, `获取Cookie: 成功`, ``) 12 | } 13 | 14 | function init() { 15 | isSurge = () => { 16 | return undefined === this.$httpClient ? false : true 17 | } 18 | isQuanX = () => { 19 | return undefined === this.$task ? false : true 20 | } 21 | getdata = (key) => { 22 | if (isSurge()) return $persistentStore.read(key) 23 | if (isQuanX()) return $prefs.valueForKey(key) 24 | } 25 | setdata = (key, val) => { 26 | if (isSurge()) return $persistentStore.write(key, val) 27 | if (isQuanX()) return $prefs.setValueForKey(key, val) 28 | } 29 | msg = (title, subtitle, body) => { 30 | if (isSurge()) $notification.post(title, subtitle, body) 31 | if (isQuanX()) $notify(title, subtitle, body) 32 | } 33 | log = (message) => console.log(message) 34 | get = (url, cb) => { 35 | if (isSurge()) { 36 | $httpClient.get(url, cb) 37 | } 38 | if (isQuanX()) { 39 | url.method = 'GET' 40 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 41 | } 42 | } 43 | post = (url, cb) => { 44 | if (isSurge()) { 45 | $httpClient.post(url, cb) 46 | } 47 | if (isQuanX()) { 48 | url.method = 'POST' 49 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 50 | } 51 | } 52 | done = (value = {}) => { 53 | $done(value) 54 | } 55 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 56 | } 57 | chavy.done() 58 | -------------------------------------------------------------------------------- /mgtv/mgtv.js: -------------------------------------------------------------------------------- 1 | const cookieName = '芒果TV' 2 | const signurlKey = 'chavy_signurl_mgtv' 3 | const signheaderKey = 'chavy_signheader_mgtv' 4 | const chavy = init() 5 | const signurlVal = chavy.getdata(signurlKey) 6 | const signheaderVal = chavy.getdata(signheaderKey) 7 | 8 | sign() 9 | 10 | function sign() { 11 | const url = { url: signurlVal, headers: JSON.parse(signheaderVal) } 12 | url.body = '{}' 13 | chavy.post(url, (error, response, data) => { 14 | chavy.log(`${cookieName}, data: ${data}`) 15 | const title = `${cookieName}` 16 | let subTitle = '' 17 | let detail = '' 18 | const result = JSON.parse(data.match(/\(([^\)]*)\)/)[1]) 19 | if (result.code == 200) { 20 | subTitle = `签到结果: 成功` 21 | detail = `共签: ${result.data.curDay}天, 连签: ${result.data.curDayTotal}天, 积分: ${result.data.balance} +${result.data.credits})` 22 | } else if (result.code == 1002) { 23 | subTitle = `签到结果: 成功 (重复签到)` 24 | } else { 25 | subTitle = `签到结果: 失败` 26 | detail = `编码: ${result.code}, 说明: ${result.msg}` 27 | } 28 | chavy.msg(title, subTitle, detail) 29 | chavy.done() 30 | }) 31 | } 32 | 33 | function init() { 34 | isSurge = () => { 35 | return undefined === this.$httpClient ? false : true 36 | } 37 | isQuanX = () => { 38 | return undefined === this.$task ? false : true 39 | } 40 | getdata = (key) => { 41 | if (isSurge()) return $persistentStore.read(key) 42 | if (isQuanX()) return $prefs.valueForKey(key) 43 | } 44 | setdata = (key, val) => { 45 | if (isSurge()) return $persistentStore.write(key, val) 46 | if (isQuanX()) return $prefs.setValueForKey(key, val) 47 | } 48 | msg = (title, subtitle, body) => { 49 | if (isSurge()) $notification.post(title, subtitle, body) 50 | if (isQuanX()) $notify(title, subtitle, body) 51 | } 52 | log = (message) => console.log(message) 53 | get = (url, cb) => { 54 | if (isSurge()) { 55 | $httpClient.get(url, cb) 56 | } 57 | if (isQuanX()) { 58 | url.method = 'GET' 59 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 60 | } 61 | } 62 | post = (url, cb) => { 63 | if (isSurge()) { 64 | $httpClient.post(url, cb) 65 | } 66 | if (isQuanX()) { 67 | url.method = 'POST' 68 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 69 | } 70 | } 71 | done = (value = {}) => { 72 | $done(value) 73 | } 74 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 75 | } 76 | -------------------------------------------------------------------------------- /mihoyo/README.md: -------------------------------------------------------------------------------- 1 | # 米游社 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | ## 配置 (Surge) 6 | 7 | ```properties 8 | [MITM] 9 | api-takumi.mihoyo.com 10 | 11 | [Script] 12 | http-request ^https:\/\/api-takumi.mihoyo.com\/apihub\/api\/getGameList script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mihoyo/mihoyo.cookie.js 13 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mihoyo/mihoyo.js 14 | ``` 15 | 16 | ## 配置 (QuanX) 17 | 18 | ```properties 19 | [MITM] 20 | api-takumi.mihoyo.com 21 | 22 | [rewrite_local] 23 | ^https:\/\/api-takumi.mihoyo.com\/apihub\/api\/getGameList url script-request-header mihoyo.cookie.js 24 | 25 | [task_local] 26 | 1 0 * * * mihoyo.js 27 | ``` 28 | 29 | ## 说明 30 | 31 | 1. 先把`api-takumi.mihoyo.com`加到`[MITM]` 32 | 2. 再配置重写规则: 33 | - Surge: 把两条远程脚本放到`[Script]` 34 | - QuanX: 把`mihoyo.cookie.js`和`mihoyo.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 35 | 3. 打开 APP , 系统提示: `获取Cookie: 成功` 36 | 4. 最后就可以把第 1 条脚本注释掉了 37 | 5. 运行一次脚本, 如果提示重复签到, 那就算成功了! 38 | 39 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 40 | 41 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 42 | 43 | ## 常见问题 44 | 45 | 1. 无法写入 Cookie 46 | 47 | - 检查 Surge 系统通知权限放开了没 48 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 49 | 50 | 2. 写入 Cookie 成功, 但签到不成功 51 | 52 | - 看看是不是在登录前就写入 Cookie 了 53 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 54 | 55 | 3. 为什么有时成功有时失败 56 | 57 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 58 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 59 | 60 | - `Surge`配置: 61 | 62 | ```properties 63 | # 没有什么是一顿饭解决不了的: 64 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 65 | # 如果有,那就两顿: 66 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 67 | # 实在不行,三顿也能接受: 68 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 69 | 70 | # 再粗暴点,直接: 71 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 72 | ``` 73 | 74 | - `QuanX`配置: 75 | 76 | ```properties 77 | [task_local] 78 | 1 0 * * * xxx.js # 每天00:01执行一次 79 | 2 0 * * * xxx.js # 每天00:02执行一次 80 | 3 0 * * * xxx.js # 每天00:03执行一次 81 | 82 | */60 * * * * xxx.js # 每60分执行一次 83 | ``` 84 | 85 | ## 感谢 86 | 87 | [@NobyDa](https://github.com/NobyDa) 88 | 89 | [@lhie1](https://github.com/lhie1) 90 | 91 | [@ConnersHua](https://github.com/ConnersHua) 92 | -------------------------------------------------------------------------------- /mihoyo/mihoyo.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '米游社' 2 | const signurlKey = 'chavy_signurl_mihoyo' 3 | const signheaderKey = 'chavy_signheader_mihoyo' 4 | const chavy = init() 5 | 6 | if ($request && $request.method != 'OPTIONS') { 7 | const signurlVal = $request.url 8 | const signheaderVal = JSON.stringify($request.headers) 9 | if (signurlVal) chavy.setdata(signurlVal, signurlKey) 10 | if (signheaderVal) chavy.setdata(signheaderVal, signheaderKey) 11 | chavy.msg(cookieName, `获取Cookie: 成功`, ``) 12 | } 13 | 14 | function init() { 15 | isSurge = () => { 16 | return undefined === this.$httpClient ? false : true 17 | } 18 | isQuanX = () => { 19 | return undefined === this.$task ? false : true 20 | } 21 | getdata = (key) => { 22 | if (isSurge()) return $persistentStore.read(key) 23 | if (isQuanX()) return $prefs.valueForKey(key) 24 | } 25 | setdata = (key, val) => { 26 | if (isSurge()) return $persistentStore.write(key, val) 27 | if (isQuanX()) return $prefs.setValueForKey(key, val) 28 | } 29 | msg = (title, subtitle, body) => { 30 | if (isSurge()) $notification.post(title, subtitle, body) 31 | if (isQuanX()) $notify(title, subtitle, body) 32 | } 33 | log = (message) => console.log(message) 34 | get = (url, cb) => { 35 | if (isSurge()) { 36 | $httpClient.get(url, cb) 37 | } 38 | if (isQuanX()) { 39 | url.method = 'GET' 40 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 41 | } 42 | } 43 | post = (url, cb) => { 44 | if (isSurge()) { 45 | $httpClient.post(url, cb) 46 | } 47 | if (isQuanX()) { 48 | url.method = 'POST' 49 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 50 | } 51 | } 52 | done = (value = {}) => { 53 | $done(value) 54 | } 55 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 56 | } 57 | chavy.done() 58 | -------------------------------------------------------------------------------- /neteasemusic/README.md: -------------------------------------------------------------------------------- 1 | # 网易云音乐 2 | 3 | > 2020.6.15 4 | > 5 | > 1. 增加自动重试机制 (BoxJs 可调整次数及间隔) 6 | > 2. 增加等级显示 (需按新方式获取会话) 7 | 8 | ## 配置 (Surge & Loon) 9 | 10 | ```properties 11 | [MITM] 12 | music.163.com 13 | 14 | [Script] 15 | http-request ^https:\/\/music.163.com\/weapi\/user\/level script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.cookie.js,requires-body=true 16 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.js 17 | ``` 18 | 19 | ## 配置 (QuanX) 20 | 21 | ```properties 22 | [MITM] 23 | music.163.com 24 | 25 | [rewrite_local] 26 | ^https:\/\/music.163.com\/weapi\/user\/level url script-request-body neteasemusic.cookie.js 27 | 28 | [task_local] 29 | 1 0 * * * neteasemusic.js 30 | ``` 31 | 32 | ## 说明 33 | 34 | 1. 先登录: 35 | 2. 再访问: 36 | 3. 提示: `获取会话: 成功!` 37 | 38 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 39 | 40 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 41 | 42 | ## 常见问题 43 | 44 | 1. 无法写入 Cookie 45 | 46 | - 检查 Surge 系统通知权限放开了没 47 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 48 | 49 | 2. 写入 Cookie 成功, 但签到不成功 50 | 51 | - 看看是不是在登录前就写入 Cookie 了 52 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 53 | 54 | 3. 为什么有时成功有时失败 55 | 56 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 57 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 58 | 59 | - `Surge`配置: 60 | 61 | ```properties 62 | # 没有什么是一顿饭解决不了的: 63 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 64 | # 如果有,那就两顿: 65 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 66 | # 实在不行,三顿也能接受: 67 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 68 | 69 | # 再粗暴点,直接: 70 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 71 | ``` 72 | 73 | - `QuanX`配置: 74 | 75 | ```properties 76 | [task_local] 77 | 1 0 * * * xxx.js # 每天00:01执行一次 78 | 2 0 * * * xxx.js # 每天00:02执行一次 79 | 3 0 * * * xxx.js # 每天00:03执行一次 80 | 81 | */60 * * * * xxx.js # 每60分执行一次 82 | ``` 83 | 84 | ## 感谢 85 | 86 | [@NobyDa](https://github.com/NobyDa) 87 | 88 | [@lhie1](https://github.com/lhie1) 89 | 90 | [@ConnersHua](https://github.com/ConnersHua) 91 | -------------------------------------------------------------------------------- /neteasemusic/neteasemusic.cookie.js: -------------------------------------------------------------------------------- 1 | const $ = new Env('网易云音乐') 2 | 3 | !(async () => { 4 | $.log('', `🔔 ${$.name}, 获取会话: 开始!`, '') 5 | const session = {} 6 | session.url = $request.url 7 | session.body = $request.body 8 | session.headers = $request.headers 9 | delete session.headers['Content-Length'] 10 | $.log('', `url: ${session.url}`, `body: ${session.body}`, `headers: ${JSON.stringify(session.headers)}`) 11 | if ($.setdata(JSON.stringify(session), 'chavy_cookie_neteasemusic')) { 12 | $.subt = '获取会话: 成功!' 13 | } else { 14 | $.subt = '获取会话: 失败!' 15 | } 16 | })() 17 | .catch((e) => { 18 | $.subt = '获取会话: 失败!' 19 | $.desc = `原因: ${e}` 20 | $.log(`❌ ${$.name}, 获取会话: 失败! 原因: ${e}!`) 21 | }) 22 | .finally(() => { 23 | $.msg($.name, $.subt, $.desc), $.log('', `🔔 ${$.name}, 获取会话: 结束!`, ''), $.done() 24 | }) 25 | 26 | // prettier-ignore 27 | function Env(s){this.name=s,this.data=null,this.logs=[],this.isSurge=(()=>"undefined"!=typeof $httpClient),this.isQuanX=(()=>"undefined"!=typeof $task),this.isNode=(()=>"undefined"!=typeof module&&!!module.exports),this.log=((...s)=>{this.logs=[...this.logs,...s],s?console.log(s.join("\n")):console.log(this.logs.join("\n"))}),this.msg=((s=this.name,t="",i="")=>{this.isSurge()&&$notification.post(s,t,i),this.isQuanX()&&$notify(s,t,i);const e=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];s&&e.push(s),t&&e.push(t),i&&e.push(i),console.log(e.join("\n"))}),this.getdata=(s=>{if(this.isSurge())return $persistentStore.read(s);if(this.isQuanX())return $prefs.valueForKey(s);if(this.isNode()){const t="box.dat";return this.fs=this.fs?this.fs:require("fs"),this.fs.existsSync(t)?(this.data=JSON.parse(this.fs.readFileSync(t)),this.data[s]):null}}),this.setdata=((s,t)=>{if(this.isSurge())return $persistentStore.write(s,t);if(this.isQuanX())return $prefs.setValueForKey(s,t);if(this.isNode()){const i="box.dat";return this.fs=this.fs?this.fs:require("fs"),!!this.fs.existsSync(i)&&(this.data=JSON.parse(this.fs.readFileSync(i)),this.data[t]=s,this.fs.writeFileSync(i,JSON.stringify(this.data)),!0)}}),this.wait=((s,t=s)=>i=>setTimeout(()=>i(),Math.floor(Math.random()*(t-s+1)+s))),this.get=((s,t)=>this.send(s,"GET",t)),this.post=((s,t)=>this.send(s,"POST",t)),this.send=((s,t,i)=>{if(this.isSurge()){const e="POST"==t?$httpClient.post:$httpClient.get;e(s,(s,t,e)=>{t&&(t.body=e,t.statusCode=t.status),i(s,t,e)})}this.isQuanX()&&(s.method=t,$task.fetch(s).then(s=>{s.status=s.statusCode,i(null,s,s.body)},s=>i(s.error,s,s))),this.isNode()&&(this.request=this.request?this.request:require("request"),s.method=t,s.gzip=!0,this.request(s,(s,t,e)=>{t&&(t.status=t.statusCode),i(null,t,e)}))}),this.done=((s={})=>this.isNode()?null:$done(s))} 28 | -------------------------------------------------------------------------------- /neteasemusic/quanx/neteasemusic.cookie.js: -------------------------------------------------------------------------------- 1 | const $ = new Env('网易云音乐') 2 | 3 | !(async () => { 4 | $.log('', `🔔 ${$.name}, 获取会话: 开始!`, '') 5 | const session = {} 6 | session.url = $request.url 7 | session.body = $request.body 8 | session.headers = $request.headers 9 | delete session.headers['Content-Length'] 10 | $.log('', `url: ${session.url}`, `body: ${session.body}`, `headers: ${JSON.stringify(session.headers)}`) 11 | if ($.setdata(JSON.stringify(session), 'chavy_cookie_neteasemusic')) { 12 | $.subt = '获取会话: 成功!' 13 | } else { 14 | $.subt = '获取会话: 失败!' 15 | } 16 | })() 17 | .catch((e) => { 18 | $.subt = '获取会话: 失败!' 19 | $.desc = `原因: ${e}` 20 | $.log(`❌ ${$.name}, 获取会话: 失败! 原因: ${e}!`) 21 | }) 22 | .finally(() => { 23 | $.msg($.name, $.subt, $.desc), $.log('', `🔔 ${$.name}, 获取会话: 结束!`, ''), $.done() 24 | }) 25 | 26 | // prettier-ignore 27 | function Env(t){this.name=t,this.logs=[],this.isSurge=(()=>"undefined"!=typeof $httpClient),this.isQuanX=(()=>"undefined"!=typeof $task),this.log=((...t)=>{this.logs=[...this.logs,...t],t?console.log(t.join("\n")):console.log(this.logs.join("\n"))}),this.msg=((t=this.name,s="",i="")=>{this.isSurge()&&$notification.post(t,s,i),this.isQuanX()&&$notify(t,s,i);const e=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t&&e.push(t),s&&e.push(s),i&&e.push(i),console.log(e.join("\n"))}),this.getdata=(t=>this.isSurge()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):void 0),this.setdata=((t,s)=>this.isSurge()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):void 0),this.get=((t,s)=>this.send(t,"GET",s)),this.wait=((t,s=t)=>i=>setTimeout(()=>i(),Math.floor(Math.random()*(s-t+1)+t))),this.post=((t,s)=>this.send(t,"POST",s)),this.send=((t,s,i)=>{if(this.isSurge()){const e="POST"==s?$httpClient.post:$httpClient.get;e(t,(t,s,e)=>{s&&(s.body=e,s.statusCode=s.status),i(t,s,e)})}this.isQuanX()&&(t.method=s,$task.fetch(t).then(t=>{t.status=t.statusCode,i(null,t,t.body)},t=>i(t.error,t,t)))}),this.done=((t={})=>$done(t))} 28 | -------------------------------------------------------------------------------- /neteasenews/README.md: -------------------------------------------------------------------------------- 1 | # 网易新闻 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > 2020.2.4 QuanX v1.0.6-build195 及以后版本可以直接使用 `neteasenews.cookie.js` 自动获取 Cookie 6 | 7 | > 2020.2.4 如果是 195 以前的版本, 或者想尝试手动抓包获取参数, 请点[这里](https://github.com/chavyleung/scripts/tree/master/neteasenews/README.old.md) 8 | 9 | ## 配置 (Surge) 10 | 11 | ```properties 12 | [MITM] 13 | *.m.163.com 14 | 15 | [Script] 16 | http-request ^https:\/\/(.*?)c\.m\.163\.com\/uc\/api\/sign\/v3\/commit script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasenews/neteasenews.cookie.js,requires-body=true 17 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasenews/neteasenews.js 18 | ``` 19 | 20 | ## 配置 (QuanX) 21 | 22 | ```properties 23 | [MITM] 24 | *.m.163.com 25 | 26 | [rewrite_local] 27 | ^https:\/\/(.*?)c\.m\.163\.com\/uc\/api\/sign\/v3\/commit url script-request-body neteasenews.cookie.js 28 | 29 | [task_local] 30 | 1 0 * * * neteasenews.js 31 | ``` 32 | 33 | ## 说明 34 | 35 | 1. 先把`*.m.163.com`加到`[MITM]` 36 | 2. 再配置重写规则: 37 | - Surge: 把两条远程脚本放到`[Script]` 38 | - QuanX: 把`neteasenews.cookie.js`和`neteasenews.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 39 | 3. 打开 APP 然后手动签到 1 次: 40 | 4. 系统提示: `获取Cookie: 成功`, `获取Body: 成功` 41 | 5. 最后就可以把第 1 条脚本注释掉了 42 | 6. 运行一次脚本, 如果提示重复签到, 那就算成功了! 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 | -------------------------------------------------------------------------------- /neteasenews/neteasenews.js: -------------------------------------------------------------------------------- 1 | const cookieName = '网易新闻' 2 | const cookieKey = 'chavy_cookie_neteasenews' 3 | const bodyKey = 'chavy_body_neteasenews' 4 | const chavy = init() 5 | const cookieVal = JSON.parse(chavy.getdata(cookieKey)) 6 | const bodyVal = chavy.getdata(bodyKey) 7 | 8 | sign() 9 | 10 | function sign() { 11 | if (bodyVal) { 12 | let url = { url: `https://c.m.163.com/uc/api/sign/v2/commit`, headers: cookieVal } 13 | url.body = bodyVal 14 | chavy.post(url, (error, response, data) => { 15 | chavy.log(`${cookieName}, data: ${data}`) 16 | let result = JSON.parse(data) 17 | const title = `${cookieName}` 18 | let subTitle = `` 19 | let detail = `` 20 | if (result.code == 200) { 21 | subTitle = '签到结果: 成功' 22 | detail = `连签: +${result.data.serialDays}, 金币: ${result.data.awardGoldCoin}, 说明: ${result.msg}` 23 | } else if (result.code == 700) { 24 | subTitle = '签到结果: 成功 (重复签到)' 25 | detail = `说明: ${result.msg}` 26 | } else { 27 | subTitle = '签到结果: 失败' 28 | detail = `编码: ${result.code}, 说明: ${result.msg}` 29 | } 30 | chavy.msg(title, subTitle, detail) 31 | }) 32 | } else { 33 | const title = `${cookieName}` 34 | let subTitle = `签到结果: 失败` 35 | let detail = `说明: body参数为空` 36 | if (isQuanX()) detail += `, QuanX用户请手动抓包 body 参数!` 37 | chavy.msg(title, subTitle, detail) 38 | } 39 | 40 | chavy.done() 41 | } 42 | 43 | function init() { 44 | isSurge = () => { 45 | return undefined === this.$httpClient ? false : true 46 | } 47 | isQuanX = () => { 48 | return undefined === this.$task ? false : true 49 | } 50 | getdata = (key) => { 51 | if (isSurge()) return $persistentStore.read(key) 52 | if (isQuanX()) return $prefs.valueForKey(key) 53 | } 54 | setdata = (key, val) => { 55 | if (isSurge()) return $persistentStore.write(key, val) 56 | if (isQuanX()) return $prefs.setValueForKey(key, val) 57 | } 58 | msg = (title, subtitle, body) => { 59 | if (isSurge()) $notification.post(title, subtitle, body) 60 | if (isQuanX()) $notify(title, subtitle, body) 61 | } 62 | log = (message) => console.log(message) 63 | get = (url, cb) => { 64 | if (isSurge()) { 65 | $httpClient.get(url, cb) 66 | } 67 | if (isQuanX()) { 68 | url.method = 'GET' 69 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 70 | } 71 | } 72 | post = (url, cb) => { 73 | if (isSurge()) { 74 | $httpClient.post(url, cb) 75 | } 76 | if (isQuanX()) { 77 | url.method = 'POST' 78 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 79 | } 80 | } 81 | done = (value = {}) => { 82 | $done(value) 83 | } 84 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 85 | } 86 | -------------------------------------------------------------------------------- /neteasenews/抓包步骤/第10步.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/neteasenews/抓包步骤/第10步.png -------------------------------------------------------------------------------- /neteasenews/抓包步骤/第1步.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/neteasenews/抓包步骤/第1步.png -------------------------------------------------------------------------------- /neteasenews/抓包步骤/第2步.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/neteasenews/抓包步骤/第2步.png -------------------------------------------------------------------------------- /neteasenews/抓包步骤/第3步.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/neteasenews/抓包步骤/第3步.png -------------------------------------------------------------------------------- /neteasenews/抓包步骤/第4-5步.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/neteasenews/抓包步骤/第4-5步.png -------------------------------------------------------------------------------- /neteasenews/抓包步骤/第6步.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/neteasenews/抓包步骤/第6步.png -------------------------------------------------------------------------------- /neteasenews/抓包步骤/第7步.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/neteasenews/抓包步骤/第7步.png -------------------------------------------------------------------------------- /neteasenews/抓包步骤/第8步.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/neteasenews/抓包步骤/第8步.png -------------------------------------------------------------------------------- /neteasenews/抓包步骤/第9步.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/neteasenews/抓包步骤/第9步.png -------------------------------------------------------------------------------- /nio/README.md: -------------------------------------------------------------------------------- 1 | # 蔚来 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | > 感谢[@danchaw](https://github.com/danchaw) PR 5 | ## 配置 (Surge) 6 | 7 | ```properties 8 | [MITM] 9 | app.nio.com 10 | 11 | [Script] 12 | http-request ^https:\/\/app\.nio\.com\/api\/1\/app\/daily_checkin script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/nio/nio.cookie.js 13 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/nio/nio.js 14 | ``` 15 | 16 | ## 配置 (QuanX) 17 | 18 | ```properties 19 | [MITM] 20 | app.nio.com 21 | 22 | [rewrite_local] 23 | 24 | # [商店版] 25 | ^https:\/\/app\.nio\.com\/api\/1\/app\/daily_checkin url script-request-header nio.cookie.js 26 | 27 | # [TestFlight] 28 | ^https:\/\/app\.nio\.com\/api\/1\/app\/daily_checkin url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/nio/nio.cookie.js 29 | 30 | [task_local] 31 | 32 | # [商店版] 33 | 1 0 * * * nio.js 34 | 35 | # [TestFlight] 36 | 1 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/nio/nio.js 37 | ``` 38 | 39 | ## 说明 40 | 41 | 1. 先把`app.nio.com`加到`[MITM]` 42 | 2. 再配置重写规则: 43 | - Surge: 把两条远程脚本放到`[Script]` 44 | - QuanX: 把`nio.cookie.js`和`nio.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 45 | 3. 打开 APP[蔚来](https://apps.apple.com/cn/app/%E8%94%9A%E6%9D%A5/id1116095987) 然后手动签到 1 次, 系统提示: `获取Cookie: 成功` 46 | 4. 最后就可以把第 1 条脚本注释掉了 47 | 5. 运行一次脚本, 如果提示重复签到, 那就算成功了! 48 | 49 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 50 | 51 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 52 | 53 | ## 常见问题 54 | 55 | 1. 无法写入 Cookie 56 | 57 | - 检查 Surge 系统通知权限放开了没 58 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 59 | 60 | 2. 写入 Cookie 成功, 但签到不成功 61 | 62 | - 看看是不是在登录前就写入 Cookie 了 63 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 64 | 65 | 3. 为什么有时成功有时失败 66 | 67 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 68 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 69 | 70 | - `Surge`配置: 71 | 72 | ```properties 73 | # 没有什么是一顿饭解决不了的: 74 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 75 | # 如果有,那就两顿: 76 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 77 | # 实在不行,三顿也能接受: 78 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 79 | 80 | # 再粗暴点,直接: 81 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 82 | ``` 83 | 84 | - `QuanX`配置: 85 | 86 | ```properties 87 | [task_local] 88 | 1 0 * * * xxx.js # 每天00:01执行一次 89 | 2 0 * * * xxx.js # 每天00:02执行一次 90 | 3 0 * * * xxx.js # 每天00:03执行一次 91 | 92 | */60 * * * * xxx.js # 每60分执行一次 93 | ``` 94 | 95 | ## 感谢 96 | 97 | [@NobyDa](https://github.com/NobyDa) 98 | 99 | [@lhie1](https://github.com/lhie1) 100 | 101 | [@ConnersHua](https://github.com/ConnersHua) 102 | 103 | [@danchaw](https://github.com/danchaw) 104 | -------------------------------------------------------------------------------- /nio/nio.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '蔚来' 2 | const signurlKey = 'signurl_nextevcar' 3 | const signheaderKey = 'signheader_nextevcar' 4 | const nextevcar = init() 5 | 6 | if ($request && $request.method == 'POST') { 7 | const signurlVal = $request.url 8 | const signheaderVal = JSON.stringify($request.headers) 9 | 10 | if (signurlVal) nextevcar.setdata(signurlVal, signurlKey) 11 | if (signheaderVal) nextevcar.setdata(signheaderVal, signheaderKey) 12 | nextevcar.msg(cookieName, `获取Cookie: 成功`, ``) 13 | } 14 | 15 | function init() { 16 | isSurge = () => { 17 | return undefined === this.$httpClient ? false : true 18 | } 19 | isQuanX = () => { 20 | return undefined === this.$task ? false : true 21 | } 22 | getdata = (key) => { 23 | if (isSurge()) return $persistentStore.read(key) 24 | if (isQuanX()) return $prefs.valueForKey(key) 25 | } 26 | setdata = (key, val) => { 27 | if (isSurge()) return $persistentStore.write(key, val) 28 | if (isQuanX()) return $prefs.setValueForKey(key, val) 29 | } 30 | msg = (title, subtitle, body) => { 31 | if (isSurge()) $notification.post(title, subtitle, body) 32 | if (isQuanX()) $notify(title, subtitle, body) 33 | } 34 | log = (message) => console.log(message) 35 | get = (url, cb) => { 36 | if (isSurge()) { 37 | $httpClient.get(url, cb) 38 | } 39 | if (isQuanX()) { 40 | url.method = 'GET' 41 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 42 | } 43 | } 44 | post = (url, cb) => { 45 | if (isSurge()) { 46 | $httpClient.post(url, cb) 47 | } 48 | if (isQuanX()) { 49 | url.method = 'POST' 50 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 51 | } 52 | } 53 | put = (url, cb) => { 54 | if (isSurge()) { 55 | $httpClient.put(url, cb) 56 | } 57 | if (isQuanX()) { 58 | url.method = 'PUT' 59 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 60 | } 61 | } 62 | done = (value = {}) => { 63 | $done(value) 64 | } 65 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, put, done } 66 | } 67 | nextevcar.done() -------------------------------------------------------------------------------- /nio/nio.js: -------------------------------------------------------------------------------- 1 | const cookieName = '蔚来' 2 | const signurlKey = 'signurl_nextevcar' 3 | const signheaderKey = 'signheader_nextevcar' 4 | const nextevcar = init() 5 | const signurlVal = nextevcar.getdata(signurlKey) 6 | const signheaderVal = nextevcar.getdata(signheaderKey) 7 | 8 | sign() 9 | 10 | function sign() { 11 | const url = { url: signurlVal, headers: JSON.parse(signheaderVal) } 12 | nextevcar.post(url, (error, response, data) => { 13 | nextevcar.log(`${cookieName}, data: ${data}`) 14 | const title = `${cookieName}` 15 | let subTitle = '' 16 | let detail = '' 17 | const result = JSON.parse(data) 18 | if (result.result_code == "success") { 19 | subTitle = `签到结果: 成功` 20 | detail = `签到积分: ${result.data.stats.credit_amount}, 连签: ${result.data.stats.continuous_checkin_days}天` 21 | } else if (result.result_code == "credit_limit_reached") { 22 | subTitle = `签到结果: 成功 (重复签到)` 23 | } else { 24 | subTitle = `签到结果: 失败` 25 | detail = `说明: ${result.debug_msg}, 请重新获取` 26 | } 27 | nextevcar.msg(title, subTitle, detail) 28 | nextevcar.done() 29 | }) 30 | } 31 | 32 | function init() { 33 | isSurge = () => { 34 | return undefined === this.$httpClient ? false : true 35 | } 36 | isQuanX = () => { 37 | return undefined === this.$task ? false : true 38 | } 39 | getdata = (key) => { 40 | if (isSurge()) return $persistentStore.read(key) 41 | if (isQuanX()) return $prefs.valueForKey(key) 42 | } 43 | setdata = (key, val) => { 44 | if (isSurge()) return $persistentStore.write(key, val) 45 | if (isQuanX()) return $prefs.setValueForKey(key, val) 46 | } 47 | msg = (title, subtitle, body) => { 48 | if (isSurge()) $notification.post(title, subtitle, body) 49 | if (isQuanX()) $notify(title, subtitle, body) 50 | } 51 | log = (message) => console.log(message) 52 | get = (url, cb) => { 53 | if (isSurge()) { 54 | $httpClient.get(url, cb) 55 | } 56 | if (isQuanX()) { 57 | url.method = 'GET' 58 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 59 | } 60 | } 61 | post = (url, cb) => { 62 | if (isSurge()) { 63 | $httpClient.post(url, cb) 64 | } 65 | if (isQuanX()) { 66 | url.method = 'POST' 67 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 68 | } 69 | } 70 | put = (url, cb) => { 71 | if (isSurge()) { 72 | $httpClient.put(url, cb) 73 | } 74 | if (isQuanX()) { 75 | url.method = 'PUT' 76 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 77 | } 78 | } 79 | done = (value = {}) => { 80 | $done(value) 81 | } 82 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, put, done } 83 | } 84 | -------------------------------------------------------------------------------- /noteyoudao/noteyoudao.cookie.js: -------------------------------------------------------------------------------- 1 | const $ = new Env('有道云笔记') 2 | 3 | !(async () => { 4 | $.log('', `🔔 ${$.name}, 获取会话: 开始!`, '') 5 | const VAL_url = $request.url 6 | const VAL_body = $request.body 7 | const VAL_headers = JSON.stringify($request.headers) 8 | 9 | $.log('', `❌ ${$.name}`, `url: ${$request.url}`, `body: ${$request.body}`, `headers: ${JSON.stringify($request.headers)}`, '') 10 | 11 | if (VAL_url && VAL_body && VAL_headers) { 12 | $.setdata(VAL_url, 'chavy_signurl_noteyoudao') 13 | $.setdata(VAL_body, 'chavy_signbody_noteyoudao') 14 | $.setdata(VAL_headers, 'chavy_signheaders_noteyoudao') 15 | $.subt = '获取会话: 成功 (签到)!' 16 | } 17 | })() 18 | .catch((e) => { 19 | $.subt = '获取会话: 失败!' 20 | $.desc = `原因: ${e}` 21 | $.log(`❌ ${$.name}, 获取会话: 失败! 原因: ${e}!`) 22 | }) 23 | .finally(() => { 24 | $.msg($.name, $.subt, $.desc), $.log('', `🔔 ${$.name}, 获取会话: 结束!`, ''), $.done() 25 | }) 26 | 27 | // prettier-ignore 28 | function Env(t){this.name=t,this.logs=[],this.isSurge=(()=>"undefined"!=typeof $httpClient),this.isQuanX=(()=>"undefined"!=typeof $task),this.log=((...t)=>{this.logs=[...this.logs,...t],t?console.log(t.join("\n")):console.log(this.logs.join("\n"))}),this.msg=((t=this.name,s="",i="")=>{this.isSurge()&&$notification.post(t,s,i),this.isQuanX()&&$notify(t,s,i),this.log("==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),t&&this.log(t),s&&this.log(s),i&&this.log(i)}),this.getdata=(t=>this.isSurge()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):void 0),this.setdata=((t,s)=>this.isSurge()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):void 0),this.get=((t,s)=>this.send(t,"GET",s)),this.wait=((t,s=t)=>i=>setTimeout(()=>i(),Math.floor(Math.random()*(s-t+1)+t))),this.post=((t,s)=>this.send(t,"POST",s)),this.send=((t,s,i)=>{if(this.isSurge()){const e="POST"==s?$httpClient.post:$httpClient.get;e(t,(t,s,e)=>{s&&(s.body=e,s.statusCode=s.status),i(t,s,e)})}this.isQuanX()&&(t.method=s,$task.fetch(t).then(t=>{t.status=t.statusCode,i(null,t,t.body)},t=>i(t.error,t,t)))}),this.done=((t={})=>$done(t))} 29 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chavy_scripts", 3 | "version": "1.0.0", 4 | "main": "Env.js", 5 | "scripts": { 6 | "dev": "http-server ." 7 | }, 8 | "repository": "https://github.com/chavyleung/scripts.git", 9 | "author": "Chavy ", 10 | "license": "MIT", 11 | "dependencies": { 12 | "crypto-js": "^4.0.0", 13 | "got": "^11.5.1", 14 | "http-server": "^0.12.3", 15 | "tough-cookie": "^4.0.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /qmkg/README.md: -------------------------------------------------------------------------------- 1 | # 全民K歌 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > QuanX 需要: v1.0.6-build195 及以后版本 (TestFlight) 6 | 7 | > 感谢 [@GideonSenku](https://github.com/GideonSenku) Commit 8 | 9 | ## 配置 (Surge) 10 | 11 | ```properties 12 | [MITM] 13 | node.kg.qq.com 14 | 15 | [Script] 16 | http-request ^https://node\.kg\.qq\.com/webapp/proxy? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qmkg/qmkg.cookie.js, requires-body=true 17 | 18 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qmkg/qmkg.js 19 | ``` 20 | 21 | ## 配置 (QuanX) 22 | 23 | ```properties 24 | [MITM] 25 | node.kg.qq.com 26 | 27 | [rewrite_local] 28 | 29 | # [商店版] QuanX v1.0.6-build194 及更早版本 30 | # 不支持 31 | 32 | # [TestFlight] QuanX v1.0.6-build195 及以后版本 33 | ^https://node\.kg\.qq\.com/webapp/proxy? url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/qmkg/qmkg.cookie.js 34 | 35 | [task_local] 36 | 1 0 * * * qmkg.js 37 | ``` 38 | 39 | ## 说明 40 | 41 | 1. 先把`node.kg.qq.com`加到`[MITM]` 42 | 2. 再配置重写规则: 43 | - Surge: 把两条远程脚本放到`[Script]` 44 | - QuanX: 把`qmkg.cookie.js`和`qmkg.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 45 | 3. 打开 APP 手动签到一次: 访问下右下角 `我的` > `任务中心` > `签到` 46 | 4. 系统提示: `获取Cookie: 成功` 47 | 5. 把获取 Cookie 的脚本注释掉 48 | 6. 运行一次脚本, 如果提示重复签到, 那就算成功了! 49 | 50 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 51 | 52 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 53 | 54 | ## 常见问题 55 | 56 | 1. 无法写入 Cookie 57 | 58 | - 检查 Surge 系统通知权限放开了没 59 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 60 | 61 | 2. 写入 Cookie 成功, 但签到不成功 62 | 63 | - 看看是不是在登录前就写入 Cookie 了 64 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 65 | 66 | 3. 为什么有时成功有时失败 67 | 68 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 69 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 70 | 71 | - `Surge`配置: 72 | 73 | ```properties 74 | # 没有什么是一顿饭解决不了的: 75 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 76 | # 如果有,那就两顿: 77 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 78 | # 实在不行,三顿也能接受: 79 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 80 | 81 | # 再粗暴点,直接: 82 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 83 | ``` 84 | 85 | - `QuanX`配置: 86 | 87 | ```properties 88 | [task_local] 89 | 1 0 * * * xxx.js # 每天00:01执行一次 90 | 2 0 * * * xxx.js # 每天00:02执行一次 91 | 3 0 * * * xxx.js # 每天00:03执行一次 92 | 93 | */60 * * * * xxx.js # 每60分执行一次 94 | ``` 95 | 96 | ## 感谢 97 | 98 | [@NobyDa](https://github.com/NobyDa) 99 | 100 | [@lhie1](https://github.com/lhie1) 101 | 102 | [@ConnersHua](https://github.com/ConnersHua) 103 | 104 | [@GideonSenku](https://github.com/GideonSenku) 105 | -------------------------------------------------------------------------------- /qmkg/qmkg.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '全民K歌' 2 | const signurlKey = 'senku_signurl_qmkg' 3 | const signheaderKey = 'senku_signheader_qmkg' 4 | const signbodyKey = 'senku_signbody_qmkg' 5 | const senku = init() 6 | 7 | const requrl = $request.url 8 | if ($request && $request.method != 'OPTIONS') { 9 | const signurlVal = requrl 10 | const signheaderVal = JSON.stringify($request.headers) 11 | const signbodyVal = $request.body 12 | const cmd = JSON.parse($request.body).cmd 13 | senku.log(`signurlVal:${signurlVal}`) 14 | senku.log(`signheaderVal:${signheaderVal}`) 15 | senku.log(`signbodyVal:${signbodyVal}`) 16 | if (signurlVal) senku.setdata(signurlVal, signurlKey) 17 | if (signheaderVal) senku.setdata(signheaderVal, signheaderKey) 18 | if (signbodyVal && cmd=='task.revisionSignInGetAward') { 19 | senku.setdata(signbodyVal, signbodyKey) 20 | senku.msg(cookieName, `获取Cookie: 成功`, ``) 21 | } 22 | } 23 | 24 | function init() { 25 | isSurge = () => { 26 | return undefined === this.$httpClient ? false : true 27 | } 28 | isQuanX = () => { 29 | return undefined === this.$task ? false : true 30 | } 31 | getdata = (key) => { 32 | if (isSurge()) return $persistentStore.read(key) 33 | if (isQuanX()) return $prefs.valueForKey(key) 34 | } 35 | setdata = (key, val) => { 36 | if (isSurge()) return $persistentStore.write(key, val) 37 | if (isQuanX()) return $prefs.setValueForKey(key, val) 38 | } 39 | msg = (title, subtitle, body) => { 40 | if (isSurge()) $notification.post(title, subtitle, body) 41 | if (isQuanX()) $notify(title, subtitle, body) 42 | } 43 | log = (message) => console.log(message) 44 | get = (url, cb) => { 45 | if (isSurge()) { 46 | $httpClient.get(url, cb) 47 | } 48 | if (isQuanX()) { 49 | url.method = 'GET' 50 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 51 | } 52 | } 53 | post = (url, cb) => { 54 | if (isSurge()) { 55 | $httpClient.post(url, cb) 56 | } 57 | if (isQuanX()) { 58 | url.method = 'POST' 59 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 60 | } 61 | } 62 | done = (value = {}) => { 63 | $done(value) 64 | } 65 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 66 | } 67 | senku.done() 68 | -------------------------------------------------------------------------------- /qmkg/qmkg.js: -------------------------------------------------------------------------------- 1 | const cookieName = '全民K歌' 2 | const signurlKey = 'senku_signurl_qmkg' 3 | const signheaderKey = 'senku_signheader_qmkg' 4 | const signbodyKey = 'senku_signbody_qmkg' 5 | const senku = init() 6 | const signurlVal = senku.getdata(signurlKey) 7 | const signheaderVal = senku.getdata(signheaderKey) 8 | const signBodyVal = senku.getdata(signbodyKey) 9 | 10 | sign() 11 | 12 | function sign() { 13 | const url = { url: signurlVal, headers: JSON.parse(signheaderVal), body: signBodyVal } 14 | senku.post(url, (error, response, data) => { 15 | const result = JSON.parse(data) 16 | const total = result.data['task.revisionSignInGetAward'].total 17 | const ret = result.data['task.revisionSignInGetAward'].ret 18 | let subTitle = `` 19 | let detail = `` 20 | if (total != 0) { 21 | const num = result.data['task.revisionSignInGetAward'].awards[0].num 22 | subTitle = `签到结果: 成功` 23 | detail = `获得鲜花: ${num}朵,已连续签到:${total}天` 24 | } else if (ret == -11532) { 25 | subTitle = `签到结果: 成功 (重复签到)` 26 | } else { 27 | subTitle = `签到结果: 失败` 28 | } 29 | senku.msg(cookieName, subTitle, detail) 30 | senku.done() 31 | }) 32 | } 33 | 34 | function init() { 35 | isSurge = () => { 36 | return undefined === this.$httpClient ? false : true 37 | } 38 | isQuanX = () => { 39 | return undefined === this.$task ? false : true 40 | } 41 | getdata = (key) => { 42 | if (isSurge()) return $persistentStore.read(key) 43 | if (isQuanX()) return $prefs.valueForKey(key) 44 | } 45 | setdata = (key, val) => { 46 | if (isSurge()) return $persistentStore.write(key, val) 47 | if (isQuanX()) return $prefs.setValueForKey(key, val) 48 | } 49 | msg = (title, subtitle, body) => { 50 | if (isSurge()) $notification.post(title, subtitle, body) 51 | if (isQuanX()) $notify(title, subtitle, body) 52 | } 53 | log = (message) => console.log(message) 54 | get = (url, cb) => { 55 | if (isSurge()) { 56 | $httpClient.get(url, cb) 57 | } 58 | if (isQuanX()) { 59 | url.method = 'GET' 60 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 61 | } 62 | } 63 | post = (url, cb) => { 64 | if (isSurge()) { 65 | $httpClient.post(url, cb) 66 | } 67 | if (isQuanX()) { 68 | url.method = 'POST' 69 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 70 | } 71 | } 72 | done = (value = {}) => { 73 | $done(value) 74 | } 75 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 76 | } 77 | -------------------------------------------------------------------------------- /qtt/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NobyDa/scripts/d934e01ff43d808260135ff538271286562e8038/qtt/.DS_Store -------------------------------------------------------------------------------- /qunar/README.md: -------------------------------------------------------------------------------- 1 | # 去哪儿 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | ## 配置 (Surge) 6 | 7 | ```properties 8 | [MITM] 9 | user.qunar.com 10 | 11 | [Script] 12 | http-request ^https:\/\/user.qunar.com\/webapi\/member\/signIndexV2.htm script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qunar/qunar.cookie.js 13 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qunar/qunar.js 14 | ``` 15 | 16 | ## 配置 (QuanX) 17 | 18 | ```properties 19 | [MITM] 20 | user.qunar.com 21 | 22 | [rewrite_local] 23 | ^https:\/\/user.qunar.com\/webapi\/member\/signIndexV2.htm url script-request-header qunar.cookie.js 24 | 25 | [task_local] 26 | 1 0 * * * qunar.js 27 | ``` 28 | 29 | ## 说明 30 | 31 | 1. 先把`user.qunar.com`加到`[MITM]` 32 | 2. 再配置重写规则: 33 | - Surge: 把两条远程脚本放到`[Script]` 34 | - QuanX: 把`qunar.cookie.js`和`qunar.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 35 | 3. 打开 APP 然后手动签到 1 次: 36 | 4. 系统提示: `获取Cookie: 成功` 37 | 5. 最后就可以把第 1 条脚本注释掉了 38 | 6. 运行一次脚本, 如果提示重复签到, 那就算成功了! 39 | 40 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 41 | 42 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 43 | 44 | ## 常见问题 45 | 46 | 1. 无法写入 Cookie 47 | 48 | - 检查 Surge 系统通知权限放开了没 49 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 50 | 51 | 2. 写入 Cookie 成功, 但签到不成功 52 | 53 | - 看看是不是在登录前就写入 Cookie 了 54 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 55 | 56 | 3. 为什么有时成功有时失败 57 | 58 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 59 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 60 | 61 | - `Surge`配置: 62 | 63 | ```properties 64 | # 没有什么是一顿饭解决不了的: 65 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 66 | # 如果有,那就两顿: 67 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 68 | # 实在不行,三顿也能接受: 69 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 70 | 71 | # 再粗暴点,直接: 72 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 73 | ``` 74 | 75 | - `QuanX`配置: 76 | 77 | ```properties 78 | [task_local] 79 | 1 0 * * * xxx.js # 每天00:01执行一次 80 | 2 0 * * * xxx.js # 每天00:02执行一次 81 | 3 0 * * * xxx.js # 每天00:03执行一次 82 | 83 | */60 * * * * xxx.js # 每60分执行一次 84 | ``` 85 | 86 | ## 感谢 87 | 88 | [@NobyDa](https://github.com/NobyDa) 89 | 90 | [@lhie1](https://github.com/lhie1) 91 | 92 | [@ConnersHua](https://github.com/ConnersHua) 93 | -------------------------------------------------------------------------------- /qunar/qunar.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '去哪儿' 2 | const cookieKey = 'chavy_cookie_qunar' 3 | const chavy = init() 4 | const cookieVal = JSON.stringify($request.headers) 5 | 6 | if (cookieVal) { 7 | chavy.setdata(cookieVal, cookieKey) 8 | chavy.msg(`${cookieName}`, '获取Cookie: 成功', '') 9 | chavy.log(`[${cookieName}] 获取Cookie: 成功, cookie: ${cookieVal}`) 10 | } else { 11 | chavy.msg(`${cookieName}`, '获取Cookie: 失败', '说明: 未知') 12 | chavy.log(`[${cookieName}] 获取Cookie: 失败, cookie: ${cookieVal}`) 13 | } 14 | 15 | function init() { 16 | isSurge = () => { 17 | return undefined === this.$httpClient ? false : true 18 | } 19 | isQuanX = () => { 20 | return undefined === this.$task ? false : true 21 | } 22 | getdata = (key) => { 23 | if (isSurge()) return $persistentStore.read(key) 24 | if (isQuanX()) return $prefs.valueForKey(key) 25 | } 26 | setdata = (key, val) => { 27 | if (isSurge()) return $persistentStore.write(key, val) 28 | if (isQuanX()) return $prefs.setValueForKey(key, val) 29 | } 30 | msg = (title, subtitle, body) => { 31 | if (isSurge()) $notification.post(title, subtitle, body) 32 | if (isQuanX()) $notify(title, subtitle, body) 33 | } 34 | log = (message) => console.log(message) 35 | get = (url, cb) => { 36 | if (isSurge()) { 37 | $httpClient.get(url, cb) 38 | } 39 | if (isQuanX()) { 40 | url.method = 'GET' 41 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 42 | } 43 | } 44 | post = (url, cb) => { 45 | if (isSurge()) { 46 | $httpClient.post(url, cb) 47 | } 48 | if (isQuanX()) { 49 | url.method = 'POST' 50 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 51 | } 52 | } 53 | done = (value = {}) => { 54 | $done(value) 55 | } 56 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 57 | } 58 | chavy.done() 59 | -------------------------------------------------------------------------------- /qunar/qunar.js: -------------------------------------------------------------------------------- 1 | const cookieName = '去哪儿' 2 | const cookieKey = 'chavy_cookie_qunar' 3 | const chavy = init() 4 | const cookieVal = JSON.parse(chavy.getdata(cookieKey)) 5 | 6 | sign() 7 | 8 | function sign() { 9 | let url = { url: `https://user.qunar.com/webapi/member/signNewIndex.htm`, headers: cookieVal } 10 | url.body = `channel=app&platform=ios` 11 | chavy.post(url, (error, response, data) => { 12 | chavy.log(`${cookieName}, data: ${data}`) 13 | let result = JSON.parse(data) 14 | const title = `${cookieName}` 15 | let subTitle = `` 16 | let detail = `` 17 | if (result.errcode == 200) { 18 | if (result.data.modalInfo.title) { 19 | subTitle = '签到结果: 成功' 20 | detail = `${result.data.unit}: ${result.data.preferential.counts}个, 共签: ${result.data.total}天, 连签: ${result.data.continuous}天, 说明: ${result.data.modalInfo.title}` 21 | } else { 22 | subTitle = '签到结果: 成功 (重复签到)' 23 | detail = `${result.data.unit}: ${result.data.preferential.counts}个, 共签: ${result.data.total}天, 连签: ${result.data.continuous}天` 24 | } 25 | } else { 26 | subTitle = '签到结果: 失败' 27 | detail = `编码: ${result.errcode}, 说明: ${result.errmsg}` 28 | } 29 | chavy.msg(title, subTitle, detail) 30 | }) 31 | 32 | chavy.done() 33 | } 34 | 35 | function init() { 36 | isSurge = () => { 37 | return undefined === this.$httpClient ? false : true 38 | } 39 | isQuanX = () => { 40 | return undefined === this.$task ? false : true 41 | } 42 | getdata = (key) => { 43 | if (isSurge()) return $persistentStore.read(key) 44 | if (isQuanX()) return $prefs.valueForKey(key) 45 | } 46 | setdata = (key, val) => { 47 | if (isSurge()) return $persistentStore.write(key, val) 48 | if (isQuanX()) return $prefs.setValueForKey(key, val) 49 | } 50 | msg = (title, subtitle, body) => { 51 | if (isSurge()) $notification.post(title, subtitle, body) 52 | if (isQuanX()) $notify(title, subtitle, body) 53 | } 54 | log = (message) => console.log(message) 55 | get = (url, cb) => { 56 | if (isSurge()) { 57 | $httpClient.get(url, cb) 58 | } 59 | if (isQuanX()) { 60 | url.method = 'GET' 61 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 62 | } 63 | } 64 | post = (url, cb) => { 65 | if (isSurge()) { 66 | $httpClient.post(url, cb) 67 | } 68 | if (isQuanX()) { 69 | url.method = 'POST' 70 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 71 | } 72 | } 73 | done = (value = {}) => { 74 | $done(value) 75 | } 76 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 77 | } 78 | -------------------------------------------------------------------------------- /rrtv/rrtv.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '人人视频' 2 | const cookieKey = 'chavy_cookie_rrtv' 3 | const chavy = init() 4 | const cookieVal = $request.headers['token'] 5 | if (cookieVal) { 6 | if (chavy.setdata(cookieVal, cookieKey)) { 7 | chavy.msg(`${cookieName}`, '获取Cookie: 成功', '') 8 | chavy.log(`[${cookieName}] 获取Cookie: 成功, cookie: ${cookieVal}`) 9 | } 10 | } 11 | function init() { 12 | isSurge = () => { 13 | return undefined === this.$httpClient ? false : true 14 | } 15 | isQuanX = () => { 16 | return undefined === this.$task ? false : true 17 | } 18 | getdata = (key) => { 19 | if (isSurge()) return $persistentStore.read(key) 20 | if (isQuanX()) return $prefs.valueForKey(key) 21 | } 22 | setdata = (key, val) => { 23 | if (isSurge()) return $persistentStore.write(key, val) 24 | if (isQuanX()) return $prefs.setValueForKey(key, val) 25 | } 26 | msg = (title, subtitle, body) => { 27 | if (isSurge()) $notification.post(title, subtitle, body) 28 | if (isQuanX()) $notify(title, subtitle, body) 29 | } 30 | log = (message) => console.log(message) 31 | get = (url, cb) => { 32 | if (isSurge()) { 33 | $httpClient.get(url, cb) 34 | } 35 | if (isQuanX()) { 36 | url.method = 'GET' 37 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 38 | } 39 | } 40 | post = (url, cb) => { 41 | if (isSurge()) { 42 | $httpClient.post(url, cb) 43 | } 44 | if (isQuanX()) { 45 | url.method = 'POST' 46 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 47 | } 48 | } 49 | done = (value = {}) => { 50 | $done(value) 51 | } 52 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 53 | } 54 | chavy.done() 55 | -------------------------------------------------------------------------------- /sfexpress/README.md: -------------------------------------------------------------------------------- 1 | # 顺丰速运 (APP) 2 | 3 | ## 配置 (Surge) 4 | 5 | ```properties 6 | [MITM] 7 | hostname = ccsp-egmas.sf-express.com 8 | 9 | [Script] 10 | Rewrite: 顺丰速运 = type=http-request, pattern=^https:\/\/ccsp-egmas.sf-express.com\/cx-app-member\/member\/app\/user\/universalSign,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.cookie.js,requires-body=true 11 | cron "1 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.js 12 | ``` 13 | 14 | ## 配置 (QuanX) 15 | 16 | ```properties 17 | [MITM] 18 | hostname = ccsp-egmas.sf-express.com 19 | 20 | [rewrite_local] 21 | ^https:\/\/ccsp-egmas.sf-express.com\/cx-app-member\/member\/app\/user\/universalSign url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.cookie.js 22 | 23 | [task_local] 24 | 1 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.js 25 | ``` 26 | 27 | ## 配置 (Loon) 28 | 29 | ```properties 30 | [MITM] 31 | hostname = ccsp-egmas.sf-express.com 32 | 33 | [Script] 34 | http-request ^https:\/\/ccsp-egmas.sf-express.com\/cx-app-member\/member\/app\/user\/universalSign script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.cookie.js, requires-body=true, tag=Rewrite: 顺丰速运 35 | cron "1 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.js 36 | ``` 37 | 38 | ## 说明 39 | 40 | 1. 配置重写 41 | 2. `APP` 我的顺丰 > 任务中心 > 去签到 42 | 3. 提示 `获取会话: 成功` 43 | 4. 注释重写 44 | 45 | ## 感谢 46 | 47 | [@wangfei021325](https://github.com/wangfei021325) 48 | -------------------------------------------------------------------------------- /smzdm/README.md: -------------------------------------------------------------------------------- 1 | # 什么值得买 2 | 3 | ## 配置 4 | 5 | ```properties 6 | [MITM] 7 | *.smzdm.com 8 | 9 | [Script] 10 | http-request ^https:\/\/www\.smzdm\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/smzdm/smzdm.cookie.js 11 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/smzdm/smzdm.js 12 | ``` 13 | 14 | ## 说明 15 | 16 | 1. 先把`*.smzdm.com`加到`[MITM]` 17 | 2. 再把两条远程脚本放到`[Script]` 18 | 3. 浏览器访问并登录: https://zhiyou.smzdm.com/user/login 19 | 4. 打开浏览器访问: https://www.smzdm.com 20 | 5. `Surge`提示: `Cookie [什么值得买] 写入成功` 21 | 6. 最后就可以把第 1 条脚本注释掉了 22 | 23 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 24 | 25 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 26 | 27 | ## 常见问题 28 | 29 | 1. 无法写入 Cookie 30 | 31 | - 检查 Surge 系统通知权限放开了没 32 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 33 | 34 | 2. 写入 Cookie 成功, 但签到不成功 35 | 36 | - 看看是不是在登录前就写入 Cookie 了 37 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 38 | 39 | 3. 为什么有时成功有时失败 40 | 41 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 42 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 43 | 44 | - `Surge`配置: 45 | 46 | ```properties 47 | # 没有什么是一顿饭解决不了的: 48 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 49 | # 如果有,那就两顿: 50 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 51 | # 实在不行,三顿也能接受: 52 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 53 | 54 | # 再粗暴点,直接: 55 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 56 | ``` 57 | 58 | - `QuanX`配置: 59 | 60 | ```properties 61 | [task_local] 62 | 1 0 * * * xxx.js # 每天00:01执行一次 63 | 2 0 * * * xxx.js # 每天00:02执行一次 64 | 3 0 * * * xxx.js # 每天00:03执行一次 65 | 66 | */60 * * * * xxx.js # 每60分执行一次 67 | ``` 68 | 69 | ## 感谢 70 | 71 | [@NobyDa](https://github.com/NobyDa) 72 | 73 | [@lhie1](https://github.com/lhie1) 74 | 75 | [@ConnersHua](https://github.com/ConnersHua) 76 | -------------------------------------------------------------------------------- /smzdm/quanx/README.md: -------------------------------------------------------------------------------- 1 | # 什么值得买 2 | 3 | ## 配置 4 | 5 | ```properties 6 | [MITM] 7 | *.smzdm.com 8 | 9 | [rewrite_local] 10 | # 189及以前版本 11 | ^https:\/\/www\.smzdm\.com\/?.? url script-response-body smzdm.cookie.js 12 | # 190及以后版本 13 | ^https:\/\/www\.smzdm\.com\/?.? url script-request-header smzdm.cookie.js 14 | 15 | [task_local] 16 | 1 0 * * * smzdm.js 17 | ``` 18 | 19 | ## 说明 20 | 21 | 1. 先把`*.smzdm.com`加到`[MITM]` 22 | 2. 把`smzdm.cookie.js`和`smzdm.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 23 | 3. 再把两条脚本分别放到`[rewrite_local]`和`[task_local]` 24 | 4. 浏览器访问并登录: https://zhiyou.smzdm.com/user/login 25 | 5. 打开浏览器访问: https://www.smzdm.com 26 | 6. `QuanX`提示: `Cookie [什么值得买] 写入成功` 27 | 7. 最后就可以把`[rewrite_local]`的脚本注释掉了 28 | 29 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 30 | 31 | > 第 2 条脚本是签到脚本, 每天`00:01:00`执行一次. 32 | 33 | ## 常见问题 34 | 35 | 1. 无法写入 Cookie 36 | 37 | - 检查 QuanX 系统通知权限放开了没 38 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 39 | 40 | 2. 写入 Cookie 成功, 但签到不成功 41 | 42 | - 看看是不是在登录前就写入 Cookie 了 43 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 44 | 45 | 3. 为什么有时成功有时失败 46 | 47 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 48 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 49 | 50 | - `Surge`配置: 51 | 52 | ```properties 53 | # 没有什么是一顿饭解决不了的: 54 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 55 | # 如果有,那就两顿: 56 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 57 | # 实在不行,三顿也能接受: 58 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 59 | 60 | # 再粗暴点,直接: 61 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 62 | ``` 63 | 64 | - `QuanX`配置: 65 | 66 | ```properties 67 | [task_local] 68 | 1 0 * * * xxx.js # 每天00:01执行一次 69 | 2 0 * * * xxx.js # 每天00:02执行一次 70 | 3 0 * * * xxx.js # 每天00:03执行一次 71 | 72 | */60 * * * * xxx.js # 每60分执行一次 73 | ``` 74 | 75 | ## 感谢 76 | 77 | [@NobyDa](https://github.com/NobyDa) 78 | 79 | [@lhie1](https://github.com/lhie1) 80 | 81 | [@ConnersHua](https://github.com/ConnersHua) 82 | -------------------------------------------------------------------------------- /smzdm/quanx/smzdm.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '什么值得买' 2 | const cookieKey = 'chavy_cookie_smzdm' 3 | const cookieVal = $request.headers['Cookie'] 4 | 5 | if (cookieVal) { 6 | let cookie = $prefs.setValueForKey(cookieVal, cookieKey) 7 | if (cookie) { 8 | let msg = `${cookieName}` 9 | $notify(msg, 'Cookie写入成功', '详见日志') 10 | console.log(msg) 11 | console.log(cookieVal) 12 | } 13 | } 14 | 15 | $done({}) 16 | -------------------------------------------------------------------------------- /smzdm/smzdm.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '什么值得买' 2 | const cookieKey = 'chavy_cookie_smzdm' 3 | const cookieVal = $request.headers['Cookie'] 4 | 5 | if (cookieVal) { 6 | let cookie = $persistentStore.write(cookieVal, cookieKey) 7 | if (cookie) { 8 | let msg = `${cookieName}` 9 | $notification.post(msg, 'Cookie写入成功', '详见日志') 10 | console.log(msg) 11 | console.log(cookieVal) 12 | } 13 | } 14 | 15 | $done({}) 16 | -------------------------------------------------------------------------------- /tieba/README.md: -------------------------------------------------------------------------------- 1 | # 百度签到 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > 目前支持签到: 贴吧、知道 (2 合 1) 6 | 7 | > 之前已经获取过贴吧 cookie 的话,不需要再次获取 (通用) 8 | 9 | > 2020.1.3: 屏蔽文库签到, 原因: 实际签不上 10 | 11 | > 2020.1.11 QuanX 在`190`版本开始, 获取 Cookie 方式需要从`script-response-body`改为`script-request-header` 12 | 13 | ## 配置 (Surge) 14 | 15 | ```properties 16 | [MITM] 17 | tieba.baidu.com 18 | 19 | [Script] 20 | http-request ^https?:\/\/tieba\.baidu\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.cookie.js 21 | cron "10 0 0 * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.js 22 | ``` 23 | 24 | ## 配置 (QuanX) 25 | 26 | ```properties 27 | [MITM] 28 | tieba.baidu.com 29 | 30 | [rewrite_local] 31 | # 189及以前版本 32 | ^https?:\/\/tieba\.baidu\.com\/?.? url script-response-body tieba.cookie.js 33 | # 190及以后版本 34 | ^https?:\/\/tieba\.baidu\.com\/?.? url script-request-header tieba.cookie.js 35 | 36 | [task_local] 37 | 1 0 * * * tieba.js 38 | ``` 39 | 40 | ## 说明 41 | 42 | 1. 先在浏览器登录 `(先登录! 先登录! 先登录!)` 43 | 2. 先把`tieba.baidu.com`加到`[MITM]` 44 | 3. 再配置重写规则: 45 | - Surge: 把两条远程脚本放到`[Script]` 46 | - QuanX: 把`tieba.cookie.js`和`tieba.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 47 | 4. 再用浏览器访问一下: https://tieba.baidu.com 或者 https://tieba.baidu.com/index/ 48 | 5. 系统提示: `获取Cookie: 成功` 49 | 6. 最后就可以把第 1 条脚本注释掉了 50 | 51 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 52 | 53 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 54 | 55 | ## 常见问题 56 | 57 | 1. 无法写入 Cookie 58 | 59 | - 检查 Surge 系统通知权限放开了没 60 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 61 | 62 | 2. 写入 Cookie 成功, 但签到不成功 63 | 64 | - 看看是不是在登录前就写入 Cookie 了 65 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 66 | 67 | 3. 为什么有时成功有时失败 68 | 69 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 70 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 71 | 72 | - `Surge`配置: 73 | 74 | ```properties 75 | # 没有什么是一顿饭解决不了的: 76 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 77 | # 如果有,那就两顿: 78 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 79 | # 实在不行,三顿也能接受: 80 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 81 | 82 | # 再粗暴点,直接: 83 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 84 | ``` 85 | 86 | - `QuanX`配置: 87 | 88 | ```properties 89 | [task_local] 90 | 1 0 * * * xxx.js # 每天00:01执行一次 91 | 2 0 * * * xxx.js # 每天00:02执行一次 92 | 3 0 * * * xxx.js # 每天00:03执行一次 93 | 94 | */60 * * * * xxx.js # 每60分执行一次 95 | ``` 96 | 97 | ## 感谢 98 | 99 | [@NobyDa](https://github.com/NobyDa) 100 | 101 | [@lhie1](https://github.com/lhie1) 102 | 103 | [@ConnersHua](https://github.com/ConnersHua) 104 | -------------------------------------------------------------------------------- /tieba/tieba.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '百度贴吧' 2 | const cookieKey = 'chavy_cookie_tieba' 3 | const chavy = init() 4 | const cookieVal = $request.headers['Cookie'] 5 | 6 | if (cookieVal.indexOf('BDUSS') > 0) { 7 | let cookie = chavy.setdata(cookieVal, cookieKey) 8 | if (cookie) { 9 | let subTitle = '获取Cookie: 成功' 10 | chavy.msg(`${cookieName}`, subTitle, '') 11 | chavy.log(`[${cookieName}] ${subTitle}, cookie: ${cookieVal}`) 12 | } 13 | } else { 14 | let subTitle = '获取Cookie: 失败' 15 | let detail = `请确保在已登录状态下获取Cookie` 16 | chavy.msg(`${cookieName}`, subTitle, detail) 17 | chavy.log(`[${cookieName}] ${subTitle}, cookie: ${cookieVal}`) 18 | } 19 | 20 | function init() { 21 | isSurge = () => { 22 | return undefined === this.$httpClient ? false : true 23 | } 24 | isQuanX = () => { 25 | return undefined === this.$task ? false : true 26 | } 27 | getdata = (key) => { 28 | if (isSurge()) return $persistentStore.read(key) 29 | if (isQuanX()) return $prefs.valueForKey(key) 30 | } 31 | setdata = (key, val) => { 32 | if (isSurge()) return $persistentStore.write(key, val) 33 | if (isQuanX()) return $prefs.setValueForKey(key, val) 34 | } 35 | msg = (title, subtitle, body) => { 36 | if (isSurge()) $notification.post(title, subtitle, body) 37 | if (isQuanX()) $notify(title, subtitle, body) 38 | } 39 | log = (message) => console.log(message) 40 | get = (url, cb) => { 41 | if (isSurge()) { 42 | $httpClient.get(url, cb) 43 | } 44 | if (isQuanX()) { 45 | url.method = 'GET' 46 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 47 | } 48 | } 49 | post = (url, cb) => { 50 | if (isSurge()) { 51 | $httpClient.post(url, cb) 52 | } 53 | if (isQuanX()) { 54 | url.method = 'POST' 55 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 56 | } 57 | } 58 | done = (value = {}) => { 59 | $done(value) 60 | } 61 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 62 | } 63 | 64 | chavy.done() 65 | -------------------------------------------------------------------------------- /tncj/README.md: -------------------------------------------------------------------------------- 1 | # 头脑吃鸡 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | ## 配置 (Surge) 6 | 7 | ```properties 8 | [MITM] 9 | tncj.hortorgames.com 10 | 11 | [Script] 12 | http-response ^https://tncj.hortorgames.com/chicken/fight/(answer|findQuiz) requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tncj/tncj.min.js 13 | ``` 14 | 15 | ## 配置 (QuanX) 16 | 17 | ```properties 18 | [MITM] 19 | tncj.hortorgames.com 20 | 21 | [rewrite_local] 22 | ^https://tncj.hortorgames.com/chicken/fight/(answer|findQuiz) url script-response-body tncj.min.js 23 | 24 | ``` 25 | 26 | ## 感谢 27 | 28 | [@LeeeMooo](https://github.com/LeeeMooo) 29 | -------------------------------------------------------------------------------- /v2ex/README.md: -------------------------------------------------------------------------------- 1 | # V2EX 2 | 3 | ## 配置 4 | 5 | ```properties 6 | [MITM] 7 | *.v2ex.com 8 | 9 | [Script] 10 | http-request ^https:\/\/www\.v2ex\.com\/mission\/daily script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/v2ex/v2ex.cookie.js 11 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/v2ex/v2ex.js 12 | ``` 13 | 14 | ## 说明 15 | 16 | 1. 先把`*.v2ex.com`加到`[MITM]` 17 | 2. 再把两条远程脚本放到`[Script]` 18 | 3. 浏览器访问并登录: https://www.v2ex.com 19 | 4. 打开浏览器访问: https://www.v2ex.com/mission/daily 20 | 5. `Surge`提示: `Cookie [V2EX] 写入成功` 21 | 6. 最后就可以把第 1 条脚本注释掉了 22 | 23 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 24 | 25 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 26 | 27 | ## 常见问题 28 | 29 | 1. 无法写入 Cookie 30 | 31 | - 检查 Surge 系统通知权限放开了没 32 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 33 | 34 | 2. 写入 Cookie 成功, 但签到不成功 35 | 36 | - 看看是不是在登录前就写入 Cookie 了 37 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 38 | 39 | 3. 为什么有时成功有时失败 40 | 41 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 42 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 43 | 44 | - `Surge`配置: 45 | 46 | ```properties 47 | # 没有什么是一顿饭解决不了的: 48 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 49 | # 如果有,那就两顿: 50 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 51 | # 实在不行,三顿也能接受: 52 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 53 | 54 | # 再粗暴点,直接: 55 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 56 | ``` 57 | 58 | - `QuanX`配置: 59 | 60 | ```properties 61 | [task_local] 62 | 1 0 * * * xxx.js # 每天00:01执行一次 63 | 2 0 * * * xxx.js # 每天00:02执行一次 64 | 3 0 * * * xxx.js # 每天00:03执行一次 65 | 66 | */60 * * * * xxx.js # 每60分执行一次 67 | ``` 68 | 69 | ## 感谢 70 | 71 | [@NobyDa](https://github.com/NobyDa) 72 | 73 | [@lhie1](https://github.com/lhie1) 74 | 75 | [@ConnersHua](https://github.com/ConnersHua) 76 | -------------------------------------------------------------------------------- /v2ex/quanx/README.md: -------------------------------------------------------------------------------- 1 | # 百度贴吧 2 | 3 | > 2020.1.11 QuanX 在`190`版本开始, 获取 Cookie 方式需要从`script-response-body`改为`script-request-header` 4 | 5 | ## 配置 6 | 7 | ```properties 8 | [MITM] 9 | *.v2ex.com 10 | 11 | [rewrite_local] 12 | # 189及以前版本 13 | ^https:\/\/www\.v2ex\.com\/mission\/daily url script-response-body v2ex.cookie.js 14 | # 190及以后版本 15 | ^https:\/\/www\.v2ex\.com\/mission\/daily url script-request-header v2ex.cookie.js 16 | 17 | [task_local] 18 | 1 0 * * * v2ex.js 19 | ``` 20 | 21 | ## 说明 22 | 23 | 1. 先把`*.v2ex.com`加到`[MITM]` 24 | 2. 再把两条远程脚本放到`[Script]` 25 | 3. 先在浏览器登录 `(先登录! 先登录! 先登录!)` 26 | 4. 打开浏览器访问: https://www.v2ex.com/mission/daily 27 | 5. `QuanX`提示: `Cookie [V2EX] 写入成功` (如果提示多条写入成功,忽略就好) 28 | 6. 最后就可以把第 1 条脚本注释掉了 29 | 30 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 31 | 32 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 33 | 34 | ## 常见问题 35 | 36 | 1. 无法写入 Cookie 37 | 38 | - 检查 QuanX 系统通知权限放开了没 39 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 40 | 41 | 2. 写入 Cookie 成功, 但签到不成功 42 | 43 | - 看看是不是在登录前就写入 Cookie 了 44 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 45 | 46 | 3. 为什么有时成功有时失败 47 | 48 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 49 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 50 | 51 | - `Surge`配置: 52 | 53 | ```properties 54 | # 没有什么是一顿饭解决不了的: 55 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 56 | # 如果有,那就两顿: 57 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 58 | # 实在不行,三顿也能接受: 59 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 60 | 61 | # 再粗暴点,直接: 62 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 63 | ``` 64 | 65 | - `QuanX`配置: 66 | 67 | ```properties 68 | [task_local] 69 | 1 0 * * * xxx.js # 每天00:01执行一次 70 | 2 0 * * * xxx.js # 每天00:02执行一次 71 | 3 0 * * * xxx.js # 每天00:03执行一次 72 | 73 | */60 * * * * xxx.js # 每60分执行一次 74 | ``` 75 | 76 | ## 感谢 77 | 78 | [@NobyDa](https://github.com/NobyDa) 79 | 80 | [@lhie1](https://github.com/lhie1) 81 | 82 | [@ConnersHua](https://github.com/ConnersHua) 83 | -------------------------------------------------------------------------------- /v2ex/quanx/v2ex.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = 'V2EX' 2 | const cookieKey = 'chavy_cookie_v2ex' 3 | const cookieVal = $request.headers['Cookie'] 4 | 5 | if (cookieVal) { 6 | let cookie = $prefs.setValueForKey(cookieVal, cookieKey) 7 | if (cookie) { 8 | let msg = `${cookieName}` 9 | $notify(msg, 'Cookie写入成功', '详见日志') 10 | console.log(msg) 11 | console.log(cookieVal) 12 | } 13 | } 14 | 15 | $done({}) 16 | -------------------------------------------------------------------------------- /v2ex/quanx/v2ex.js: -------------------------------------------------------------------------------- 1 | const cookieName = 'V2EX' 2 | const cookieKey = 'chavy_cookie_v2ex' 3 | const cookieVal = $prefs.valueForKey(cookieKey) 4 | 5 | function sign() { 6 | let url = { 7 | url: `https://www.v2ex.com/mission/daily`, 8 | method: 'GET', 9 | headers: { 10 | Cookie: cookieVal 11 | } 12 | } 13 | $task.fetch(url).then((response) => { 14 | let data = response.body 15 | if (data.indexOf('每日登录奖励已领取') >= 0) { 16 | let title = `${cookieName}` 17 | let subTitle = `签到结果: 签到跳过` 18 | let detail = `今天已经签过了` 19 | console.log(`${title}, ${subTitle}, ${detail}`) 20 | $notify(title, subTitle, detail) 21 | $done() 22 | } else { 23 | signMission(data.match(/]*\/mission\/daily\/redeem\?once=(\d+)[^>]*>/)[1]) 24 | } 25 | }) 26 | } 27 | 28 | function signMission(code) { 29 | let url = { 30 | url: `https://www.v2ex.com/mission/daily/redeem?once=${code}`, 31 | method: 'GET', 32 | headers: { Cookie: cookieVal } 33 | } 34 | $task.fetch(url).then((response) => { 35 | let data = response.body 36 | if (data.indexOf('每日登录奖励已领取') >= 0) { 37 | let title = `${cookieName}` 38 | let subTitle = `签到结果: 签到成功` 39 | let detail = `` 40 | console.log(`${title}, ${subTitle}, ${detail}`) 41 | $notify(title, subTitle, detail) 42 | } else { 43 | let title = `${cookieName}` 44 | let subTitle = `签到结果: 签到失败` 45 | let detail = `详见日志` 46 | console.log(`签到失败: ${cookieName}, data: ${data}`) 47 | $notify(title, subTitle, detail) 48 | } 49 | $done() 50 | }) 51 | } 52 | 53 | sign({}) 54 | -------------------------------------------------------------------------------- /v2ex/v2ex.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = 'V2EX' 2 | const cookieKey = 'chavy_cookie_v2ex' 3 | const cookieVal = $request.headers['Cookie'] 4 | 5 | if (cookieVal) { 6 | let cookie = $persistentStore.write(cookieVal, cookieKey) 7 | if (cookie) { 8 | let msg = `${cookieName}` 9 | $notification.post(msg, 'Cookie写入成功', '详见日志') 10 | console.log(msg) 11 | console.log(cookieVal) 12 | } 13 | } 14 | 15 | $done({}) 16 | -------------------------------------------------------------------------------- /v2ex/v2ex.js: -------------------------------------------------------------------------------- 1 | const cookieName = 'V2EX' 2 | const cookieKey = 'chavy_cookie_v2ex' 3 | const cookieVal = $persistentStore.read(cookieKey) 4 | 5 | function sign() { 6 | let url = { 7 | url: `https://www.v2ex.com/mission/daily`, 8 | headers: { 9 | Cookie: cookieVal 10 | } 11 | } 12 | $httpClient.get(url, (error, response, data) => { 13 | if (data.indexOf('每日登录奖励已领取') >= 0) { 14 | let title = `${cookieName}` 15 | let subTitle = `签到结果: 签到跳过` 16 | let detail = `今天已经签过了` 17 | console.log(`${title}, ${subTitle}, ${detail}`) 18 | $notification.post(title, subTitle, detail) 19 | } else { 20 | signMission(data.match(/]*\/mission\/daily\/redeem\?once=(\d+)[^>]*>/)[1]) 21 | } 22 | }) 23 | $done({}) 24 | } 25 | 26 | function signMission(code) { 27 | let url = { 28 | url: `https://www.v2ex.com/mission/daily/redeem?once=${code}`, 29 | headers: { Cookie: cookieVal } 30 | } 31 | $httpClient.get(url, (error, response, data) => { 32 | if (data.indexOf('每日登录奖励已领取') >= 0) { 33 | let title = `${cookieName}` 34 | let subTitle = `签到结果: 签到成功` 35 | let detail = `` 36 | console.log(`${title}, ${subTitle}, ${detail}`) 37 | $notification.post(title, subTitle, detail) 38 | } else { 39 | let title = `${cookieName}` 40 | let subTitle = `签到结果: 签到失败` 41 | let detail = `详见日志` 42 | console.log(`签到失败: ${cookieName}, error: ${error}, response: ${response}, data: ${data}`) 43 | $notification.post(title, subTitle, detail) 44 | } 45 | }) 46 | } 47 | 48 | sign({}) 49 | -------------------------------------------------------------------------------- /wmmeituan/wmmeituan.js: -------------------------------------------------------------------------------- 1 | const cookieName = '美团外卖' 2 | const tokenurlKey = 'chavy_tokenurl_wmmeituan' 3 | const tokenheaderKey = 'chavy_tokenheader_wmmeituan' 4 | const signurlKey = 'chavy_signurl_wmmeituan' 5 | const signheaderKey = 'chavy_signheader_wmmeituan' 6 | const signbodyKey = 'chavy_signbody_wmmeituan' 7 | const chavy = init() 8 | const tokenurlVal = chavy.getdata(tokenurlKey) 9 | const tokenheaderVal = chavy.getdata(tokenheaderKey) 10 | const signurlVal = chavy.getdata(signurlKey) 11 | const signheaderVal = chavy.getdata(signheaderKey) 12 | const signBodyVal = chavy.getdata(signbodyKey) 13 | 14 | sign() 15 | 16 | function sign() { 17 | const url = { url: signurlVal, headers: JSON.parse(signheaderVal), body: signBodyVal } 18 | chavy.post(url, (error, response, data) => { 19 | chavy.log(`${cookieName}, data: ${data}`) 20 | const result = JSON.parse(data) 21 | let subTitle = `` 22 | let detail = `` 23 | if (result.code == 0 && result.subcode == 0) { 24 | subTitle = `签到结果: 成功` 25 | detail = `说明: ${result.msg}` 26 | } else if (result.code == 1 && result.subcode == 3) { 27 | subTitle = `签到结果: 成功 (重复签到)` 28 | detail = `说明: ${result.msg}` 29 | } else { 30 | subTitle = `签到结果: 失败` 31 | detail = `编码: ${result.code}-${result.subcode}, 说明: ${result.msg}` 32 | } 33 | chavy.msg(cookieName, subTitle, detail) 34 | chavy.done() 35 | }) 36 | } 37 | 38 | function init() { 39 | isSurge = () => { 40 | return undefined === this.$httpClient ? false : true 41 | } 42 | isQuanX = () => { 43 | return undefined === this.$task ? false : true 44 | } 45 | getdata = (key) => { 46 | if (isSurge()) return $persistentStore.read(key) 47 | if (isQuanX()) return $prefs.valueForKey(key) 48 | } 49 | setdata = (key, val) => { 50 | if (isSurge()) return $persistentStore.write(key, val) 51 | if (isQuanX()) return $prefs.setValueForKey(key, val) 52 | } 53 | msg = (title, subtitle, body) => { 54 | if (isSurge()) $notification.post(title, subtitle, body) 55 | if (isQuanX()) $notify(title, subtitle, body) 56 | } 57 | log = (message) => console.log(message) 58 | get = (url, cb) => { 59 | if (isSurge()) { 60 | $httpClient.get(url, cb) 61 | } 62 | if (isQuanX()) { 63 | url.method = 'GET' 64 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 65 | } 66 | } 67 | post = (url, cb) => { 68 | if (isSurge()) { 69 | $httpClient.post(url, cb) 70 | } 71 | if (isQuanX()) { 72 | url.method = 'POST' 73 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 74 | } 75 | } 76 | done = (value = {}) => { 77 | $done(value) 78 | } 79 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 80 | } 81 | -------------------------------------------------------------------------------- /wps/README.md: -------------------------------------------------------------------------------- 1 | # WPS 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > 2020.3.15 增加小程序签到 6 | 7 | > 2020.6.10 1.小程序打卡可以自动答题; 2.自动做满邀请 10 个用户任务 (次日打卡送 10 天会员). 感谢 @Wenmoux 提供的邀请人列表 8 | > 注意 1: 获取 Cookie 的正则有变动, 但不用重取 Cookie 9 | > 注意 2: 把签到时间调整为 06:00 - 13:00 之间 10 | 11 | > 2020.6.11 不需要单独从小程序获取 Cookie, 添加自动报名脚本 12 | 13 | ## 配置 (Surge) 14 | 15 | ```properties 16 | [MITM] 17 | hostname = zt.wps.cn 18 | 19 | [Script] 20 | http-request ^https:\/\/zt.wps.cn\/2018\/docer_check_in\/api\/act_list script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js 21 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.js 22 | ``` 23 | 24 | ## 配置 (QuanX) 25 | 26 | ```properties 27 | [MITM] 28 | hostname = 110.43.90.61, zt.wps.cn 29 | 30 | [rewrite_local] 31 | ^https:\/\/zt.wps.cn\/2018\/docer_check_in\/api\/act_list url script-request-header wps.cookie.js 32 | 33 | [task_local] 34 | 1 0 * * * wps.js 35 | ``` 36 | 37 | ## 说明 38 | 39 | 1. 配置`[MITM]` 40 | - Surge: zt.wps.cn 41 | - QuanX: 110.43.90.61, zt.wps.cn 42 | 2. 再配置重写规则: 43 | - Surge: 把两条远程脚本放到`[Script]` 44 | - QuanX: 把`wps.cookie.js`和`wps.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 45 | 3. 打开 APP , 进入签到页面, 系统提示: `获取会话: 成功 (签到)` (不用手动签到) 46 | 4. 最后就可以把两条获取 Cookie 的脚本注释掉了 47 | 5. 运行一次脚本, 如果提示重复签到, 那就算成功了! 48 | 49 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 50 | 51 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 52 | 53 | ## 常见问题 54 | 55 | 1. 无法写入 Cookie 56 | 57 | - 检查 Surge 系统通知权限放开了没 58 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 59 | 60 | 2. 写入 Cookie 成功, 但签到不成功 61 | 62 | - 看看是不是在登录前就写入 Cookie 了 63 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 64 | 65 | 3. 为什么有时成功有时失败 66 | 67 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 68 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 69 | 70 | - `Surge`配置: 71 | 72 | ```properties 73 | # 没有什么是一顿饭解决不了的: 74 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 75 | # 如果有,那就两顿: 76 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 77 | # 实在不行,三顿也能接受: 78 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 79 | 80 | # 再粗暴点,直接: 81 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 82 | ``` 83 | 84 | - `QuanX`配置: 85 | 86 | ```properties 87 | [task_local] 88 | 1 0 * * * xxx.js # 每天00:01执行一次 89 | 2 0 * * * xxx.js # 每天00:02执行一次 90 | 3 0 * * * xxx.js # 每天00:03执行一次 91 | 92 | */60 * * * * xxx.js # 每60分执行一次 93 | ``` 94 | 95 | ## 感谢 96 | 97 | [@NobyDa](https://github.com/NobyDa) 98 | 99 | [@lhie1](https://github.com/lhie1) 100 | 101 | [@ConnersHua](https://github.com/ConnersHua) 102 | -------------------------------------------------------------------------------- /wps/wps.cookie.js: -------------------------------------------------------------------------------- 1 | const $ = new Env('WPS') 2 | 3 | !(async () => { 4 | $.log('', `🔔 ${$.name}, 获取会话: 开始!`, '') 5 | const VAL_url = $request.url 6 | const VAL_headers = JSON.stringify($request.headers) 7 | $.log('', `❕ ${$.name}`, `url: ${$request.url}`, `headers: ${JSON.stringify($request.headers)}`, '') 8 | $.setdata(VAL_url, 'chavy_signhomeurl_wps') 9 | $.setdata(VAL_headers, 'chavy_signhomeheader_wps') 10 | $.subt = '获取会话: 成功!' 11 | })() 12 | .catch((e) => { 13 | $.subt = '获取会话: 失败!' 14 | $.desc = `原因: ${e}` 15 | $.log(`❌ ${$.name}, 获取会话: 失败! 原因: ${e}!`) 16 | }) 17 | .finally(() => { 18 | $.msg($.name, $.subt, $.desc), $.log('', `🔔 ${$.name}, 获取会话: 结束!`, ''), $.done() 19 | }) 20 | 21 | // prettier-ignore 22 | function Env(s){this.name=s,this.data=null,this.logs=[],this.isSurge=(()=>"undefined"!=typeof $httpClient),this.isQuanX=(()=>"undefined"!=typeof $task),this.isNode=(()=>"undefined"!=typeof module&&!!module.exports),this.log=((...s)=>{this.logs=[...this.logs,...s],s?console.log(s.join("\n")):console.log(this.logs.join("\n"))}),this.msg=((s=this.name,t="",i="")=>{this.isSurge()&&$notification.post(s,t,i),this.isQuanX()&&$notify(s,t,i);const e=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];s&&e.push(s),t&&e.push(t),i&&e.push(i),console.log(e.join("\n"))}),this.getdata=(s=>{if(this.isSurge())return $persistentStore.read(s);if(this.isQuanX())return $prefs.valueForKey(s);if(this.isNode()){const t="box.dat";return this.fs=this.fs?this.fs:require("fs"),this.fs.existsSync(t)?(this.data=JSON.parse(this.fs.readFileSync(t)),this.data[s]):null}}),this.setdata=((s,t)=>{if(this.isSurge())return $persistentStore.write(s,t);if(this.isQuanX())return $prefs.setValueForKey(s,t);if(this.isNode()){const i="box.dat";return this.fs=this.fs?this.fs:require("fs"),!!this.fs.existsSync(i)&&(this.data=JSON.parse(this.fs.readFileSync(i)),this.data[t]=s,this.fs.writeFileSync(i,JSON.stringify(this.data)),!0)}}),this.wait=((s,t=s)=>i=>setTimeout(()=>i(),Math.floor(Math.random()*(t-s+1)+s))),this.get=((s,t)=>this.send(s,"GET",t)),this.post=((s,t)=>this.send(s,"POST",t)),this.send=((s,t,i)=>{if(this.isSurge()){const e="POST"==t?$httpClient.post:$httpClient.get;e(s,(s,t,e)=>{t&&(t.body=e,t.statusCode=t.status),i(s,t,e)})}this.isQuanX()&&(s.method=t,$task.fetch(s).then(s=>{s.status=s.statusCode,i(null,s,s.body)},s=>i(s.error,s,s))),this.isNode()&&(this.request=this.request?this.request:require("request"),s.method=t,s.gzip=!0,this.request(s,(s,t,e)=>{t&&(t.status=t.statusCode),i(null,t,e)}))}),this.done=((s={})=>this.isNode()?null:$done(s))} 23 | -------------------------------------------------------------------------------- /wykl/README.md: -------------------------------------------------------------------------------- 1 | # 网易考拉(弃坑) 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > QuanX 需要: v1.0.6-build195 及以后版本 (TestFlight) 6 | 7 | > 感谢 [@GideonSenku](https://github.com/GideonSenku) Commit 8 | 9 | ## 配置 (Surge) 10 | 11 | ```properties 12 | [MITM] 13 | m-bean.kaola.com 14 | 15 | [Script] 16 | http-request ^https:\/\/m-bean\.kaola\.com/m/point/sign\.html script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wykl/wykl.cookie.js, requires-body=true 17 | 18 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wykl/wykl.js 19 | ``` 20 | 21 | ## 配置 (QuanX) 22 | 23 | ```properties 24 | [MITM] 25 | m-bean.kaola.com 26 | 27 | [rewrite_local] 28 | 29 | # [商店版] QuanX v1.0.6-build194 及更早版本 30 | # ^https:\/\/m-bean\.kaola\.com/m/point/sign\.html url script-request-body wykl.cookie.js 31 | 32 | # [TestFlight] QuanX v1.0.6-build195 及以后版本 33 | ^https:\/\/m-bean\.kaola\.com/m/point/sign\.html url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/wykl/wykl.cookie.js 34 | 35 | [task_local] 36 | 1 0 * * * wykl.js 37 | ``` 38 | 39 | ## 说明 40 | 41 | 1. 先把`m-bean.kaola.com`加到`[MITM]` 42 | 2. 再配置重写规则: 43 | - Surge: 把两条远程脚本放到`[Script]` 44 | - QuanX: 把`wykl.cookie.js`和`wykl.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 45 | 3. 打开 APP 手动签到一次: 访问下右下角 `我的考拉` > `领考拉豆` > `签到` 46 | 4. 系统提示: `获取Cookie: 成功` 47 | 5. 把获取 Cookie 的脚本注释掉 48 | 6. 运行一次脚本, 如果提示重复签到, 那就算成功了! 49 | 50 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 51 | 52 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 53 | 54 | ## 常见问题 55 | 56 | 1. 无法写入 Cookie 57 | 58 | - 检查 Surge 系统通知权限放开了没 59 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 60 | 61 | 2. 写入 Cookie 成功, 但签到不成功 62 | 63 | - 看看是不是在登录前就写入 Cookie 了 64 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 65 | 66 | 3. 为什么有时成功有时失败 67 | 68 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 69 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 70 | 71 | - `Surge`配置: 72 | 73 | ```properties 74 | # 没有什么是一顿饭解决不了的: 75 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 76 | # 如果有,那就两顿: 77 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 78 | # 实在不行,三顿也能接受: 79 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 80 | 81 | # 再粗暴点,直接: 82 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 83 | ``` 84 | 85 | - `QuanX`配置: 86 | 87 | ```properties 88 | [task_local] 89 | 1 0 * * * xxx.js # 每天00:01执行一次 90 | 2 0 * * * xxx.js # 每天00:02执行一次 91 | 3 0 * * * xxx.js # 每天00:03执行一次 92 | 93 | */60 * * * * xxx.js # 每60分执行一次 94 | ``` 95 | 96 | ## 感谢 97 | 98 | [@NobyDa](https://github.com/NobyDa) 99 | 100 | [@lhie1](https://github.com/lhie1) 101 | 102 | [@ConnersHua](https://github.com/ConnersHua) 103 | 104 | [@GideonSenku](https://github.com/GideonSenku) 105 | -------------------------------------------------------------------------------- /wykl/wykl.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '网易考拉' 2 | const signurlKey = 'senku_signurl_wykl' 3 | const signheaderKey = 'senku_signheader_wykl' 4 | const signbodyKey = 'senku_signbody_wykl' 5 | const senku = init() 6 | 7 | const requrl = $request.url 8 | if ($request && $request.method != 'OPTIONS') { 9 | const signurlVal = requrl 10 | const signheaderVal = JSON.stringify($request.headers) 11 | const signbodyVal = $request.body 12 | if (signurlVal) senku.setdata(signurlVal, signurlKey) 13 | if (signheaderVal) senku.setdata(signheaderVal, signheaderKey) 14 | if (signbodyVal) senku.setdata(signbodyVal, signbodyKey) 15 | senku.msg(cookieName, `获取Cookie: 成功`, ``) 16 | } 17 | 18 | function init() { 19 | isSurge = () => { 20 | return undefined === this.$httpClient ? false : true 21 | } 22 | isQuanX = () => { 23 | return undefined === this.$task ? false : true 24 | } 25 | getdata = (key) => { 26 | if (isSurge()) return $persistentStore.read(key) 27 | if (isQuanX()) return $prefs.valueForKey(key) 28 | } 29 | setdata = (key, val) => { 30 | if (isSurge()) return $persistentStore.write(key, val) 31 | if (isQuanX()) return $prefs.setValueForKey(key, val) 32 | } 33 | msg = (title, subtitle, body) => { 34 | if (isSurge()) $notification.post(title, subtitle, body) 35 | if (isQuanX()) $notify(title, subtitle, body) 36 | } 37 | log = (message) => console.log(message) 38 | get = (url, cb) => { 39 | if (isSurge()) { 40 | $httpClient.get(url, cb) 41 | } 42 | if (isQuanX()) { 43 | url.method = 'GET' 44 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 45 | } 46 | } 47 | post = (url, cb) => { 48 | if (isSurge()) { 49 | $httpClient.post(url, cb) 50 | } 51 | if (isQuanX()) { 52 | url.method = 'POST' 53 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 54 | } 55 | } 56 | done = (value = {}) => { 57 | $done(value) 58 | } 59 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 60 | } 61 | senku.done() 62 | -------------------------------------------------------------------------------- /wykl/wykl.js: -------------------------------------------------------------------------------- 1 | const cookieName = '网易考拉' 2 | const signurlKey = 'senku_signurl_wykl' 3 | const signheaderKey = 'senku_signheader_wykl' 4 | const signbodyKey = 'senku_signbody_wykl' 5 | const senku = init() 6 | const signurlVal = senku.getdata(signurlKey) 7 | const signheaderVal = senku.getdata(signheaderKey) 8 | const signBodyVal = senku.getdata(signbodyKey) 9 | 10 | sign() 11 | 12 | function sign() { 13 | const url = { url: signurlVal, headers: JSON.parse(signheaderVal), body: signBodyVal } 14 | senku.post(url, (error, response, data) => { 15 | senku.log(`${cookieName}, data: ${data}`) 16 | const res = JSON.parse(data) 17 | let subTitle = `` 18 | let detail = `` 19 | if (res.retCode == 200) { 20 | subTitle = `签到结果: 成功` 21 | detail = `获得:${res.data.popupWindowInfo.frontRewardName},签到天数:${res.data.signCount}` 22 | } else if (res.retCode==401 || res.retCode==403 || res.code==401) { 23 | subTitle = `签到结果: 成功 (重复签到)` 24 | } else { 25 | subTitle = `签到结果: 失败` 26 | detail = `编码: ${res.code}, 说明: ${res.msg}` 27 | } 28 | senku.msg(cookieName, subTitle, detail) 29 | senku.done() 30 | }) 31 | } 32 | 33 | function init() { 34 | isSurge = () => { 35 | return undefined === this.$httpClient ? false : true 36 | } 37 | isQuanX = () => { 38 | return undefined === this.$task ? false : true 39 | } 40 | getdata = (key) => { 41 | if (isSurge()) return $persistentStore.read(key) 42 | if (isQuanX()) return $prefs.valueForKey(key) 43 | } 44 | setdata = (key, val) => { 45 | if (isSurge()) return $persistentStore.write(key, val) 46 | if (isQuanX()) return $prefs.setValueForKey(key, val) 47 | } 48 | msg = (title, subtitle, body) => { 49 | if (isSurge()) $notification.post(title, subtitle, body) 50 | if (isQuanX()) $notify(title, subtitle, body) 51 | } 52 | log = (message) => console.log(message) 53 | get = (url, cb) => { 54 | if (isSurge()) { 55 | $httpClient.get(url, cb) 56 | } 57 | if (isQuanX()) { 58 | url.method = 'GET' 59 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 60 | } 61 | } 62 | post = (url, cb) => { 63 | if (isSurge()) { 64 | $httpClient.post(url, cb) 65 | } 66 | if (isQuanX()) { 67 | url.method = 'POST' 68 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 69 | } 70 | } 71 | done = (value = {}) => { 72 | $done(value) 73 | } 74 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 75 | } 76 | -------------------------------------------------------------------------------- /ximalaya/README.md: -------------------------------------------------------------------------------- 1 | # 喜马拉雅 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > 2020.1.9 部分场景不能获取 Cookie 请更换匹配正则 6 | 7 | > 2020.1.11 QuanX 在`190`版本开始, 获取 Cookie 方式需要从`script-response-body`改为`script-request-header` 8 | 9 | > 2020.3.9 增加自动执行每日`浏览发现页`任务 (更新脚本即可, 无需重新获取 cookike) 10 | 11 | > 2020.3.12 移除`浏览发现页`, 原因: 需要观看视频 3 分钟 12 | 13 | ## 配置 (Surge) 14 | 15 | ```properties 16 | [MITM] 17 | mobwsa.ximalaya.com 18 | 19 | [Script] 20 | http-request ^https?:\/\/.*\/mobile\-user\/homePage\/.* script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.cookie.js 21 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.js 22 | ``` 23 | 24 | ## 配置 (QuanX) 25 | 26 | ```properties 27 | [MITM] 28 | mobwsa.ximalaya.com 29 | 30 | [rewrite_local] 31 | # 189及以前版本 32 | ^https?:\/\/.*\/mobile\-user\/homePage\/.* url script-response-body ximalaya.cookie.js 33 | # 190及以后版本 34 | ^https?:\/\/.*\/mobile\-user\/homePage\/.* url script-request-header ximalaya.cookie.js 35 | 36 | [task_local] 37 | 1 0 * * * ximalaya.js 38 | ``` 39 | 40 | ## 说明 41 | 42 | 1. 先把`mobwsa.ximalaya.com`加到`[MITM]` 43 | 2. 再配置重写规则: 44 | - Surge: 把两条远程脚本放到`[Script]` 45 | - QuanX: 把`ximalaya.cookie.js`和`ximalaya.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 46 | 3. 打开 APP, 访问下右下角`账号` 47 | 4. 系统提示: `获取Cookie: 成功` & `获取Token: 成功`(如果不提示获取成功, 尝试杀进程再进`账号`) 48 | 5. 最后就可以把第 1 条脚本注释掉了 49 | 50 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 51 | 52 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 53 | 54 | ## 常见问题 55 | 56 | 1. 无法写入 Cookie 57 | 58 | - 检查 Surge 系统通知权限放开了没 59 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 60 | 61 | 2. 写入 Cookie 成功, 但签到不成功 62 | 63 | - 看看是不是在登录前就写入 Cookie 了 64 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 65 | 66 | 3. 为什么有时成功有时失败 67 | 68 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 69 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 70 | 71 | - `Surge`配置: 72 | 73 | ```properties 74 | # 没有什么是一顿饭解决不了的: 75 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 76 | # 如果有,那就两顿: 77 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 78 | # 实在不行,三顿也能接受: 79 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 80 | 81 | # 再粗暴点,直接: 82 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 83 | ``` 84 | 85 | - `QuanX`配置: 86 | 87 | ```properties 88 | [task_local] 89 | 1 0 * * * xxx.js # 每天00:01执行一次 90 | 2 0 * * * xxx.js # 每天00:02执行一次 91 | 3 0 * * * xxx.js # 每天00:03执行一次 92 | 93 | */60 * * * * xxx.js # 每60分执行一次 94 | ``` 95 | 96 | ## 感谢 97 | 98 | [@NobyDa](https://github.com/NobyDa) 99 | 100 | [@lhie1](https://github.com/lhie1) 101 | 102 | [@ConnersHua](https://github.com/ConnersHua) 103 | -------------------------------------------------------------------------------- /ximalaya/ximalaya.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '喜马拉雅' 2 | const cookieKey = 'chavy_cookie_ximalaya' 3 | const chavy = init() 4 | const cookieVal = $request.headers['Cookie'] 5 | if (cookieVal) { 6 | if (chavy.setdata(cookieVal, cookieKey)) { 7 | chavy.msg(`${cookieName}`, '获取Cookie: 成功', '') 8 | chavy.log(`[${cookieName}] 获取Cookie: 成功, cookie: ${cookieVal}`) 9 | } 10 | } 11 | 12 | function init() { 13 | isSurge = () => { 14 | return undefined === this.$httpClient ? false : true 15 | } 16 | isQuanX = () => { 17 | return undefined === this.$task ? false : true 18 | } 19 | getdata = (key) => { 20 | if (isSurge()) return $persistentStore.read(key) 21 | if (isQuanX()) return $prefs.valueForKey(key) 22 | } 23 | setdata = (key, val) => { 24 | if (isSurge()) return $persistentStore.write(key, val) 25 | if (isQuanX()) return $prefs.setValueForKey(key, val) 26 | } 27 | msg = (title, subtitle, body) => { 28 | if (isSurge()) $notification.post(title, subtitle, body) 29 | if (isQuanX()) $notify(title, subtitle, body) 30 | } 31 | log = (message) => console.log(message) 32 | get = (url, cb) => { 33 | if (isSurge()) { 34 | $httpClient.get(url, cb) 35 | } 36 | if (isQuanX()) { 37 | url.method = 'GET' 38 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 39 | } 40 | } 41 | post = (url, cb) => { 42 | if (isSurge()) { 43 | $httpClient.post(url, cb) 44 | } 45 | if (isQuanX()) { 46 | url.method = 'POST' 47 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 48 | } 49 | } 50 | done = (value = {}) => { 51 | $done(value) 52 | } 53 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 54 | } 55 | chavy.done() 56 | -------------------------------------------------------------------------------- /yanxuan/README.md: -------------------------------------------------------------------------------- 1 | # 网易严选 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | 5 | > 2020.1.11 QuanX 在`190`版本开始, 获取 Cookie 方式需要从`script-response-body`改为`script-request-header` 6 | 7 | > 2020.1.22 签到脚本会导致账号异常, 请停止使用 8 | 9 | ## 配置 (Surge) 10 | 11 | ```properties 12 | [MITM] 13 | *.you.163.com 14 | 15 | [Script] 16 | http-request ^https:\/\/m\.you\.163\.com\/xhr\/points\/index\.json script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/yanxuan/yanxuan.cookie.js 17 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/yanxuan/yanxuan.js 18 | ``` 19 | 20 | ## 配置 (QuanX) 21 | 22 | ```properties 23 | [MITM] 24 | *.you.163.com 25 | 26 | [rewrite_local] 27 | # 189及以前版本 28 | ^https:\/\/m\.you\.163\.com\/xhr\/points\/index\.json url script-response-body yanxuan.cookie.js 29 | # 190及以后版本 30 | ^https:\/\/m\.you\.163\.com\/xhr\/points\/index\.json url script-request-header yanxuan.cookie.js 31 | 32 | 33 | 34 | [task_local] 35 | 1 0 * * * yanxuan.js 36 | ``` 37 | 38 | ## 说明 39 | 40 | 1. 先把`*.you.163.com`加到`[MITM]` 41 | 2. 再配置重写规则: 42 | - Surge: 把两条远程脚本放到`[Script]` 43 | - QuanX: 把`yanxuan.cookie.js`和`yanxuan.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 44 | 3. 打开 APP, 访问下`个人`>`每日签到`(右上角) 45 | 4. 系统提示: `获取Cookie: 成功` (如果不提示获取成功, 尝试杀进程再进`个人`>`每日签到`) 46 | 5. 最后就可以把第 1 条脚本注释掉了 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 | -------------------------------------------------------------------------------- /yanxuan/yanxuan.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '网易严选' 2 | const cookieKey = 'chavy_cookie_yanxuan' 3 | const tokenKey = 'chavy_token_yanxuan' 4 | const chavy = init() 5 | const cookieVal = $request.headers['Cookie'] 6 | if (cookieVal.indexOf('yx_csrf') > 0) { 7 | if (chavy.setdata(cookieVal, cookieKey)) { 8 | chavy.msg(`${cookieName}`, '获取Cookie: 成功', '') 9 | chavy.log(`[${cookieName}] 获取Cookie: 成功, cookie: ${cookieVal}`) 10 | } 11 | } else { 12 | chavy.msg(`${cookieName}`, '获取Cookie: 失败', `请确保在已登录状态下获取Cookie`) 13 | chavy.log(`[${cookieName}] ${subTitle}, cookie: ${cookieVal}`) 14 | } 15 | 16 | const queryparam = $request.url.split('?')[1] 17 | if (queryparam) { 18 | const params = {} 19 | for (param of $request.url.split('?')[1].split('&')) { 20 | params[param.split('=')[0]] = param.split('=')[1] 21 | } 22 | const token = JSON.stringify(params) 23 | if (params['csrf_token'] && chavy.setdata(token, tokenKey)) { 24 | chavy.msg(`${cookieName}`, '获取Token: 成功', '') 25 | chavy.log(`[${cookieName}] 获取Token: 成功, token: ${token}`) 26 | } 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 | } 72 | chavy.done() 73 | -------------------------------------------------------------------------------- /zimuzu/zimuzu.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '字幕组' 2 | const cookieKey = 'chavy_cookie_zimuzu' 3 | const cookieAppKey = 'chavy_cookie_zimuzu_app' 4 | const authUrlAppKey = 'chavy_auth_url_zimuzu_app' 5 | const chavy = init() 6 | if ($request.headers.Host == 'h5.rrhuodong.com') { 7 | const cookieVal = $request.headers['Cookie'] 8 | if (cookieVal) { 9 | if (chavy.setdata(cookieVal, cookieAppKey)) { 10 | chavy.setdata(``, authUrlAppKey) 11 | chavy.msg(`${cookieName} (APP)`, '获取Cookie: 成功', '') 12 | chavy.log(`[${cookieName} (APP)] 获取Cookie: 成功, cookie: ${cookieVal}`) 13 | } 14 | } 15 | } else if ($request.headers.Host == `ios.zmzapi.com` && $request.url.indexOf('accesskey') >= 0) { 16 | if (chavy.setdata($request.url, authUrlAppKey)) { 17 | chavy.setdata(``, cookieAppKey) 18 | chavy.msg(`${cookieName} (APP)`, '获取Cookie: 成功', '') 19 | chavy.log(`[${cookieName} (APP)] 获取Cookie: 成功, cookie: ${$request.url}`) 20 | } 21 | } else { 22 | const cookieVal = $request.headers['Cookie'] 23 | if (cookieVal) { 24 | if (chavy.setdata(cookieVal, cookieKey)) { 25 | chavy.msg(`${cookieName} (网页)`, '获取Cookie: 成功', '') 26 | chavy.log(`[${cookieName} (网页)] 获取Cookie: 成功, cookie: ${cookieVal}`) 27 | } 28 | } 29 | } 30 | 31 | function init() { 32 | isSurge = () => { 33 | return undefined === this.$httpClient ? false : true 34 | } 35 | isQuanX = () => { 36 | return undefined === this.$task ? false : true 37 | } 38 | getdata = (key) => { 39 | if (isSurge()) return $persistentStore.read(key) 40 | if (isQuanX()) return $prefs.valueForKey(key) 41 | } 42 | setdata = (key, val) => { 43 | if (isSurge()) return $persistentStore.write(key, val) 44 | if (isQuanX()) return $prefs.setValueForKey(key, val) 45 | } 46 | msg = (title, subtitle, body) => { 47 | if (isSurge()) $notification.post(title, subtitle, body) 48 | if (isQuanX()) $notify(title, subtitle, body) 49 | } 50 | log = (message) => console.log(message) 51 | get = (url, cb) => { 52 | if (isSurge()) { 53 | $httpClient.get(url, cb) 54 | } 55 | if (isQuanX()) { 56 | url.method = 'GET' 57 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 58 | } 59 | } 60 | post = (url, cb) => { 61 | if (isSurge()) { 62 | $httpClient.post(url, cb) 63 | } 64 | if (isQuanX()) { 65 | url.method = 'POST' 66 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 67 | } 68 | } 69 | done = (value = {}) => { 70 | $done(value) 71 | } 72 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 73 | } 74 | chavy.done() 75 | -------------------------------------------------------------------------------- /zsfc/README.md: -------------------------------------------------------------------------------- 1 | # 掌上飞车 2 | 3 | > 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可 4 | > 感谢[@danchaw](https://github.com/danchaw) PR 5 | ## 配置 (Surge) 6 | 7 | ```properties 8 | [MITM] 9 | mwegame.qq.com 10 | 11 | [Script] 12 | http-request ^https:\/\/mwegame\.qq\.com\/ams\/sign\/doSign\/month script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zsfc/zsfc.js 13 | cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/zsfc/zsfc.js 14 | ``` 15 | 16 | ## 配置 (QuanX) 17 | 18 | ```properties 19 | [MITM] 20 | mwegame.qq.com 21 | 22 | [rewrite_local] 23 | 24 | # [商店版] 25 | ^https:\/\/mwegame\.qq\.com\/ams\/sign\/doSign\/month url script-request-header zsfc.js 26 | 27 | # [TestFlight] 28 | ^https:\/\/mwegame\.qq\.com\/ams\/sign\/doSign\/month url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/zsfc/zsfc.js 29 | 30 | [task_local] 31 | 32 | # [商店版] 33 | 1 0 * * * zsfc.js 34 | 35 | # [TestFlight] 36 | 1 0 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/zsfc/zsfc.js 37 | ``` 38 | 39 | ## 说明 40 | 41 | 1. 先把`mwegame.qq.com`加到`[MITM]` 42 | 2. 再配置重写规则: 43 | - Surge: 把两条远程脚本放到`[Script]` 44 | - QuanX: 把`nio.cookie.js`和`nio.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关) 45 | 3. 打开 APP[掌上飞车](https://apps.apple.com/cn/app/%E6%8E%8C%E4%B8%8A%E9%A3%9E%E8%BD%A6/id1116903233) 然后手动签到 1 次, 系统提示: `首次写入xxxUrl成功🎉,首次写入xxxCookie成功🎉` 46 | 4. 最后就可以把第 1 条脚本注释掉了 47 | 5. 运行一次脚本, 如果提示重复签到, 那就算成功了! 48 | 49 | > 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie. 50 | 51 | > 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次. 52 | 53 | ## 常见问题 54 | 55 | 1. 无法写入 Cookie 56 | 57 | - 检查 Surge 系统通知权限放开了没 58 | - 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴) 59 | 60 | 2. 写入 Cookie 成功, 但签到不成功 61 | 62 | - 看看是不是在登录前就写入 Cookie 了 63 | - 如果是,请确保在登录成功后,再尝试写入 Cookie 64 | 65 | 3. 为什么有时成功有时失败 66 | 67 | - 很正常,网络问题,哪怕你是手工签到也可能失败(凌晨签到容易拥堵就容易失败) 68 | - 暂时不考虑代码级的重试机制,但咱有配置级的(暴力美学): 69 | 70 | - `Surge`配置: 71 | 72 | ```properties 73 | # 没有什么是一顿饭解决不了的: 74 | cron "10 0 0 * * *" script-path=xxx.js # 每天00:00:10执行一次 75 | # 如果有,那就两顿: 76 | cron "20 0 0 * * *" script-path=xxx.js # 每天00:00:20执行一次 77 | # 实在不行,三顿也能接受: 78 | cron "30 0 0 * * *" script-path=xxx.js # 每天00:00:30执行一次 79 | 80 | # 再粗暴点,直接: 81 | cron "* */60 * * * *" script-path=xxx.js # 每60分执行一次 82 | ``` 83 | 84 | - `QuanX`配置: 85 | 86 | ```properties 87 | [task_local] 88 | 1 0 * * * xxx.js # 每天00:01执行一次 89 | 2 0 * * * xxx.js # 每天00:02执行一次 90 | 3 0 * * * xxx.js # 每天00:03执行一次 91 | 92 | */60 * * * * xxx.js # 每60分执行一次 93 | ``` 94 | 95 | ## 感谢 96 | 97 | [@NobyDa](https://github.com/NobyDa) 98 | 99 | [@lhie1](https://github.com/lhie1) 100 | 101 | [@ConnersHua](https://github.com/ConnersHua) 102 | 103 | [@danchaw](https://github.com/danchaw) 104 | -------------------------------------------------------------------------------- /zxhc/zxhc.cookie.js: -------------------------------------------------------------------------------- 1 | const cookieName = '智行火车' 2 | const signurlKey = 'senku_signurl_zxhc' 3 | const signheaderKey = 'senku_signheader_zxhc' 4 | const signbodyKey = 'senku_signbody_zxhc' 5 | const senku = init() 6 | 7 | const requrl = $request.url 8 | if ($request && $request.method != 'OPTIONS') { 9 | const signurlVal = requrl 10 | const signheaderVal = JSON.stringify($request.headers) 11 | const signbodyVal = $request.body 12 | if (signurlVal) senku.setdata(signurlVal, signurlKey) 13 | if (signheaderVal) senku.setdata(signheaderVal, signheaderKey) 14 | if (signbodyVal) senku.setdata(signbodyVal, signbodyKey) 15 | senku.msg(cookieName, `获取Cookie: 成功`, ``) 16 | } 17 | 18 | function init() { 19 | isSurge = () => { 20 | return undefined === this.$httpClient ? false : true 21 | } 22 | isQuanX = () => { 23 | return undefined === this.$task ? false : true 24 | } 25 | getdata = (key) => { 26 | if (isSurge()) return $persistentStore.read(key) 27 | if (isQuanX()) return $prefs.valueForKey(key) 28 | } 29 | setdata = (key, val) => { 30 | if (isSurge()) return $persistentStore.write(key, val) 31 | if (isQuanX()) return $prefs.setValueForKey(key, val) 32 | } 33 | msg = (title, subtitle, body) => { 34 | if (isSurge()) $notification.post(title, subtitle, body) 35 | if (isQuanX()) $notify(title, subtitle, body) 36 | } 37 | log = (message) => console.log(message) 38 | get = (url, cb) => { 39 | if (isSurge()) { 40 | $httpClient.get(url, cb) 41 | } 42 | if (isQuanX()) { 43 | url.method = 'GET' 44 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 45 | } 46 | } 47 | post = (url, cb) => { 48 | if (isSurge()) { 49 | $httpClient.post(url, cb) 50 | } 51 | if (isQuanX()) { 52 | url.method = 'POST' 53 | $task.fetch(url).then((resp) => cb(null, {}, resp.body)) 54 | } 55 | } 56 | done = (value = {}) => { 57 | $done(value) 58 | } 59 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 60 | } 61 | senku.done() 62 | -------------------------------------------------------------------------------- /zxhc/zxhc.js: -------------------------------------------------------------------------------- 1 | const cookieName = '智行火车' 2 | const signurlKey = 'senku_signurl_zxhc' 3 | const signheaderKey = 'senku_signheader_zxhc' 4 | const signbodyKey = 'senku_signbody_zxhc' 5 | const senku = init() 6 | const signurlVal = senku.getdata(signurlKey) 7 | const signheaderVal = senku.getdata(signheaderKey) 8 | const signBodyVal = senku.getdata(signbodyKey) 9 | 10 | sign() 11 | 12 | function sign() { 13 | const url = { url: signurlVal, headers: JSON.parse(signheaderVal), body: signBodyVal } 14 | senku.post(url, (error, response, data) => { 15 | senku.log(`${cookieName}, data: ${data}`) 16 | const res = JSON.parse(data) 17 | let subTitle = `` 18 | let detail = `` 19 | if (res.resultCode == 0) { 20 | subTitle = `签到结果: 成功` 21 | detail = `积分: ${res.credit}` 22 | if (res.coupon!=null) { 23 | detail += `优惠券:${res.coupon}` 24 | } 25 | } else if (res.resultCode == -1) {}{ 26 | subTitle = `签到结果: ${res.resultMessage}` 27 | } 28 | senku.msg(cookieName, subTitle, detail) 29 | senku.done() 30 | }) 31 | } 32 | 33 | function init() { 34 | isSurge = () => { 35 | return undefined === this.$httpClient ? false : true 36 | } 37 | isQuanX = () => { 38 | return undefined === this.$task ? false : true 39 | } 40 | getdata = (key) => { 41 | if (isSurge()) return $persistentStore.read(key) 42 | if (isQuanX()) return $prefs.valueForKey(key) 43 | } 44 | setdata = (key, val) => { 45 | if (isSurge()) return $persistentStore.write(key, val) 46 | if (isQuanX()) return $prefs.setValueForKey(key, val) 47 | } 48 | msg = (title, subtitle, body) => { 49 | if (isSurge()) $notification.post(title, subtitle, body) 50 | if (isQuanX()) $notify(title, subtitle, body) 51 | } 52 | log = (message) => console.log(message) 53 | get = (url, cb) => { 54 | if (isSurge()) { 55 | $httpClient.get(url, cb) 56 | } 57 | if (isQuanX()) { 58 | url.method = 'GET' 59 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 60 | } 61 | } 62 | post = (url, cb) => { 63 | if (isSurge()) { 64 | $httpClient.post(url, cb) 65 | } 66 | if (isQuanX()) { 67 | url.method = 'POST' 68 | $task.fetch(url).then((resp) => cb(null, resp, resp.body)) 69 | } 70 | } 71 | done = (value = {}) => { 72 | $done(value) 73 | } 74 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 75 | } 76 | --------------------------------------------------------------------------------