├── Cookie.conf ├── README.md ├── Script.conf ├── Task.conf ├── ctrip └── index.js ├── dianshijia └── dianshijia.js ├── dingdong ├── activitySign.js ├── ddgy.js └── index.js ├── dingtalk └── index.js ├── ftqq └── index.js ├── hammer.js ├── htt ├── cookie.js └── index.js ├── ikuuu └── index.js ├── index.js ├── iosapp └── index.js ├── jd └── index.js ├── jrtt └── index.js ├── ks └── index.js ├── liwo └── index.js ├── location └── index.js ├── lxhealth ├── index.js ├── manual.js └── manual_alert.js ├── lxsj └── index.js ├── plugins ├── dianshijia.plugin ├── netease.plugin ├── tb_jd_price.plugin └── youth.plugin ├── qktx ├── cookie.js └── index.js ├── qq └── read.js ├── studygolang └── index.js ├── tieba └── index.js ├── tls ├── cookie.js └── index.js ├── txnews └── index.js ├── weixin └── ad.js ├── wtk └── index.js ├── xxys └── index.js ├── youth └── index.js └── zxjb └── index.js /Cookie.conf: -------------------------------------------------------------------------------- 1 | # 获取Cookie订阅 By iepngs 2 | # 该订阅仅适用于定时签到脚本的Cookie获取. 3 | # 可以在使用后手动将其禁用,以免产生不必要的MITM. 4 | 5 | hostname = ikuuu.co,studygolang.com,maicai.api.ddxq.mobi,tieba.baidu.com,api.m.jd.com,www.52pojie.cn,music.163.com,user.qunar.com,m.client.10010.com,act.10010.com,promotion.waimai.meituan.com,h5.ele.me,m.ctrip.com,as.xiaojukeji.com,webapi.qmai.cn,mall.oclean.com,nebula.kuaishou.com,*.youth.cn,ios.baertt.com,farm.api.ddxq.mobi 6 | # ,mqqapi.reader.qq.com,act.gaoqingdianshi.com,api.gaoqingdianshi.com 7 | 8 | # //-------------------------------羊毛系列------------------------------------ 9 | # > 电视家 10 | # http-request http:\/\/act\.gaoqingdianshi\.com\/\/api\/v4\/sign\/signin script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js,tag=电视家签到 11 | # http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js,tag=电视家提现 12 | 13 | # > 中青看点极速版 14 | http-request ^https:\/\/\w+\.youth\.cn\/TaskCenter\/(sign|getSign) script-path=https://raw.githubusercontent.com/iepngs/Script/master/youth/index.js,timeout=30,tag=中青看点 15 | http-request ^https:\/\/ios\.baertt\.com\/v5\/(article\/complete|article\/red_packet|user\/app_stay\.json) script-path=https://raw.githubusercontent.com/iepngs/Script/master/youth/index.js,requires-body=true,timeout=30,tag=中青看点 16 | 17 | # > 梨涡签到领现金 18 | # 手动签到一次,次日起可用 19 | # http-request ^https:\/\/api\.m\.jd\.com\/api\/v1\/sign\/doSign script-path=https://raw.githubusercontent.com/iepngs/Script/master/liwo/index.js, requires-body=true, timeout=10, tag=梨涡签到Cookie 20 | 21 | # > 企鹅阅读 (By @ziye12) 22 | # http://m.q.qq.com/a/s/d9dfb0b1ce05ffd8a629f242d8c3512a 23 | # 点读书程序〉我的 进一本书看 5秒左右然后返回,获取阅读时长cookie 24 | # http-request ^https:\/\/mqqapi\.reader\.qq\.com\/(mqq\/addReadTimeWithBid|log\/v4\/mqq\/track) script-path=https://raw.githubusercontent.com/iepngs/Script/master/qq/read.js, requires-body=true, tag=企鹅读书 25 | 26 | # > 趣头条 27 | # http-request ^https:\/\/api\.1sapp\.com\/(sign\/info|content\/readV2|x\/feed\/getReward) script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qtt/qtt.cookie.js,tag=趣头条,enabled=false 28 | 29 | # > 惠头条 30 | # http-request ^https:\/\/api\.cashtoutiao\.com script-path=https://raw.githubusercontent.com/iepngs/Script/master/htt/cookie.js,requires-body=true,timeout=30,tag=惠头条,enabled=false 31 | 32 | # > 腾讯新闻 33 | # http-request ^https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? script-path=https://raw.githubusercontent.com/iepngs/Script/master/txnews/index.js,requires-body=true,timeout=30,tag=腾讯新闻703,enabled=false 34 | # http-request ^https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js,requires-body=true,enabled=false 35 | 36 | # > 今日头条极速版 37 | # http-request ^https:\/\/is\.snssdk\.com\/score_task\/v1\/task\/(sign_in|get_read_bonus) script-path=https://raw.githubusercontent.com/iepngs/Script/master/jrtt/index.js,requires-body=true,tag=今日头条极速版,enabled=false 38 | # http-request ^https:\/\/i\.snssdk\.com\/ttgame\/game_farm\/home_info script-path=https://raw.githubusercontent.com/iepngs/Script/master/jrtt/index.js,requires-body=true,tag=今日头条极速版,enabled=false 39 | 40 | 41 | # //-------------------------------日签系列------------------------------------ 42 | # > lxhealth 43 | # http-request ^https:\/\/sports\.lifesense\.com\/sport_service\/sport\/sport\/uploadMobileStepV2 script-path=https://raw.githubusercontent.com/iepngs/Script/master/lxhealth/index.js,tag=lxhealth,enabled=false 44 | 45 | # > ikuuu 46 | # 手动登录 https://ikuuu.co 点击进入“我的信息”页面 如通知成功获取cookie, 则可以使用此签到脚本. 47 | http-request ^https?:\/\/ikuuu\.co\/user\/profile script-path=https://raw.githubusercontent.com/iepngs/Script/master/ikuuu/index.js,tag=ikuuu 48 | 49 | # > go语言中文网 50 | http-request ^https:\/\/studygolang\.com\/account\/edit script-path=https://raw.githubusercontent.com/iepngs/Script/master/studygolang/index.js,tag=go语言中文网 51 | 52 | # > 贴吧 53 | http-request ^https?:\/\/tieba.baidu\.com\/mg\/o\/userpost script-path=https://raw.githubusercontent.com/iepngs/Script/master/tieba/index.js,requires-body=true,timeout=30,tag=贴吧 54 | 55 | # > 吾爱破解 56 | http-request https:\/\/www\.52pojie\.cn\/home\.php\? script-path=https://raw.githubusercontent.com/NobyDa/Script/master/52pojie-DailyBonus/52pojie.js,tag=吾爱破解 57 | 58 | # > 叮咚买菜 59 | # 1.签到 60 | http-request ^https:\/\/maicai\.api\.ddxq\.mobi\/point\/home script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mcdd/mcdd.cookie.js,tag=叮咚签到 61 | # 2.农场 62 | http-request ^https:\/\/maicai\.api\.ddxq\.mobi\/user\/checkLogin script-path=https://raw.githubusercontent.com/iepngs/Script/master/dingdong/index.js,tag=叮咚农场 63 | # 2.果园 64 | http-request ^https:\/\/farm\.api\.ddxq\.mobi\/api\/v2\/props\/feed script-path=https://raw.githubusercontent.com/iepngs/Script/master/dingdong/ddgy.js,tag=叮咚果园 65 | 66 | # > 京东 67 | # 浏览器登录 https://bean.m.jd.com 点击签到并且出现签到日历 68 | http-request https:\/\/api\.m\.jd\.com\/client\.action.*functionId=signBean(Index|GroupStageIndex) max-size=0,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js,tag=京东 69 | 70 | # > 京东成长分 (By @barrymchen) 71 | http-request ^https:\/\/ms\.jr\.jd\.com\/gw\/generic\/bt\/h5\/m\/queryUserSignFlow script-path=https://raw.githubusercontent.com/nzw9314/QuantumultX/master/Task/jdczfcookie.js,tag=京东成长分 72 | 73 | # > 网易云音乐 74 | #1. 先登录: 75 | #2. 再访问: 76 | #3. 提示: `获取会话: 成功!` 77 | 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,tag=网易云音乐 78 | 79 | # > 去哪儿 80 | http-request ^https:\/\/user\.qunar\.com\/webapi\/member\/signIndexV2.htm script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qunar/qunar.cookie.js,tag=去哪儿 81 | 82 | # > 中国联通 83 | # 打开 APP , 进入签到页面, 系统提示: `获取刷新链接: 成功`,然后手动签到 1 次 84 | # 首页>天天抽奖, 系统提示 `2` 次: `获取Cookie: 成功 (登录抽奖)` 和 `获取Cookie: 成功 (抽奖次数)` 85 | http-request ^https:\/\/act\.10010\.com\/SigninApp\/signin\/querySigninActivity.htm script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js,tag=中国联通1 86 | http-request ^https:\/\/act\.10010\.com\/SigninApp(.*?)\/signin\/daySign script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js,tag=中国联通2 87 | http-request ^https:\/\/m\.client\.10010\.com\/dailylottery\/static\/(textdl\/userLogin|active\/findActivityInfo) script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js,tag=中国联通3 88 | 89 | # > 美团外卖 90 | http-request ^https:\/\/promotion\.waimai\.meituan\.com\/playcenter\/signIn\/entry script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.cookie.js,tag=美团外卖 91 | http-request ^https:\/\/promotion\.waimai\.meituan\.com\/playcenter\/signIn\/doaction script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.cookie.js,requires-body=true,tag=美团外卖 92 | 93 | # > 饿了么 (By @syzzzf) 94 | http-request ^https:\/\/h5\.ele\.me\/restapi\/eus\/v\d\/current_user$ script-path=https://raw.githubusercontent.com/songyangzz/QuantumultX/master/elem/elemGetCookies.js 95 | 96 | # > 携程旅行 (By @barrymchen) 97 | http-request https:\/\/m\.ctrip\.com\/restapi\/soa2\/14946\/json\/userBaseInfo script-path=https://raw.githubusercontent.com/iepngs/Script/master/ctrip/index.js,tag=携程旅行 98 | 99 | # > 滴滴出行 (By @zZPiglet) 100 | http-request ^https:\/\/as\.xiaojukeji\.com\/ep\/as\/toggles\? script-path=https://raw.githubusercontent.com/zZPiglet/Task/master/DiDi/DiDi.js,tag=滴滴出行 101 | 102 | # > 快手极速版签到 103 | http-request ^https:\/\/nebula\.kuaishou\.com\/rest\/n\/nebula\/sign\/sign script-path=https://raw.githubusercontent.com/iepngs/Script/master/ks/index.js,tag=快手极速版签到,enabled=true 104 | 105 | # --------------------------------微信小程序部分--------------------------------x 106 | 107 | # > 奈雪 (By @zZPiglet) 108 | http-request ^https:\/\/webapi\.qmai\.cn\/web\/cy\/v\d\/store\/template-scene script-path=https://raw.githubusercontent.com/zZPiglet/Task/master/Naixue/Naixue.js,tag=奈雪cookie 109 | 110 | # > 微信小程序 - 欧可林商城 (By @zZPiglet) 111 | http-request ^https:\/\/mall\.oclean\.com\/API\/VshopProcess\.ashx\?action=TaskHome&clientType=5&client=5&openId= script-path=https://raw.githubusercontent.com/zZPiglet/Task/master/Oclean/Oclean_mini.js,tag=欧可林商城cookie 112 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Script 2 | Loon远程脚本 3 | 4 | > [Cookie.conf](https://raw.githubusercontent.com/iepngs/Script/master/Cookie.conf): 用于获取api权限所需Cookie数据 5 | 6 | > [Task.conf](https://raw.githubusercontent.com/iepngs/Script/master/Task.conf): 用于定时任务脚本 7 | 8 | > [Script.conf](https://raw.githubusercontent.com/iepngs/Script/master/Script.conf): 用于request或response数据重写 9 | -------------------------------------------------------------------------------- /Script.conf: -------------------------------------------------------------------------------- 1 | # 该订阅为脚本合集,用于Remove Ads + unlock vip. 2 | # 需要配置 CA 证书并启用 MitM 开关. 3 | # 可以在使用后手动将本模块禁用,以免产生不必要的MITM. 4 | 5 | hostname = mp.weixin.qq.com,trade-acs.m.taobao.com,api.m.jd.com,pan.baidu.com,aweme*.snssdk.com,r.inews.qq.com 6 | # sports.lifesense.com,weixin.566.com,api.566.com,vipapi.jxedt.com 7 | 8 | # // - ------------------------去广告系列-------------------------------------- 9 | # > 朋友圈广告 10 | http-response ^https:\/\/mp\.weixin\.qq\.com\/mp\/(getappmsgext|getappmsgad) script-path=https://raw.githubusercontent.com/iepngs/Script/master/weixin/ad.js,requires-body=true,tag=朋友圈广告 11 | 12 | # > 腾讯新闻广告 13 | http-response ^https://r\.inews\.qq.com\/get(QQNewsUnreadList|RecommendList) requires-body=1,script-path=https://raw.githubusercontent.com/Choler/Surge/master/Script/QQNews.js,tag=腾讯新闻去广告 14 | 15 | # // - ------------------------重写系列---------------------------------------- 16 | # > 抖音 Remove Ad & Logo 17 | # 需配合URL Rewrite使用 18 | http-response ^https?:\/\/aweme\.snssdk\.com\/aweme\/v1\/(aweme\/post|feed|follow\/feed|nearby\/feed|search\/item|general\/search\/single|hot\/search\/video\/list)\/ script-path=https://Choler.github.io/Surge/Script/douyin.js, requires-body=true, timeout=10, tag=抖音 19 | 20 | # > 健康步数 21 | # http-request ^https:\/\/sports\.lifesense\.com\/sport_service\/sport\/sport\/uploadMobileStepV2 script-path=https://raw.githubusercontent.com/iepngs/Script/master/lxhealth/manual.js,requires-body=true,tag=lxhealth,enabled=false 22 | 23 | # > 京东比价 24 | http-response ^https?://api\.m\.jd\.com/client\.action\?functionId=(wareBusiness|serverConfig|basicConfig) requires-body=1,script-path=https://raw.githubusercontent.com/yichahucha/surge/master/jd_price.js,tag=京东比价 25 | 26 | # > 淘宝比价 27 | # 不生效或失效的需要卸载 tb 重装,注意不开脚本进 tb 会失效 28 | http-request ^http://.+/amdc/mobileDispatch requires-body=1,script-path=https://raw.githubusercontent.com/yichahucha/surge/master/tb_price.js,tag=淘宝比价1(内置版) 29 | http-response ^https?://trade-acs\.m\.taobao\.com/gw/mtop\.taobao\.detail\.getdetail requires-body=1,script-path=https://raw.githubusercontent.com/yichahucha/surge/master/tb_price.js,tag=淘宝比价2(内置版) 30 | # Lite弹窗版 31 | http-request ^http://.+/amdc/mobileDispatch requires-body=1,script-path=https://raw.githubusercontent.com/yichahucha/surge/master/tb_price_lite.js,tag=淘宝比价1 Lite(通知版) 32 | http-response ^https?://trade-acs\.m\.taobao\.com/gw/mtop\.taobao\.detail\.getdetail requires-body=1,script-path=https://raw.githubusercontent.com/yichahucha/surge/master/tb_price_lite.js,tag=淘宝比价2 Lite(通知版) 33 | 34 | # > 驾校一点通 (by @superuv) 35 | # http-response ^https:\/\/vipapi\.jxedt\.com\/vip\/check requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/nzw9314/QuantumultX/master/Script/jxydt.js,tag=驾校一点通 36 | 37 | # > 云盘解析(Made by Meeta) 38 | http-response ^https?:\/\/pan\.baidu\.com\/s\/ requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/nzw9314/MeetaRules/master/Surge/Scripting/yun_analyze.js,tag=云盘解析 39 | 40 | # > 万题库 41 | # http-response ^https:\/\/(api|weixin)\.566\.com\/api\/(Sys\/UserVipStatus|Sys\/HasVipPrivilege|User\/UserInfos|Resource\/IsUnlockChapter|ad\/AdList|ad\/noticelist) script-path=https://raw.githubusercontent.com/iepngs/Script/master/wtk/index.js,requires-body=true,tag=万题库 42 | -------------------------------------------------------------------------------- /Task.conf: -------------------------------------------------------------------------------- 1 | # 定时脚本 2 | 3 | # //-------------------------------羊毛系列------------------------------------ 4 | # > Debug 5 | cron "5,35 8-21 * * *" script-path=https://gitee.com/iepngs/repo/raw/loon/index.js,tag=Debug,enabled=false 6 | 7 | 8 | # > 电视家 (By @Macsuny) 9 | # APP登陆账号后,点击底部’赚赚‘进入签到页面,即可获取Cookie. 10 | # cron "0 0 7,12,20 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js,tag=电视家_用plugin里的 11 | 12 | # > 中青看点极速版 (By @Macsuny) 13 | # 1.进入app,签到一次,即可获取Cookie. 14 | # 2.阅读一篇文章,获取阅读请求body 15 | # 3.在阅读文章最下面有个惊喜红包,点击获取惊喜红包请求 16 | # // 已取消。4.激励视频获取方法: 关闭vpn,进入任务中心=>抽奖赚点击下面第一个宝箱,出现视频广告页面,然后打开vpn,等待视频播放完毕,点击点我继续领青豆,再重复一次上面操作,获取激励视频请求的body 17 | # > 中青极速版 18 | cron "*/7 7-18 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/youth/index.js,tag=中青看点_用plugin里的,enabled=false 19 | 20 | # > 今日头条极速版 21 | # 打开 APP 手动签到一次:`个人中心`右上角`签到` 22 | # cron "5,35 8-21 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/jrtt/index.js,tag=今日头条极速版,enabled=false 23 | 24 | # > 快手极速版签到 25 | # 手动签到一次,次日起可用 26 | cron "15 9 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/ks/index.js,tag=快手极速版签到 27 | 28 | # > 梨涡签到领现金 29 | # 手动签到一次,次日起可用 30 | # cron "7 0 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/liwo/index.js,tag=梨涡签到 31 | 32 | # > 企鹅阅读 (By @ziye12) 33 | # cron "*/10 9-23 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/qq/read.js, tag=企鹅读书 34 | 35 | # //-------------------------------日签系列------------------------------------ 36 | 37 | # > lxhealth 38 | # cron "16 9 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/lxhealth/index.js,tag=lxhealth,enabled=false 39 | 40 | # > dingtalk 41 | cron "30 8,18 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/dingtalk/index.js,tag=打卡提醒 42 | 43 | # > ikuuu 44 | cron "10 11 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/ikuuu/index.js,tag=ikuuu 45 | 46 | # > go语言中文网 47 | cron "13 11 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/studygolang/index.js,tag=go语言中文网 48 | 49 | # > 贴吧 50 | cron "10 9 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/tieba/index.js,tag=贴吧 51 | 52 | # > 吾爱破解 53 | cron "25 12 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/52pojie-DailyBonus/52pojie.js,tag=吾爱破解 54 | 55 | # > 京东系列合集 (By @NobyDa、@lxk0301) 56 | cron "10 0 8 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js,tag=京东 57 | # 东东农场 58 | cron "15 7,12,17 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js,tag=东东农场 59 | # 种豆得豆 60 | cron "1 7-21/2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js,tag=种豆得豆 61 | # 天天加速 62 | cron "8 */3 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_speed.js,tag=京东天天加速,enabled=false 63 | # 京东摇钱树 64 | cron "3 */2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_moneyTree.js,tag=京东摇钱树 65 | # 京小超 66 | cron "11 1-23/5 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_superMarket.js,tag=京小超 67 | # 京小超兑换奖品 68 | cron "0 0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js,tag=京小超兑换奖品 69 | # 进店领豆 70 | cron "10 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_shop.js,tag=进店领豆 71 | # 摇京豆 72 | cron "5 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_club_lottery.js,tag=摇京豆 73 | # 京豆变动通知 74 | cron "2 9 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_change.js,tag=京豆变动通知 75 | # 领京豆额外奖励 76 | cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js, tag=领京豆额外奖励 77 | # 健康抽奖机 78 | cron "10 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机 79 | # 东东萌宠 80 | # cron "25 7,12,17 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js,tag=东东萌宠 81 | # 京东汽车 82 | # 活动入口:首页京东汽车屏幕右中部,车主福利,长期活动,签到满500赛点可兑换500京豆 83 | # cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车 84 | # 京东代属 85 | # cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属,enabled=false 86 | # 数码加购京豆 87 | # cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_digital_floor.js, tag=数码加购京豆 88 | # 直播红包雨 89 | # cron "0 0,9,11,13,15,17,19,20,21,23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨 90 | # 京东直播 91 | # cron "10-20/5 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js,tag=京东直播 92 | # 京东看一看 93 | # cron "10-20/10 9 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js,tag=京东看一看 94 | # 京东炸年兽 95 | # cron "0 8 * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian.js,tag=京东炸年兽 96 | # 京东炸年兽收🧨 97 | # cron "20 * * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nianCollect.js,tag=京东收🧨 98 | # 京东宠汪汪 99 | # cron "15 */2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy.js,tag=京东宠汪汪 100 | # 宠汪汪偷好友积分与狗粮 101 | # cron "0 0,6 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_steal.js,tag=宠汪汪偷好友积分与狗粮 102 | # 京东宠汪汪喂食 103 | # cron "15 */1 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_feedPets.js,tag=京东宠汪汪喂食 104 | # 宠汪汪积分兑换奖品 105 | # cron "0 0-16/8,12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_reward.js,tag=宠汪汪积分兑换奖品 106 | # 宠汪汪邀请助力与赛跑助力 107 | # cron "15 10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_run.js,tag=宠汪汪邀请助力与赛跑助力,enabled=false 108 | # 店铺签到 109 | # cron "1 0 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/jd/index.js,tag=店铺签到,enabled=false 110 | # 京东全民开红包 111 | # cron "1 1 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_redPacket.js,tag=京东全民开红包 112 | # 秒杀红包雨 113 | # cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨 114 | # 金榜年终奖 ,活动2020-12-12日结束,活动入口:京东APP首页右边浮动飘窗 115 | # cron "10 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_split.js,tag=年终奖 116 | # 京东手机狂欢城 117 | # cron "1 0-18/6 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_818.js,tag=京东手机狂欢城,enabled=false 118 | # 京东星推官 119 | # cron "2 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_xtg.js,tag=京东星推官,enabled=false 120 | 121 | 122 | # > 叮咚买菜 123 | #1.打开 APP, 访问下`我的`>`积分` 124 | cron "10 6 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mcdd/mcdd.js,tag=叮咚买菜 125 | #2."我的"- 叮咚农场 126 | cron "1 8,12,17 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/dingdong/index.js,tag=叮咚农场养鱼 127 | # 叮咚果园 浇一次水抓ck 128 | cron "1 8,11,17 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/dingdong/ddgy.js,tag=叮咚果园 129 | #3.叮咚网红打卡免费领 首页-网红打卡地-打卡免费领banner - 手动签到一次,次日起可用 130 | cron "7 0 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/dingdong/activitySign.js,tag=叮咚网红打卡免费领,enabled=false 131 | 132 | # > 电信营业厅 133 | #打开 APP 手动签到一次: 访问下右下角 `我` > `签到` (头像下面) 134 | # cron "50 0 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.js,tag=电信营业厅,enabled=false 135 | 136 | # > 网易云音乐 137 | #浏览器访问并登录: https://music.163.com/m/login 138 | cron "10 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.js,tag=网易云音乐 139 | 140 | # > 去哪儿 141 | #打开 APP 然后手动签到 1 次 142 | cron "40 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/qunar/qunar.js,tag=去哪儿 143 | 144 | # > 中国联通 145 | #1打开 APP , 进入签到页面, 系统提示: `获取刷新链接: 成功`,然后手动签到 1 次 146 | #2首页>天天抽奖, 系统提示 `2` 次: `获取Cookie: 成功 (登录抽奖)` 和 `获取Cookie: 成功 (抽奖次数)` 147 | cron "5 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.js,tag=中国联通 148 | 149 | # > 美团外卖 150 | #打开 APP , 进入签到页面, 系统提示: `获取刷新链接: 成功`,然后手动签到 1 次 151 | cron "35 8 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.js,tag=美团外卖 152 | 153 | # > 其他 154 | # > 饿了么 (By @syzzzf) 155 | #打开 APP, 访问下`我的`>`签到领红包`(左上角) 156 | cron "9 8 * * *" script-path=https://raw.githubusercontent.com/songyangzz/QuantumultX/master/elem/elemSign.js,tag=饿了么 157 | cron "9 8 * * *" script-path=https://raw.githubusercontent.com/zZPiglet/Task/master/elem/elemCheckIn.js,tag=饿了么-打卡领红包 158 | 159 | # > 携程旅行 (By @barrymchen) 160 | #打开App 点击”我的“,然后点击”我的积分“,再点击下面的”签到.任务“即可 161 | # cron "29 8 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/ctrip/index.js,tag=携程旅行 162 | 163 | # > 滴滴出行 (By @zZPiglet) 164 | # 进入"滴滴出行",若弹出"首次写入滴滴出行 Token 成功" 165 | cron "14 10 * * *" script-path=https://raw.githubusercontent.com/zZPiglet/Task/master/DiDi/DiDi.js,tag=滴滴出行 166 | cron "50 23 * * *" script-path=https://raw.githubusercontent.com/zZPiglet/Task/master/DiDi/DiDi_reward.js,tag=滴滴出行 167 | 168 | # > 奈雪 (By @zZPiglet) 169 | # 进入"奈雪点单"小程序,若弹出"首次写入奈雪の茶 Token 成功" 170 | cron "3 10 * * *" script-path=https://raw.githubusercontent.com/zZPiglet/Task/master/Naixue/Naixue.js,tag=奈雪 171 | 172 | # > 微信小程序 - 欧可林商城 (By @zZPiglet) 173 | # 进入微信小程序"欧可林商城"并点击"每日任务" 174 | cron "8 10 * * *" script-path=https://raw.githubusercontent.com/zZPiglet/Task/master/Oclean/Oclean_mini.js,tag=欧可林商城 175 | 176 | # > iOS限免监控 177 | # cron "40 10,17 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/iosapp/index.js,tag=iOS限免监控,enabled=false 178 | -------------------------------------------------------------------------------- /ctrip/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | cookie获取: 在携程app内点击"我的",然后点击"我的积分",再点击下面的"签到.任务"即可 3 | http-request https:\/\/m\.ctrip\.com\/restapi\/soa2\/14946\/json\/userBaseInfo script-path=https://raw.githubusercontent.com/iepngs/Script/master/ctrip/index.js,tag=携程旅行 4 | mimt:m.ctrip.com 5 | 6 | cron "29 8 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/ctrip/index.js,tag=携程旅行 7 | */ 8 | 9 | const $hammer=(()=>{const isRequest="undefined"!=typeof $request,isSurge="undefined"!=typeof $httpClient,isQuanX="undefined"!=typeof $task;const log=(...n)=>{for(let i in n)console.log(n[i])};const alert=(title,body="",subtitle="",options={})=>{let link=null;switch(typeof options){case"string":link=isQuanX?{"open-url":options}:options;break;case"object":if(["null","{}"].indexOf(JSON.stringify(options))==-1){link=isQuanX?options:options["open-url"];break}default:link=isQuanX?{}:""}if(isSurge)return $notification.post(title,subtitle,body,link);if(isQuanX)return $notify(title,subtitle,body,link);log("==============📣系统通知📣==============");log("title:",title,"subtitle:",subtitle,"body:",body,"link:",link)};const read=key=>{if(isSurge)return $persistentStore.read(key);if(isQuanX)return $prefs.valueForKey(key)};const write=(val,key)=>{if(isSurge)return $persistentStore.write(val,key);if(isQuanX)return $prefs.setValueForKey(val,key)};const request=(method,params,callback)=>{let options={};if(typeof params=="string"){options.url=params}else{options.url=params.url;if(typeof params=="object"){params.headers&&(options.headers=params.headers);params.body&&(options.body=params.body)}}method=method.toUpperCase();const writeRequestErrorLog=function(m,u){return err=>{log(`\n===request error-s--\n`);log(`${m} ${u}`,err);log(`\n===request error-e--\n`)}}(method,options.url);if(isSurge){const _runner=method=="GET"?$httpClient.get:$httpClient.post;return _runner(options,(error,response,body)=>{if(error==null||error==""){response.body=body;callback("",body,response)}else{writeRequestErrorLog(error);callback(error,"",response)}})}if(isQuanX){options.method=method;$task.fetch(options).then(response=>{response.status=response.statusCode;delete response.statusCode;callback("",response.body,response)},reason=>{writeRequestErrorLog(reason.error);response.status=response.statusCode;delete response.statusCode;callback(reason.error,"",response)})}};const done=(value={})=>{if(isQuanX)return isRequest?$done(value):null;if(isSurge)return isRequest?$done(value):$done()};const pad=(c="~",s=false,l=15)=>s?console.log(c.padEnd(l,c)):`\n${c.padEnd(l,c)}\n`;return{isRequest,isSurge,isQuanX,log,alert,read,write,request,done,pad}})(); 10 | 11 | const Protagnist = "携程旅行"; 12 | const cookieKey = "cookie_ctrip"; 13 | 14 | function GetCookie(){ 15 | const cookieVal = $request.headers.Cookie; 16 | if (cookieVal) { 17 | $hammer.write(cookieVal, cookieKey); 18 | $hammer.alert(Protagnist, '获取Cookie: 成功'); 19 | } 20 | $hammer.done(); 21 | } 22 | 23 | function Sign() { 24 | const cookieVal = $hammer.read(cookieKey); 25 | if(!cookieVal){ 26 | $hammer.log(`${Protagnist} 无cookie`); 27 | $hammer.done(); 28 | } 29 | const options = { 30 | url: 'https://m.ctrip.com/restapi/soa2/14946/json/saveDailyBonus?', 31 | headers: { 32 | 'Cookie': cookieVal, 33 | 'User-Agent' : `Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 mediaCode=SFEXPRESSAPP-iOS-ML`, 34 | } 35 | } 36 | $hammer.request('get', options, (error, response, data) => { 37 | const result = JSON.parse(response); 38 | const detail = result.resultcode == 0 ? `签到结果: 成功,总积分${result.integrated}` : `签到结果: 未知, ${result.resultmessage}`; 39 | $hammer.alert(Protagnist, detail); 40 | $hammer.done(); 41 | }) 42 | } 43 | 44 | $hammer.isRequest ? GetCookie() : Sign(); 45 | 46 | 47 | 48 | function randomNumber(start, end, fixed = 0) {const differ = end - start, random = Math.random();return (start + differ * random).toFixed(fixed);}; 49 | let fakeMD5 = ""; 50 | for (let index = 0; ; index++) { 51 | const random = randomNumber(97, 132); 52 | fakeMD5 += random > 122 ? randomNumber(0, 9).toString() : String.fromCharCode(random); 53 | if(fakeMD5.length == 32) break; 54 | } 55 | console.log(fakeMD5); -------------------------------------------------------------------------------- /dingdong/activitySign.js: -------------------------------------------------------------------------------- 1 | // 叮咚网红打卡免费领 2 | // 首页-网红打卡地-打卡免费领banner - 手动签到一次,次日起可用 3 | // app下载⏬: 4 | 5 | // ---------------------------------------------------------------------------- 6 | 7 | // QX 8 | // [MITM] 9 | // hostname=gw.api.ddxq.mobi 10 | 11 | // [rewrite_local] 12 | // ^https:\/\/gw\.api\.ddxq\.mobi\/promocore-service\/client\/maicai\/mcActivityTrigger\/v1\/trigger url script-request-body https://raw.githubusercontent.com/iepngs/Script/master/dingdong/activitySign.js 13 | 14 | // [local_tasK] 15 | // 7 0 * * * https://raw.githubusercontent.com/iepngs/Script/master/dingdong/activitySign.js, tag=叮咚网红打卡 16 | 17 | // ---------------------------------------------------------------------------- 18 | // Loon 19 | 20 | // [MITM] 21 | // hostname=gw.api.ddxq.mobi 22 | 23 | // [Script] 24 | // http-request ^https:\/\/gw\.api\.ddxq\.mobi\/promocore-service\/client\/maicai\/mcActivityTrigger\/v1\/trigger script-path=https://raw.githubusercontent.com/iepngs/Script/master/dingdong/activitySign.js, requires-body=true, timeout=10, tag=叮咚网红打卡Cookie 25 | // cron "7 0 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/dingdong/activitySign.js,tag=叮咚网红打卡 26 | 27 | // ---------------------------------------------------------------------------- 28 | 29 | const $ = hammer("叮咚网红打卡"); 30 | const CookieKey = "CookieDDXQSign"; 31 | 32 | function GetCookie() { 33 | const CookieVal = JSON.stringify({ 34 | c: $request.headers.Cookie, 35 | u: $request.headers['User-Agent'], 36 | b: $request.body, 37 | }); 38 | $.log(`cookie:\n ${CookieVal}`); 39 | $.write(CookieVal, CookieKey); 40 | $.alert('签到Cookie写入成功'); 41 | $.done(); 42 | } 43 | 44 | async function main() { 45 | let CookieVal = $.read(CookieKey); 46 | CookieVal = CookieVal ? JSON.parse(CookieVal) : ""; 47 | if(!CookieVal){ 48 | $.log("Cookie不存在,中止运行."); 49 | return $.done(); 50 | } 51 | const options = { 52 | url: "https://gw.api.ddxq.mobi/promocore-service/client/maicai/mcActivityTrigger/v1/trigger", 53 | headers: { 54 | "Content-Type": "application/x-www-form-urlencoded", 55 | "Cookie": CookieVal.c, 56 | "User-Agent": CookieVal.u 57 | }, 58 | body: CookieVal.b.replace(/&bizNo=\d+/, "&bizNo=" + (+new Date()).toString()) 59 | }; 60 | $.request('post', options, (error, response, data) => { 61 | if(error){ 62 | $.log(`sign request error: \n${error}`); 63 | return resolve(); 64 | } 65 | $.log(`sign response: \n${response}`); 66 | response = JSON.parse(response); 67 | if (response.msg == "请求成功" && !response.code) { 68 | $.alert('今日打卡成功'); 69 | return resolve(); 70 | } 71 | $.alert(response.msg); 72 | $.done(); 73 | }) 74 | } 75 | 76 | if(Date.now() > 1601481600000){ 77 | $.log("活动已结束"); 78 | $.done(); 79 | }else{ 80 | $.isRequest ? GetCookie() : main(); 81 | } 82 | 83 | function hammer(t="untitled",l=3){return new class{constructor(t,l){this.name=t,this.logLevel=l,this.isRequest=("object"==typeof $request)&&$request.method!="OPTIONS",this.isSurge="undefined"!=typeof $httpClient,this.isQuanX="undefined"!=typeof $task,this.isNode="function"==typeof require,this.node=(()=>{if(!this.isNode){return null}const file="localstorage.yml";let f,y,r;try{f=require('fs');y=require('js-yaml');r=require('request');f.appendFile(file,"",function(err){if(err)throw err;})}catch(e){console.log("install unrequired module by: yarn add module_name");console.log(e.message);return{}}return{file:file,fs:f,yaml:y,request:r,}})()}log(...n){if(l<2){return null}console.log(`\n***********${this.name}***********`);for(let i in n)console.log(typeof n[i]=="object"?JSON.stringify(n[i]):n[i])}alert(body="",subtitle="",options={}){if(l==2||l==0){return null}if(typeof options=="string"){options={"open-url":options}}let link=null;if(Object.keys(options).length){link=this.isQuanX?options:{openUrl:options["open-url"],mediaUrl:options["media-url"]}}if(this.isSurge)return $notification.post(this.name,subtitle,body,link);if(this.isQuanX)return $notify(this.name,subtitle,body,link);console.log(`系统通知📣\ntitle:${this.name}\nsubtitle:${subtitle}\nbody:${body}\nlink:${link}`)}request(method,params,callback){let options={};if(typeof params=="string"){options.url=params}else{options.url=params.url;if(typeof params=="object"){params.headers&&(options.headers=params.headers);params.body&&(options.body=params.body)}}method=method.toUpperCase();const writeRequestErrorLog=function(n,m,u){return err=>console.log(`${n}request error:\n${m}${u}\n${err}`)}(this.name,method,options.url);if(this.isSurge){const _runner=method=="GET"?$httpClient.get:$httpClient.post;return _runner(options,(error,response,body)=>{if(error==null||error==""){response.body=body;callback("",body,response)}else{writeRequestErrorLog(error);callback(error,"",response)}})}options.method=method;if(this.isQuanX){$task.fetch(options).then(response=>{response.status=response.statusCode;delete response.statusCode;callback("",response.body,response)},reason=>{writeRequestErrorLog(reason.error);response.status=response.statusCode;delete response.statusCode;callback(reason.error,"",response)})}if(this.isNode){if(options.method=="POST"&&options.body){try{options.body=JSON.parse(options.body);options.json=true}catch(e){console.log(e.message)}}this.node.request(options,(error,response,body)=>{if(typeof body=="object"){body=JSON.stringify(body)}if(typeof response=='object'&&response){response.status=response.statusCode;delete response.statusCode}callback(error,body,response)})}}read(key){if(this.isSurge)return $persistentStore.read(key);if(this.isQuanX)return $prefs.valueForKey(key);if(this.isNode){let val="";try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");const data=this.node.yaml.safeLoad(fileContents);val=(typeof(data)=="object"&&data[key])?data[key]:""}catch(e){console.log(`读取文件时错误:\n${e.message}`);return""}return val}}write(val,key){if(this.isSurge)return $persistentStore.write(val,key);if(this.isQuanX)return $prefs.setValueForKey(val,key);if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};data[key]=val;val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}delete(key){if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};if(!data.hasOwnProperty(key)){return true}delete data[key];const val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}done(value={}){if(this.isQuanX)return $done(value);if(this.isSurge)return this.isRequest?$done(value):$done()}pad(s=false,c="*",l=15){return s?this.log(c.padEnd(l,c)):`\n${c.padEnd(l,c)}\n`}}(t,l)} -------------------------------------------------------------------------------- /dingdong/ddgy.js: -------------------------------------------------------------------------------- 1 | /** 2 | 叮咚果园 3 | 4 | 说明: 5 | 叮咚买菜App - 右下角“我的”- 叮咚果园 进入后浇水一次即可获取cookie(种新树需要重新捕获一次) 6 | 7 | ************************ 8 | [Mitm] 9 | ************************ 10 | hostname = farm.api.ddxq.mobi 11 | 12 | 13 | ************************ 14 | QuantumultX 本地脚本配置: 15 | ************************ 16 | 17 | [task_local] 18 | # 叮咚果园 19 | 1 8,12,17 * * * iepngs/Script/master/dingdong/ddgy.js 20 | 21 | [rewrite_local] 22 | # 获取Cookie 23 | https:\/\/farm\.api\.ddxq\.mobi\/api\/v2\/props\/feed url script-request-header iepngs/Script/master/dingdong/ddgy.js 24 | 25 | 26 | ************************ 27 | Loon 2.1.0+ 脚本配置: 28 | ************************ 29 | 30 | [Script] 31 | # 叮咚果园 32 | cron "1 8,11,17 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/dingdong/ddgy.js,tag=叮咚果园 33 | 34 | # 获取Cookie 35 | http-request ^https:\/\/farm\.api\.ddxq\.mobi\/api\/v2\/props\/feed script-path=https://raw.githubusercontent.com/iepngs/Script/master/dingdong/ddgy.js,tag=叮咚果园 36 | 37 | *********************** 38 | Nodejs 39 | *********************** 40 | export DDFruitFarm = {"station_id":"抓包获得"","uid":"抓包获得"","seedId":"抓包获得","propsId":"抓包获得","cookie":"抓包获得"} 41 | 如:export DDFruitFarm = {"station_id":"5de89c8d26c3d","uid":"5d7ccfda7e48","seedId":"2108272230","propsId":"21082722","cookie":"DDXQSESSID=f3ccf95fb545f7"} 42 | **/ 43 | 44 | const $ = hammer("叮咚果园", 3); 45 | 46 | const CookieKey = "DDFruitFarm", 47 | DD_API_HOST = 'https://farm.api.ddxq.mobi/api/v2'; 48 | 49 | let CookieValue = $.read(CookieKey); 50 | CookieValue = CookieValue ? CookieValue : (($.isNode && process.env[CookieKey]) ? process.env[CookieKey] : ''); 51 | CookieContents = CookieValue ? JSON.parse(CookieValue) : {}; 52 | const {station_id, uid, seedId, propsId} = CookieContents; 53 | 54 | function GetCookie() { 55 | // https://farm.api.ddxq.mobi/api/v2/props/feed?api_version=9.1.0&app_client_id=1&station_id=5de89&native_version=&uid=5dc&latitude=31.292&longitude=121.425&propsCode=FEED&seedId=210&propsId=210 56 | let ur = $request.url.split('?'); 57 | ur.shift(); 58 | ur = ur.join('?').split('&'); 59 | const keys = Object.keys(CookieContents); 60 | for (const u of ur) { 61 | let pv = u.split('='); 62 | const k = pv.shift(); 63 | if (!keys.includes(k)) { 64 | continue; 65 | } 66 | CookieContents[k] = pv.join('='); 67 | } 68 | CookieContents.cookie = $request.headers.Cookie; 69 | for (const k of keys) { 70 | if(!CookieContents[k]){ 71 | return $.done(); 72 | } 73 | } 74 | CookieValue = JSON.stringify(CookieContents); 75 | const result = $.write(CookieValue, CookieKey); 76 | $.alert(result ? "Cookie已写入" : "Cookie已捕获但写入失败"); 77 | return $.done(); 78 | } 79 | 80 | const initRequestHeaders = function() { 81 | return { 82 | "Host": "farm.api.ddxq.mobi", 83 | "Content-Type": "application/x-www-form-urlencoded", 84 | "Origin": "https://orchard-m.ddxq.mobi", 85 | "Accept-Encoding": "gzip, deflate, br", 86 | "Cookie": CookieContents.cookie, 87 | "Connection": "keep-alive", 88 | "Accept": "*/*", 89 | "User-Agent": `Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 xzone/9.31.1 station_id/${station_id}`, 90 | "Referer": "https://orchard-m.ddxq.mobi/?is_nav_hide=true&s=mine_orchard", 91 | "Accept-Language": "zh-cn", 92 | "DDMC-GAME-TID": "2", 93 | }; 94 | }; 95 | 96 | function fetchMyTask(){ 97 | return new Promise(resolve =>{ 98 | const options = { 99 | url: `${DD_API_HOST}/task/list?api_version=9.1.0&app_client_id=1&station_id=${station_id}&native_version=&app_version=9.31.1&uid=${uid}&latitude=30.272356&longitude=120.022035&gameId=1&cityCode=0901`, 100 | headers: initRequestHeaders() 101 | } 102 | $.request("GET", options, async (error, response) =>{ 103 | if(error){ 104 | $.log(error) 105 | return resolve(); 106 | } 107 | response = JSON.parse(response); 108 | if(response.code){ 109 | $.log(response); 110 | $.alert(response.msg, "task/list"); 111 | return resolve(); 112 | } 113 | if(response.error){ 114 | $.log(response); 115 | $.alert(`${response.status}#${response.error}#${response.message}`, "task/list"); 116 | return resolve(); 117 | } 118 | const taskList = response.data.userTasks; 119 | const taskStatus = { 120 | "TO_ACHIEVE": "未完成", 121 | "TO_REWARD": "已完成,未领取奖励", 122 | "WAITING_REWARD": "等待完成", 123 | "WAITING_WINDOW": "未到领取时间", 124 | "FINISHED": "完成,已领取奖励", 125 | }; 126 | for (const task of taskList) { 127 | if(["INVITATION", "POINT_EXCHANGE", "LUCK_DRAW"].includes(task.taskCode)){ 128 | continue; 129 | } 130 | const desc = task.taskDescription[0] ? `:${task.taskDescription[0]}` : ""; 131 | const status = taskStatus[task.buttonStatus] ? taskStatus[task.buttonStatus] : (task.buttonStatus ? task.buttonStatus : "未知"); 132 | switch (task.buttonStatus) { 133 | case "TO_ACHIEVE": 134 | if(["ANY_ORDER", "BUY_GOODS", "MULTI_ORDER"].includes(task.taskCode)){ 135 | continue; 136 | } 137 | console.log(`\n${task.taskName}(${task.taskCode})${desc}\n- 持续天数:${task.continuousDays}\n- 任务状态:${status}`); 138 | await taskAchieve(task.taskCode); 139 | break; 140 | case "TO_REWARD": 141 | task.userTaskLogId && await taskReward(task.userTaskLogId); 142 | break; 143 | } 144 | } 145 | resolve(); 146 | }) 147 | }); 148 | } 149 | 150 | // 做任务 151 | function taskAchieve(taskCode){ 152 | return new Promise(resolve =>{ 153 | const options = { 154 | url: `${DD_API_HOST}/task/achieve?api_version=9.28.0&env=PE&app_client_id=3&station_id=${station_id}&native_version=9.31.1&h5_source=&page_type=2&gameId=2&city_number=0901&uid=${uid}&latitude=30.272356&longitude=120.022035&taskCode=${taskCode}`, 155 | headers: initRequestHeaders() 156 | } 157 | $.request("GET", options, async (error, response) =>{ 158 | if(error){ 159 | $.log(error) 160 | return resolve(); 161 | } 162 | response = JSON.parse(response); 163 | if(response.code){ 164 | $.log(response); 165 | $.alert(response.msg, `task/achieve?${taskCode}`); 166 | return resolve(); 167 | } 168 | if (response.data.taskStatus == "ACHIEVED") { 169 | const userTaskLogId = response.data.hasOwnProperty("userTaskLogId")?response.data.userTaskLogId:null; 170 | if(userTaskLogId){ 171 | await taskReward(userTaskLogId); 172 | return resolve(); 173 | } 174 | } 175 | await showReward(response.data.rewards); 176 | resolve(); 177 | }) 178 | }) 179 | } 180 | 181 | // 有任务编号的领取奖励 182 | function taskReward(userTaskLogId){ 183 | return new Promise(resolve => { 184 | const options = { 185 | url: `${DD_API_HOST}/task/reward?api_version=9.1.0&app_client_id=1&station_id=${station_id}&native_version=&latitude=30.272356&longitude=120.022035&gameId=1&userTaskLogId=${userTaskLogId}&uid=${uid}`, 186 | headers: initRequestHeaders() 187 | } 188 | $.request("GET", options, async (error, response) =>{ 189 | if(error){ 190 | $.log(error) 191 | return resolve(); 192 | } 193 | response = JSON.parse(response); 194 | if(response.code){ 195 | $.log(response); 196 | $.alert(response.msg, "task/reward"); 197 | return resolve(); 198 | } 199 | await showReward(response.data.rewards); 200 | resolve(); 201 | }) 202 | }) 203 | } 204 | 205 | 206 | function showReward(data){ 207 | return new Promise(resolve => { 208 | let amount = {fr:0, fd:0}; 209 | for (const reward of data) { 210 | switch (reward.rewardCode) { 211 | case 'FERTILIZER': 212 | amount.fr += reward.amount; 213 | break; 214 | case 'FEED': 215 | amount.fd += reward.amount; 216 | default: 217 | break; 218 | } 219 | } 220 | // if(taskCode == "LOTTERY"){ 221 | // $.alert(`本时段三餐开福袋已领取:${amount}g`); 222 | // }else{ 223 | console.log(`任务完成,获得水滴:${amount.fd}g, 肥料:${amount.fr}g`); 224 | // } 225 | resolve(); 226 | }) 227 | } 228 | 229 | function fruitTreeSeed(i){ 230 | return new Promise(resolve => { 231 | const options = { 232 | url: `${DD_API_HOST}/props/feed?api_version=9.1.0&app_client_id=1&station_id=${station_id}&native_version=&uid=${uid}&latitude=30.272356&longitude=120.022035&propsCode=FEED&seedId=${seedId}&propsId=${propsId}`, 233 | headers: initRequestHeaders() 234 | }; 235 | console.log(`第${i}次浇水`); 236 | $.request("GET", options, (error, response) => { 237 | if(error){ 238 | $.log(error); 239 | return resolve(false); 240 | } 241 | response = JSON.parse(response); 242 | if(response.code){ 243 | console.log(response.msg); 244 | (response.code == 800) || $.alert(response.msg); 245 | return resolve(false); 246 | } 247 | const data = response.data; 248 | let treeName = data.seed.speciesCode.split('_')[0]; 249 | if(data.seed.expPercent >= 100){ 250 | $.alert(`去看看,${treeName}应该已经成熟了`); 251 | return resolve(false); 252 | } 253 | const remain = data.feed.amount; 254 | const description = `剩余水滴: ${remain}g, 肥料: ${data.fertilizer.amount}g(当前肥力:${data.fertilizerUse.amount}g),进度: ${data.seed.expPercent}, ${data.msg}`; 255 | console.log(description); 256 | if(remain < 10){ 257 | $.alert(description, `今天浇了${i}次,现在水滴不够了`); 258 | return resolve(false); 259 | } 260 | setTimeout(()=>{ 261 | resolve(true); 262 | }, Math.floor(Math.random()*1500)); 263 | }) 264 | }) 265 | } 266 | 267 | $.isRequest ? GetCookie() : (async function(){ 268 | if(!CookieContents.cookie){ 269 | $.alert("cookie不存在,先去获取吧(浇一次水)"); 270 | return $.done(); 271 | } 272 | await fetchMyTask(); 273 | console.log(`\n任务做完开始浇水\n`); 274 | let index = 1; 275 | while(await fruitTreeSeed(index)){ 276 | index++; 277 | } 278 | $.done(); 279 | })().catch(err => {$.log(`🙅 运行异常: ${err}`) && $.done()}); 280 | 281 | function hammer(t="untitled",l=3){return new class{constructor(t,l){this.name=t,this.logLevel=l,this.isRequest=("object"==typeof $request)&&$request.method!="OPTIONS",this.isSurge="undefined"!=typeof $httpClient,this.isQuanX="undefined"!=typeof $task,this.isNode="function"==typeof require,this.node=(()=>{if(!this.isNode){return null}const file="localstorage.yml";let f,y,r,yc,sc;try{f=require('fs');y=require('js-yaml');r=require('got');f.appendFile(file,"",function(err){if(err)throw err;});yc=y.load(f.readFileSync(file,"utf8"));sc=data=>f.writeFileSync(file,y.safeDump(data),'utf8')}catch(e){console.log(e.message);console.log("install unrequired module, example: yarn add js-yaml got");return{}}return{file:file,fs:f,yaml:y,request:r,yamlContents:yc,saveYamlContents:sc,}})()}log(...n){if(l<2){return null}for(let i in n){const ct=typeof n[i]=="object"?eval(`(${JSON.stringify(n[i])})`):n[i];console.log(`\n***********${this.name}***********\n${ct}`)}}alert(body="",subtitle="",options={}){if(l==2||l==0){return null}body=`${body}`;if(typeof options=="string"){options={"open-url":options}}let link={};if(Object.keys(options).length){link=this.isQuanX?options:{openUrl:options["open-url"],mediaUrl:options["media-url"]}}if(this.isSurge)return $notification.post(this.name,subtitle,body,link);if(this.isQuanX)return $notify(this.name,subtitle,body,link);console.log(`系统通知\ntitle:${this.name}\nsubtitle:${subtitle}\nbody:${body}\nlink:${link}`)}async request(method,params,callback){let options={};if(typeof params=="string"){options.url=params}else{options.url=params.url;if(typeof params=="object"){params.headers&&(options.headers=params.headers);params.body&&(options.body=params.body)}}if(!options.headers||typeof(options.headers)!="object"){options['headers']={}}if(!options.headers||(!Object.keys(options.headers).includes("User-Agent")&&!Object.keys(options.headers).includes("aser-agent"))){const ua='Mozilla%2F5.0%20(iPhone%3B%20CPU%20iPhone%20OS%2013_2_3%20like%20Mac%20OS%20X)%20AppleWebKit%2F605.1.15%20(KHTML%2C%20like%20Gecko)%20Version%2F13.0.3%20Mobile%2F15E148%20Safari%2F604.1';options['headers']['User-Agent']=decodeURIComponent(ua)}method=method.toUpperCase();const writeRequestErrorLog=function(n,m,u){return err=>console.log(`${n}request error:\n${m}${u}\n${err}`)}(this.name,method,options.url);if(this.isSurge){const _runner=method=="GET"?$httpClient.get:$httpClient.post;return _runner(options,(error,response,body)=>{if(error==null||error==""){response.body=body;callback("",body,response)}else{writeRequestErrorLog(error);callback(error,"",response)}})}options.method=method;if(this.isQuanX){$task.fetch(options).then(response=>{response.status=response.statusCode;delete response.statusCode;callback("",response.body,response)},reason=>{writeRequestErrorLog(reason.error);response.status=response.statusCode;delete response.statusCode;callback(reason.error,"",response)})}if(this.isNode){method=options.method.toLowerCase();const hc=this.node.request[method];if(typeof(hc)!="function"){return callback(`unsupport request method ${options.method}in got`)}let ro={responseType:"text",};if(options.headers){ro.headers=options.headers}if(options.body){ro.body=(options.body&&typeof(options.body)=="object")?JSON.stringify(options.body):options.body}if(params.option){const ks=Object.keys(params.option);for(const k of ks){ro[k]=params.option[k]}}let error="",body="",response={};try{response=await hc(options.url,ro);body=response.body;response={status:response.statusCode,headers:response.headers,body:body,}}catch(e){error=`${e.name}:${e.message}`}callback(error,body,response)}}read(key){if(this.isSurge)return $persistentStore.read(key);if(this.isQuanX)return $prefs.valueForKey(key);if(this.isNode){let val="";try{const data=this.node.yamlContents;val=(typeof(data)=="object"&&data[key])?(typeof(data[key])=='object'?JSON.stringify(data[key]):data[key]):""}catch(e){console.log(`读取文件时错误:\n${e.message}`);return""}return val}}write(val,key){if(this.isSurge)return $persistentStore.write(val,key);if(this.isQuanX)return $prefs.setValueForKey(val,key);if(this.isNode){try{const data=this.node.yamlContents;data=typeof data=="object"?data:{};data[key]=val;this.node.saveYamlContents(data)}catch(e){console.log(e.message);return false}return true}}delete(key){if(this.isSurge)return $persistentStore.remove(key);if(this.isQuanX)return $prefs.removeValueForKey(key);if(this.isNode){try{const data=this.node.yamlContents;data=typeof data=="object"?data:{};if(!data.hasOwnProperty(key)){return true}delete data[key];this.node.saveYamlContents(data)}catch(e){console.log(e.message);return false}return true}}done(value={}){if(this.isQuanX)return $done(value);if(this.isSurge)return this.isRequest?$done(value):$done()}pad(s=false,c="*",l=15){return s?this.log(c.padEnd(l,c)):`\n${c.padEnd(l,c)}\n`}}(t,l)} 282 | -------------------------------------------------------------------------------- /dingtalk/index.js: -------------------------------------------------------------------------------- 1 | // 数据来源: 2 | // http://www.apihubs.cn/#/holidays 3 | // https://segmentfault.com/a/1190000038961352 4 | 5 | const node = (new Date()).getHours() > 12 ? "下班" : "上班"; 6 | const $ = hammer(`钉钉${node}打卡`, 3); 7 | 8 | function initDate(){ 9 | const ds = (d, s='') => { 10 | const year = d.getFullYear(); 11 | let month = d.getMonth()+1; 12 | if(month<10){ 13 | month = `0${month}`; 14 | } 15 | let day = d.getDate(); 16 | if(day<10){ 17 | day = `0${day}`; 18 | } 19 | const a = [year, month, day].join(s); 20 | return s ? a : +a; 21 | }; 22 | let dateObj = new Date(); 23 | const today = ds(dateObj); 24 | const todayDate = ds(dateObj, "-"); 25 | dateObj.setDate(dateObj.getDate() + 1); 26 | return { 27 | today: today, 28 | tomorrow: ds(dateObj), 29 | todayDate: todayDate, 30 | } 31 | } 32 | 33 | function alertOptions() { 34 | // 每个公司的这个corpId不一样 35 | const corpId = "ding307c0c3ff8b707a435c2f4657eb6378f"; 36 | const link = "dingtalk://dingtalkclient/page/link?url=https%3A%2F%2Fattend.dingtalk.com%2Fattend%2Findex.html%3FcorpId%3D"; 37 | return {"open-url": `${link}${corpId}`}; 38 | } 39 | 40 | (() => { 41 | const {today, tomorrow, todayDate} = initDate(); 42 | const link = `https://api.apihubs.cn/holiday/get?field=date%2Cweek%2Cworkday%2Choliday_overtime&date=${today}%2C${tomorrow}&order_by=1&cn=1&size=2`; 43 | $.request('get', link, (error, response) => { 44 | let errMsg = `工作日检测异常`; 45 | if(error){ 46 | $.log(error); 47 | $.alert(errMsg); 48 | return $.done(); 49 | } 50 | try{ 51 | response = JSON.parse(response); 52 | }catch(e){} 53 | if(typeof(response) != "object"){ 54 | $.log(response); 55 | $.alert(errMsg, `返回数据解析错误`); 56 | return $.done(); 57 | } 58 | if(response.code != "0"){ 59 | $.log(response); 60 | $.alert(errMsg, response.msg); 61 | return $.done(); 62 | } 63 | if(response.data.list.length != 2){ 64 | $.log(response); 65 | $.alert(errMsg, `返回数据解析异常`); 66 | return $.done(); 67 | } 68 | let row = response.data.list[0]; 69 | const onWorking = row.workday == 1; 70 | const title = `${todayDate} ${row.week_cn}`; 71 | row = response.data.list[1]; 72 | // 明天上班 73 | if(row.workday == 1){ 74 | // 明天上班 75 | if(row.week > 5){ 76 | // 周末的补班 77 | let contents = `明天${row.holiday_overtime_cn}要搬砖,开起床闹钟`; 78 | if(onWorking){ 79 | // 今天上班明天也上班 80 | $.alert(contents, title, alertOptions()); 81 | return $.done(); 82 | } 83 | // 今天不上班明天补班 84 | $.alert(contents, title); 85 | return $.done(); 86 | } 87 | //周内的正常工作日 88 | if(onWorking){ 89 | $.alert(`明天继续搬砖`, title, alertOptions()); 90 | } 91 | }else{ 92 | // 明天不上班 93 | if(onWorking){ 94 | // 今天上班,明天不上班 95 | $.alert(`明儿可以休息了`, title, alertOptions()); 96 | } 97 | // 今明都不上班不提醒 98 | } 99 | return $.done(); 100 | }) 101 | })() 102 | 103 | function hammer(t="untitled",l=3){return new class{constructor(t,l){this.name=t,this.logLevel=l,this.isRequest=("object"==typeof $request)&&$request.method!="OPTIONS",this.isSurge="undefined"!=typeof $httpClient,this.isQuanX="undefined"!=typeof $task,this.isNode="function"==typeof require,this.node=(()=>{if(!this.isNode){return null}const file="localstorage.yml";let f,y,r;try{f=require('fs');y=require('js-yaml');r=require('request');f.appendFile(file,"",function(err){if(err)throw err;})}catch(e){console.log("install unrequired module, example: yarn add js-yaml request");console.log(e.message);return{}}return{file:file,fs:f,yaml:y,request:r,}})()}log(...n){if(l<2){return null}console.log(`\n***********${this.name}***********`);for(let i in n)console.log(typeof n[i]=="object"?JSON.stringify(n[i]):n[i])}alert(body="",subtitle="",options={}){if(l==2||l==0){return null}if(typeof options=="string"){options={"open-url":options}}let link=null;if(Object.keys(options).length){link=this.isQuanX?options:{openUrl:options["open-url"],mediaUrl:options["media-url"]}}if(this.isSurge)return $notification.post(this.name,subtitle,body,link);if(this.isQuanX)return $notify(this.name,subtitle,body,link);console.log(`系统通知\ntitle:${this.name}\nsubtitle:${subtitle}\nbody:${body}\nlink:${link}`)}request(method,params,callback){let options={};if(typeof params=="string"){options.url=params}else{options.url=params.url;if(typeof params=="object"){params.headers&&(options.headers=params.headers);params.body&&(options.body=params.body)}}method=method.toUpperCase();const writeRequestErrorLog=function(n,m,u){return err=>console.log(`${n}request error:\n${m}${u}\n${err}`)}(this.name,method,options.url);if(this.isSurge){const _runner=method=="GET"?$httpClient.get:$httpClient.post;return _runner(options,(error,response,body)=>{if(error==null||error==""){response.body=body;callback("",body,response)}else{writeRequestErrorLog(error);callback(error,"",response)}})}options.method=method;if(this.isQuanX){$task.fetch(options).then(response=>{response.status=response.statusCode;delete response.statusCode;callback("",response.body,response)},reason=>{writeRequestErrorLog(reason.error);response.status=response.statusCode;delete response.statusCode;callback(reason.error,"",response)})}if(this.isNode){if(options.method=="POST"&&options.body){try{options.body=JSON.parse(options.body)}catch(e){}}this.node.request(options,(error,response)=>{let body=response.body;if(typeof body=="object"){body=JSON.stringify(body)}if(typeof response=='object'&&response){response.status=response.statusCode;delete response.statusCode}callback(error,body,response)})}}read(key){if(this.isSurge)return $persistentStore.read(key);if(this.isQuanX)return $prefs.valueForKey(key);if(this.isNode){let val="";try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");const data=this.node.yaml.safeLoad(fileContents);val=(typeof(data)=="object"&&data[key])?data[key]:""}catch(e){console.log(`读取文件时错误:\n${e.message}`);return""}return val}}write(val,key){if(this.isSurge)return $persistentStore.write(val,key);if(this.isQuanX)return $prefs.setValueForKey(val,key);if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};data[key]=val;val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}delete(key){if(this.isSurge)return $persistentStore.remove(key);if(this.isQuanX)return $prefs.removeValueForKey(key);if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};if(!data.hasOwnProperty(key)){return true}delete data[key];const val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}done(value={}){if(this.isQuanX)return $done(value);if(this.isSurge)return this.isRequest?$done(value):$done()}pad(s=false,c="*",l=15){return s?this.log(c.padEnd(l,c)):`\n${c.padEnd(l,c)}\n`}}(t,l)} -------------------------------------------------------------------------------- /ftqq/index.js: -------------------------------------------------------------------------------- 1 | const $hammer = (() => { 2 | const isRequest = "undefined" != typeof $request, 3 | isSurge = "undefined" != typeof $httpClient, 4 | isQuanX = "undefined" != typeof $task; 5 | 6 | const log = (...n) => { for (let i in n) console.log(n[i]) }; 7 | const alert = (title, body = "", subtitle = "", options = {}) => { 8 | // option(|): {open-url: , media-url: } 9 | let link = null; 10 | switch (typeof options) { 11 | case "string": 12 | link = isQuanX ? {"open-url": options} : options; 13 | break; 14 | case "object": 15 | if(["null", "{}"].indexOf(JSON.stringify(options)) == -1){ 16 | link = isQuanX ? options : options["open-url"]; 17 | break; 18 | } 19 | default: 20 | link = isQuanX ? {} : ""; 21 | } 22 | if (isSurge) return $notification.post(title, subtitle, body, link); 23 | if (isQuanX) return $notify(title, subtitle, body, link); 24 | log("==============📣系统通知📣=============="); 25 | log("title:", title, "subtitle:", subtitle, "body:", body, "link:", link); 26 | }; 27 | const read = key => { 28 | if (isSurge) return $persistentStore.read(key); 29 | if (isQuanX) return $prefs.valueForKey(key); 30 | }; 31 | const write = (val, key) => { 32 | if (isSurge) return $persistentStore.write(val, key); 33 | if (isQuanX) return $prefs.setValueForKey(val, key); 34 | }; 35 | const request = (method, params, callback) => { 36 | /** 37 | * 38 | * params(): {url: , headers: , body: } | 39 | * 40 | * callback( 41 | * error, 42 | * ?, 43 | * {status: , headers: , body: }? 44 | * ) 45 | * 46 | */ 47 | let options = {}; 48 | if (typeof params == "string") { 49 | options.url = params; 50 | } else { 51 | options.url = params.url; 52 | if (typeof params == "object") { 53 | params.headers && (options.headers = params.headers); 54 | params.body && (options.body = params.body); 55 | } 56 | } 57 | method = method.toUpperCase(); 58 | 59 | const writeRequestErrorLog = function (m, u) { 60 | return err => { 61 | log(`\n=== request error -s--\n`); 62 | log(`${m} ${u}`, err); 63 | log(`\n=== request error -e--\n`); 64 | }; 65 | }(method, options.url); 66 | 67 | if (isSurge) { 68 | const _runner = method == "GET" ? $httpClient.get : $httpClient.post; 69 | return _runner(options, (error, response, body) => { 70 | if (error == null || error == "") { 71 | response.body = body; 72 | callback("", body, response); 73 | } else { 74 | writeRequestErrorLog(error); 75 | callback(error, "", response); 76 | } 77 | }); 78 | } 79 | if (isQuanX) { 80 | options.method = method; 81 | $task.fetch(options).then( 82 | response => { 83 | response.status = response.statusCode; 84 | delete response.statusCode; 85 | callback("", response.body, response); 86 | }, 87 | reason => { 88 | writeRequestErrorLog(reason.error); 89 | response.status = response.statusCode; 90 | delete response.statusCode; 91 | callback(reason.error, "", response); 92 | } 93 | ); 94 | } 95 | }; 96 | const done = (value = {}) => { 97 | if (isQuanX) return isRequest ? $done(value) : null; 98 | if (isSurge) return isRequest ? $done(value) : $done(); 99 | }; 100 | return { isRequest, isSurge, isQuanX, log, alert, read, write, request, done }; 101 | })(); 102 | 103 | const secret = "SCU22065T1df01fa393cd204d6487ee0aa9a24a375c43ed3fe5034"; 104 | const pushWechatMessage = (key => { 105 | return (title, detail="") => { 106 | const options = { 107 | url: `https://sc.ftqq.com/${key}.send`, 108 | headers: {"content-type": "application/x-www-form-urlencoded"}, 109 | body: `text=${title}&desp=${detail}` 110 | }; 111 | $hammer.request("post", options, (error, response) => { 112 | if(error){ 113 | $hammer.log(error); 114 | return $hammer.done(); 115 | } 116 | $hammer.log(response); 117 | $hammer.done(); 118 | }) 119 | } 120 | })(secret); 121 | 122 | 123 | pushWechatMessage('Open app by click schema', '[点击打开(打不开的话在右上角菜单用自带浏览器打开)](alipay://platformapi/startapp?appId=60000002)'); 124 | -------------------------------------------------------------------------------- /hammer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * http://www.jsons.cn/jsforamt/ 3 | function hammer(t="untitled",l=3){return new class{constructor(t,l){this.name=t,this.logLevel=l,this.isRequest=("object"==typeof $request)&&$request.method!="OPTIONS",this.isSurge="undefined"!=typeof $httpClient,this.isQuanX="undefined"!=typeof $task,this.isNode="function"==typeof require,this.node=(()=>{if(!this.isNode){return null}const file="localstorage.yml";let f,y,r,yc,sc;try{f=require('fs');y=require('js-yaml');r=require('got');f.appendFile(file,"",function(err){if(err)throw err;});yc=y.load(f.readFileSync(file,"utf8"));sc=data=>f.writeFileSync(file,y.safeDump(data),'utf8')}catch(e){console.log(e.message);console.log("install unrequired module, example: yarn add js-yaml got");return{}}return{file:file,fs:f,yaml:y,request:r,yamlContents:yc,saveYamlContents:sc,}})()}log(...n){if(l<2){return null}for(let i in n){const ct=typeof n[i]=="object"?eval(`(${JSON.stringify(n[i])})`):n[i];console.log(`\n***********${this.name}***********\n${ct}`)}}alert(body="",subtitle="",options={}){if(l==2||l==0){return null}body=`${body}`;if(typeof options=="string"){options={"open-url":options}}let link={};if(Object.keys(options).length){link=this.isQuanX?options:{openUrl:options["open-url"],mediaUrl:options["media-url"]}}if(this.isSurge)return $notification.post(this.name,subtitle,body,link);if(this.isQuanX)return $notify(this.name,subtitle,body,link);console.log(`系统通知\ntitle:${this.name}\nsubtitle:${subtitle}\nbody:${body}\nlink:${link}`)}async request(method,params,callback){let options={};if(typeof params=="string"){options.url=params}else{options.url=params.url;if(typeof params=="object"){params.headers&&(options.headers=params.headers);params.body&&(options.body=params.body)}}if(!options.headers||typeof(options.headers)!="object"){options['headers']={}}if(!options.headers||(!Object.keys(options.headers).includes("User-Agent")&&!Object.keys(options.headers).includes("aser-agent"))){const ua='Mozilla%2F5.0%20(iPhone%3B%20CPU%20iPhone%20OS%2013_2_3%20like%20Mac%20OS%20X)%20AppleWebKit%2F605.1.15%20(KHTML%2C%20like%20Gecko)%20Version%2F13.0.3%20Mobile%2F15E148%20Safari%2F604.1';options['headers']['User-Agent']=decodeURIComponent(ua)}method=method.toUpperCase();const writeRequestErrorLog=function(n,m,u){return err=>console.log(`${n}request error:\n${m}${u}\n${err}`)}(this.name,method,options.url);if(this.isSurge){const _runner=method=="GET"?$httpClient.get:$httpClient.post;return _runner(options,(error,response,body)=>{if(error==null||error==""){response.body=body;callback("",body,response)}else{writeRequestErrorLog(error);callback(error,"",response)}})}options.method=method;if(this.isQuanX){$task.fetch(options).then(response=>{response.status=response.statusCode;delete response.statusCode;callback("",response.body,response)},reason=>{writeRequestErrorLog(reason.error);response.status=response.statusCode;delete response.statusCode;callback(reason.error,"",response)})}if(this.isNode){method=options.method.toLowerCase();const hc=this.node.request[method];if(typeof(hc)!="function"){return callback(`unsupport request method ${options.method}in got`)}let ro={responseType:"text",};if(options.headers){ro.headers=options.headers}if(options.body){ro.body=(options.body&&typeof(options.body)=="object")?JSON.stringify(options.body):options.body}if(params.option){const ks=Object.keys(params.option);for(const k of ks){ro[k]=params.option[k]}}let error="",body="",response={};try{response=await hc(options.url,ro);body=response.body;response={status:response.statusCode,headers:response.headers,body:body,}}catch(e){error=`${e.name}:${e.message}`}callback(error,body,response)}}read(key){if(this.isSurge)return $persistentStore.read(key);if(this.isQuanX)return $prefs.valueForKey(key);if(this.isNode){let val="";try{const data=this.node.yamlContents;val=(typeof(data)=="object"&&data[key])?(typeof(data[key])=='object'?JSON.stringify(data[key]):data[key]):""}catch(e){console.log(`读取文件时错误:\n${e.message}`);return""}return val}}write(val,key){if(this.isSurge)return $persistentStore.write(val,key);if(this.isQuanX)return $prefs.setValueForKey(val,key);if(this.isNode){try{const data=this.node.yamlContents;data=typeof data=="object"?data:{};data[key]=val;this.node.saveYamlContents(data)}catch(e){console.log(e.message);return false}return true}}delete(key){if(this.isSurge)return $persistentStore.remove(key);if(this.isQuanX)return $prefs.removeValueForKey(key);if(this.isNode){try{const data=this.node.yamlContents;data=typeof data=="object"?data:{};if(!data.hasOwnProperty(key)){return true}delete data[key];this.node.saveYamlContents(data)}catch(e){console.log(e.message);return false}return true}}done(value={}){if(this.isQuanX)return $done(value);if(this.isSurge)return this.isRequest?$done(value):$done()}pad(s=false,c="*",l=15){return s?this.log(c.padEnd(l,c)):`\n${c.padEnd(l,c)}\n`}}(t,l)} 4 | */ 5 | 6 | (() => { 7 | if("function" == typeof(require)){ 8 | module.exports = hammer; 9 | // Useage: 10 | // const $ = require("./hammer.js")("jd", 3); 11 | } 12 | })() 13 | 14 | function hammer(t="untitled", l=3){ 15 | /** 16 | * t title 17 | * l log-level 18 | * 0:alert-no log-no 19 | * 1:alert-yes log-no 20 | * 2:alert-no log-yes 21 | * 3:alert-yes log-yes 22 | */ 23 | return new class{ 24 | constructor(t, l){ 25 | this.name = t, 26 | this.logLevel = l, 27 | this.isRequest = ("object" == typeof $request) && $request.method != "OPTIONS", 28 | this.isSurge = "undefined" != typeof $httpClient, 29 | this.isQuanX = "undefined" != typeof $task, 30 | this.isNode = "function" == typeof require, 31 | this.node=(()=>{ 32 | if(!this.isNode) { 33 | return null; 34 | } 35 | const file = "localstorage.yml"; 36 | let f,y,r,yc,sc; 37 | try { 38 | f = require('fs'); 39 | y = require('js-yaml'); 40 | r = require('got'); 41 | f.appendFile(file, "", function (err) { 42 | if (err) throw err; 43 | }); 44 | yc = y.load(f.readFileSync(file, "utf8")); 45 | sc = data => f.writeFileSync(file, y.safeDump(data), 'utf8'); 46 | } catch (e) { 47 | console.log(e.message); 48 | console.log("install unrequired module, example: yarn add js-yaml got"); 49 | return {}; 50 | } 51 | return { 52 | file: file, 53 | fs: f, 54 | yaml: y, 55 | request: r, 56 | yamlContents: yc, 57 | saveYamlContents: sc, 58 | } 59 | })() 60 | } 61 | log(...n){ 62 | if(l < 2){ 63 | return null; 64 | } 65 | for (let i in n) { 66 | const ct = typeof n[i] == "object"?eval(`(${JSON.stringify(n[i])})`):n[i]; 67 | console.log(`\n*********** ${this.name} ***********\n${ct}`); 68 | } 69 | } 70 | alert(body = "", subtitle = "", options = {}){ 71 | // option(|): {open-url: , media-url: } 72 | if(l == 2 || l == 0){ 73 | return null; 74 | } 75 | body = `${body}`; 76 | if(typeof options == "string"){ 77 | options = {"open-url": options}; 78 | } 79 | let link = {}; 80 | if(Object.keys(options).length){ 81 | link = this.isQuanX ? options : {openUrl: options["open-url"], mediaUrl: options["media-url"]}; 82 | } 83 | if (this.isSurge) return $notification.post(this.name, subtitle, body, link); 84 | if (this.isQuanX) return $notify(this.name, subtitle, body, link); 85 | console.log(`系统通知\ntitle: ${this.name}\nsubtitle: ${subtitle}\nbody: ${body}\nlink: ${link}`); 86 | } 87 | async request(method, params, callback){ 88 | /** 89 | * 90 | * params(): {url: , headers: , body: } | 91 | * 92 | * callback( 93 | * error, 94 | * ?, 95 | * {status: , headers: , body: }? 96 | * ) 97 | * 98 | */ 99 | let options = {}; 100 | if (typeof params == "string") { 101 | options.url = params; 102 | } else { 103 | options.url = params.url; 104 | if (typeof params == "object") { 105 | params.headers && (options.headers = params.headers); 106 | params.body && (options.body = params.body); 107 | } 108 | } 109 | if(!options.headers || typeof(options.headers) != "object"){ 110 | options['headers'] = {}; 111 | } 112 | if(!options.headers || (!Object.keys(options.headers).includes("User-Agent") && !Object.keys(options.headers).includes("user-agent"))){ 113 | const ua = 'Mozilla%2F5.0%20(iPhone%3B%20CPU%20iPhone%20OS%2013_2_3%20like%20Mac%20OS%20X)%20AppleWebKit%2F605.1.15%20(KHTML%2C%20like%20Gecko)%20Version%2F13.0.3%20Mobile%2F15E148%20Safari%2F604.1'; 114 | options['headers']['User-Agent'] = decodeURIComponent(ua); 115 | } 116 | method = method.toUpperCase(); 117 | 118 | const writeRequestErrorLog = function (n, m, u) { 119 | return err => console.log(`${n} request error:\n${m} ${u}\n${err}`); 120 | }(this.name, method, options.url); 121 | 122 | if (this.isSurge) { 123 | const _runner = method == "GET" ? $httpClient.get : $httpClient.post; 124 | return _runner(options, (error, response, body) => { 125 | if (error == null || error == "") { 126 | response.body = body; 127 | callback("", body, response); 128 | } else { 129 | writeRequestErrorLog(error); 130 | callback(error, "", response); 131 | } 132 | }); 133 | } 134 | options.method = method; 135 | if (this.isQuanX) { 136 | $task.fetch(options).then( 137 | response => { 138 | response.status = response.statusCode; 139 | delete response.statusCode; 140 | callback("", response.body, response); 141 | }, 142 | reason => { 143 | writeRequestErrorLog(reason.error); 144 | response.status = response.statusCode; 145 | delete response.statusCode; 146 | callback(reason.error, "", response); 147 | } 148 | ); 149 | } 150 | if(this.isNode){ 151 | method = options.method.toLowerCase(); 152 | const hc = this.node.request[method]; 153 | if(typeof(hc) != "function"){ 154 | return callback(`unsupport request method ${options.method} in got`); 155 | } 156 | let ro = { 157 | responseType: "text", 158 | }; 159 | if(options.headers){ 160 | ro.headers = options.headers; 161 | } 162 | if(options.body){ 163 | ro.body = (options.body && typeof(options.body) == "object") ? JSON.stringify(options.body) : options.body; 164 | } 165 | if(params.option){ 166 | const ks = Object.keys(params.option); 167 | for (const k of ks) { 168 | ro[k] = params.option[k]; 169 | } 170 | } 171 | let error = "", body = "", response = {}; 172 | try { 173 | response = await hc(options.url, ro); 174 | body = response.body; 175 | response = { 176 | status: response.statusCode, 177 | headers: response.headers, 178 | body: body, 179 | } 180 | } catch (e) { 181 | error = `${e.name}: ${e.message}`; 182 | } 183 | callback(error, body, response); 184 | } 185 | } 186 | read(key){ 187 | if (this.isSurge) return $persistentStore.read(key); 188 | if (this.isQuanX) return $prefs.valueForKey(key); 189 | if (this.isNode) { 190 | let val = ""; 191 | try{ 192 | const data = this.node.yamlContents; 193 | val = (typeof(data) == "object" && data[key]) ? (typeof(data[key])=='object' ? JSON.stringify(data[key]) : data[key]) : ""; 194 | }catch( e ){ 195 | console.log(`读取文件时错误:\n${e.message}`); 196 | return ""; 197 | } 198 | return val; 199 | } 200 | } 201 | write(val, key){ 202 | if (this.isSurge) return $persistentStore.write(val, key); 203 | if (this.isQuanX) return $prefs.setValueForKey(val, key); 204 | if (this.isNode) { 205 | try { 206 | const data = this.node.yamlContents; 207 | data = typeof data == "object" ? data : {}; 208 | data[key] = val; 209 | this.node.saveYamlContents(data); 210 | } catch (e) { 211 | console.log(e.message); 212 | return false; 213 | } 214 | return true; 215 | } 216 | } 217 | delete(key){ 218 | if(this.isSurge) return $persistentStore.remove(key); 219 | if(this.isQuanX) return $prefs.removeValueForKey(key); 220 | if(this.isNode){ 221 | try { 222 | const data = this.node.yamlContents; 223 | data = typeof data == "object" ? data : {}; 224 | if(!data.hasOwnProperty(key)){ 225 | return true; 226 | } 227 | delete data[key]; 228 | this.node.saveYamlContents(data); 229 | } catch (e) { 230 | console.log(e.message); 231 | return false; 232 | } 233 | return true; 234 | } 235 | } 236 | done(value = {}){ 237 | if (this.isQuanX) return $done(value); 238 | if (this.isSurge) return this.isRequest ? $done(value) : $done(); 239 | } 240 | pad(s=false, c="*", l=15){ 241 | return s ? this.log(c.padEnd(l, c)) : `\n${c.padEnd(l,c)}\n`; 242 | } 243 | }(t, l) 244 | } 245 | -------------------------------------------------------------------------------- /htt/cookie.js: -------------------------------------------------------------------------------- 1 | /* 2 | 邀请码:53150681 3 | by红鲤鱼与绿鲤鱼与驴 4 | 2020.6.28 5 | 增加小视频和视频奖励ck 6 | 2020.6.30更新获取ck的bug 7 | 点击签到获取ck 8 | 9 | ==================================== 10 | 获取ck完毕可以禁止该js 11 | #惠头条签到获取Qx 12 | 13 | https:\/\/api\.cashtoutiao\.com url script-request-body htt_cookie.js 14 | 15 | #惠头条签到获取ckloon 16 | 17 | http-request https:\/\/api\.cashtoutiao\.com script-path=htt_cookie.js, requires-body=true, timeout=30, tag=惠头条CK 18 | 19 | ==================================== 20 | 21 | MITM=api.cashtoutiao.com 22 | ==================================== 23 | */ 24 | 25 | //++++++++++++++++++++++++++++++++- 26 | //1.需要申明的变量 27 | 28 | const $iosrule = iosrule();//声明必须 29 | const httid = "A"; 30 | 31 | 32 | const huitoutiao = "惠头条"; 33 | 34 | 35 | const htt_dongfangname = "htt_dongfangname" + httid; 36 | 37 | const htt_signurlckname = "htt_signurlckname" + httid; 38 | 39 | const htt_signbdname = "htt_signbdname" + httid; 40 | 41 | const htt_videoname = "htt_videoname" + httid; 42 | 43 | const htt_smvideoname = "htt_smvideoname" + httid; 44 | 45 | 46 | 47 | //++++++++++++++++++++++++++++++++- 48 | 49 | 50 | if ($iosrule.isRequest) { 51 | htt_writeck(); 52 | } 53 | $iosrule.end(); 54 | 55 | 56 | function htt_writeck() { 57 | if ($request.headers) { 58 | var urlval = $request.url; 59 | 60 | var md_header = $request.headers; 61 | var md_bd = $request.body; 62 | 63 | var tt = huitoutiao; 64 | 65 | console.log(urlval) 66 | if (urlval.indexOf("frontend/sign?") >= 0) { 67 | var htt_signurlck = urlval.substring(urlval.indexOf("sign?") + 5, urlval.length); 68 | var httso = $iosrule.write(htt_signurlck, htt_signurlckname); 69 | var httbdo = $iosrule.write(md_bd, htt_signbdname); 70 | if (httbdo == true && httso == true) 71 | papa(tt, "[签到ck]", "写入" + tt + "签到数据成功"); 72 | }else if (urlval.indexOf("frontend/credit/sych/reward/per/hour?") >= 0) { 73 | var htt_signurlck = urlval.substring(urlval.indexOf("hour?") + 5, urlval.length); 74 | var httso = $iosrule.write(htt_signurlck, htt_signurlckname); 75 | var httbdo = $iosrule.write(md_bd, htt_signbdname); 76 | if (httbdo == true && httso == true) 77 | papa(tt, "[时段签到ck]", "写入" + tt + "时段签到数据成功"); 78 | }else if (urlval.indexOf("frontend/read/sych/duration") >= 0) { 79 | if (md_bd.indexOf("dongfang") > 0) { 80 | var httbdo = $iosrule.write(md_bd, htt_dongfangname); 81 | if (httbdo == true) 82 | papa(tt, "[阅读ck]", "写入" + tt + "阅读数据成功"); 83 | }else if (md_bd.indexOf("video") > 0 && md_bd.indexOf("self_smallvideo") < 0) { 84 | var httbdo = $iosrule.write(md_bd, htt_videoname); 85 | if (httbdo == true) 86 | papa(tt, "[视频ck]", "写入" + tt + "视频数据成功"); 87 | }else if (md_bd.indexOf("self_smallvideo") > 0) { 88 | var httbdo = $iosrule.write(md_bd, htt_smvideoname); 89 | if (httbdo == true) 90 | papa(tt, "[小视频ck]", "写入" + tt + "小视频数据成功"); 91 | } 92 | } 93 | } 94 | } 95 | 96 | 97 | 98 | //可以增加模块 99 | 100 | function papa(x, y, z) { 101 | $iosrule.notify(x, y, z); 102 | } 103 | 104 | function iosrule() { 105 | const isRequest = typeof $request != "undefined" 106 | const isSurge = typeof $httpClient != "undefined" 107 | const isQuanX = typeof $task != "undefined" 108 | const notify = (title, subtitle, message) => { 109 | if (isQuanX) $notify(title, subtitle, message) 110 | if (isSurge) $notification.post(title, subtitle, message) 111 | } 112 | const write = (value, key) => { 113 | if (isQuanX) return $prefs.setValueForKey(value, key) 114 | if (isSurge) return $persistentStore.write(value, key) 115 | } 116 | const read = (key) => { 117 | if (isQuanX) return $prefs.valueForKey(key) 118 | if (isSurge) return $persistentStore.read(key) 119 | } 120 | const get = (options, callback) => { 121 | if (isQuanX) { 122 | if (typeof options == "string") options = { url: options } 123 | options["method"] = "GET" 124 | $task.fetch(options).then(response => { 125 | response["status"] = response.statusCode 126 | callback(null, response, response.body) 127 | }, reason => callback(reason.error, null, null)) 128 | } 129 | if (isSurge) $httpClient.get(options, callback) 130 | } 131 | const post = (options, callback) => { 132 | if (isQuanX) { 133 | if (typeof options == "string") options = { url: options } 134 | options["method"] = "POST" 135 | $task.fetch(options).then(response => { 136 | response["status"] = response.statusCode 137 | callback(null, response, response.body) 138 | }, reason => callback(reason.error, null, null)) 139 | } 140 | if (isSurge) $httpClient.post(options, callback) 141 | } 142 | const end = () => { 143 | if (isQuanX) isRequest ? $done({}) : "" 144 | if (isSurge) isRequest ? $done({}) : $done() 145 | } 146 | return { isRequest, isQuanX, isSurge, notify, write, read, get, post, end } 147 | }; 148 | -------------------------------------------------------------------------------- /htt/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | 邀请码:53150681 3 | 4 | by红鲤鱼与绿鲤鱼与驴 5 | 2020.6.27 6 | 7 | #惠头条签到定时执行任务,因为有阅读,视频和小视频三个奖励,建议2分钟以上频率. 8 | 9 | 1.2020627完成签到奖励,时段奖励,阅读奖励 10 | 2.2020628增加观视频奖励,小视频奖励,首页奖励,每日阅读资讯领金币 11 | 3.20200629修复每日任务的阅读资讯领金币待测试,首页奖励无法代码实现。加关闭任务通知功能。 12 | 4.没有改动界面。对上版本圈叉和loon通用修复,请匹配最新版的htt_cookie.js文件,本次发布在微信撸金币群。 13 | 14 | 15 | 问题:如果日志出现提示登录状态失效之类,点阅读软件首页时段奖励按钮获取ck。 16 | 17 | 18 | loon定时格式参考 19 | cron "0 21,31,50 0-22 * * ?" script-path=htt_task.js, tag=惠头条 20 | */ 21 | 22 | 23 | //以上是配置说明 24 | 25 | 26 | const Notice = 30;//设置运行多少次才通知,默认30。 27 | 28 | 29 | 30 | //==================================== 31 | 32 | const $iosrule = iosrule();//声明必须 33 | const httid = "A"; 34 | const huitoutiao = "惠头条"; 35 | 36 | 37 | //++++++++++++++++++++++++++++++++- 38 | 39 | const htt_videoname = "htt_videoname" + httid; 40 | const htt_video = $iosrule.read(htt_videoname); 41 | 42 | const htt_dongfangname = "htt_dongfangname" + httid; 43 | const htt_dongfang = $iosrule.read(htt_dongfangname); 44 | const htt_smvideoname = "htt_smvideoname" + httid; 45 | const htt_smvideo = $iosrule.read(htt_smvideoname); 46 | 47 | 48 | const htt_signurlckname = "htt_signurlckname" + httid; 49 | const htt_signurlck = $iosrule.read(htt_signurlckname); 50 | 51 | 52 | const htt_signbdname = "htt_signbdname" + httid; 53 | const htt_signbd = $iosrule.read(htt_signbdname); 54 | 55 | var htt_num = 0; var htt_result = ""; 56 | 57 | //++++++++++++++++++++++++++++++++ 58 | 59 | 60 | 61 | 62 | 63 | 64 | //++++++++++++++++++++++++++++++++ 65 | 66 | //3.需要执行的函数都写这里 67 | function main() { 68 | htt_main(); 69 | } 70 | 71 | function htt_main() { 72 | htt_coinall(); 73 | } 74 | 75 | 76 | 77 | main() 78 | 79 | 80 | //++++++++++++++++++++++++++++++++++++ 81 | //4.基础模板 82 | 83 | function htt_homepage() { 84 | var result1 = "【首页奖励】"; var result2 = ""; 85 | var tt = huitoutiao; 86 | const llUrl1 = { url: "https://api.cashtoutiao.com/frontend/homepage/top/ttsdk_ios/ad/feedback?" + htt_signurlck, headers: { "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" }, body: htt_signbd, timeout: 60 }; 87 | $iosrule.post(llUrl1, function (error, response, data) { 88 | console.log(data) 89 | var obj = JSON.parse(data); 90 | if (obj.statusCode == 200) 91 | result2 = "[金币]" + obj.reward; 92 | 93 | else if (obj.statusCode == -50) 94 | result2 = obj.msg; 95 | htt_msg(result1 + "\n" + result2 + "\n"); 96 | }) 97 | } 98 | 99 | 100 | function htt_taskread5() { 101 | var result1 = "【每日任务阅读奖励】"; var result2 = ""; 102 | var tt = huitoutiao; 103 | var htt_signbd_task = JSON.parse(htt_signbd); 104 | htt_signbd_task.taskId = 5; htt_signbd_task = JSON.stringify(htt_signbd_task); 105 | const llUrl1 = { url: "https://api.cashtoutiao.com/frontend/daily/task/revision/draw?" + htt_signurlck, headers: { "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" }, body: htt_signbd_task, timeout: 60 }; 106 | $iosrule.post(llUrl1, function (error, response, data) { 107 | console.log(data) 108 | var obj = JSON.parse(data); 109 | if (obj.statusCode == 200) 110 | result2 = "[金币]" + obj.reward; 111 | else if (obj.statusCode == -50) 112 | result2 = obj.msg; 113 | htt_msg(result1 + "\n" + result2 + "\n"); 114 | }) 115 | } 116 | 117 | 118 | function htt_daysign() { 119 | var result1 = ""; var result2 = ""; 120 | var tt = huitoutiao; 121 | const llUrl1 = { url: "https://api.cashtoutiao.com/frontend/sign?" + htt_signurlck, headers: { "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" }, body: htt_signbd }; var signjs = JSON.parse(htt_signbd); signjs["code"] = sign("%3Dhdfefni"); signjs = JSON.stringify(signjs); const llUrl2 = { url: "https://api.cashtoutiao.com/frontend/invite?" + htt_signurlck, headers: { "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" }, body: signjs }; 122 | $iosrule.post(llUrl1, function (error, response, data) { 123 | console.log(data) 124 | var obj = JSON.parse(data) 125 | if (obj.statusCode == 200) { 126 | result2 = "[金币]" + obj.signCredit; 127 | htt_signday(result2); 128 | }else if (obj.statusCode == -50) { 129 | result2 = "[重复签到]"; 130 | htt_signday(result2); 131 | } 132 | }) 133 | $iosrule.post(llUrl2, function (error, response, data) { }) 134 | } 135 | 136 | function htt_hoursign() { 137 | var result1 = "【时段奖励】"; var result2 = ""; 138 | var tt = huitoutiao; 139 | const llUrl1 = { url: "https://api.cashtoutiao.com/frontend/credit/sych/reward/per/hour?" + htt_signurlck, headers: { "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" }, body: htt_signbd, timeout: 60 }; 140 | $iosrule.post(llUrl1, function (error, response, data) { 141 | console.log(data) 142 | var obj = JSON.parse(data); 143 | if (obj.statusCode == 200) 144 | result2 = "[金币]" + obj.credit; 145 | 146 | else if (obj.statusCode == -50) 147 | result2 = obj.msg; 148 | htt_msg(result1 + "\n" + result2 + "\n"); 149 | }) 150 | } 151 | 152 | function htt_signday(res) { 153 | var result1 = "【签到奖励】"; var result2 = ""; 154 | var tt = huitoutiao; 155 | const llUrl1 = { url: "https://api.cashtoutiao.com/frontend/sign/record?" + htt_signurlck, headers: { "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" }, body: htt_signbd, timeout: 60 }; 156 | 157 | $iosrule.post(llUrl1, function (error, response, data) { 158 | 159 | console.log(data) 160 | var obj = JSON.parse(data) 161 | 162 | if (obj.statusCode == 200) 163 | result2 = res + " [签到天数]" + obj.day; 164 | 165 | htt_msg(result1 + "\n" + result2 + "\n"); 166 | }) 167 | } 168 | 169 | function htt_read_dongfang() { 170 | var result1 = "【阅读奖励】"; var result2 = ""; 171 | var tt = huitoutiao; 172 | const llUrl1 = { url: "https://api.cashtoutiao.com/frontend/read/sych/duration?" + htt_signurlck, headers: { "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" }, body: htt_find(htt_dongfang), timeout: 60 }; 173 | 174 | $iosrule.post(llUrl1, function (error, response, data) { 175 | console.log(data); 176 | var obj = JSON.parse(data); 177 | if (obj.statusCode == 200) { 178 | if (data.indexOf("失败") < 0) { 179 | result2 = "[金币]" + obj.incCredit + " [今日阅读时长]" + formatSeconds(obj.todayDuration); 180 | }else { 181 | result2 = obj.msg; result1 = "【阅读奖励失败】"; 182 | } 183 | htt_msg(result1 + "\n" + result2 + "\n"); 184 | } 185 | }) 186 | } 187 | 188 | function htt_read_video() { 189 | var result1 = "【看视频奖励】"; var result2 = ""; 190 | var tt = huitoutiao; 191 | const llUrl1 = { url: "https://api.cashtoutiao.com/frontend/read/sych/duration?" + htt_signurlck, headers: { "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" }, body: htt_find(htt_video), timeout: 60 }; 192 | $iosrule.post(llUrl1, function (error, response, data) { 193 | console.log(data) 194 | var obj = JSON.parse(data) 195 | 196 | if (obj.statusCode == 200) { 197 | if (data.indexOf("失败") < 0) { 198 | result2 = "[金币]" + obj.incCredit + " [今日看视频时长]" + formatSeconds(obj.todayDuration); 199 | }else { 200 | result2 = obj.msg; result1 = "【看视频奖励失败】" 201 | } 202 | }else{ 203 | result2 = "请求失败*"; 204 | } 205 | htt_msg(result1 + "\n" + result2 + "\n"); 206 | }) 207 | } 208 | 209 | 210 | function htt_read_smvideo() { 211 | var result1 = "【看小视频奖励】"; var result2 = ""; 212 | var tt = huitoutiao; 213 | const llUrl1 = { url: "https://api.cashtoutiao.com/frontend/read/sych/duration?" + htt_signurlck, headers: { "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" }, body: htt_find(htt_smvideo), timeout: 300 }; 214 | $iosrule.post(llUrl1, function (error, response, data) { 215 | console.log("小视频" + data) 216 | var obj = JSON.parse(data) 217 | if (obj.statusCode == 200) { 218 | if (data.indexOf("失败") < 0) { 219 | result2 = "[金币]" + obj.incCredit + " [今日看小视频时长]" + formatSeconds(obj.todayDuration); 220 | }else { 221 | result2 = obj.msg; result1 = "【看小视频奖励失败】" 222 | } 223 | }else{ 224 | result2 = "请求失败*"; 225 | } 226 | htt_msg(result1 + "\n" + result2 + "\n"); 227 | }) 228 | } 229 | 230 | 231 | function htt_readtotal() { 232 | var result1 = "【收益统计】"; var result2 = ""; 233 | var tt = huitoutiao; 234 | const llUrl1 = { url: "https://api.cashtoutiao.com/frontend/read/detail/today?" + htt_signurlck, headers: { "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" }, body: htt_signbd, timeout: 60 }; 235 | 236 | $iosrule.post(llUrl1, function (error, response, data) { 237 | var obj = JSON.parse(data) 238 | if (obj.statusCode == 200) { 239 | result2 = 240 | "[总金币]" + obj.userDailyReadRecord.durationCredit + "💰 " + formatSeconds(obj.userDailyReadRecord.totalDuration) + "\n" + 241 | "[观看视频]" + obj.userDailyReadRecord.videoDurationCredit + "💰" + formatSeconds(obj.userDailyReadRecord.videoDuration) + "\n" + 242 | "[观看小视频]" + obj.userDailyReadRecord.smallVideoDurationCredit + "💰" + formatSeconds(obj.userDailyReadRecord.smallVideoDuration) + " " 243 | + "\n" + 244 | "[分享收益]" + obj.userDailyReadRecord.shareClickCredit + "💰"; 245 | htt_msg(result1 + "\n" + result2 + "\n"); 246 | } 247 | }) 248 | } 249 | 250 | 251 | 252 | 253 | function htt_msg(r) { 254 | var tt = huitoutiao; 255 | htt_num++; 256 | htt_result += r; 257 | if (htt_num == 8) { 258 | var loon = $iosrule.read("iosrule"); 259 | if (typeof (loon) != "undefined") { 260 | loon = loon.substring(7, loon.length); 261 | loon++; $iosrule.write("iosrule" + loon, "iosrule"); 262 | } else { 263 | loon = 1; 264 | $iosrule.write("iosrule" + loon, "iosrule") 265 | } 266 | if (loon % Notice == 0) { 267 | papa(tt, "[签到-时段-视频-阅读]" + "当前运行" + loon + "次", htt_result); 268 | loon = 0; 269 | $iosrule.write("iosrule" + loon, "iosrule"); 270 | loon = 0; 271 | htt_result = ""; 272 | $iosrule.write("iosrule" + loon, "iosrule"); 273 | } 274 | } 275 | } 276 | 277 | function htt_coinall() { 278 | setTimeout(function () { 279 | htt_daysign(); 280 | }, 1 * 100); 281 | 282 | setTimeout(function () { 283 | htt_hoursign(); 284 | htt_homepage(); 285 | htt_taskread5(); 286 | }, 5 * 100); 287 | 288 | setTimeout(function () { 289 | htt_read_dongfang(); 290 | }, 6 * 100); 291 | 292 | setTimeout(function () { 293 | htt_read_video(); 294 | }, 35 * 1000); 295 | 296 | setTimeout(function () { 297 | htt_read_smvideo(); 298 | }, 70 * 1000); 299 | 300 | setTimeout(function () { 301 | htt_readtotal(); 302 | }, 71 * 1000); 303 | 304 | } 305 | 306 | 307 | function htt_find(bd) { 308 | if (JSON.parse(bd).hasOwnProperty("token")) { 309 | bd = JSON.parse(bd); 310 | delete bd["token"]; 311 | bd = JSON.stringify(bd); 312 | } 313 | return bd; 314 | } 315 | 316 | function formatSeconds(value) { 317 | let result = parseInt(value) 318 | let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600); 319 | let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60)); 320 | let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60)); 321 | 322 | let res = ''; 323 | if (h !== '00') res += `${h}小时`; 324 | if (m !== '00') res += `${m}分`; 325 | res += `${s}秒`; 326 | return res; 327 | } 328 | 329 | function papa(x, y, z) { 330 | $iosrule.notify(x, y, z); 331 | } 332 | 333 | function sign(code) { 334 | code = unescape(code); 335 | var c = String.fromCharCode(code.charCodeAt(0) - code.length); 336 | for (var i = 1; i < code.length; i++) { 337 | c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1)); 338 | } 339 | return c; 340 | } 341 | 342 | 343 | function iosrule() { 344 | const isRequest = typeof $request != "undefined" 345 | const isSurge = typeof $httpClient != "undefined" 346 | const isQuanX = typeof $task != "undefined" 347 | const notify = (title, subtitle, message) => { 348 | if (isQuanX) $notify(title, subtitle, message) 349 | if (isSurge) $notification.post(title, subtitle, message) 350 | } 351 | const write = (value, key) => { 352 | if (isQuanX) return $prefs.setValueForKey(value, key) 353 | if (isSurge) return $persistentStore.write(value, key) 354 | } 355 | const read = (key) => { 356 | if (isQuanX) return $prefs.valueForKey(key) 357 | if (isSurge) return $persistentStore.read(key) 358 | } 359 | const get = (options, callback) => { 360 | if (isQuanX) { 361 | if (typeof options == "string") options = { url: options } 362 | options["method"] = "GET" 363 | $task.fetch(options).then(response => { 364 | response["status"] = response.statusCode 365 | callback(null, response, response.body) 366 | }, reason => callback(reason.error, null, null)) 367 | } 368 | if (isSurge) $httpClient.get(options, callback) 369 | } 370 | const post = (options, callback) => { 371 | if (isQuanX) { 372 | if (typeof options == "string") options = { url: options } 373 | options["method"] = "POST" 374 | $task.fetch(options).then(response => { 375 | response["status"] = response.statusCode 376 | callback(null, response, response.body) 377 | }, reason => callback(reason.error, null, null)) 378 | } 379 | if (isSurge) $httpClient.post(options, callback) 380 | } 381 | const end = () => { 382 | if (isQuanX) isRequest ? $done({}) : "" 383 | if (isSurge) isRequest ? $done({}) : $done() 384 | } 385 | return { isRequest, isQuanX, isSurge, notify, write, read, get, post, end } 386 | }; 387 | -------------------------------------------------------------------------------- /ikuuu/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | ikuuu签到脚本 3 | 4 | 说明: 5 | 手动登录 https://ikuuu.co 点击进入“我的信息”页面 如通知成功获取cookie, 则可以使用此签到脚本. 6 | 获取Cookie后, 请将Cookie脚本禁用并移除主机名,以免产生不必要的MITM. 7 | 脚本将在每天上午9点执行。 可以修改执行时间。 8 | 9 | ************************ 10 | Surge 4.2.0+ 脚本配置: 11 | ************************ 12 | 13 | [Script] 14 | ikuuu签到 = type=cron,cronexp=0 9 * * *,script-path=https://raw.githubusercontent.com/iepngs/Script/master/ikuuu/index.js 15 | 16 | ikuuu获取Cookie = type=http-request,pattern=https:\/\/ikuuu\.co\/user\/profile,script-path=https://raw.githubusercontent.com/iepngs/Script/master/ikuuu/index.js 17 | 18 | [MITM] 19 | hostname = ikuuu.co 20 | 21 | ************************ 22 | QuantumultX 本地脚本配置: 23 | ************************ 24 | 25 | [task_local] 26 | # ikuuu签到 27 | 0 9 * * * iepngs/Script/ikuuu/index.js 28 | 29 | [rewrite_local] 30 | # 获取Cookie 31 | https:\/\/ikuuu\.co\/user\/profile url script-request-header iepngs/Script/ikuuu/index.js 32 | 33 | [mitm] 34 | hostname = ikuuu.co 35 | 36 | ************************ 37 | Loon 2.1.0+ 脚本配置: 38 | ************************ 39 | 40 | [Script] 41 | # ikuuu签到 42 | cron "0 9 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/ikuuu/index.js 43 | 44 | # 获取Cookie 网站登录后点击我的信息页面 45 | http-request https:\/\/ikuuu\.co\/user\/profile script-path=https://raw.githubusercontent.com/iepngs/Script/master/ikuuu/index.js 46 | 47 | [Mitm] 48 | hostname = ikuuu.co 49 | **/ 50 | 51 | const $hammer = (() => { 52 | const isRequest = "undefined" != typeof $request, 53 | isSurge = "undefined" != typeof $httpClient, 54 | isQuanX = "undefined" != typeof $task; 55 | 56 | const log = (...n) => { for (let i in n) console.log(n[i]) }; 57 | const alert = (title, body = "", subtitle = "", options = {}) => { 58 | // option(|): {open-url: , media-url: } 59 | let link = null; 60 | switch (typeof options) { 61 | case "string": 62 | link = isQuanX ? { "open-url": options } : options; 63 | break; 64 | case "object": 65 | if (["null", "{}"].indexOf(JSON.stringify(options)) == -1) { 66 | link = isQuanX ? options : options["open-url"]; 67 | break; 68 | } 69 | default: 70 | link = isQuanX ? {} : ""; 71 | } 72 | if (isSurge) return $notification.post(title, subtitle, body, link); 73 | if (isQuanX) return $notify(title, subtitle, body, link); 74 | log("==============📣系统通知📣=============="); 75 | log("title:", title, "subtitle:", subtitle, "body:", body, "link:", link); 76 | }; 77 | const read = key => { 78 | if (isSurge) return $persistentStore.read(key); 79 | if (isQuanX) return $prefs.valueForKey(key); 80 | }; 81 | const write = (val, key) => { 82 | if (isSurge) return $persistentStore.write(val, key); 83 | if (isQuanX) return $prefs.setValueForKey(val, key); 84 | }; 85 | const request = (method, params, callback) => { 86 | /** 87 | * 88 | * params(): {url: , headers: , body: } | 89 | * 90 | * callback( 91 | * error, 92 | * ?, 93 | * {status: , headers: , body: }? 94 | * ) 95 | * 96 | */ 97 | let options = {}; 98 | if (typeof params == "string") { 99 | options.url = params; 100 | } else { 101 | options.url = params.url; 102 | if (typeof params == "object") { 103 | params.headers && (options.headers = params.headers); 104 | params.body && (options.body = params.body); 105 | } 106 | } 107 | method = method.toUpperCase(); 108 | 109 | const writeRequestErrorLog = function (m, u) { 110 | return err => { 111 | log(`\n=== request error -s--\n`); 112 | log(`${m} ${u}`, err); 113 | log(`\n=== request error -e--\n`); 114 | }; 115 | }(method, options.url); 116 | 117 | if (isSurge) { 118 | const _runner = method == "GET" ? $httpClient.get : $httpClient.post; 119 | return _runner(options, (error, response, body) => { 120 | if (error == null || error == "") { 121 | response.body = body; 122 | callback("", body, response); 123 | } else { 124 | writeRequestErrorLog(error); 125 | callback(error, "", response); 126 | } 127 | }); 128 | } 129 | if (isQuanX) { 130 | options.method = method; 131 | $task.fetch(options).then( 132 | response => { 133 | response.status = response.statusCode; 134 | delete response.statusCode; 135 | callback("", response.body, response); 136 | }, 137 | reason => { 138 | writeRequestErrorLog(reason.error); 139 | response.status = response.statusCode; 140 | delete response.statusCode; 141 | callback(reason.error, "", response); 142 | } 143 | ); 144 | } 145 | }; 146 | const done = (value = {}) => { 147 | if (isQuanX) return isRequest ? $done(value) : null; 148 | if (isSurge) return isRequest ? $done(value) : $done(); 149 | }; 150 | return { isRequest, isSurge, isQuanX, log, alert, read, write, request, done }; 151 | })(); 152 | 153 | const CookieKey = "CookieIKUUU"; 154 | const Protagonist = "iKuuu"; 155 | 156 | function GetCookie() { 157 | const CookieName = "IKUUU的Cookie"; 158 | const CookieValue = $request.headers.Cookie; 159 | if(!CookieValue){ 160 | $hammer.alert(CookieName, "未捕获到cookie信息"); 161 | return $hammer.done(); 162 | } 163 | const historyCookieVal = $hammer.read(CookieKey); 164 | const dynamic = historyCookieVal ? (historyCookieVal == CookieValue ? "" : "更新") : "写入"; 165 | if (dynamic) { 166 | $hammer.write(CookieValue, CookieKey); 167 | $hammer.alert(CookieName, `${dynamic}成功🎉`); 168 | } else { 169 | $hammer.alert(CookieName, 'cookie已存在'); 170 | } 171 | $hammer.done(); 172 | } 173 | 174 | function checkin() { 175 | const cookie = $hammer.read(CookieKey); 176 | if (!cookie) { 177 | $hammer.alert(Protagonist, "cookie没有,先去获取吧!"); 178 | return $hammer.done(); 179 | } 180 | const host = `https://ikuuu.co`; 181 | let options = { 182 | url: `${host}/user/checkin`, 183 | headers: { 184 | "accept": "application/json, text/javascript, */*; q=0.01", 185 | "origin": "https://ikuuu.co", 186 | "referer": "https://ikuuu.co/user", 187 | "cookie": cookie, 188 | "user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1", 189 | } 190 | } 191 | $hammer.request("post", options, (error, response, result) => { 192 | if (error) { 193 | $hammer.alert(Protagonist, error, "签到请求失败"); 194 | return $hammer.done(); 195 | } 196 | try { 197 | response = JSON.parse(response); 198 | } catch (error) { 199 | $hammer.log(`${Protagonist}签到结果:`, result); 200 | if (result.body.indexOf("remember-me") > 0) { 201 | $hammer.alert(Protagonist, "Cookie又过期了", "", `${host}/user/profile`); 202 | } else { 203 | $hammer.alert(Protagonist, "签到结果解析异常,看一下日志"); 204 | } 205 | return $hammer.done(); 206 | } 207 | $hammer.alert(Protagonist, response.msg); 208 | $hammer.done(); 209 | }) 210 | } 211 | 212 | $hammer.isRequest ? GetCookie() : checkin(); 213 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iepngs/Script/13a321d6c52c934e2cabc1cf025546114b6686bd/index.js -------------------------------------------------------------------------------- /iosapp/index.js: -------------------------------------------------------------------------------- 1 | 2 | // cron "40 10,17 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/iosapp/index.js,tag=iOS限免监控 3 | 4 | //------------------------------------------------------------------------- 5 | // 监控的应用链接 6 | const apps = [ 7 | "https://apps.apple.com/cn/app/alook%E6%B5%8F%E8%A7%88%E5%99%A8-2%E5%80%8D%E9%80%9F/id1261944766", 8 | "https://apps.apple.com/us/app/shadowrocket/id932747118", 9 | "https://apps.apple.com/cn/app/notability/id736189492", 10 | "https://apps.apple.com/cn/app/shu-%E6%96%87%E4%BB%B6%E9%A2%84%E8%A7%88/id1282297037", 11 | ]; 12 | // 无限免应用是否通知,1通知 0不通知 13 | const notice = 1; 14 | //------------------------------------------------------------------------- 15 | 16 | const $ = new hammer("iOS限免监控", 3); 17 | let inventories = { 18 | free: [], 19 | charge: [], 20 | }; 21 | 22 | function monitor(app){ 23 | return new Promise(async resolve => { 24 | const matcher = /com\/(\w+)\/app\/.*\/id(\d+)$/.exec(app.split("?")[0]); 25 | if(matcher.length != 3){ 26 | $.alert(app, "应用链接格式不对"); 27 | return resolve(); 28 | } 29 | const link = `https://itunes.apple.com/lookup?id=${matcher[2]}&country=${matcher[1]}`; 30 | await $.request('get', link, (error, response, data) => { 31 | if(error){ 32 | $.log(error); 33 | return resolve(); 34 | } 35 | response = JSON.parse(response); 36 | const result = response.results[0]; 37 | if(result.price == 0.00){ 38 | scpush(`${result.trackName}今日限免`, `速点击查看下载(注意商店地区):\n${result.trackViewUrl}`); 39 | $.alert('速点击查看下载(注意商店地区)', `${result.trackName}今日限免`, result.trackViewUrl); 40 | inventories.free.push(result.trackName); 41 | return resolve(); 42 | } 43 | inventories.charge.push(`${result.trackName} - ${result.formattedPrice}`); 44 | resolve(); 45 | }); 46 | }) 47 | } 48 | 49 | function fmt(arr){ 50 | return arr.length ? arr.join("\n") : "无"; 51 | } 52 | 53 | (async function(){ 54 | await Promise.all(apps.map(async app => await monitor(app))); 55 | let detail = `左滑查看今日监控的应用清单:\n\n`; 56 | detail += `今日限免${inventories.free.length}款:\n${fmt(inventories.free)}\n` 57 | detail += `其余${inventories.charge.length}款售价:\n${fmt(inventories.charge)}`; 58 | notice && $.alert(detail); 59 | $.log(notice); 60 | $.done(); 61 | })() 62 | 63 | 64 | // util tool 65 | function hammer(t="untitled",l=3){return new class{constructor(t,l){this.name=t,this.logLevel=l,this.isRequest=("object"==typeof $request)&&$request.method!="OPTIONS",this.isSurge="undefined"!=typeof $httpClient,this.isQuanX="undefined"!=typeof $task,this.isNode="function"==typeof require,this.node=(()=>{if(!this.isNode){return null}const file="localstorage.yml";let f,y,r;try{f=require('fs');y=require('js-yaml');r=require('request');f.appendFile(file,"",function(err){if(err)throw err;})}catch(e){console.log("install unrequired module by: yarn add module_name");console.log(e.message);return{}}return{file:file,fs:f,yaml:y,request:r,}})()}log(...n){if(l<2){return null}console.log(`\n***********${this.name}***********`);for(let i in n)console.log(typeof n[i]=="object"?JSON.stringify(n[i]):n[i])}alert(body="",subtitle="",options={}){if(l==2||l==0){return null}if(typeof options=="string"){options={"open-url":options}}let link=null;if(Object.keys(options).length){link=this.isQuanX?options:{openUrl:options["open-url"],mediaUrl:options["media-url"]}}if(this.isSurge)return $notification.post(this.name,subtitle,body,link);if(this.isQuanX)return $notify(this.name,subtitle,body,link);console.log(`系统通知📣\ntitle:${this.name}\nsubtitle:${subtitle}\nbody:${body}\nlink:${link}`)}request(method,params,callback){let options={};if(typeof params=="string"){options.url=params}else{options.url=params.url;if(typeof params=="object"){params.headers&&(options.headers=params.headers);params.body&&(options.body=params.body)}}method=method.toUpperCase();const writeRequestErrorLog=function(n,m,u){return err=>console.log(`${n}request error:\n${m}${u}\n${err}`)}(this.name,method,options.url);if(this.isSurge){const _runner=method=="GET"?$httpClient.get:$httpClient.post;return _runner(options,(error,response,body)=>{if(error==null||error==""){response.body=body;callback("",body,response)}else{writeRequestErrorLog(error);callback(error,"",response)}})}options.method=method;if(this.isQuanX){$task.fetch(options).then(response=>{response.status=response.statusCode;delete response.statusCode;callback("",response.body,response)},reason=>{writeRequestErrorLog(reason.error);response.status=response.statusCode;delete response.statusCode;callback(reason.error,"",response)})}if(this.isNode){if(options.method=="POST"&&options.body){try{options.body=JSON.parse(options.body);options.json=true}catch(e){console.log(e.message)}}this.node.request(options,(error,response,body)=>{if(typeof body=="object"){body=JSON.stringify(body)}if(typeof response=='object'&&response){response.status=response.statusCode;delete response.statusCode}callback(error,body,response)})}}read(key){if(this.isSurge)return $persistentStore.read(key);if(this.isQuanX)return $prefs.valueForKey(key);if(this.isNode){let val="";try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");const data=this.node.yaml.safeLoad(fileContents);val=(typeof(data)=="object"&&data[key])?data[key]:""}catch(e){console.log(`读取文件时错误:\n${e.message}`);return""}return val}}write(val,key){if(this.isSurge)return $persistentStore.write(val,key);if(this.isQuanX)return $prefs.setValueForKey(val,key);if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};data[key]=val;val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}delete(key){if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};if(!data.hasOwnProperty(key)){return true}delete data[key];const val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}done(value={}){if(this.isQuanX)return $done(value);if(this.isSurge)return this.isRequest?$done(value):$done()}pad(s=false,c="*",l=15){return s?this.log(c.padEnd(l,c)):`\n${c.padEnd(l,c)}\n`}}(t,l)} -------------------------------------------------------------------------------- /jd/index.js: -------------------------------------------------------------------------------- 1 | 2 | // cookie用JD签到的 3 | // cron "1 0 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/jd/index.js,tag=店铺签到 4 | 5 | // **************************************************************************** 6 | // 活动ID配置项目 7 | const vas = [ 8 | "1000328145,10182070", 9 | "136277,10190083", 10 | "31018,10191143", 11 | "776299,10223756", 12 | "1000347404,10195490", 13 | ]; 14 | // **************************************************************************** 15 | 16 | const $ = hammer("店铺签到", 3); 17 | 18 | let results = ["左滑 / 下拉 查看详细结果..."]; 19 | 20 | let options = { 21 | url: "", 22 | headers: { 23 | Cookie: $.read('CookieJD'), 24 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1", 25 | "referer": "https://h5.m.jd.com/", 26 | } 27 | }; 28 | 29 | function checkCookie(){ 30 | return new Promise(resolve => { 31 | if(!options.headers.Cookie){ 32 | $.alert("Cookie不存在,中止运行."); 33 | return resolve(false); 34 | } 35 | options.url = "https://plogin.m.jd.com/cgi-bin/ml/islogin"; 36 | $.request("GET", options, (err, resp, data) => { 37 | if(err){ 38 | $.log(err); 39 | $.alert("Cookie检测异常,查看日志"); 40 | return resolve(false); 41 | } 42 | resp = JSON.parse(resp); 43 | if(resp.islogin == 1){ 44 | return resolve(true); 45 | } 46 | $.log(resp); 47 | $.alert("Cookie已失效"); 48 | return resolve(false); 49 | }) 50 | }) 51 | } 52 | 53 | // **************************************************************************** 54 | function buildOptions(va){ 55 | return new Promise(resolve => { 56 | const nowTs = Date.now(); 57 | const [v, a] = va.split(",", 2); 58 | options.url = `https://api.m.jd.com/api?appid=interCenter_shopSign&t=${nowTs}&loginType=2&functionId=interact_center_shopSign_signCollectGift&body=%7B%22token%22%3A%2293F80D2F93AD3591911610FE675280E%22%2C%22venderId%22%3A${v}%2C%22activityId%22%3A${a}%2C%22type%22%3A56%2C%22actionType%22%3A7%7D`; 59 | $.request("GET", options, (err, resp, data) => { 60 | if(err){ 61 | $.log(`<${va}>签到异常`, err); 62 | results.push(`${va} ×`); 63 | return resolve(); 64 | } 65 | resp = JSON.parse(resp); 66 | if(!resp.success){ 67 | $.log(resp); 68 | results.push(`${va} ×\n(${resp.msg})`); 69 | return resolve(); 70 | } 71 | results.push(`${va} √`); 72 | setTimeout(()=>{ 73 | return resolve(); 74 | }, 1234) 75 | }) 76 | }) 77 | } 78 | 79 | async function dailySign(){ 80 | if (!await checkCookie()) { 81 | return $.done(); 82 | } 83 | $.log("JDCookie校验完成,开始签到"); 84 | for (const va of vas) { 85 | await buildOptions(va); 86 | } 87 | $.alert(results.join("\n"), "签到结束"); 88 | $.done(); 89 | } 90 | 91 | 92 | $.isRequest ? $.done() : dailySign(); 93 | 94 | function hammer(t="untitled",l=3){return new class{constructor(t,l){this.name=t,this.logLevel=l,this.isRequest=("object"==typeof $request)&&$request.method!="OPTIONS",this.isSurge="undefined"!=typeof $httpClient,this.isQuanX="undefined"!=typeof $task,this.isNode="function"==typeof require,this.node=(()=>{if(!this.isNode){return null}const file="localstorage.yml";let f,y,r;try{f=require('fs');y=require('js-yaml');r=require('request');f.appendFile(file,"",function(err){if(err)throw err;})}catch(e){console.log("install unrequired module by: yarn add module_name");console.log(e.message);return{}}return{file:file,fs:f,yaml:y,request:r,}})()}log(...n){if(l<2){return null}console.log(`\n***********${this.name}***********`);for(let i in n)console.log(typeof n[i]=="object"?JSON.stringify(n[i]):n[i])}alert(body="",subtitle="",options={}){if(l==2||l==0){return null}if(typeof options=="string"){options={"open-url":options}}let link=null;if(Object.keys(options).length){link=this.isQuanX?options:{openUrl:options["open-url"],mediaUrl:options["media-url"]}}if(this.isSurge)return $notification.post(this.name,subtitle,body,link);if(this.isQuanX)return $notify(this.name,subtitle,body,link);console.log(`系统通知📣\ntitle:${this.name}\nsubtitle:${subtitle}\nbody:${body}\nlink:${link}`)}request(method,params,callback){let options={};if(typeof params=="string"){options.url=params}else{options.url=params.url;if(typeof params=="object"){params.headers&&(options.headers=params.headers);params.body&&(options.body=params.body)}}method=method.toUpperCase();const writeRequestErrorLog=function(n,m,u){return err=>console.log(`${n}request error:\n${m}${u}\n${err}`)}(this.name,method,options.url);if(this.isSurge){const _runner=method=="GET"?$httpClient.get:$httpClient.post;return _runner(options,(error,response,body)=>{if(error==null||error==""){response.body=body;callback("",body,response)}else{writeRequestErrorLog(error);callback(error,"",response)}})}options.method=method;if(this.isQuanX){$task.fetch(options).then(response=>{response.status=response.statusCode;delete response.statusCode;callback("",response.body,response)},reason=>{writeRequestErrorLog(reason.error);response.status=response.statusCode;delete response.statusCode;callback(reason.error,"",response)})}if(this.isNode){if(options.method=="POST"&&options.body){try{options.body=JSON.parse(options.body);options.json=true}catch(e){console.log(e.message)}}this.node.request(options,(error,response,body)=>{if(typeof body=="object"){body=JSON.stringify(body)}if(typeof response=='object'&&response){response.status=response.statusCode;delete response.statusCode}callback(error,body,response)})}}read(key){if(this.isSurge)return $persistentStore.read(key);if(this.isQuanX)return $prefs.valueForKey(key);if(this.isNode){let val="";try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");const data=this.node.yaml.safeLoad(fileContents);val=(typeof(data)=="object"&&data[key])?data[key]:""}catch(e){console.log(`读取文件时错误:\n${e.message}`);return""}return val}}write(val,key){if(this.isSurge)return $persistentStore.write(val,key);if(this.isQuanX)return $prefs.setValueForKey(val,key);if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};data[key]=val;val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}delete(key){if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};if(!data.hasOwnProperty(key)){return true}delete data[key];const val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}done(value={}){if(this.isQuanX)return $done(value);if(this.isSurge)return this.isRequest?$done(value):$done()}pad(s=false,c="*",l=15){return s?this.log(c.padEnd(l,c)):`\n${c.padEnd(l,c)}\n`}}(t,l)} -------------------------------------------------------------------------------- /ks/index.js: -------------------------------------------------------------------------------- 1 | // 快手极速版签到 2 | // app下载⏬:https://nbic2zwnf.kwairr9aw56vso581r.com/f/Yzcsl79n_AO 3 | 4 | // Task: 5 | // cron "15 9 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/ks/index.js,tag=快手极速版签到,enable=true 6 | 7 | // Script: 8 | // http-request ^https:\/\/nebula\.kuaishou\.com\/rest\/n\/nebula\/sign\/sign script-path=https://raw.githubusercontent.com/iepngs/Script/master/ks/index.js,tag=快手极速版签到,enabled=true 9 | 10 | // MITM: nebula.kuaishou.com 11 | 12 | const Protagnist = '快手极速版'; 13 | const $hammer = new hammer(Protagnist); 14 | 15 | const KsCookieKey = 'ksCookie'; 16 | let KsCookieVal = ''; 17 | 18 | function GetCookie(){ 19 | KsCookieVal = $request.headers.Cookie; 20 | $hammer.write(KsCookieVal, KsCookieKey); 21 | $hammer.alert("Cookie已捕获"); 22 | $hammer.done(); 23 | } 24 | 25 | function DailySign(){ 26 | KsCookieVal = KsCookieVal || $hammer.read(KsCookieKey); 27 | if(!KsCookieVal){ 28 | $hammer.log("Cookie不存在"); 29 | return $hammer.done(); 30 | } 31 | const options = { 32 | url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/sign?source=popup', 33 | headers: { 34 | 'Cookie': KsCookieVal, 35 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 ksNebula/2.3.2.78', 36 | 'Referer': 'https://nebula.kuaishou.com/nebula/task/earning?source=timer&layoutType=4&hyId=nebula_earning' 37 | } 38 | }; 39 | $hammer.request('get', options, (error, response, data) => { 40 | if(error){ 41 | $hammer.log(`request error:\n ${error}`); 42 | return $hammer.done(); 43 | } 44 | response = JSON.parse(response); 45 | if(response.result != 1 || response.data.status != 2){ 46 | $hammer.log(`响应解析异常: \n${response}`); 47 | return $hammer.done(); 48 | } 49 | const content = `${response.data.nebulaSignInPopup.subTitle},剩余金币:${response.data.totalCoin}`; 50 | $hammer.alert(content, response.data.nebulaSignInPopup.title); 51 | $hammer.done(); 52 | }) 53 | } 54 | 55 | $hammer.isRequest ? GetCookie() : DailySign(); 56 | 57 | function hammer(t="untitled",l=3){return new class{constructor(t,l){this.name=t,this.logLevel=l,this.isRequest=("object"==typeof $request)&&$request.method!="OPTIONS",this.isSurge="undefined"!=typeof $httpClient,this.isQuanX="undefined"!=typeof $task,this.isNode="function"==typeof require,this.node=(()=>{if(!this.isNode){return null}const file="localstorage.yml";let f,y,r;try{f=require('fs');y=require('js-yaml');r=require('request');f.appendFile(file,"",function(err){if(err)throw err;})}catch(e){console.log("install unrequired module by: yarn add module_name");console.log(e.message);return{}}return{file:file,fs:f,yaml:y,request:r,}})()}log(...n){if(l<2){return null}console.log(`\n***********${this.name}***********`);for(let i in n)console.log(typeof n[i]=="object"?JSON.stringify(n[i]):n[i])}alert(body="",subtitle="",options={}){if(l==2||l==0){return null}if(typeof options=="string"){options={"open-url":options}}let link=null;if(Object.keys(options).length){link=this.isQuanX?options:{openUrl:options["open-url"],mediaUrl:options["media-url"]}}if(this.isSurge)return $notification.post(this.name,subtitle,body,link);if(this.isQuanX)return $notify(this.name,subtitle,body,link);console.log(`系统通知📣\ntitle:${this.name}\nsubtitle:${subtitle}\nbody:${body}\nlink:${link}`)}request(method,params,callback){let options={};if(typeof params=="string"){options.url=params}else{options.url=params.url;if(typeof params=="object"){params.headers&&(options.headers=params.headers);params.body&&(options.body=params.body)}}method=method.toUpperCase();const writeRequestErrorLog=function(n,m,u){return err=>console.log(`${n}request error:\n${m}${u}\n${err}`)}(this.name,method,options.url);if(this.isSurge){const _runner=method=="GET"?$httpClient.get:$httpClient.post;return _runner(options,(error,response,body)=>{if(error==null||error==""){response.body=body;callback("",body,response)}else{writeRequestErrorLog(error);callback(error,"",response)}})}options.method=method;if(this.isQuanX){$task.fetch(options).then(response=>{response.status=response.statusCode;delete response.statusCode;callback("",response.body,response)},reason=>{writeRequestErrorLog(reason.error);response.status=response.statusCode;delete response.statusCode;callback(reason.error,"",response)})}if(this.isNode){if(options.method=="POST"&&options.body){try{options.body=JSON.parse(options.body);options.json=true}catch(e){console.log(e.message)}}this.node.request(options,(error,response,body)=>{if(typeof body=="object"){body=JSON.stringify(body)}if(typeof response=='object'&&response){response.status=response.statusCode;delete response.statusCode}callback(error,body,response)})}}read(key){if(this.isSurge)return $persistentStore.read(key);if(this.isQuanX)return $prefs.valueForKey(key);if(this.isNode){let val="";try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");const data=this.node.yaml.safeLoad(fileContents);val=(typeof(data)=="object"&&data[key])?data[key]:""}catch(e){console.log(`读取文件时错误:\n${e.message}`);return""}return val}}write(val,key){if(this.isSurge)return $persistentStore.write(val,key);if(this.isQuanX)return $prefs.setValueForKey(val,key);if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};data[key]=val;val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}delete(key){if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};if(!data.hasOwnProperty(key)){return true}delete data[key];const val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}done(value={}){if(this.isQuanX)return $done(value);if(this.isSurge)return this.isRequest?$done(value):$done()}pad(s=false,c="*",l=15){return s?this.log(c.padEnd(l,c)):`\n${c.padEnd(l,c)}\n`}}(t,l)} -------------------------------------------------------------------------------- /liwo/index.js: -------------------------------------------------------------------------------- 1 | // 梨涡签到领现金 2 | // app下载⏬:https://bit.ly/3maDsf4 3 | 4 | // ---------------------------------------------------------------------------- 5 | 6 | // QX 7 | // [MITM] 8 | // hostname=api.m.jd.com 9 | 10 | // [rewrite_local] 11 | // ^https:\/\/api\.m\.jd\.com\/api\/v1\/sign\/doSign url script-request-body https://raw.githubusercontent.com/iepngs/Script/master/liwo/index.js 12 | 13 | // [local_tasK] 14 | // 7 0 * * * https://raw.githubusercontent.com/iepngs/Script/master/liwo/index.js, tag=梨涡签到 15 | 16 | // ---------------------------------------------------------------------------- 17 | // Loon 18 | 19 | // [MITM] 20 | // hostname=api.m.jd.com 21 | 22 | // [Script] 23 | // http-request ^https:\/\/api\.m\.jd\.com\/api\/v1\/sign\/doSign script-path=https://raw.githubusercontent.com/iepngs/Script/master/liwo/index.js, requires-body=true, timeout=10, tag=梨涡签到Cookie 24 | // cron "7 0 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/liwo/index.js,tag=梨涡签到 25 | 26 | // ---------------------------------------------------------------------------- 27 | 28 | const $ = hammer("梨涡签到"); 29 | const CookieKey = "liwoCookie"; 30 | 31 | function GetCookie() { 32 | $.log(`cookie:\n ${$request.body}`); 33 | $.write($request.body, CookieKey); 34 | $.alert('签到Cookie写入成功'); 35 | $.done(); 36 | } 37 | 38 | function toSign(options) { 39 | return new Promise(resolve => { 40 | $.request("post", options, (error, response, data) => { 41 | const type = options.url.split("/").pop(); 42 | if(error){ 43 | $.log(`${type} request error: \n${error}`); 44 | return resolve(0); 45 | } 46 | $.log(`${type} response: \n${response}`); 47 | response = JSON.parse(response); 48 | const inlink = {"open-url": "yocial://webview/?url=https%3A%2F%2F2do.jd.com%2Fevents%2F7-days%2F%23%2F&login=1"}; 49 | if (response.status) { 50 | const ret = response.data; 51 | $.alert(ret.message, ret.title, inlink); 52 | return resolve(1); 53 | } 54 | if([39004, 39003].includes(+response.error.code)){ 55 | $.alert(response.error.message); 56 | // 开启新一轮签到 57 | return setTimeout(()=>{ 58 | resolve(2); 59 | }, 1234); 60 | } 61 | $.alert(response.error.message, '', inlink); 62 | return resolve(3); 63 | }) 64 | }) 65 | }; 66 | 67 | async function main() { 68 | const cookie = $.read('CookieJD'); 69 | const CookieVal = $.read(CookieKey); 70 | if(!cookie || !CookieVal){ 71 | $.log("Cookie不存在,中止运行."); 72 | return $.done(); 73 | } 74 | const body = CookieVal.replace(/&t=\d+/, "&t=" + Date.now().toString()); 75 | const headers = { 76 | "Content-Type": "application/x-www-form-urlencoded", 77 | "Cookie": cookie, 78 | "Host": "api.m.jd.com", 79 | "Origin": "https://2do.jd.com", 80 | "Referer": "https://2do.jd.com/events/7-days/", 81 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148/yocial/5.1.1(iOS;13.7;com.jd.campustodo)" 82 | } 83 | let options = { 84 | url: "https://api.m.jd.com/api/v1/sign/doSign", 85 | headers: headers, 86 | body: body 87 | } 88 | if((await toSign(options)) == 2){ 89 | options.url = options.url.replace("doSign", "resetSign"); 90 | options.body = options.body.replace("v1_sign_doSign", "v1_sign_resetSign"); 91 | await toSign(options); 92 | } 93 | $.done(); 94 | } 95 | 96 | $.isRequest ? GetCookie() : main(); 97 | 98 | function hammer(t="untitled",l=3){return new class{constructor(t,l){this.name=t,this.logLevel=l,this.isRequest=("object"==typeof $request)&&$request.method!="OPTIONS",this.isSurge="undefined"!=typeof $httpClient,this.isQuanX="undefined"!=typeof $task,this.isNode="function"==typeof require,this.node=(()=>{if(!this.isNode){return null}const file="localstorage.yml";let f,y,r;try{f=require('fs');y=require('js-yaml');r=require('request');f.appendFile(file,"",function(err){if(err)throw err;})}catch(e){console.log("install unrequired module by: yarn add module_name");console.log(e.message);return{}}return{file:file,fs:f,yaml:y,request:r,}})()}log(...n){if(l<2){return null}console.log(`\n***********${this.name}***********`);for(let i in n)console.log(typeof n[i]=="object"?JSON.stringify(n[i]):n[i])}alert(body="",subtitle="",options={}){if(l==2||l==0){return null}if(typeof options=="string"){options={"open-url":options}}let link=null;if(Object.keys(options).length){link=this.isQuanX?options:{openUrl:options["open-url"],mediaUrl:options["media-url"]}}if(this.isSurge)return $notification.post(this.name,subtitle,body,link);if(this.isQuanX)return $notify(this.name,subtitle,body,link);console.log(`系统通知📣\ntitle:${this.name}\nsubtitle:${subtitle}\nbody:${body}\nlink:${link}`)}request(method,params,callback){let options={};if(typeof params=="string"){options.url=params}else{options.url=params.url;if(typeof params=="object"){params.headers&&(options.headers=params.headers);params.body&&(options.body=params.body)}}method=method.toUpperCase();const writeRequestErrorLog=function(n,m,u){return err=>console.log(`${n}request error:\n${m}${u}\n${err}`)}(this.name,method,options.url);if(this.isSurge){const _runner=method=="GET"?$httpClient.get:$httpClient.post;return _runner(options,(error,response,body)=>{if(error==null||error==""){response.body=body;callback("",body,response)}else{writeRequestErrorLog(error);callback(error,"",response)}})}options.method=method;if(this.isQuanX){$task.fetch(options).then(response=>{response.status=response.statusCode;delete response.statusCode;callback("",response.body,response)},reason=>{writeRequestErrorLog(reason.error);response.status=response.statusCode;delete response.statusCode;callback(reason.error,"",response)})}if(this.isNode){if(options.method=="POST"&&options.body){try{options.body=JSON.parse(options.body);options.json=true}catch(e){console.log(e.message)}}this.node.request(options,(error,response,body)=>{if(typeof body=="object"){body=JSON.stringify(body)}if(typeof response=='object'&&response){response.status=response.statusCode;delete response.statusCode}callback(error,body,response)})}}read(key){if(this.isSurge)return $persistentStore.read(key);if(this.isQuanX)return $prefs.valueForKey(key);if(this.isNode){let val="";try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");const data=this.node.yaml.safeLoad(fileContents);val=(typeof(data)=="object"&&data[key])?data[key]:""}catch(e){console.log(`读取文件时错误:\n${e.message}`);return""}return val}}write(val,key){if(this.isSurge)return $persistentStore.write(val,key);if(this.isQuanX)return $prefs.setValueForKey(val,key);if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};data[key]=val;val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}delete(key){if(this.isNode){try{const fileContents=this.node.fs.readFileSync(this.node.file,"utf8");let data=this.node.yaml.safeLoad(fileContents);data=typeof data=="object"?data:{};if(!data.hasOwnProperty(key)){return true}delete data[key];const val=this.node.yaml.safeDump(data);this.node.fs.writeFileSync(this.node.file,val,'utf8')}catch(e){console.log(e.message);return false}return true}}done(value={}){if(this.isQuanX)return $done(value);if(this.isSurge)return this.isRequest?$done(value):$done()}pad(s=false,c="*",l=15){return s?this.log(c.padEnd(l,c)):`\n${c.padEnd(l,c)}\n`}}(t,l)} -------------------------------------------------------------------------------- /location/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 自动定位脚本 3 | * @author: Peng-YM 4 | * 更新地址:https://raw.githubusercontent.com/Peng-YM/QuanX/master/Tools/Location/locate.js 5 | * 配置方法: 6 | * 根据平台添加如下配置 7 | * 1. Quantumult X 8 | * [MITM] 9 | * hostname=weather-data.apple.com 10 | * [Rewrite] 11 | * https://weather-data.apple.com url script-request-header https://raw.githubusercontent.com/Peng-YM/QuanX/master/Tools/Location/locate.js 12 | * 13 | * 2. Loon 14 | * [MITM] 15 | * hostname=weather-data.apple.com 16 | * [Script] 17 | * http-request https://weather-data.apple.com, script-path=https://raw.githubusercontent.com/Peng-YM/QuanX/master/Tools/Location/locate.js, require-body=false 18 | * 19 | * 3. Surge 20 | * [MITM] 21 | * hostname=weather-data.apple.com 22 | * [Script] 23 | * type=http-request, pattern=https://weather-data.apple.com, script-path=https://raw.githubusercontent.com/Peng-YM/QuanX/master/Tools/Location/locate.js, require-body=false 24 | * 25 | * 即可定时获取当前位置,注意需要安装自带的天气应用。此重写不要禁用。 26 | * 在脚本中即可通过 "latitude" 和 ”longitude" 这两个字段引用当前的经纬度了。 27 | */ 28 | 29 | const url = $request.url; 30 | const res = url.match(/CN\/(.*)\/(.*)\?/); 31 | const latitude = res[1]; 32 | const longitude = res[2]; 33 | console.log(`当前位置:经度${latitude},纬度${longitude}`); 34 | 35 | // write data 36 | if (typeof $prefs !== 'undefined'){ 37 | // QX 38 | $prefs.setValueForKey(latitude, "latitude"); 39 | $prefs.setValueForKey(longitude, "longitude"); 40 | }else{ 41 | // Loon & Surge 42 | $persistentStore.write(latitude, "latitude"); 43 | $persistentStore.write(longitude, "longitude"); 44 | } 45 | -------------------------------------------------------------------------------- /lxhealth/manual.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | //desc: 步数上传 4 | //author: iepngs 5 | 6 | [Script] 7 | // *Loon 8 | http-request ^https:\/\/sports\.lifesense\.com\/sport_service\/sport\/sport\/uploadMobileStepV2 requires-body=true,timeout=10,script-path=https://raw.githubusercontent.com/iepngs/Script/master/lxhealth/index.js,tag=lxhealth 9 | 10 | // *QX 11 | ^https:\/\/sports\.lifesense\.com\/sport_service\/sport\/sport\/uploadMobileStepV2 url script-request-body iepngs/Script/lxhealth/index.js,tag=lxhealth 12 | 13 | [MitM] 14 | hostname = sports.lifesense.com 15 | 16 | */ 17 | 18 | const $hammer = (() => { 19 | const isRequest = "undefined" != typeof $request, 20 | isSurge = "undefined" != typeof $httpClient, 21 | isQuanX = "undefined" != typeof $task; 22 | 23 | const log = (...n) => { for (let i in n) console.log(n[i]) }; 24 | const alert = (title, body = "", subtitle = "", options = {}) => { 25 | // option(|): {open-url: , media-url: } 26 | let link = null; 27 | switch (typeof options) { 28 | case "string": 29 | link = isQuanX ? {"open-url": options} : options; 30 | break; 31 | case "object": 32 | if(["null", "{}"].indexOf(JSON.stringify(options)) == -1){ 33 | link = isQuanX ? options : options["open-url"]; 34 | break; 35 | } 36 | default: 37 | link = isQuanX ? {} : ""; 38 | } 39 | if (isSurge) return $notification.post(title, subtitle, body, link); 40 | if (isQuanX) return $notify(title, subtitle, body, link); 41 | log("==============📣系统通知📣=============="); 42 | log("title:", title, "subtitle:", subtitle, "body:", body, "link:", link); 43 | }; 44 | const read = key => { 45 | if (isSurge) return $persistentStore.read(key); 46 | if (isQuanX) return $prefs.valueForKey(key); 47 | }; 48 | const write = (val, key) => { 49 | if (isSurge) return $persistentStore.write(val, key); 50 | if (isQuanX) return $prefs.setValueForKey(val, key); 51 | }; 52 | const request = (method, params, callback) => { 53 | /** 54 | * 55 | * params(): {url: , headers: , body: } | 56 | * 57 | * callback( 58 | * error, 59 | * ?, 60 | * {status: , headers: , body: }? 61 | * ) 62 | * 63 | */ 64 | let options = {}; 65 | if (typeof params == "string") { 66 | options.url = params; 67 | } else { 68 | options.url = params.url; 69 | if (typeof params == "object") { 70 | params.headers && (options.headers = params.headers); 71 | params.body && (options.body = params.body); 72 | } 73 | } 74 | method = method.toUpperCase(); 75 | 76 | const writeRequestErrorLog = function (m, u) { 77 | return err => { 78 | log(`\n=== request error -s--\n`); 79 | log(`${m} ${u}`, err); 80 | log(`\n=== request error -e--\n`); 81 | }; 82 | }(method, options.url); 83 | 84 | if (isSurge) { 85 | const _runner = method == "GET" ? $httpClient.get : $httpClient.post; 86 | return _runner(options, (error, response, body) => { 87 | if (error == null || error == "") { 88 | response.body = body; 89 | callback("", body, response); 90 | } else { 91 | writeRequestErrorLog(error); 92 | callback(error, "", response); 93 | } 94 | }); 95 | } 96 | if (isQuanX) { 97 | options.method = method; 98 | $task.fetch(options).then( 99 | response => { 100 | response.status = response.statusCode; 101 | delete response.statusCode; 102 | callback("", response.body, response); 103 | }, 104 | reason => { 105 | writeRequestErrorLog(reason.error); 106 | response.status = response.statusCode; 107 | delete response.statusCode; 108 | callback(reason.error, "", response); 109 | } 110 | ); 111 | } 112 | }; 113 | const done = (value = {}) => { 114 | if (isQuanX) return isRequest ? $done(value) : null; 115 | if (isSurge) return isRequest ? $done(value) : $done(); 116 | }; 117 | return { isRequest, isSurge, isQuanX, log, alert, read, write, request, done }; 118 | })(); 119 | 120 | function hackingRequestBody(data) { 121 | try { 122 | data = JSON.parse(data); 123 | } catch (e) { 124 | return data; 125 | } 126 | const lastOneIndex = data.list.length - 1; 127 | let steps = data.list[lastOneIndex].step; 128 | const initSteps = 18007, 129 | notifyContents = `原始数据为:${steps}`; 130 | if (~~steps < initSteps) { 131 | steps = initSteps + Math.ceil(Math.random() * 4000); 132 | data.list[lastOneIndex].step = steps.toString(); 133 | data.list[lastOneIndex].calories = (steps * 0.0325).toString(); 134 | data.list[lastOneIndex].distance = (Math.ceil((steps * 0.7484).toFixed(1))).toString(); 135 | } 136 | $hammer.alert(`🐢 健康上传步数:${steps}`, notifyContents); 137 | return JSON.stringify(data); 138 | } 139 | 140 | $hammer.done({ body: hackingRequestBody($request.body) }); -------------------------------------------------------------------------------- /lxhealth/manual_alert.js: -------------------------------------------------------------------------------- 1 | const $hammer = (() => { 2 | const isRequest = "undefined" != typeof $request, 3 | isSurge = "undefined" != typeof $httpClient, 4 | isQuanX = "undefined" != typeof $task; 5 | 6 | const log = (...n) => { for (let i in n) console.log(n[i]) }; 7 | const alert = (title, body = "", subtitle = "", options = {}) => { 8 | // option(|): {open-url: , media-url: } 9 | let link = null; 10 | switch (typeof options) { 11 | case "string": 12 | link = isQuanX ? {"open-url": options} : options; 13 | break; 14 | case "object": 15 | if(["null", "{}"].indexOf(JSON.stringify(options)) == -1){ 16 | link = isQuanX ? options : options["open-url"]; 17 | break; 18 | } 19 | default: 20 | link = isQuanX ? {} : ""; 21 | } 22 | if (isSurge) return $notification.post(title, subtitle, body, link); 23 | if (isQuanX) return $notify(title, subtitle, body, link); 24 | log("==============📣系统通知📣=============="); 25 | log("title:", title, "subtitle:", subtitle, "body:", body, "link:", link); 26 | }; 27 | const read = key => { 28 | if (isSurge) return $persistentStore.read(key); 29 | if (isQuanX) return $prefs.valueForKey(key); 30 | }; 31 | const write = (val, key) => { 32 | if (isSurge) return $persistentStore.write(val, key); 33 | if (isQuanX) return $prefs.setValueForKey(val, key); 34 | }; 35 | const request = (method, params, callback) => { 36 | /** 37 | * 38 | * params(): {url: , headers: , body: } | 39 | * 40 | * callback( 41 | * error, 42 | * ?, 43 | * {status: , headers: , body: }? 44 | * ) 45 | * 46 | */ 47 | let options = {}; 48 | if (typeof params == "string") { 49 | options.url = params; 50 | } else { 51 | options.url = params.url; 52 | if (typeof params == "object") { 53 | params.headers && (options.headers = params.headers); 54 | params.body && (options.body = params.body); 55 | } 56 | } 57 | method = method.toUpperCase(); 58 | 59 | const writeRequestErrorLog = function (m, u) { 60 | return err => { 61 | log(`\n=== request error -s--\n`); 62 | log(`${m} ${u}`, err); 63 | log(`\n=== request error -e--\n`); 64 | }; 65 | }(method, options.url); 66 | 67 | if (isSurge) { 68 | const _runner = method == "GET" ? $httpClient.get : $httpClient.post; 69 | return _runner(options, (error, response, body) => { 70 | if (error == null || error == "") { 71 | response.body = body; 72 | callback("", body, response); 73 | } else { 74 | writeRequestErrorLog(error); 75 | callback(error, "", response); 76 | } 77 | }); 78 | } 79 | if (isQuanX) { 80 | options.method = method; 81 | $task.fetch(options).then( 82 | response => { 83 | response.status = response.statusCode; 84 | delete response.statusCode; 85 | callback("", response.body, response); 86 | }, 87 | reason => { 88 | writeRequestErrorLog(reason.error); 89 | response.status = response.statusCode; 90 | delete response.statusCode; 91 | callback(reason.error, "", response); 92 | } 93 | ); 94 | } 95 | }; 96 | const done = (value = {}) => { 97 | if (isQuanX) return isRequest ? $done(value) : null; 98 | if (isSurge) return isRequest ? $done(value) : $done(); 99 | }; 100 | return { isRequest, isSurge, isQuanX, log, alert, read, write, request, done }; 101 | })(); 102 | 103 | !(() => { 104 | const randomNumber = (start, end, fixed = 0) => { 105 | const differ = end - start; 106 | const random = Math.random(); 107 | return (start + differ * random).toFixed(fixed); 108 | }; 109 | const waitSecond = randomNumber(0, 30); 110 | setTimeout(() => { 111 | try { 112 | $hammer.alert("lxhealth", "", "点击启动", "lswearable://"); 113 | } catch (error) { 114 | $hammer.log("lxhealth.alert.js - error:"); 115 | $hammer.log(error); 116 | } 117 | }, waitSecond * 1000); 118 | })(); -------------------------------------------------------------------------------- /lxsj/index.js: -------------------------------------------------------------------------------- 1 | // MITM ios-fenqu11.lxsjgo.com 2 | 3 | // http-request ^https:\/\/ios-fenqu11\.lxsjgo\.com\/dog\/bug\?ts script-path=https://raw.githubusercontent.com/iepngs/Script/master/lxsj/index.js,requires-body=true,tag=旅行世界购物版 4 | // http-response ^https:\/\/ios-fenqu11\.lxsjgo\.com\/dog\/bug\?ts script-path=https://raw.githubusercontent.com/iepngs/Script/master/lxsj/index.js,requires-body=true,timeout=10,tag=旅行世界购物版 5 | // = ----------------------------------- 6 | 7 | const $hammer = (() => { const isRequest = "undefined" != typeof $request, isSurge = "undefined" != typeof $httpClient, isQuanX = "undefined" != typeof $task; const log = (...n) => { for (let i in n) console.log(n[i]) }; const alert = (title, body = "", subtitle = "", options = {}) => { let link = null; switch (typeof options) { case "string": link = isQuanX ? { "open-url": options } : options; break; case "object": if (["null", "{}"].indexOf(JSON.stringify(options)) == -1) { link = isQuanX ? options : options["open-url"]; break } default: link = isQuanX ? {} : "" }if (isSurge) return $notification.post(title, subtitle, body, link); if (isQuanX) return $notify(title, subtitle, body, link); log("==============📣系统通知📣=============="); log("title:", title, "subtitle:", subtitle, "body:", body, "link:", link) }; const read = key => { if (isSurge) return $persistentStore.read(key); if (isQuanX) return $prefs.valueForKey(key) }; const write = (val, key) => { if (isSurge) return $persistentStore.write(val, key); if (isQuanX) return $prefs.setValueForKey(val, key) }; const request = (method, params, callback) => { let options = {}; if (typeof params == "string") { options.url = params } else { options.url = params.url; if (typeof params == "object") { params.headers && (options.headers = params.headers); params.body && (options.body = params.body) } } method = method.toUpperCase(); const writeRequestErrorLog = function (m, u) { return err => { log(`\n===request error-s--\n`); log(`${m}${u}`, err); log(`\n===request error-e--\n`) } }(method, options.url); if (isSurge) { const _runner = method == "GET" ? $httpClient.get : $httpClient.post; return _runner(options, (error, response, body) => { if (error == null || error == "") { response.body = body; callback("", body, response) } else { writeRequestErrorLog(error); callback(error, "", response) } }) } if (isQuanX) { options.method = method; $task.fetch(options).then(response => { response.status = response.statusCode; delete response.statusCode; callback("", response.body, response) }, reason => { writeRequestErrorLog(reason.error); response.status = response.statusCode; delete response.statusCode; callback(reason.error, "", response) }) } }; const done = (value = {}) => { if (isQuanX) return isRequest ? $done(value) : null; if (isSurge) return isRequest ? $done(value) : $done() }; return { isRequest, isSurge, isQuanX, log, alert, read, write, request, done } })(); 8 | 9 | const Protagonist = "旅行世界购物版"; 10 | const CookieKey = "lxsjCookie"; 11 | const showlog = false; 12 | 13 | let lastResponse = { 14 | data: {}, 15 | error: "" 16 | }; 17 | 18 | // request的时候写入Cookie 19 | function GetCookie() { 20 | const options = { 21 | url: $request.url, 22 | headers: $request.headers, 23 | body: $request.body 24 | }; 25 | const CookieValue = JSON.stringify(options); 26 | $hammer.write(CookieValue, CookieKey); 27 | showlog && $hammer.alert(Protagonist, `Cookie写入成功🎉`); 28 | $hammer.done(); 29 | } 30 | 31 | // response的时候重放 32 | function replay(index) { 33 | return new Promise(resolve => { 34 | $hammer.log(`${Protagonist} 第${index}次重放`); 35 | let options = $hammer.read(CookieKey); 36 | options = options ? JSON.parse(options) : false; 37 | if (!options) { 38 | $hammer.alert(Protagonist, "Cookie不存在"); 39 | return resolve(false); 40 | } 41 | $hammer.request("post", options, (error, response, data) => { 42 | lastResponse.data = data; 43 | lastResponse.error = error; 44 | setTimeout(()=>{ 45 | resolve(true); 46 | }, 250); 47 | }) 48 | }); 49 | } 50 | 51 | // 检查投放结果 52 | function checkResult() { 53 | if (lastResponse.error) { 54 | $hammer.log(`${Protagonist} request error:`, lastResponse.error); 55 | return lastResponse.error; 56 | } 57 | const response = lastResponse.data; 58 | showlog && $hammer.log(`${Protagonist} checkResult data:`, response); 59 | const result = JSON.parse(response.body); 60 | if (response.status == 200) { 61 | if (result.adInfo == null) { 62 | return false; 63 | } 64 | return "金币不够了,要看广告"; 65 | } 66 | switch (result.errorCode) { 67 | case 40000: 68 | // 位置满了 69 | return result.message; 70 | case 40001: 71 | return "token又失效了"; 72 | default: 73 | return result.message ? result.message : `只知道错误码:${result.errorCode}`; 74 | } 75 | } 76 | 77 | // 解析response 78 | async function catchResponse() { 79 | lastResponse.data = $response; 80 | showlog && $hammer.log(`${Protagonist} catchResponse:`, $response); 81 | let index = 1; 82 | while (true) { 83 | const stopReplay = checkResult(); 84 | if (stopReplay) { 85 | showlog && $hammer.alert(Protagonist, stopReplay, "重放中止"); 86 | break; 87 | } 88 | if (!(await replay(index++))) { 89 | break; 90 | } 91 | } 92 | $hammer.done(); 93 | } 94 | 95 | typeof $response == "object" ? catchResponse() : GetCookie(); -------------------------------------------------------------------------------- /plugins/dianshijia.plugin: -------------------------------------------------------------------------------- 1 | #[MITM] 2 | #APP登陆账号后,点击菜单栏'领现金',即可获取Cookie 3 | #进入提现页面,点击随机金额,可获取提现地址!! 4 | #因为不是https无需添加 hostname,每日7点、12点、20点各运行一次,其他随意 5 | 6 | [Script] 7 | cron "0 0 7,12,18,19,20 * * *" script-path=https://github.com/iepngs/Script/raw/master/dianshijia/dianshijia.js, tag=电视家 8 | http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin script-path=https://github.com/iepngs/Script/raw/master/dianshijia/dianshijia.js, timeout=10, tag=电视家 9 | http-request http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal script-path=https://github.com/iepngs/Script/raw/master/dianshijia/dianshijia.js, timeout=10, tag=电视家 10 | -------------------------------------------------------------------------------- /plugins/netease.plugin: -------------------------------------------------------------------------------- 1 | [Rule] 2 | # > Netease Music 3 | DOMAIN,apm.music.163.com 4 | DOMAIN,apm3.music.163.com 5 | DOMAIN,interface.music.163.com 6 | DOMAIN,interface3.music.163.com 7 | DOMAIN,music.126.net 8 | DOMAIN,music.163.com 9 | DOMAIN-SUFFIX,music.126.net,DIRECT 10 | DOMAIN-SUFFIX,ehg-youtube.hitbox.com,REJECT 11 | IP-CIDR,101.71.154.241/32,no-resolve 12 | IP-CIDR,103.126.92.132/32,no-resolve 13 | IP-CIDR,103.126.92.133/32,no-resolve 14 | IP-CIDR,112.13.119.17/32,no-resolve 15 | IP-CIDR,112.13.122.1/32,no-resolve 16 | IP-CIDR,115.236.118.33/32,no-resolve 17 | IP-CIDR,115.236.121.1/32,no-resolve 18 | IP-CIDR,118.24.63.156/32,no-resolve 19 | IP-CIDR,193.112.159.225/32,no-resolve 20 | IP-CIDR,223.252.199.66/32,no-resolve 21 | IP-CIDR,223.252.199.67/32,no-resolve 22 | IP-CIDR,39.105.63.80/32,no-resolve 23 | IP-CIDR,45.254.48.1/32,no-resolve 24 | IP-CIDR,47.100.127.239/32,no-resolve 25 | IP-CIDR,59.111.160.195/32,no-resolve 26 | IP-CIDR,59.111.160.197/32,no-resolve 27 | IP-CIDR,59.111.181.35/32,no-resolve 28 | IP-CIDR,59.111.181.38/32,no-resolve 29 | 30 | 31 | IP-CIDR,59.111.181.60/32,no-resolve 32 | -------------------------------------------------------------------------------- /plugins/tb_jd_price.plugin: -------------------------------------------------------------------------------- 1 | [MITM] 2 | hostname = api.m.jd.com, trade-acs.m.taobao.com 3 | 4 | [Script] 5 | http-response https?://api\.m\.jd\.com/client\.action\?functionId=(wareBusiness|serverConfig|basicConfig) script-path=https://raw.githubusercontent.com/yichahucha/surge/master/jd_price.js, requires-body=true, timeout=10, enabled=true, tag=jd历史价格 6 | 7 | http-request http://.+/amdc/mobileDispatch script-path=https://raw.githubusercontent.com/yichahucha/surge/master/tb_price.js, requires-body=true, timeout=10, enabled=true, tag=tb历史价格1 8 | http-response https?://trade-acs\.m\.taobao\.com/gw/mtop\.taobao\.detail\.getdetail script-path=https://raw.githubusercontent.com/yichahucha/surge/master/tb_price.js, requires-body=true, timeout=10, enabled=true, tag=tb历史价格2 9 | -------------------------------------------------------------------------------- /plugins/youth.plugin: -------------------------------------------------------------------------------- 1 | [MITM] 2 | hostname = kd.youth.cn 3 | #,ios.baertt.com 4 | 5 | [Script] 6 | cron "*/7 7-18 * * *" script-path=https://ghproxy.com/https://raw.githubusercontent.com/GoodHolidays/Scripts/master/Task/youth.js, tag=sunert中青签到&转盘宝箱&时长 7 | #cron "10 */2 * * *" script-path=https://ghproxy.com/https://raw.githubusercontent.com/GoodHolidays/Scripts/master/Task/Youth_Read.js, tag=sunert中青自动阅读 8 | cron "30 6 * * *" script-path=https://ghproxy.com/https://raw.githubusercontent.com/ztxtop/x/main/youth_banner.js, tag=ztxtop中青看看赚&浏览赚 9 | 10 | http-request https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList script-path=https://ghproxy.com/https://raw.githubusercontent.com/GoodHolidays/Scripts/master/Task/youth.js, tag=中青看点 11 | #http-request https:\/\/ios\.baertt\.com\/v5\/article\/info\/get\.json script-path=https://ghproxy.com/https://raw.githubusercontent.com/GoodHolidays/Scripts/master/Task/youth.js, requires-body=true, tag=中青看点 12 | #http-request https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json script-path=https://ghproxy.com/https://raw.githubusercontent.com/GoodHolidays/Scripts/master/Task/youth.js, requires-body=true, tag=中青看点 13 | #http-request https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json script-path=https://ghproxy.com/https://raw.githubusercontent.com/GoodHolidays/Scripts/master/Task/youth.js, requires-body=true, tag=中青看点 14 | -------------------------------------------------------------------------------- /qktx/cookie.js: -------------------------------------------------------------------------------- 1 | /* 2 | 公众号iosrule by红鲤鱼与绿鲤鱼与驴 3 | 2020.7.3 4 | 获取cookies文件 5 | ==================================== 6 | 获取ck完毕可以禁止该js 7 | #趣看天下ck Qx 8 | https:\/\/(appv8\.qukantianxia\.com|appv7\.qukantx\.com) url script-request-header qktx_cookie.js 9 | 10 | #趣看天下获取ck loon 11 | 12 | http-request https:\/\/(appv8\.qukantianxia\.com|appv7\.qukantx\.com) script-path=qktx_cookie.js, requires-body=true, timeout=30, tag=趣看天下ck 13 | 14 | ==================================== 15 | 16 | MITM=appv8.qukantianxia.com,appv7.qukantx.com 17 | ==================================== 18 | */ 19 | 20 | //++++++++++++++++++++++++++++++++- 21 | //1.需要申明的变量 22 | 23 | const $iosrule = iosrule();//声明必须 24 | const qktxid = "A"; 25 | 26 | 27 | const qukantianxia = "趣看天下"; 28 | 29 | 30 | const qktx_urlckname = "qktx_urlckname" + qktxid; 31 | 32 | const qktx_urlrckname = "qktx_urlrckname" + qktxid; 33 | const qktx_ridname = "qktx_ridname" + qktxid; 34 | 35 | const qktx_frboxurlname = "qktx_frboxurlname" + qktxid; 36 | const qktx_taskboxurlname = "qktx_taskboxurlname" + qktxid; 37 | const qktx_username = "qktx_username" + qktxid; 38 | 39 | 40 | 41 | //++++++++++++++++++++++++++++++++- 42 | 43 | 44 | if ($iosrule.isRequest) { 45 | qktx_writeck(); 46 | } 47 | $iosrule.end() 48 | 49 | 50 | function qktx_writeck() { 51 | if ($request.headers) { 52 | var urlval = $request.url; 53 | 54 | var md_header = $request.headers; 55 | var md_bd = $request.body; 56 | var tt = qukantianxia; 57 | 58 | if (urlval.indexOf("qktx-activity/activity/openBox?") >= 0) { 59 | var so = $iosrule.write(urlval, qktx_frboxurlname); if (so == true) 60 | papa(tt, "[好友开宝箱ck]", "写入" + tt + "开宝箱数据成功"); 61 | }else if (urlval.indexOf("qktx-activity/activity/openActivityBox?") >= 0) { 62 | var so = $iosrule.write(urlval, qktx_taskboxurlname); if (so == true) 63 | papa(tt, "[每日任务宝箱ck]", "写入" + tt + "任务宝箱数据成功"); 64 | }else if (urlval.indexOf("user/userPoint.do?") >= 0) { 65 | var val_url = urlval.substring(urlval.indexOf("userPoint.do?") + 13, urlval.length); 66 | var so = $iosrule.write(val_url, qktx_username); if (so == true) 67 | papa(tt, "[用户信息ck]", "写入" + tt + "用户数据成功"); 68 | }else if (urlval.indexOf("qktx-content/showURL?") >= 0) { 69 | var ck_url = urlval.substring(urlval.indexOf("showURL") + 8, urlval.length); 70 | var so = $iosrule.write(ck_url, qktx_urlckname); if (so == true) 71 | papa(tt, "[阅读ck1]", "写入" + tt + "阅读数据成功"); 72 | } else if (urlval.indexOf("addCoin.json?") >= 0) { 73 | var rck_url = urlval.substring(urlval.indexOf("addCoin.json?") + 13, urlval.length); 74 | var so = $iosrule.write(rck_url, qktx_urlrckname); if (so == true) 75 | papa(tt, "[阅读ck2]", "写入" + tt + "阅读数据成功"); 76 | }else if (urlval.indexOf("qktx-content/task/getArticleRelationList?") >= 0) { 77 | var qktx_rid = urlval.substr(urlval.indexOf("taskId="), 15); 78 | var fuckok = $iosrule.write(qktx_rid, qktx_ridname); 79 | if (fuckok == true) papa(tt, "[写入阅读]", "写入阅读ck成功"); 80 | }else if(urlval.indexOf("search/addCoinSearch") >= 0){ 81 | const cookieKey = 'QKTXSearchTaskCookie'; 82 | const cookieVal = JSON.stringify({ 83 | url: $request.url, 84 | headers: $request.headers, 85 | body: $request.body, 86 | timestamp: Date.now(), 87 | times: 0 88 | }); 89 | console.log(`QKTXSearchTaskCookie:\n${cookieVal}`); 90 | $iosrule.write(cookieVal, cookieKey); 91 | papa("趣看天下", "搜索任务已记录", "剩余未完成部分将在下一次自动执行"); 92 | } 93 | } 94 | } 95 | 96 | 97 | //可以增加模块 98 | function papa(x, y, z) { 99 | $iosrule.notify(x, y, z); 100 | } 101 | 102 | 103 | function iosrule() { 104 | const isRequest = typeof $request != "undefined" 105 | const isSurge = typeof $httpClient != "undefined" 106 | const isQuanX = typeof $task != "undefined" 107 | const notify = (title, subtitle, message) => { 108 | if (isQuanX) $notify(title, subtitle, message) 109 | if (isSurge) $notification.post(title, subtitle, message) 110 | } 111 | const write = (value, key) => { 112 | if (isQuanX) return $prefs.setValueForKey(value, key) 113 | if (isSurge) return $persistentStore.write(value, key) 114 | } 115 | const read = (key) => { 116 | if (isQuanX) return $prefs.valueForKey(key) 117 | if (isSurge) return $persistentStore.read(key) 118 | } 119 | const get = (options, callback) => { 120 | if (isQuanX) { 121 | if (typeof options == "string") options = { url: options } 122 | options["method"] = "GET" 123 | $task.fetch(options).then(response => { 124 | response["status"] = response.statusCode 125 | callback(null, response, response.body) 126 | }, reason => callback(reason.error, null, null)) 127 | } 128 | if (isSurge) $httpClient.get(options, callback) 129 | } 130 | const post = (options, callback) => { 131 | if (isQuanX) { 132 | if (typeof options == "string") options = { url: options } 133 | options["method"] = "POST" 134 | $task.fetch(options).then(response => { 135 | response["status"] = response.statusCode 136 | callback(null, response, response.body) 137 | }, reason => callback(reason.error, null, null)) 138 | } 139 | if (isSurge) $httpClient.post(options, callback) 140 | } 141 | const end = () => { 142 | if (isQuanX) isRequest ? $done({}) : "" 143 | if (isSurge) isRequest ? $done({}) : $done() 144 | } 145 | return { isRequest, isQuanX, isSurge, notify, write, read, get, post, end } 146 | }; 147 | -------------------------------------------------------------------------------- /studygolang/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | go语言中文网签到脚本 3 | 4 | 说明: 5 | 手动登录 https://studygolang.com 点击自己头像右边用户名下面的“个人资料设置”页面 如通知成功获取cookie, 则可以使用此签到脚本. 6 | 获取Cookie后, 请将Cookie脚本禁用并移除主机名,以免产生不必要的MITM. 7 | 脚本将在每天上午9点执行。 可以修改执行时间。 8 | 9 | ************************ 10 | [Mitm] 11 | ************************ 12 | hostname = studygolang.com 13 | 14 | 15 | ************************ 16 | QuantumultX 本地脚本配置: 17 | ************************ 18 | 19 | [task_local] 20 | # go语言中文网签到 21 | 0 9 * * * iepngs/Script/master/studygolang/index.js 22 | 23 | [rewrite_local] 24 | # 获取Cookie 25 | https:\/\/studygolang\.com\/account\/edit url script-request-header iepngs/Script/master/studygolang/index.js 26 | 27 | 28 | ************************ 29 | Loon 2.1.0+ 脚本配置: 30 | ************************ 31 | 32 | [Script] 33 | # go语言中文网签到 34 | cron "0 9 * * *" script-path=https://raw.githubusercontent.com/iepngs/Script/master/studygolang/index.js 35 | 36 | # 获取Cookie 网站登录后点击自己头像右边用户名下面的“个人资料设置”页面 37 | http-request https:\/\/studygolang\.com\/account\/edit script-path=https://raw.githubusercontent.com/iepngs/Script/master/studygolang/index.js 38 | 39 | **/ 40 | 41 | const $hammer = (() => { 42 | const isRequest = "undefined" != typeof $request, 43 | isSurge = "undefined" != typeof $httpClient, 44 | isQuanX = "undefined" != typeof $task; 45 | 46 | const log = (...n) => { for (let i in n) console.log(n[i]) }; 47 | const alert = (title, body = "", subtitle = "", options = {}) => { 48 | // option(|): {open-url: , media-url: } 49 | let link = null; 50 | switch (typeof options) { 51 | case "string": 52 | link = isQuanX ? {"open-url": options} : options; 53 | break; 54 | case "object": 55 | if(["null", "{}"].indexOf(JSON.stringify(options)) == -1){ 56 | link = isQuanX ? options : options["open-url"]; 57 | break; 58 | } 59 | default: 60 | link = isQuanX ? {} : ""; 61 | } 62 | if (isSurge) return $notification.post(title, subtitle, body, link); 63 | if (isQuanX) return $notify(title, subtitle, body, link); 64 | log("==============📣系统通知📣=============="); 65 | log("title:", title, "subtitle:", subtitle, "body:", body, "link:", link); 66 | }; 67 | const read = key => { 68 | if (isSurge) return $persistentStore.read(key); 69 | if (isQuanX) return $prefs.valueForKey(key); 70 | }; 71 | const write = (val, key) => { 72 | if (isSurge) return $persistentStore.write(val, key); 73 | if (isQuanX) return $prefs.setValueForKey(val, key); 74 | }; 75 | const request = (method, params, callback) => { 76 | /** 77 | * 78 | * params(): {url: , headers: , body: } | 79 | * 80 | * callback( 81 | * error, 82 | * ?, 83 | * {status: , headers: , body: }? 84 | * ) 85 | * 86 | */ 87 | let options = {}; 88 | if (typeof params == "string") { 89 | options.url = params; 90 | } else { 91 | options.url = params.url; 92 | if (typeof params == "object") { 93 | params.headers && (options.headers = params.headers); 94 | params.body && (options.body = params.body); 95 | } 96 | } 97 | method = method.toUpperCase(); 98 | 99 | const writeRequestErrorLog = function (m, u) { 100 | return err => { 101 | log(`\n=== request error -s--\n`); 102 | log(`${m} ${u}`, err); 103 | log(`\n=== request error -e--\n`); 104 | }; 105 | }(method, options.url); 106 | 107 | if (isSurge) { 108 | const _runner = method == "GET" ? $httpClient.get : $httpClient.post; 109 | return _runner(options, (error, response, body) => { 110 | if (error == null || error == "") { 111 | response.body = body; 112 | callback("", body, response); 113 | } else { 114 | writeRequestErrorLog(error); 115 | callback(error, "", response); 116 | } 117 | }); 118 | } 119 | if (isQuanX) { 120 | options.method = method; 121 | $task.fetch(options).then( 122 | response => { 123 | response.status = response.statusCode; 124 | delete response.statusCode; 125 | callback("", response.body, response); 126 | }, 127 | reason => { 128 | writeRequestErrorLog(reason.error); 129 | response.status = response.statusCode; 130 | delete response.statusCode; 131 | callback(reason.error, "", response); 132 | } 133 | ); 134 | } 135 | }; 136 | const done = (value = {}) => { 137 | if (isQuanX) return isRequest ? $done(value) : null; 138 | if (isSurge) return isRequest ? $done(value) : $done(); 139 | }; 140 | return { isRequest, isSurge, isQuanX, log, alert, read, write, request, done }; 141 | })(); 142 | 143 | const CookieKey = "StudyGolang"; 144 | 145 | function GetCookie() { 146 | const CookieName = CookieKey + "的Cookie"; 147 | try { 148 | if ($request.headers) { 149 | const CookieValue = $request.headers['Cookie']; 150 | const cachedCookie = $hammer.read(CookieKey); 151 | const dynamic = cachedCookie ? (cachedCookie == CookieValue ? "" : "更新") : "写入"; 152 | if(dynamic){ 153 | const result = $hammer.write(CookieValue, CookieKey); 154 | $hammer.alert(CookieName, dynamic + (result ? "成功🎉" : "失败")); 155 | } 156 | } else { 157 | $hammer.alert(CookieName, "请检查匹配URL或配置内脚本类型", "写入失败"); 158 | } 159 | } catch (error) { 160 | $hammer.alert(CookieName, "未知错误", "写入失败") 161 | $hammer.log(error) 162 | } 163 | $hammer.done(); 164 | } 165 | 166 | function checkin() { 167 | const host = "https://studygolang.com"; 168 | const cookie = $hammer.read(CookieKey); 169 | if (!cookie) { 170 | $hammer.alert(CookieKey, "cookie没有,先去获取吧!", host); 171 | return $hammer.done(); 172 | } 173 | const options = { 174 | url: `${host}/mission/daily/redeem`, 175 | headers: { 176 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", 177 | "Accept-Encoding": "gzip, deflate, br", 178 | "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8", 179 | "Connection": "keep-alive", 180 | "Cookie": cookie, 181 | "Host": "studygolang.com", 182 | "Referer": "https://studygolang.com/mission/daily", 183 | "Sec-Fetch-Mode": "navigate", 184 | "Sec-Fetch-Site": "same-origin", 185 | "Sec-Fetch-User": "?1", 186 | "Upgrade-Insecure-Requests": "1", 187 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36", 188 | } 189 | }; 190 | $hammer.request("get", options, (error, response, ret) => { 191 | if (error) { 192 | let desc = "响应异常,去看一下日志"; 193 | if(ret.status == 303){ 194 | if(ret.headers?.Location == "/mission/daily?fr=redeem"){ 195 | $hammer.alert(CookieKey, "签到完成"); 196 | return $hammer.done(); 197 | } 198 | if (response.indexOf("account/login") > 0) { 199 | desc = "cookie已过期,需要重新获取"; 200 | } 201 | } 202 | $hammer.log(`${CookieKey}签到结果(1):`, ret); 203 | $hammer.alert(CookieKey, desc, "签到请求失败", host); 204 | return $hammer.done(); 205 | } 206 | if(response.indexOf("已成功领取每日登录奖励")>0){ 207 | $hammer.alert(CookieKey, "签到完成"); 208 | return $hammer.done(); 209 | } 210 | $hammer.log(`${CookieKey}签到结果(2):`, ret); 211 | const desc = response.indexOf("user_remember_me") > 0 ? "cookie已过期,请重新获取" : "响应异常,去看一下日志"; 212 | $hammer.alert(CookieKey, desc, "签到失败", host); 213 | $hammer.done(); 214 | }) 215 | } 216 | 217 | $hammer.isRequest ? GetCookie() : checkin(); -------------------------------------------------------------------------------- /tieba/index.js: -------------------------------------------------------------------------------- 1 | // cookie 获取: 2 | // 网页打开tieba.baidu.com,登陆后从“我的”点击进入“我的贴子”即可。 3 | 4 | const $ = hammer('贴吧签到'); 5 | const CookieKey = 'CookieTB'; 6 | 7 | const flushCookie = () => { 8 | const regex = /(^|)BDUSS=([^;]*)(;|$)/; 9 | const headerCookie = $request.headers.Cookie.match(regex)[0]; 10 | if(headerCookie){ 11 | $.write(headerCookie, CookieKey); 12 | $.alert('Cookie已写入'); 13 | } 14 | $.done(); 15 | }; 16 | 17 | const main = () => { 18 | const cookieVal = $.read(CookieKey); 19 | if (!cookieVal) { 20 | return $.alert("签到失败", "未获取到cookie"); 21 | } 22 | 23 | let successnum = 0; 24 | const host = "https://tieba.baidu.com"; 25 | const ua = "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16A366"; 26 | const buildRequsetBody = body => { 27 | return { 28 | url: `${host}/sign/add`, 29 | headers: { 30 | "Content-Type": "application/x-www-form-urlencoded", 31 | Cookie: cookieVal, 32 | "User-Agent": ua 33 | }, 34 | body: body 35 | }; 36 | }; 37 | const fetchMyLikedForums = () => { 38 | return new Promise(resolve => { 39 | const options = { 40 | url: `${host}/mo/q/newmoindex`, 41 | headers: { 42 | "Content-Type": "application/octet-stream", 43 | Referer: `${host}/index/tbwise/forum`, 44 | Cookie: cookieVal, 45 | "User-Agent": ua 46 | } 47 | }; 48 | $.request('get', options, (error, response, resp) => { 49 | if(error){ 50 | $.alert("未成功获取关注的贴吧列表", "签到失败"); 51 | return resolve(false); 52 | } 53 | const body = JSON.parse(response); 54 | const isSuccessResponse = body && body.no == 0 && body.error == "success" && body.data.tbs; 55 | if (!isSuccessResponse) { 56 | $.alert((body && body.error) ? body.error : "接口数据获取失败", "签到失败"); 57 | return resolve(false); 58 | } 59 | resolve(body.data); 60 | }); 61 | }) 62 | }; 63 | const signin = async (bar, tbs) => { 64 | return new Promise(resolve => { 65 | const body = `tbs=${tbs}&kw=${bar.forum_name}&ie=utf-8`; 66 | $.request('post', buildRequsetBody(body), (error,response,resp) => { 67 | if(error){ 68 | $.log(`${bar.forum_name} signin error:`, error); 69 | return resolve(`网络请求异常`); 70 | } 71 | let res = ""; 72 | try { 73 | const result = JSON.parse(response); 74 | $.log(`${bar.forum_name}签到结果:\n${response}`); 75 | if(result.no == 0){ 76 | successnum++; 77 | const info = result.data.uinfo; 78 | res = `✅获得${info.cont_sign_num}积分,第${info.user_sign_rank}个签到`; 79 | }else{ 80 | res = `❎签到失败(${result.no}):${result.error}`; 81 | } 82 | } catch (e) { 83 | res = `❎签到异常:${e.message}` 84 | } 85 | setTimeout(() => { 86 | resolve(res); 87 | }, Math.ceil(Math.random()*2000)); 88 | }); 89 | }); 90 | }; 91 | const startSignin = async () => { 92 | const resp = await fetchMyLikedForums(); 93 | if(resp){ 94 | const forums = resp.like_forum; 95 | const total = forums.length; 96 | if(total < 1){ 97 | return $.alert("签到失败", "请确认您有关注的贴吧"); 98 | } 99 | let result = `当前关注的贴吧有${total}个:\n`; 100 | for (const bar of forums) { 101 | result += `${bar.forum_name}> `; 102 | if(bar.is_sign == 1){ 103 | successnum++; 104 | result += `${bar.user_level}级\n`; 105 | continue; 106 | } 107 | result += await signin(bar, resp.tbs); 108 | result += "\n"; 109 | } 110 | $.alert(result, `今日已签:${successnum}/${total}`); 111 | } 112 | $.done(); 113 | }; 114 | startSignin(); 115 | }; 116 | 117 | $.isRequest ? flushCookie() : main(); 118 | 119 | function hammer(t="untitled",l=3){return new class{constructor(t,l){this.name=t,this.logLevel=l,this.isRequest=("object"==typeof $request)&&$request.method!="OPTIONS",this.isSurge="undefined"!=typeof $httpClient,this.isQuanX="undefined"!=typeof $task,this.isNode="function"==typeof require,this.node=(()=>{if(!this.isNode){return null}const file="localstorage.yml";let f,y,r,yc,sc;try{f=require('fs');y=require('js-yaml');r=require('got');f.appendFile(file,"",function(err){if(err)throw err;});yc=y.load(f.readFileSync(file,"utf8"));sc=data=>f.writeFileSync(file,y.safeDump(data),'utf8')}catch(e){console.log("install unrequired module, example: yarn add js-yaml got");console.log(e.message);return{}}return{file:file,fs:f,yaml:y,request:r,yamlContents:yc,saveYamlContents:sc,}})()}log(...n){if(l<2){return null}console.log(`\n***********${this.name}***********`);for(let i in n)console.log(typeof n[i]=="object"?eval(`(${JSON.stringify(n[i])})`):n[i])}alert(body="",subtitle="",options={}){if(l==2||l==0){return null}if(typeof options=="string"){options={"open-url":options}}let link=null;if(Object.keys(options).length){link=this.isQuanX?options:{openUrl:options["open-url"],mediaUrl:options["media-url"]}}if(this.isSurge)return $notification.post(this.name,subtitle,body,link);if(this.isQuanX)return $notify(this.name,subtitle,body,link);console.log(`系统通知\ntitle:${this.name}\nsubtitle:${subtitle}\nbody:${body}\nlink:${link}`)}async request(method,params,callback){let options={};if(typeof params=="string"){options.url=params}else{options.url=params.url;if(typeof params=="object"){params.headers&&(options.headers=params.headers);params.body&&(options.body=params.body)}}if(!options.headers||typeof(options.headers)!="object"){options['headers']={}}if(!options.headers||!Object.keys(options.headers).includes("User-Agent")){const ua='Mozilla%2F5.0%20(iPhone%3B%20CPU%20iPhone%20OS%2013_2_3%20like%20Mac%20OS%20X)%20AppleWebKit%2F605.1.15%20(KHTML%2C%20like%20Gecko)%20Version%2F13.0.3%20Mobile%2F15E148%20Safari%2F604.1';options['headers']['User-Agent']=decodeURIComponent(ua)}method=method.toUpperCase();const writeRequestErrorLog=function(n,m,u){return err=>console.log(`${n}request error:\n${m}${u}\n${err}`)}(this.name,method,options.url);if(this.isSurge){const _runner=method=="GET"?$httpClient.get:$httpClient.post;return _runner(options,(error,response,body)=>{if(error==null||error==""){response.body=body;callback("",body,response)}else{writeRequestErrorLog(error);callback(error,"",response)}})}options.method=method;if(this.isQuanX){$task.fetch(options).then(response=>{response.status=response.statusCode;delete response.statusCode;callback("",response.body,response)},reason=>{writeRequestErrorLog(reason.error);response.status=response.statusCode;delete response.statusCode;callback(reason.error,"",response)})}if(this.isNode){method=options.method.toLowerCase();const hc=this.node.request[method];if(typeof(hc)!="function"){return callback(`unsupport request method ${options.method}in got`)}let ro={responseType:"text",};if(options.headers){ro.headers=options.headers}if(options.body){ro.body=(options.body&&typeof(options.body)=="object")?JSON.stringify(options.body):options.body}if(params.option){const ks=Object.keys(params.option);for(const k of ks){ro[k]=params.option[k]}}let error="",body="",response={};try{response=await hc(options.url,ro);body=response.body;response={status:response.statusCode,headers:response.headers,body:body,}}catch(e){error=`${e.name}:${e.message}`}callback(error,body,response)}}read(key){if(this.isSurge)return $persistentStore.read(key);if(this.isQuanX)return $prefs.valueForKey(key);if(this.isNode){let val="";try{const data=this.node.yamlContents;val=(typeof(data)=="object"&&data[key])?data[key]:""}catch(e){console.log(`读取文件时错误:\n${e.message}`);return""}return val}}write(val,key){if(this.isSurge)return $persistentStore.write(val,key);if(this.isQuanX)return $prefs.setValueForKey(val,key);if(this.isNode){try{const data=this.node.yamlContents;data=typeof data=="object"?data:{};data[key]=val;this.node.saveYamlContents(data)}catch(e){console.log(e.message);return false}return true}}delete(key){if(this.isSurge)return $persistentStore.remove(key);if(this.isQuanX)return $prefs.removeValueForKey(key);if(this.isNode){try{const data=this.node.yamlContents;data=typeof data=="object"?data:{};if(!data.hasOwnProperty(key)){return true}delete data[key];this.node.saveYamlContents(data)}catch(e){console.log(e.message);return false}return true}}done(value={}){if(this.isQuanX)return $done(value);if(this.isSurge)return this.isRequest?$done(value):$done()}pad(s=false,c="*",l=15){return s?this.log(c.padEnd(l,c)):`\n${c.padEnd(l,c)}\n`}}(t,l)} 120 | -------------------------------------------------------------------------------- /tls/cookie.js: -------------------------------------------------------------------------------- 1 | /* 2 | 公众号iosrule by红鲤鱼与绿鲤鱼与驴 3 | 2020.6.28 4 | 5 | 6 | ==================================== 7 | 获取ck完毕可以禁止该js 8 | #特仑苏获取Qx 9 | https:\/\/xwsh\.javamall\.cn url script-request-body tls_cookie.js 10 | 11 | #特仑苏获取ckloon 12 | 13 | http-request https:\/\/xwsh\.javamall\.cn script-path=tls_cookie.js, requires-body=true, timeout=30, tag=特仑苏微信获取ck 14 | 15 | ==================================== 16 | 17 | MITM=xwsh.javamall.cn 18 | 获取完ck后在主机名后面➕.com 或者删掉tls的主机名 19 | 要获取ck时再删掉.com或者重新添加主机名 20 | ==================================== 21 | 22 | 点击进入“特仑苏向往的生活”小程序授权登录后点击放牧获取ck 23 | */ 24 | 25 | //++++++++++++++++++++++++++++++++- 26 | //1.需要申明的变量 27 | 28 | const $iosrule = iosrule();//声明必须 29 | 30 | 31 | 32 | const telunsu="特仑苏"; 33 | 34 | 35 | 36 | const tls_signckname="tls_signckname"; 37 | 38 | 39 | //++++++++++++++++++++++++++++++++- 40 | 41 | 42 | if ($iosrule.isRequest) 43 | { 44 | 45 | tls_writeck(); 46 | 47 | } 48 | $iosrule.end() 49 | 50 | 51 | function tls_writeck() { 52 | 53 | if ($request.headers) { 54 | 55 | var urlval = $request.url; 56 | 57 | var md_header=$request.headers; 58 | var md_bd=$request.body; 59 | var tt=telunsu; 60 | console.log(urlval) 61 | if(urlval.indexOf("Api/TelunsuHandler2.ashx")>=0) 62 | { 63 | var so= $iosrule.write(md_header.Cookie,tls_signckname);if (so==true) 64 | papa(tt,"[签到ck]","写入" + tt + "签到数据成功");} 65 | 66 | 67 | 68 | 69 | } 70 | } 71 | 72 | 73 | 74 | 75 | 76 | //可以增加模块 77 | 78 | 79 | 80 | function papa(x,y,z){ 81 | $iosrule.notify(x,y,z);} 82 | 83 | 84 | 85 | 86 | function iosrule() { 87 | const isRequest = typeof $request != "undefined" 88 | const isSurge = typeof $httpClient != "undefined" 89 | const isQuanX = typeof $task != "undefined" 90 | const notify = (title, subtitle, message) => { 91 | if (isQuanX) $notify(title, subtitle, message) 92 | if (isSurge) $notification.post(title, subtitle, message) 93 | } 94 | const write = (value, key) => { 95 | if (isQuanX) return $prefs.setValueForKey(value, key) 96 | if (isSurge) return $persistentStore.write(value, key) 97 | } 98 | const read = (key) => { 99 | if (isQuanX) return $prefs.valueForKey(key) 100 | if (isSurge) return $persistentStore.read(key) 101 | } 102 | const get = (options, callback) => { 103 | if (isQuanX) { 104 | if (typeof options == "string") options = { url: options } 105 | options["method"] = "GET" 106 | $task.fetch(options).then(response => { 107 | response["status"] = response.statusCode 108 | callback(null, response, response.body) 109 | }, reason => callback(reason.error, null, null)) 110 | } 111 | if (isSurge) $httpClient.get(options, callback) 112 | } 113 | const post = (options, callback) => { 114 | if (isQuanX) { 115 | if (typeof options == "string") options = { url: options } 116 | options["method"] = "POST" 117 | $task.fetch(options).then(response => { 118 | response["status"] = response.statusCode 119 | callback(null, response, response.body) 120 | }, reason => callback(reason.error, null, null)) 121 | } 122 | if (isSurge) $httpClient.post(options, callback) 123 | } 124 | const end = () => { 125 | if (isQuanX) isRequest ? $done({}) : "" 126 | if (isSurge) isRequest ? $done({}) : $done() 127 | } 128 | return { isRequest, isQuanX, isSurge, notify, write, read, get, post, end } 129 | }; -------------------------------------------------------------------------------- /tls/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 公众号iosrule by红鲤鱼与绿鲤鱼与驴 4 | 2020.6.28 5 | 6 | 特仑苏 7 | 8 | 9 | loon定时格式参考 10 | cron "0 21,31,50 0-22 * * *" script-path=tlswet_task.js, tag=特仑苏 11 | */ 12 | 13 | 14 | //以上是配置说明 15 | const $iosrule = iosrule();//声明必须 16 | 17 | 18 | 19 | //==================================== 20 | 21 | const telunsu="特仑苏微信"; 22 | 23 | 24 | //++++++++++++++++++++++++++++++++- 25 | 26 | 27 | const tls_signckname="tls_signckname"; 28 | const tls_signck= $iosrule.read(tls_signckname) 29 | ; 30 | var tls_num=0;var tls_result=""; 31 | 32 | 33 | 34 | //++++++++++++++++++++++++++++++++ 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | //++++++++++++++++++++++++++++++++ 49 | 50 | //3.需要执行的函数都写这里 51 | function main() 52 | { 53 | 54 | 55 | tls_main(); 56 | 57 | 58 | 59 | } 60 | 61 | function tls_main() 62 | { 63 | 64 | tls_GetUserValues();
tls_Getanswer(); 65 | tls_sign(); 66 | tls_AddFeedSuSu(); 67 | tls_AddInteraction_music(); 68 | tls_AddInteraction_graze(); 69 | tls_AddInteraction_shower(); 70 | tls_AddInteraction_massage(); 71 | tls_AddShare(); 72 | } 73 | 74 | 75 | 76 | main() 77 | 78 | 79 | //++++++++++++++++++++++++++++++++++++ 80 | //4.基础模板 81 | 82 | function tls_sign() 83 | { 84 | var result1="【签到】";var result2=""; 85 | var tt=telunsu; 86 | const llUrl = {url:"https://xwsh.javamall.cn/Api/TelunsuHandler2.ashx?method=ClickSign",headers:{Cookie:tls_signck,"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.12(0x17000c32) NetType/4G Language/zh_CN miniProgram"},timeout:60}; 87 | $iosrule.post(llUrl, function(error, response, data) { 88 | console.log(data) 89 | var obj=JSON.parse(data); 90 | if(obj.errcode==0) 91 | result2="成功"; 92 | else if(obj.errcode==1) 93 | result2=obj.errmsg; 94 | tls_msg(result1+"\n"+result2+"\n"); 95 | }) 96 | } 97 | function tls_GetUserValues() 98 | { 99 | var result1="【用户信息】";var result2=""; 100 | var tt=telunsu; 101 | const llUrl = {url:"https://xwsh.javamall.cn/Api/TelunsuHandler2.ashx?method=GetUserValues",headers:{Cookie:tls_signck,"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.12(0x17000c32) NetType/4G Language/zh_CN miniProgram"},timeout:60}; 102 | $iosrule.post(llUrl, function(error, response, data) { 103 | console.log(data) 104 | var obj=JSON.parse(data); 105 | if(obj.errcode==0) 106 | result2="苜蓿"+obj.result.falfa+" 牛奶"+obj.result.milk+" 体力"+obj.result.susuvalue; 107 | else if(obj.errcode==1) 108 | result2=obj.errmsg; 109 | tls_msg(result1+"\n"+result2+"\n"); 110 | }) 111 | } 112 | 113 | function tls_AddFeedSuSu() 114 | { 115 | var result1="【喂牛】";var result2=""; 116 | var tt=telunsu; 117 | const llUrl = {url:"https://xwsh.javamall.cn/Api/TelunsuHandler2.ashx?method=AddFeedSuSu",headers:{Cookie:tls_signck,"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.12(0x17000c32) NetType/4G Language/zh_CN miniProgram"},timeout:60}; 118 | $iosrule.post(llUrl, function(error, response, data) { 119 | console.log(data) 120 | var obj=JSON.parse(data); 121 | if(obj.errcode==0) 122 | result2="成功"; 123 | else if(obj.errcode==1) 124 | result2=obj.errmsg; 125 | tls_msg(result1+"\n"+result2+"\n"); 126 | }) 127 | } 128 | 129 | function tls_AddInteraction_graze() 130 | { 131 | var result1="【放牧】";var result2=""; 132 | var tt=telunsu; 133 | const llUrl = {url:"https://xwsh.javamall.cn/Api/TelunsuHandler2.ashx?method=AddInteraction",headers:{Cookie:tls_signck,"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.12(0x17000c32) NetType/4G Language/zh_CN miniProgram"},body:"InterName=susuGraze",timeout:60}; 134 | $iosrule.post(llUrl, function(error, response, data) { 135 | console.log(data) 136 | var obj=JSON.parse(data); 137 | if(obj.errcode==0) 138 | result2="成功"; 139 | else if(obj.errcode==1) 140 | result2=obj.errmsg; 141 | tls_msg(result1+"\n"+result2+"\n"); 142 | }) 143 | } 144 | 145 | function tls_AddInteraction_music() 146 | { 147 | var result1="【音乐】";var result2=""; 148 | var tt=telunsu; 149 | const llUrl = {url:"https://xwsh.javamall.cn/Api/TelunsuHandler2.ashx?method=AddInteraction",headers:{Cookie:tls_signck,"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.12(0x17000c32) NetType/4G Language/zh_CN miniProgram"},body:"InterName=susuMusic",timeout:60}; 150 | $iosrule.post(llUrl, function(error, response, data) { 151 | console.log(data) 152 | var obj=JSON.parse(data); 153 | if(obj.errcode==0) 154 | result2="成功"; 155 | else if(obj.errcode==1) 156 | result2=obj.errmsg; 157 | tls_msg(result1+"\n"+result2+"\n"); 158 | }) 159 | }

function tls_AddInteraction_shower() 160 | { 161 | var result1="【洗澡】";var result2=""; 162 | var tt=telunsu; 163 | const llUrl = {url:"https://xwsh.javamall.cn/Api/TelunsuHandler2.ashx?method=AddInteraction",headers:{Cookie:tls_signck,"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.12(0x17000c32) NetType/4G Language/zh_CN miniProgram"},body:"InterName=susuShower",timeout:60}; 164 | $iosrule.post(llUrl, function(error, response, data) { 165 | console.log(data) 166 | var obj=JSON.parse(data); 167 | if(obj.errcode==0) 168 | result2="成功"; 169 | else if(obj.errcode==1) 170 | result2=obj.errmsg; 171 | tls_msg(result1+"\n"+result2+"\n"); 172 | }) 173 | } 174 | 175 | function tls_AddInteraction_massage() 176 | { 177 | var result1="【按摩】";var result2=""; 178 | var tt=telunsu; 179 | const llUrl = {url:"https://xwsh.javamall.cn/Api/TelunsuHandler2.ashx?method=AddInteraction",headers:{Cookie:tls_signck,"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.12(0x17000c32) NetType/4G Language/zh_CN miniProgram"},body:"InterName=susuMassage",timeout:60}; 180 | $iosrule.post(llUrl, function(error, response, data) { 181 | console.log(data) 182 | var obj=JSON.parse(data); 183 | if(obj.errcode==0) 184 | result2="成功"; 185 | else if(obj.errcode==1) 186 | result2=obj.errmsg; 187 | tls_msg(result1+"\n"+result2+"\n"); 188 | }) 189 | } 190 | 191 | function tls_AddShare() 192 | { 193 | var result1="【助力】";var result2=""; 194 | var tt=telunsu; 195 | const llUrl = {url:"https://xwsh.javamall.cn/Api/TelunsuHandler2.ashx?method=AddShare",headers:{Cookie:tls_signck,"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.12(0x17000c32) NetType/4G Language/zh_CN miniProgram"},body:"userid=5765397",timeout:60}; 196 | $iosrule.post(llUrl, function(error, response, data) { 197 | console.log(data) 198 | var obj=JSON.parse(data); 199 | if(obj.errcode==0) 200 | result2="成功"; 201 | else if(obj.errcode==1) 202 | result2=obj.errmsg; 203 | tls_msg(result1+"\n"+result2+"\n"); 204 | }) 205 | } 206 | 207 | function tls_Getanswer() 208 | { 209 | var result1="【答题】";var result2=""; 210 | var tt=telunsu; 211 | const llUrl = {url:"https://xwsh.javamall.cn/Api/TelunsuHandler2.ashx?method=Getanswer",headers:{Cookie:tls_signck,"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.12(0x17000c32) NetType/4G Language/zh_CN miniProgram","Content-Type":"application/x-www-form-urlencoded"},timeout:60}; 212 | $iosrule.post(llUrl, function(error, response, data) { 213 | 214 | var obj=JSON.parse(data); 215 | if(obj.errcode==0) 216 | 217 | 218 | var answer_body={answerList:[{"question_id":71,"question_answer":"C","time_interval":""},{"question_id":72,"question_answer":"未选择","time_interval":""},{"question_id":73,"question_answer":"C","time_interval":""},{"question_id":74,"question_answer":"未选择","time_interval":""},{"question_id":75,"question_answer":"A","time_interval":""},{"question_id":76,"question_answer":"D","time_interval":""},{"question_id":77,"question_answer":"D","time_interval":""},{"question_id":78,"question_answer":"B","time_interval":""},{"question_id":79,"question_answer":"C","time_interval":""},{"question_id":80,"question_answer":"C","time_interval":""}]} 219 | 220 | 221 | for(var i=0;i { 338 | if (isQuanX) $notify(title, subtitle, message) 339 | if (isSurge) $notification.post(title, subtitle, message) 340 | } 341 | const write = (value, key) => { 342 | if (isQuanX) return $prefs.setValueForKey(value, key) 343 | if (isSurge) return $persistentStore.write(value, key) 344 | } 345 | const read = (key) => { 346 | if (isQuanX) return $prefs.valueForKey(key) 347 | if (isSurge) return $persistentStore.read(key) 348 | } 349 | const get = (options, callback) => { 350 | if (isQuanX) { 351 | if (typeof options == "string") options = { url: options } 352 | options["method"] = "GET" 353 | $task.fetch(options).then(response => { 354 | response["status"] = response.statusCode 355 | callback(null, response, response.body) 356 | }, reason => callback(reason.error, null, null)) 357 | } 358 | if (isSurge) $httpClient.get(options, callback) 359 | } 360 | const post = (options, callback) => { 361 | if (isQuanX) { 362 | if (typeof options == "string") options = { url: options } 363 | options["method"] = "POST" 364 | $task.fetch(options).then(response => { 365 | response["status"] = response.statusCode 366 | callback(null, response, response.body) 367 | }, reason => callback(reason.error, null, null)) 368 | } 369 | if (isSurge) $httpClient.post(options, callback) 370 | } 371 | const end = () => { 372 | if (isQuanX) isRequest ? $done({}) : "" 373 | if (isSurge) isRequest ? $done({}) : $done() 374 | } 375 | return { isRequest, isQuanX, isSurge, notify, write, read, get, post, end } 376 | } -------------------------------------------------------------------------------- /weixin/ad.js: -------------------------------------------------------------------------------- 1 | let resp = $response.body; 2 | try { 3 | resp = JSON.parse(resp); 4 | resp.advertisement_num=0; 5 | resp.advertisement_info=[]; 6 | delete resp.appid; 7 | resp = JSON.stringify(resp); 8 | } catch (e) { 9 | console.log(`weixin ad error:\n${e.message}`); 10 | } 11 | 12 | $done({body: resp}); -------------------------------------------------------------------------------- /wtk/index.js: -------------------------------------------------------------------------------- 1 | // MITM 2 | // weixin.566.com,api.566.com 3 | 4 | // rewrite 5 | // http-response ^https:\/\/(api|weixin)\.566\.com\/api\/(Sys\/UserVipStatus|Sys\/HasVipPrivilege|User\/UserInfos|Resource\/IsUnlockChapter|ad\/AdList|ad\/noticelist) script-path=https://gitee.com/iepngs/repo/raw/loon/index.js,requires-body=true,tag=万题库 6 | 7 | const $hammer=(()=>{const isRequest="undefined"!=typeof $request,isSurge="undefined"!=typeof $httpClient,isQuanX="undefined"!=typeof $task;const log=(...n)=>{for(let i in n)console.log(n[i])};const alert=(title,body="",subtitle="",options={})=>{let link=null;switch(typeof options){case"string":link=isQuanX?{"open-url":options}:options;break;case"object":if(["null","{}"].indexOf(JSON.stringify(options))==-1){link=isQuanX?options:options["open-url"];break}default:link=isQuanX?{}:""}if(isSurge)return $notification.post(title,subtitle,body,link);if(isQuanX)return $notify(title,subtitle,body,link);log("==============📣系统通知📣==============");log("title:",title,"subtitle:",subtitle,"body:",body,"link:",link)};const read=key=>{if(isSurge)return $persistentStore.read(key);if(isQuanX)return $prefs.valueForKey(key)};const write=(val,key)=>{if(isSurge)return $persistentStore.write(val,key);if(isQuanX)return $prefs.setValueForKey(val,key)};const request=(method,params,callback)=>{let options={};if(typeof params=="string"){options.url=params}else{options.url=params.url;if(typeof params=="object"){params.headers&&(options.headers=params.headers);params.body&&(options.body=params.body)}}method=method.toUpperCase();const writeRequestErrorLog=function(m,u){return err=>{log(`\n===request error-s--\n`);log(`${m} ${u}`,err);log(`\n===request error-e--\n`)}}(method,options.url);if(isSurge){const _runner=method=="GET"?$httpClient.get:$httpClient.post;return _runner(options,(error,response,body)=>{if(error==null||error==""){response.body=body;callback("",body,response)}else{writeRequestErrorLog(error);callback(error,"",response)}})}if(isQuanX){options.method=method;$task.fetch(options).then(response=>{response.status=response.statusCode;delete response.statusCode;callback("",response.body,response)},reason=>{writeRequestErrorLog(reason.error);response.status=response.statusCode;delete response.statusCode;callback(reason.error,"",response)})}};const done=(value={})=>{if(isQuanX)return isRequest?$done(value):null;if(isSurge)return isRequest?$done(value):$done()};const pad=(c,s=false,l=15)=>s?console.log(c.padEnd(l,c)):c.padEnd(l,c);return{isRequest,isSurge,isQuanX,log,alert,read,write,request,done,pad}})(); 8 | 9 | function initExpireDate(s=0){ 10 | const dateObj = new Date(+Date.now()+s*1000); 11 | const year = dateObj.getUTCFullYear(); 12 | const month = dateObj.getUTCMonth() + 1; 13 | const date = dateObj.getUTCDate(); 14 | const hour = dateObj.getUTCHours(); 15 | const minute = dateObj.getUTCMinutes(); 16 | const second = dateObj.getUTCSeconds(); 17 | const padzero = n => +n > 9 ? n : "0" + n.toString(); 18 | const fmt1 = [year, month, date].map(padzero).join("-"); 19 | const fmt2 = [hour, minute, second].map(padzero).join(":"); 20 | return fmt1 + "T" + fmt2; 21 | } 22 | 23 | (()=>{ 24 | const Protagonist = "万题库"; 25 | let uri = "", bodyObj = {}; 26 | try{ 27 | uri = /\/([^\/\?]+(?!.*\/))/.exec($request.url)[1]; 28 | bodyObj = JSON.parse($response.body); 29 | $hammer.log(`${Protagonist} request uri:\n${$hammer.pad("~")}\n${uri}`); 30 | }catch(e){ 31 | console.log(e.message); 32 | return $hammer.done({body: $response.body}); 33 | } 34 | switch (uri) { 35 | case "AdList": 36 | bodyObj.AdList = []; 37 | bodyObj.NewVerAdList = []; 38 | break; 39 | case "noticelist": 40 | bodyObj.Notice = []; 41 | break; 42 | case "IsUnlockChapter": 43 | bodyObj.IsUnlock = 1; 44 | break; 45 | case "UserVipStatus": 46 | bodyObj.IsValid = 1; 47 | bodyObj.ExpireDate = initExpireDate(7*86400); 48 | bodyObj.DaysToExpire = 7; 49 | bodyObj.VipType = 8; 50 | break; 51 | case "UserInfos": 52 | bodyObj.UserLevel.VipLevel = 3; 53 | bodyObj.UserLevel.ExpLimit = Math.ceil(+Date.now()/1000+86400*7); 54 | break; 55 | case "HasVipPrivilege": 56 | bodyObj.VipType = 8; 57 | bodyObj.HasVipPrivilege = 1; 58 | bodyObj.Locks = []; 59 | break; 60 | default: 61 | console.log("cross default section.") 62 | break; 63 | } 64 | const newBody = JSON.stringify(bodyObj); 65 | $hammer.done({body: newBody}); 66 | })(); -------------------------------------------------------------------------------- /xxys/index.js: -------------------------------------------------------------------------------- 1 | 2 | // 来源: 3 | // https://raw.githubusercontent.com/photonmang/quantumultX/master/xxysrw.js 4 | 5 | const $ = hammer('小小影视', 3); 6 | const CookieKey = 'py_signheader_xxys'; 7 | let CookieVal = ''; 8 | const host = 'https://uv4tq1fvpg5gy5r5lkq9.hnhx360.com'; 9 | let message = ''; 10 | 11 | function GetCookie() { 12 | CookieVal = JSON.stringify($request.headers); 13 | $.log(CookieVal); 14 | $.write(CookieVal, 'py_signheader_xxys'); 15 | $.alert(CookieVal, "获取Cookie成功"); 16 | $.done(); 17 | } 18 | 19 | function nowTs(){ 20 | return (+new Date()).toString(); 21 | } 22 | 23 | function buildRequestOptions(uri, body = ''){ 24 | return options = { 25 | url: `${host}/${uri}`, 26 | headers: JSON.parse(CookieVal), 27 | body: body 28 | }; 29 | } 30 | 31 | function sign() { 32 | return new Promise(resolve => { 33 | const options = buildRequestOptions('ucp/task/sign'); 34 | $.request('post', options, (error, response, data) => { 35 | if(error){ 36 | $.log(`sign request error:\n ${error}`); 37 | return resolve(); 38 | } 39 | $.log(`sign response:\n ${response}`); 40 | const result = JSON.parse(response); 41 | if (result.retcode == 0) { 42 | message += `签到结果: ${result.retcode ? response : '成功'}\n`; 43 | } 44 | resolve(); 45 | }) 46 | }) 47 | } 48 | 49 | function pl() { 50 | return new Promise(resolve => { 51 | const body = '{_t=' + nowTs() + '&content=%E6%B5%8B%E8%AF%95%E4%B8%80%E4%B8%8B&parentid=0&pid=&s_device_id=2D1749C8-38B2-4859-A2FC-4BF783C533A3&s_os_version=13.3&s_platform=ios&vodid=62894}' 52 | const options = buildRequestOptions('comment/post', body); 53 | $.request('post', options, (error, response, data) => { 54 | if(error){ 55 | $.log(`pl request error:\n ${error}`); 56 | return resolve(); 57 | } 58 | $.log(`pl response:\n ${response}`); 59 | const result = JSON.parse(response); 60 | message += `评论结果: ${result.retcode ? response : '成功'}\n`; 61 | resolve(); 62 | }) 63 | }) 64 | } 65 | 66 | function ad() { 67 | return new Promise(resolve => { 68 | const options = buildRequestOptions('ucp/task/adviewClick?'); 69 | $.request('post', options, (error, response, data) => { 70 | if(error){ 71 | $.log(`ad request error:\n ${error}`); 72 | return resolve(); 73 | } 74 | $.log(`ad response:\n ${response}`); 75 | const result = JSON.parse(response); 76 | message += `广告结果: ${result.retcode ? response : '成功'}\n`; 77 | resolve(); 78 | }) 79 | }) 80 | } 81 | 82 | function fx() { 83 | return new Promise(resolve => { 84 | const url = `ucp/task/share?_t=${nowTs()}&pid=&s_device_id=2D1749C8-38B2-4859-A2FC-4BF783C533A3&s_os_version=13.3&s_platform=ios&vodid=62935`; 85 | const options = buildRequestOptions(url); 86 | $.request('post', options, (error, response, data) => { 87 | if(error){ 88 | $.log(`fx request error:\n ${error}`); 89 | return resolve(); 90 | } 91 | $.log(`fx response:\n ${response}`); 92 | const result = JSON.parse(response); 93 | message += `分享结果: ${result.retcode ? response : '成功'}\n`; 94 | resolve(); 95 | }) 96 | }) 97 | } 98 | 99 | function sc1() { 100 | return new Promise(resolve => { 101 | const ID = Math.floor(Math.random() * 60000 + 10); 102 | const body = '_t='+nowTs()+'&pid=&s_device_id=2D1749C8-38B2-4859-A2FC-4BF783C533A3&s_os_version=13.3&s_platform=ios&vodid=' + ID 103 | const options = buildRequestOptions(`favorite/add`, body); 104 | $.request('post', options, (error, response, data) => { 105 | if(error){ 106 | $.log(`sc1 request error:\n ${error}`); 107 | return resolve(); 108 | } 109 | $.log(`sc1 response:\n ${response}`); 110 | const result = JSON.parse(response); 111 | message += `收藏结果: ${result.retcode ? response : '成功'}\n`; 112 | resolve(); 113 | }) 114 | }) 115 | } 116 | 117 | function scRequest(index){ 118 | return new Promise(resolve => { 119 | const ID = Math.floor(Math.random() * 60000 + 10); 120 | const body = '_t='+nowTs()+'&pid=&s_device_id=2D1749C8-38B2-4859-A2FC-4BF783C533A3&s_os_version=13.3&s_platform=ios&vodid=' + ID 121 | const options = buildRequestOptions(`favorite/add`, body); 122 | $.request('post', options, (error, response, data) => { 123 | if(error){ 124 | $.log(`sc request error:\n ${error}`); 125 | return resolve(0); 126 | } 127 | $.log(`sc response:\n ${response}`); 128 | const result = JSON.parse(response); 129 | message += `第${index}次收藏结果: ${result.retcode ? response : '成功'}\n`; 130 | if(result.retcode == -1){ 131 | return resolve(1); 132 | } 133 | setTimeout(()=>{ 134 | resolve(2); 135 | }, 2000); 136 | }) 137 | }) 138 | } 139 | 140 | function sc() { 141 | return new Promise(async resolve => { 142 | let runTimes = 0; 143 | let success = 0; 144 | while (true) { 145 | if(success > 5 || runTimes > 12){ 146 | break; 147 | } 148 | if((await scRequest(runTimes++)) == 1){ 149 | continue; 150 | } 151 | success++; 152 | } 153 | resolve(); 154 | }) 155 | } 156 | function boxall() { 157 | return new Promise(async resolve => { 158 | await box(); 159 | if ((new Date()).getDay() == 6) { 160 | await box6(); 161 | } 162 | resolve(); 163 | }) 164 | } 165 | 166 | function box6() { 167 | return new Promise(resolve => { 168 | const options = buildRequestOptions(`ucp/taskbox/taskboxopen?taskid=1622`); 169 | $.request('post', options, (error, response, data) => { 170 | if(error){ 171 | $.log(`box6 request error:\n ${error}`); 172 | return resolve(0); 173 | } 174 | $.log(`box6 response:\n ${response}`); 175 | const result = JSON.parse(response); 176 | message += `周六宝箱: ${result.retcode ? response : '成功'}\n`; 177 | if(result.retcode == -1){ 178 | return resolve(1); 179 | } 180 | resolve(2); 181 | }) 182 | }) 183 | } 184 | 185 | function box() { 186 | return new Promise(resolve => { 187 | const options = buildRequestOptions(`ucp/taskbox/taskboxopen?taskid=1022`); 188 | $.request('post', options, (error, response, data) => { 189 | if(error){ 190 | $.log(`box request error:\n ${error}`); 191 | return resolve(0); 192 | } 193 | $.log(`box response:\n ${response}`); 194 | const result = JSON.parse(response); 195 | message += `每日宝箱: ${result.retcode ? response : '成功'}\n`; 196 | resolve(result.retcode == -1 ? 1 : 2); 197 | }) 198 | }) 199 | } 200 | 201 | function reqplay(index) { 202 | return new Promise(resolve => { 203 | const num = Math.floor(Math.random() * 60000 + 10); 204 | const url = "vod/reqplay/" + num + "?_t="+nowTs()+"&pid=&playindex=1"; 205 | const options = buildRequestOptions(url); 206 | $.request('post', options, (error, response, data) => { 207 | if(error){ 208 | $.log(`reqplay request error:\n ${error}`); 209 | return resolve(); 210 | } 211 | $.log(`reqplay response:\n ${response}`); 212 | const result = JSON.parse(response); 213 | message += `第${index}次收藏结果: ${result.retcode ? response : '成功'}\n`; 214 | let ret = 0; 215 | switch (result.retcode) { 216 | case 0: 217 | // 成功 218 | ret = 0; 219 | break; 220 | case 3: 221 | // 今日观看次数已看完 222 | ret = 3; 223 | break; 224 | default: 225 | ret = 1; 226 | break; 227 | } 228 | setTimeout(() => { 229 | resolve(ret); 230 | }, Math.ceil(Math.random()*10000)); 231 | }) 232 | }) 233 | } 234 | 235 | function ten() { 236 | return new Promise(async resolve => { 237 | let runTimes = 0; 238 | let success = 0; 239 | while (true) { 240 | if(success > 5 || runTimes > 12){ 241 | break; 242 | } 243 | const ret = await reqplay(runTimes++); 244 | if(ret == 3){ 245 | break; 246 | } 247 | if(!ret){ 248 | success++; 249 | } 250 | } 251 | resolve(); 252 | }) 253 | } 254 | 255 | function play() { 256 | return new Promise(resolve => { 257 | const options = buildRequestOptions("vod/playhb/53376?"); 258 | $.request('post', options, (error, response, data) => { 259 | if(error){ 260 | $.log(`play request error:\n ${error}`); 261 | return resolve(); 262 | } 263 | $.log(`play response:\n ${response}`); 264 | resolve(); 265 | }) 266 | }) 267 | } 268 | 269 | async function main() { 270 | CookieVal = $.read(CookieKey); 271 | if(!CookieVal){ 272 | $.log("Cookie不存在,中止运行."); 273 | return $.done(); 274 | } 275 | const date = new Date(); 276 | const hour = date.getHours(); 277 | const min = date.getMinutes(); 278 | const s = date.getSeconds(); 279 | if (hour == 22 && min == 0 && s == 10) { 280 | await boxall()//开启宝箱 281 | }else if (hour == 9 && min == 0 && s == 10) { 282 | await sign() //签到 283 | await pl() //评论 284 | await ad() //广告 285 | await fx() //分享 286 | await sc() //收藏 287 | await ten() //10次观影 288 | }else if (hour == 9 && min <= 30) { 289 | await play() //30分钟观影 290 | } 291 | $.done(); 292 | } 293 | 294 | $.isRequest ? GetCookie() : main(); 295 | 296 | function hammer(t = "untitled", l = 3) { return new class { constructor(t, l) { this.name = t, this.logLevel = l, this.isRequest = ("object" == typeof $request) && $request.method != "OPTIONS", this.isSurge = "undefined" != typeof $httpClient, this.isQuanX = "undefined" != typeof $task, this.isNode = "function" == typeof require, this.node = (() => { if (!this.isNode) { return null } const file = "localstorage.yml"; let f, y, r; try { f = require('fs'); y = require('js-yaml'); r = require('request'); f.appendFile(file, "", function (err) { if (err) throw err; }) } catch (e) { console.log("install unrequired module by: yarn add module_name"); console.log(e.message); return {} } return { file: file, fs: f, yaml: y, request: r, } })() } log(...n) { if (l < 2) { return null } console.log(`\n***********${this.name}***********`); for (let i in n) console.log(n[i]) } alert(body = "", subtitle = "", options = {}) { if (l == 2 || l == 0) { return null } if (typeof options == "string") { options = { "open-url": options } } let link = null; if (Object.keys(options).length) { link = this.isQuanX ? options : { openUrl: options["open-url"], mediaUrl: options["media-url"] } } if (this.isSurge) return $notification.post(this.name, subtitle, body, link); if (this.isQuanX) return $notify(this.name, subtitle, body, link); console.log(`系统通知📣\ntitle:${this.name}\nsubtitle:${subtitle}\nbody:${body}\nlink:${link}`) } request(method, params, callback) { let options = {}; if (typeof params == "string") { options.url = params } else { options.url = params.url; if (typeof params == "object") { params.headers && (options.headers = params.headers); params.body && (options.body = params.body) } } method = method.toUpperCase(); const writeRequestErrorLog = function (m, u) { return err => console.log(`${this.name}request error:\n${m}${u}`, err) }(method, options.url); if (this.isSurge) { const _runner = method == "GET" ? $httpClient.get : $httpClient.post; return _runner(options, (error, response, body) => { if (error == null || error == "") { response.body = body; callback("", body, response) } else { writeRequestErrorLog(error); callback(error, "", response) } }) } options.method = method; if (this.isQuanX) { $task.fetch(options).then(response => { response.status = response.statusCode; delete response.statusCode; callback("", response.body, response) }, reason => { writeRequestErrorLog(reason.error); response.status = response.statusCode; delete response.statusCode; callback(reason.error, "", response) }) } if (this.isNode) { if (options.method == "POST" && options.body) { try { options.body = JSON.parse(options.body); options.json = true } catch (e) { console.log(e.message) } } this.node.request(options, (error, response, body) => { if (typeof body == "object") { body = JSON.stringify(body) } if (typeof response == 'object' && response) { response.status = response.statusCode; delete response.statusCode } callback(error, body, response) }) } } read(key) { if (this.isSurge) return $persistentStore.read(key); if (this.isQuanX) return $prefs.valueForKey(key); if (this.isNode) { let val = ""; try { const fileContents = this.node.fs.readFileSync(this.node.file, "utf8"); const data = this.node.yaml.safeLoad(fileContents); val = (typeof (data) == "object" && data[key]) ? data[key] : "" } catch (e) { console.log(`读取文件时错误:\n${e.message}`); return "" } return val } } write(val, key) { if (this.isSurge) return $persistentStore.write(val, key); if (this.isQuanX) return $prefs.setValueForKey(val, key); if (this.isNode) { try { const fileContents = this.node.fs.readFileSync(this.node.file, "utf8"); let data = this.node.yaml.safeLoad(fileContents); data = typeof data == "object" ? data : {}; data[key] = val; val = this.node.yaml.safeDump(data); this.node.fs.writeFileSync(this.node.file, val, 'utf8') } catch (e) { console.log(e.message); return false } return true } } delete(key) { if (this.isNode) { try { const fileContents = this.node.fs.readFileSync(this.node.file, "utf8"); let data = this.node.yaml.safeLoad(fileContents); data = typeof data == "object" ? data : {}; if (!data.hasOwnProperty(key)) { return true } delete data[key]; const val = this.node.yaml.safeDump(data); this.node.fs.writeFileSync(this.node.file, val, 'utf8') } catch (e) { console.log(e.message); return false } return true } } done(value = {}) { if (this.isQuanX) return this.isRequest ? $done(value) : null; if (this.isSurge) return this.isRequest ? $done(value) : $done() } pad(s = false, c = "*", l = 15) { return s ? this.log(c.padEnd(l, c)) : `\n${c.padEnd(l, c)}\n` } }(t, l) } 297 | -------------------------------------------------------------------------------- /zxjb/index.js: -------------------------------------------------------------------------------- 1 | const $hammer = (() => { const isRequest = "undefined" != typeof $request, isSurge = "undefined" != typeof $httpClient, isQuanX = "undefined" != typeof $task; const log = (...n) => { for (let i in n) console.log(n[i]) }; const alert = (title, body = "", subtitle = "", options = {}) => { let link = null; switch (typeof options) { case "string": link = isQuanX ? { "open-url": options } : options; break; case "object": if (["null", "{}"].indexOf(JSON.stringify(options)) == -1) { link = isQuanX ? options : options["open-url"]; break } default: link = isQuanX ? {} : "" }if (isSurge) return $notification.post(title, subtitle, body, link); if (isQuanX) return $notify(title, subtitle, body, link); log("==============📣系统通知📣=============="); log("title:", title, "subtitle:", subtitle, "body:", body, "link:", link) }; const read = key => { if (isSurge) return $persistentStore.read(key); if (isQuanX) return $prefs.valueForKey(key) }; const write = (val, key) => { if (isSurge) return $persistentStore.write(val, key); if (isQuanX) return $prefs.setValueForKey(val, key) }; const request = (method, params, callback) => { let options = {}; if (typeof params == "string") { options.url = params } else { options.url = params.url; if (typeof params == "object") { params.headers && (options.headers = params.headers); params.body && (options.body = params.body) } } method = method.toUpperCase(); const writeRequestErrorLog = function (m, u) { return err => { log(`\n===request error-s--\n`); log(`${m} ${u}`, err); log(`\n===request error-e--\n`) } }(method, options.url); if (isSurge) { const _runner = method == "GET" ? $httpClient.get : $httpClient.post; return _runner(options, (error, response, body) => { if (error == null || error == "") { response.body = body; callback("", body, response) } else { writeRequestErrorLog(error); callback(error, "", response) } }) } if (isQuanX) { options.method = method; $task.fetch(options).then(response => { response.status = response.statusCode; delete response.statusCode; callback("", response.body, response) }, reason => { writeRequestErrorLog(reason.error); response.status = response.statusCode; delete response.statusCode; callback(reason.error, "", response) }) } }; const done = (value = {}) => { if (isQuanX) return isRequest ? $done(value) : null; if (isSurge) return isRequest ? $done(value) : $done() }; return { isRequest, isSurge, isQuanX, log, alert, read, write, request, done } })(); 2 | function http_build_query(obj) { let s = []; for (const key in obj) { s.push(`${key}=${encodeURIComponent(obj[key])}`); } return s.join("&"); } 3 | 4 | const Protagonist = "每日资讯简报"; 5 | 6 | const dateObj = new Date(); 7 | function day() { return ["一", "二", "三", "四", "五", "六", "七"][dateObj.getDay() - 1]; } 8 | const date = `${dateObj.getMonth() + 1}月${dateObj.getDate()}日`; 9 | const week = `星期${day()}`; 10 | let globalOptions = {}; 11 | 12 | function buildRequestOption(link) { 13 | return { 14 | url: link, 15 | headers: { 16 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36", 17 | } 18 | }; 19 | } 20 | 21 | function spider() { 22 | return new Promise(resolve => { 23 | const host = "https://weixin.sogou.com"; 24 | const query = http_build_query({ query: `【${Protagonist}】${date} ${week}`, type: 2, ie: "utf8" }); 25 | globalOptions = buildRequestOption(`${host}/weixin?${query}`); 26 | 27 | $hammer.request("get", globalOptions, (error, response, data) => { 28 | if (error) { 29 | $hammer.log(`${Protagonist} request error:`, data); 30 | return resolve(false); 31 | } 32 | let pattern = /
找到约(\d+)条结果/; 33 | let matcher = pattern.exec(response); 34 | matcher = matcher ? ~~matcher[1] : 0; 35 | if (matcher < 1) { 36 | return resolve(false); 37 | } 38 | 39 | matcher = /href="(.*)" id=".*" uigs="article_title_0"/.exec(response); 40 | matcher = matcher ? `${host}${matcher[1]}` : ""; 41 | if (!matcher) { 42 | return resolve(false); 43 | } 44 | matcher = matcher.replace(/&/g, "&").replace(/\s/g, "%20"); 45 | $hammer.log(`${Protagonist} response matcher:`, matcher); 46 | $hammer.alert(Protagonist, `${date} ${week}`, "", matcher); 47 | setTimeout(()=>{ 48 | resolve(matcher); 49 | }, 1500); 50 | }) 51 | }) 52 | }; 53 | 54 | function getContent(link) { 55 | return new Promise(resolve => { 56 | globalOptions.url = link; 57 | $hammer.log("options.url:", globalOptions.url) 58 | $hammer.request("get", globalOptions, (error, response, data) => { 59 | if (error) { 60 | $hammer.log(`${Protagonist} link error:`, error, globalOptions, data); 61 | return resolve(false); 62 | } 63 | $hammer.log(`${Protagonist} link response:`, response); 64 | 65 | let prelink = /src = '(.*)';/.exec(response); 66 | prelink = prelink ? prelink[1].replace(/'\s\+\s'/g, "") : ""; 67 | if(!prelink){ 68 | $hammer.log(`${Protagonist} match prelink error`); 69 | return resolve(false); 70 | } 71 | globalOptions.url = prelink; 72 | globalOptions.headers["Referer"] = link; 73 | $hammer.request('get', globalOptions, () =>{ 74 | resolve(response); 75 | }) 76 | }) 77 | }) 78 | } 79 | 80 | function resource(response){ 81 | return new Promise(resolve => { 82 | const re = /url \+= '(.*)';/, 83 | reg = /url \+= '(.*)';/g; 84 | let data = []; 85 | while (true) { 86 | const temp = reg.exec(response); 87 | if(temp == null){ 88 | break; 89 | } 90 | data.push(temp[1]); 91 | } 92 | const finalLink = data.join("").replace("@", ""); 93 | $hammer.log(`${Protagonist} finalLink: \n${finalLink}`); 94 | 95 | globalOptions.url = finalLink; 96 | $hammer.request('get', globalOptions, (error, response, data) => { 97 | if (error) { 98 | $hammer.log(`${Protagonist} finalLink error:`, error, globalOptions, data); 99 | return resolve(false); 100 | } 101 | $hammer.log(`${Protagonist} finalLink response:`, response); 102 | $hammer.alert(`${Protagonist}`, response); 103 | resolve(true); 104 | }) 105 | }) 106 | } 107 | 108 | (async () => { 109 | try { 110 | const target = await spider(); 111 | if (target) { 112 | const resp = await getContent(target); 113 | await resource(resp); 114 | } 115 | } catch (error) { 116 | $hammer.log(error.message); 117 | } 118 | $hammer.done(); 119 | })(); 120 | --------------------------------------------------------------------------------