├── .github └── workflows │ ├── flw.yml │ ├── iboxpay.yml │ ├── main.yml │ ├── sync-repo.yml │ └── xiaole.yml ├── LICENSE ├── README.md ├── Script └── 1 ├── Task ├── QQread.js ├── ZIYEnode.zip ├── flw.jpg ├── flw.js ├── flw.png ├── flwCOOKIE.js ├── flwck.js ├── githubAC.js ├── githubACCOOKIE.js ├── githubACck.js ├── iboxpay.js ├── iboxpay.png ├── iboxpayCOOKIE.js ├── iboxpayck.js ├── sendNotify.js ├── ttwkziye.js ├── xiaole.js ├── xiaole.png ├── xiaoleCOOKIE.js └── ziye.boxjs.json ├── diqudaima.txt ├── dkhjziye333.js ├── flwhbziye.js ├── package.json ├── sendNotify.js ├── xiaoleziye.js ├── xiaoleziye.png ├── yydkziye.js └── ziye.png /.github/workflows/flw.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: 返利网 5 | 6 | on: 7 | workflow_dispatch: 8 | schedule: 9 | - cron: '0 12,23 * * *' 10 | watch: 11 | types: started 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | if: github.event.repository.owner.id == github.event.sender.id 16 | env: 17 | FL_flwURL: ${{ secrets.FL_flwURL }} 18 | FL_flwHEADER: ${{ secrets.FL_flwHEADER }} 19 | FL_flwspBODY: ${{ secrets.FL_flwspBODY }} 20 | FL_flwqwBODY: ${{ secrets.FL_flwqwBODY }} 21 | FL_CASH: ${{ secrets.FL_CASH }}//天天领现金提现 22 | FL_DHCASH: ${{ secrets.FL_DHCASH }}//签到活动兑换 23 | steps: 24 | - name: Checkout 25 | run: | 26 | git clone https://github.com/ziye12/JavaScript.git ~/JavaScript 27 | - name: Use Node.js 12.x 28 | uses: actions/setup-node@v1 29 | with: 30 | node-version: 12.x 31 | - name: npm install 32 | if: env.FL_flwURL 33 | run: | 34 | cd ~/JavaScript 35 | npm install 36 | - name: '运行 【返利网】' 37 | if: env.FL_flwURL 38 | run: | 39 | cd ~/JavaScript 40 | node Task/flw.js 41 | env: 42 | 43 | PUSH_KEY: ${{ secrets.PUSH_KEY }} 44 | BARK_PUSH: ${{ secrets.BARK_PUSH }} 45 | TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} 46 | TG_USER_ID: ${{ secrets.TG_USER_ID }} 47 | BARK_SOUND: ${{ secrets.BARK_SOUND }} 48 | DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} 49 | DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} 50 | 51 | 52 | -------------------------------------------------------------------------------- /.github/workflows/iboxpay.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: 笑谱 5 | 6 | on: 7 | workflow_dispatch: 8 | schedule: 9 | - cron: '*/15 8-23 * * *' 10 | watch: 11 | types: started 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | if: github.event.repository.owner.id == github.event.sender.id 16 | env: 17 | XP_iboxpayHEADER: ${{ secrets.XP_iboxpayHEADER }} 18 | XP_refreshTOKEN: ${{ secrets.XP_refreshTOKEN }} 19 | XP_CASH: ${{ secrets.XP_CASH }} 20 | XP_live: ${{ secrets.XP_live }} 21 | steps: 22 | - name: Checkout 23 | run: | 24 | git clone https://github.com/ziye12/JavaScript.git ~/JavaScript 25 | - name: Use Node.js 12.x 26 | uses: actions/setup-node@v1 27 | with: 28 | node-version: 12.x 29 | - name: npm install 30 | if: env.XP_iboxpayHEADER 31 | run: | 32 | cd ~/JavaScript 33 | npm install 34 | - name: '运行 【笑谱】' 35 | if: env.XP_iboxpayHEADER 36 | run: | 37 | cd ~/JavaScript 38 | node Task/iboxpay.js 39 | env: 40 | 41 | PUSH_KEY: ${{ secrets.PUSH_KEY }} 42 | BARK_PUSH: ${{ secrets.BARK_PUSH }} 43 | TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} 44 | TG_USER_ID: ${{ secrets.TG_USER_ID }} 45 | BARK_SOUND: ${{ secrets.BARK_SOUND }} 46 | DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} 47 | DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} 48 | 49 | 50 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the main branch 8 | push: 9 | branches: [ main ] 10 | pull_request: 11 | branches: [ main ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | build: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | 23 | # Steps represent a sequence of tasks that will be executed as part of the job 24 | steps: 25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 26 | - uses: actions/checkout@v2 27 | 28 | # Runs a single command using the runners shell 29 | - name: Run a one-line script 30 | run: echo Hello, world! 31 | 32 | # Runs a set of commands using the runners shell 33 | - name: Run a multi-line script 34 | run: | 35 | echo Add other actions to build, 36 | echo test, and deploy your project. 37 | -------------------------------------------------------------------------------- /.github/workflows/sync-repo.yml: -------------------------------------------------------------------------------- 1 | # File: .github/workflows/repo-sync.yml 2 | name: sync-ziye12-JavaScript 3 | on: 4 | schedule: 5 | - cron: '1 */3 * * *' 6 | workflow_dispatch: 7 | watch: 8 | types: started 9 | repository_dispatch: 10 | types: sync-ziye12-JavaScript 11 | jobs: 12 | repo-sync: 13 | env: 14 | PAT: ${{ secrets.PAT }} #此处PAT需要申请,教程详见:https://www.jianshu.com/p/bb82b3ad1d11 15 | dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} # 我自己同步到gitee使用,其他人可忽略 16 | runs-on: ubuntu-latest 17 | if: github.event.repository.owner.id == github.event.sender.id 18 | steps: 19 | - uses: actions/checkout@v2 20 | with: 21 | persist-credentials: false 22 | 23 | - name: sync ziye12-JavaScript 24 | uses: repo-sync/github-sync@v2 25 | if: env.PAT 26 | with: 27 | source_repo: "https://github.com/ziye12/JavaScript.git" 28 | source_branch: "main" 29 | destination_branch: "main" 30 | github_token: ${{ secrets.PAT }} 31 | -------------------------------------------------------------------------------- /.github/workflows/xiaole.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: 小乐 5 | 6 | on: 7 | workflow_dispatch: 8 | schedule: 9 | - cron: '17 8-23 * * *' 10 | watch: 11 | types: started 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | if: github.event.repository.owner.id == github.event.sender.id 16 | env: 17 | XL_URL: ${{ secrets.XL_URL }} 18 | XL_HEADER: ${{ secrets.XL_HEADER }} 19 | 20 | steps: 21 | - name: Checkout 22 | run: | 23 | git clone https://github.com/ziye12/JavaScript.git ~/JavaScript 24 | - name: Use Node.js 12.x 25 | uses: actions/setup-node@v1 26 | with: 27 | node-version: 12.x 28 | - name: npm install 29 | if: env.XL_URL 30 | run: | 31 | cd ~/JavaScript 32 | npm install 33 | - name: '运行 【小乐】' 34 | if: env.XL_URL 35 | run: | 36 | cd ~/JavaScript 37 | node Task/xiaole.js 38 | env: 39 | 40 | PUSH_KEY: ${{ secrets.PUSH_KEY }} 41 | BARK_PUSH: ${{ secrets.BARK_PUSH }} 42 | TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} 43 | TG_USER_ID: ${{ secrets.TG_USER_ID }} 44 | BARK_SOUND: ${{ secrets.BARK_SOUND }} 45 | DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} 46 | DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} 47 | 48 | 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 不要fork! 请点亮Star 2 | 3 | ## 特别声明: 4 | 5 | * 本仓库发布的Script项目中涉及的任何解锁和解密分析脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断. 6 | 7 | * 本项目内所有资源文件,禁止任何公众号、自媒体进行任何形式的转载、发布。 8 | 9 | * ziye12对任何脚本问题概不负责,包括但不限于由任何脚本错误导致的任何损失或损害. 10 | 11 | * 间接使用脚本的任何用户,包括但不限于建立VPS或在某些行为违反国家/地区法律或相关法规的情况下进行传播, ziye12 对于由此引起的任何隐私泄漏或其他后果概不负责. 12 | 13 | * 请勿将Script项目的任何内容用于商业或非法目的,否则后果自负. 14 | 15 | * 如果任何单位或个人认为该项目的脚本可能涉嫌侵犯其权利,则应及时通知并提供身份证明,所有权证明,我们将在收到认证文件后删除相关脚本. 16 | 17 | * 任何以任何方式查看此项目的人或直接或间接使用该Script项目的任何脚本的使用者都应仔细阅读此声明。ziye12 保留随时更改或补充此免责声明的权利。一旦使用并复制了任何相关脚本或Script项目的规则,则视为您已接受此免责声明. 18 | 19 | **您必须在下载后的24小时内从计算机或手机中完全删除以上内容.**
20 | > ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此声明,请仔细阅读*** 21 | 22 | -------------------------------------------------------------------------------- /Script/1: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /Task/QQread.js: -------------------------------------------------------------------------------- 1 | 2 | /*ziye 3 | 4 | 本人github地址 https://github.com/ziye12/JavaScript 5 | 转载请备注个名字,谢谢 6 | 7 | 11.28 ⚠️无时长功能,只有签到,视频,宝箱 8 | 1.18 调整显示错误 9 | 10 | 日均0.18收益 11 | 12 | 13 | 14 | 15 | 16 | ⚠️cookie获取方法: 17 | 18 | 进 QQ阅读APP 点我的 获取cookie 秘密为 QQREADAPP_HEADER 多账号换行 19 | 20 | 点 免费 福利 日常福利-看视频 获取视频cookie 秘密为 QQREADAPP_VIDEOHD 多账号换行 21 | 22 | 23 | 24 | ⚠️宝箱奖励为60分钟一次,自己根据情况设置定时, 25 | 26 | 27 | 28 | hostname=commontgw6.reader.qq.com,eventv36.reader.qq.com 29 | 30 | ############## 圈x 31 | 32 | #QQ阅读APP获取cookie 33 | 34 | https:\/\/commontgw6\.reader\.qq\.com\/v7_5_2\/nativepage\/getAcctInfo url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/Task/QQread.js 35 | 36 | #QQ阅读APP获取视频cookie 37 | https:\/\/eventv36\.reader\.qq\.com\/activity\/pkg11955\/watchVideo url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/Task/QQread.js 38 | 39 | ############## loon 40 | 41 | //QQ阅读APP获取cookie 42 | https:\/\/commontgw6\.reader\.qq\.com\/v7_5_2\/nativepage\/getAcctInfo script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/Task/QQreads.js,requires-header=true, tag=QQ阅读APP获取cookie 43 | 44 | //QQ阅读APP获取时长cookie 45 | https:\/\/eventv36\.reader\.qq\.com\/activity\/pkg11955\/watchVideo script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/Task/QQreads.js, requires-header=true, tag=QQ阅读APP获取视频cookie 46 | 47 | ############## surge 48 | 49 | //QQ阅读APP获取cookie 50 | QQ阅读APP获取cookie = type=https:\/\/commontgw6\.reader\.qq\.com\/v7_5_2\/nativepage\/getAcctInfo,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/Task/QQreads.js, 51 | 52 | //QQ阅读APP获取视频cookie 53 | QQ阅读APP获取视频cookie = https:\/\/eventv36\.reader\.qq\.com\/activity\/pkg11955\/watchVideo,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/Task/QQreads.js, 54 | 55 | 56 | */ 57 | 58 | const jsname='QQ阅读APP' 59 | const $ = Env(jsname) 60 | const notify = $.isNode() ? require('./sendNotify') : ''; 61 | var tz=''; 62 | var kz=''; 63 | var task=''; 64 | 65 | 66 | var COOKIES_SPLIT='\n' //自定义多cookie之间连接的分隔符,默认为\n换行分割,不熟悉的不要改动和配置,为了兼容本地node执行 67 | 68 | const logs = 0; //0为关闭日志,1为开启 69 | const notifyInterval=1 70 | //0为关闭通知,1为所有通知,2为宝箱领取成功通知, 71 | 72 | const dd=1//单次任务延迟,默认1秒 73 | 74 | 75 | 76 | let QQreadhdArr = [], QQreadheaderVal = '', 77 | QQreadvideohdArr = [], QQreadvideoheaderVal = '', 78 | QQreadHD = [], QQreadvideoHD = []; 79 | if ($.isNode()) { 80 | if (process.env.COOKIES_SPLIT){ 81 | COOKIES_SPLIT = process.env.COOKIES_SPLIT; 82 | }; 83 | console.log(`============ cookies分隔符为:${COOKIES_SPLIT} =============\n`); 84 | if (process.env.QQREADAPP_HEADER && process.env.QQREADAPP_HEADER.indexOf(COOKIES_SPLIT) > -1) { 85 | QQreadHD = process.env.QQREADAPP_HEADER.split(COOKIES_SPLIT); 86 | } else { 87 | QQreadHD = process.env.QQREADAPP_HEADER.split() 88 | }; 89 | 90 | 91 | 92 | if (process.env.QQREADAPP_VIDEOHD && process.env.QQREADAPP_VIDEOHD.indexOf(COOKIES_SPLIT) > -1) { 93 | QQreadvideoHD = process.env.QQREADAPP_VIDEOHD.split(COOKIES_SPLIT); 94 | } else { 95 | QQreadvideoHD = process.env.QQREADAPP_VIDEOHD.split() 96 | }; 97 | 98 | } 99 | 100 | if ($.isNode()) { 101 | Object.keys(QQreadHD).forEach((item) => { 102 | if (QQreadHD[item]) { 103 | QQreadhdArr.push(QQreadHD[item]) 104 | } 105 | }) 106 | 107 | Object.keys(QQreadvideoHD).forEach((item) => { 108 | if (QQreadvideoHD[item]) { 109 | QQreadvideohdArr.push(QQreadvideoHD[item]) 110 | } 111 | }) 112 | 113 | console.log(`============ 共${QQreadhdArr.length}个QQ阅读APP账号 =============\n`) 114 | console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) 115 | } else { 116 | QQreadhdArr.push($.getdata('QQreadhd')); 117 | QQreadvideohdArr.push($.getdata('QQreadvideohd')); 118 | 119 | } 120 | 121 | if (isGetCookie = typeof $request !== 'undefined') { 122 | GetCookie(); 123 | $.done(); 124 | } 125 | 126 | 127 | 128 | 129 | function GetCookie() { 130 | if($request &&$request.url.indexOf("getAcctInfo")>=0) { 131 | 132 | const QQreadheaderVal = JSON.stringify($request.headers) 133 | if (QQreadheaderVal) $.setdata(QQreadheaderVal,'QQreadhd') 134 | $.log(`[${jsname}] 获取Cookie: 成功,QQreadheaderVal: ${QQreadheaderVal}`) 135 | $.msg(jsname, `获取cookie: 成功🎉`, ``) 136 | } 137 | 138 | 139 | 140 | if($request &&$request.url.indexOf("watchVideo")>=0) { 141 | 142 | const QQreadvideoheaderVal = JSON.stringify($request.headers) 143 | if (QQreadvideoheaderVal) $.setdata(QQreadvideoheaderVal,'QQreadvideohd') 144 | $.log(`[${jsname}] 获取视频Cookie: 成功,QQreadvideoheaderVal: ${QQreadvideoheaderVal}`) 145 | $.msg(jsname, `获取视频cookie: 成功🎉`, ``) 146 | } 147 | 148 | 149 | 150 | } 151 | 152 | 153 | 154 | 155 | let K = 0; 156 | all() 157 | function all(){ 158 | QQreadheaderVal = QQreadhdArr[K]; 159 | QQreadvideoheaderVal = QQreadvideohdArr[K]; 160 | for(var i=0;i<7;i++) 161 | { (function(i) { 162 | setTimeout(function() { 163 | 164 | if (i==0) 165 | QQreadinfo();//用户名 166 | 167 | else if (i==1) 168 | QQreadtask();//任务列表 169 | 170 | else if (i==2) 171 | QQreadboxinfo();//宝箱 172 | 173 | else if (i==4&& task.data&&task.data.watchVideo.videoCount==0) 174 | QQreadsign();//金币签到 175 | 176 | else if (i==5&& task.data&&task.data.watchVideo.videoCount<=19) 177 | QQreadvideo();//视频任务 178 | 179 | 180 | 181 | else if (i == 6 && K < QQreadhdArr.length - 1) { 182 | K += 1; 183 | all(); 184 | } else if (i == 6 && K == QQreadhdArr.length - 1) { 185 | showmsg();//通知 186 | console.log(tz) 187 | $.done(); 188 | } 189 | }, 190 | 191 | (i + 1) * dd * 1000 192 | ); 193 | })(i); 194 | } 195 | } 196 | 197 | 198 | 199 | //用户名 200 | function QQreadinfo() { 201 | return new Promise((resolve, reject) => { 202 | 203 | const toQQreadinfourl = { 204 | 205 | url: 'https://commontgw6.reader.qq.com/v7_5_2/nativepage/getAcctInfo', 206 | headers: JSON.parse(QQreadheaderVal), 207 | timeout:60000}; 208 | $.get(toQQreadinfourl,(error, response, data) =>{ 209 | if(logs) $.log(`${jsname}, 用户名: ${data}`) 210 | info =JSON.parse(data) 211 | kz+= 212 | '\n========== 【'+info.nick+'】 ==========\n'; 213 | tz+= 214 | '\n========== 【'+info.nick+'】 ==========\n'; 215 | 216 | resolve() 217 | }) 218 | }) 219 | } 220 | 221 | 222 | 223 | 224 | 225 | //任务列表 226 | function QQreadtask() { 227 | return new Promise((resolve, reject) => { 228 | 229 | const toQQreadtaskurl ={url: 'https://eventv3.reader.qq.com/activity/pkg11955/initV2', 230 | headers: JSON.parse(QQreadvideoheaderVal), 231 | timeout:60000}; 232 | $.get(toQQreadtaskurl,(error, response, data) =>{ 233 | if(logs) $.log(`${jsname}, 任务列表: ${data}`) 234 | task =JSON.parse(data) 235 | kz+= 236 | '【现金余额】:'+ 237 | task.data.userBalance.cash+ 238 | '元\n'+ 239 | '【今日收益】:'+ 240 | (task.data.userBalance.coin/30000).toFixed(2)+ 241 | '元\n'; 242 | 243 | tz+= 244 | '【现金余额】:'+ 245 | task.data.userBalance.cash+ 246 | '元\n'+ 247 | '【今日收益】:'+ 248 | (task.data.userBalance.coin/30000).toFixed(2)+ 249 | '元\n'+ 250 | '【签到天数】:'+ 251 | (task.data.userType-1)+ 252 | '天\n'+ 253 | '【已看视频】:'+ 254 | task.data.watchVideo.videoCount+ 255 | '/20次\n' 256 | 257 | 258 | resolve() 259 | 260 | }) 261 | }) 262 | } 263 | 264 | 265 | 266 | 267 | 268 | //金币签到 269 | function QQreadsign() { 270 | return new Promise((resolve, reject) => { 271 | const toQQreadsignurl ={url: 'https://eventv36.reader.qq.com/activity/pkg11955/punchCard_v2', 272 | headers: JSON.parse(QQreadvideoheaderVal), 273 | timeout:60000}; 274 | $.get(toQQreadsignurl,(error, response, data) =>{ 275 | if(logs) $.log(`${jsname}, 金币签到: ${data}`) 276 | sign =JSON.parse(data) 277 | if (sign.code==0) 278 | { 279 | tz+= 280 | '【金币签到】:获得'+sign.data.coinNum+'金币\n' 281 | } 282 | resolve() 283 | }) 284 | }) 285 | } 286 | 287 | 288 | 289 | //视频奖励 290 | function QQreadvideo() { 291 | return new Promise((resolve, reject) => { 292 | const toQQreadvideourl ={url: 'https://eventv36.reader.qq.com/activity/pkg11955/watchVideo', 293 | headers: JSON.parse(QQreadvideoheaderVal), 294 | timeout:60000}; 295 | $.get(toQQreadvideourl,(error, response, data) =>{ 296 | if(logs) $.log(`${jsname}, 视频奖励: ${data}`) 297 | video =JSON.parse(data) 298 | if (video.code==0) 299 | { 300 | tz+= 301 | '【视频任务'+video.data.videoCount+'】:获得100金币\n' 302 | } 303 | 304 | resolve() 305 | }) 306 | }) 307 | } 308 | 309 | 310 | 311 | 312 | 313 | //宝箱奖励 314 | function QQreadboxinfo() { 315 | return new Promise((resolve, reject) => { 316 | const toQQreadboxinfourl ={url: 'https://eventv3.reader.qq.com/activity/pkg11955/queryOpenBoxInfo', 317 | headers: JSON.parse(QQreadvideoheaderVal), 318 | timeout:60000}; 319 | $.get(toQQreadboxinfourl,(error, response, data) =>{ 320 | if(logs) $.log(`${jsname}, 宝箱奖励详情: ${data}`) 321 | boxinfo =JSON.parse(data) 322 | var cz=new Date().getTime()-boxinfo.data.openTime 323 | var CZ=3600-(cz/1000).toFixed(0) 324 | if (CZ>=1){ 325 | tz+= 326 | '【宝箱剩余'+boxinfo.data.openNum+'】:差'+CZ+'秒\n'; 327 | kz+= 328 | '【宝箱剩余'+boxinfo.data.openNum+'】:差'+CZ+'秒\n'; 329 | } 330 | 331 | else if(CZ<=0) { 332 | const toQQreadboxurl ={url: 'https://eventv3.reader.qq.com/activity/pkg11955/openBox', 333 | headers: JSON.parse(QQreadvideoheaderVal), 334 | timeout:60000}; 335 | $.get(toQQreadboxurl,(error, response, data) =>{ 336 | if(logs) $.log(`${jsname}, 宝箱奖励: ${data}`) 337 | box =JSON.parse(data) 338 | if (box.code==0){ 339 | tz+= 340 | '【宝箱剩余'+box.data.openNum+'】:获得'+box.data.coin+'金币\n' 341 | kz+= 342 | '【宝箱剩余'+box.data.openNum+'】:获得'+box.data.coin+'金币\n' 343 | } 344 | 345 | }) 346 | 347 | } 348 | }) 349 | resolve() 350 | 351 | }) 352 | } 353 | 354 | 355 | 356 | 357 | function showmsg() { 358 | tz += `\n\n========= 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} \n\n`; 359 | 360 | let d = new Date(new Date().getTime() + 8 * 60 * 60 * 1000); 361 | if (d.getHours()==12 && d.getMinutes()<=20 ||d.getHours()==23 && d.getMinutes()>=40 ) { 362 | notify.sendNotify(jsname,kz) 363 | } 364 | 365 | if (notifyInterval==1) 366 | $.msg(jsname,'',tz)//显示所有通知 367 | 368 | else if (notifyInterval==2&&CZ<=0&&boxinfo.data.openNum>0) 369 | $.msg(jsname,'',tz)//宝箱领取成功通知 370 | 371 | 372 | 373 | } 374 | 375 | 376 | // prettier-ignore 377 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 378 | -------------------------------------------------------------------------------- /Task/ZIYEnode.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/age174/JavaScript/058f182c19c3c1fb1c784ff5cd902eca8eae17b4/Task/ZIYEnode.zip -------------------------------------------------------------------------------- /Task/flw.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/age174/JavaScript/058f182c19c3c1fb1c784ff5cd902eca8eae17b4/Task/flw.jpg -------------------------------------------------------------------------------- /Task/flw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/age174/JavaScript/058f182c19c3c1fb1c784ff5cd902eca8eae17b4/Task/flw.png -------------------------------------------------------------------------------- /Task/flwCOOKIE.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | //独立COOKIE文件 ck在``里面填写,多账号换行 4 | let flwurlVal= `` 5 | let flwheaderVal= `` 6 | let flwspbodyVal= `` 7 | let flwqwbodyVal= `` 8 | 9 | 10 | 11 | let flwcookie = { 12 | flwurlVal: flwurlVal, 13 | flwheaderVal: flwheaderVal, 14 | flwspbodyVal: flwspbodyVal, 15 | flwqwbodyVal: flwqwbodyVal, 16 | 17 | 18 | } 19 | 20 | module.exports = flwcookie 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Task/flwck.js: -------------------------------------------------------------------------------- 1 | /* ziye 导出返利网ck专用 务必下载或者复制到本地使用 2 | 3 | github地址 https://github.com/ziye12 4 | TG频道地址 https://t.me/ziyescript 5 | TG交流群 https://t.me/joinchat/AAAAAE7XHm-q1-7Np-tF3g 6 | boxjs链接 https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/ziye.boxjs.json 7 | 8 | 9 | 转载请备注个名字,谢谢 10 | 11 | 12 | 13 | */ 14 | 15 | //请先确定boxjs已经存在ck,想要导出哪个值,就设置为1 16 | 17 | 18 | const flwurl = 1 19 | const flwheader = 1 20 | const flwspbody = 1 21 | const flwqwbody = 1 22 | 23 | 24 | 25 | const GG=''//默认为换行,也可以将需要隔开的符号填写在''内 26 | 27 | 28 | let K = 1;//从哪个账号开始 29 | 30 | let Z = 1;//到哪个账号结束 31 | 32 | 33 | 34 | const $ = Env("返利网"); 35 | $.idx = ($.idx = ($.getval('flwSuffix') || '1') - 1) > 0 ? ($.idx + 1 + '') : ''; // 账号扩展字符 36 | const notify = $.isNode() ? require("./sendNotify") : ""; 37 | 38 | let R=K 39 | const flwurlArr = []; 40 | let flwurlVal = ""; 41 | 42 | const flwheaderArr = []; 43 | let flwheaderVal = ""; 44 | 45 | const flwspbodyArr = []; 46 | let flwspbodyVal = ""; 47 | 48 | const flwqwbodyArr = []; 49 | let flwqwbodyVal = ""; 50 | 51 | 52 | flwurlArr.push($.getdata("flwurl")); 53 | flwheaderArr.push($.getdata("flwheader")); 54 | flwspbodyArr.push($.getdata("flwspbody")); 55 | flwqwbodyArr.push($.getdata("flwqwbody")); 56 | // 根据boxjs中设置的额外账号数,添加存在的账号数据进行任务处理 57 | let flwCount = ($.getval('flwCount') || '1') - 0; 58 | for (let i = 2; i <= flwCount; i++) { 59 | if ($.getdata(`flwheader${i}`)) { 60 | flwurlArr.push($.getdata(`flwurl${i}`)); 61 | flwheaderArr.push($.getdata(`flwheader${i}`)); 62 | flwspbodyArr.push($.getdata(`flwspbody${i}`)); 63 | flwqwbodyArr.push($.getdata(`flwqwbody${i}`)); 64 | 65 | 66 | } 67 | } 68 | 69 | 70 | 71 | console.log( 72 | `============ 共${flwurlArr.length}个${$.name}账号 =============\n` 73 | ); 74 | console.log( 75 | `============ 脚本执行-北京时间(UTC+8):${new Date( 76 | new Date().getTime() + 8 * 60 * 60 * 1000 77 | ).toLocaleString()} =============\n` 78 | ); 79 | 80 | 81 | 82 | 83 | if (ZR) 91 | $.msg($.name+R+'到'+(K-1)+'打印成功'+K+'到'+Z+'打印失败', '⚠️提示:请先获取'+K+'到'+Z+'的ck','并在boxjs里设置好账号数') 92 | 93 | if (K==R&&Z>R) 94 | $.msg($.name+K+'到'+Z+'打印失败', '⚠️提示:请先获取'+K+'到'+Z+'的ck','并在boxjs里设置好账号数') 95 | 96 | 97 | if (Z==R) 98 | $.msg($.name+K+'打印失败', '⚠️提示:请先获取'+K+'的ck','并在boxjs里设置好账号数') 99 | 100 | $.done(); 101 | } 102 | 103 | 104 | flwurlVal = flwurlArr[K-1]; 105 | flwheaderVal = flwheaderArr[K-1]; 106 | flwspbodyVal = flwspbodyArr[K-1]; 107 | flwqwbodyVal = flwqwbodyArr[K-1]; 108 | 109 | 110 | 111 | if(flwurl==1)console.log(flwurlVal+GG) 112 | if(flwheader==1)console.log(flwheaderVal+GG) 113 | if(flwspbody==1)console.log(flwspbodyVal+GG) 114 | if(flwqwbody==1)console.log(flwqwbodyVal+GG) 115 | 116 | 117 | 118 | for (let i = 0; i < 1; i++) { 119 | (function (i) { 120 | setTimeout( 121 | function () { 122 | 123 | if (i == 0){ 124 | if ( K < Z ) { 125 | K += 1; 126 | all(); 127 | } else if (K == Z ) { 128 | let F=Z-R+1 129 | $.msg($.name+R+'到'+Z+',ck打印成功','✅已打印'+F+'个ck',) 130 | 131 | $.done(); 132 | 133 | 134 | } 135 | } 136 | }, 137 | 138 | (i + 1) * 10 139 | ); 140 | })(i); 141 | } 142 | } 143 | 144 | // prettier-ignore 145 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 146 | -------------------------------------------------------------------------------- /Task/githubACCOOKIE.js: -------------------------------------------------------------------------------- 1 | //独立COOKIE文件 ck在``里面填写,多js换行 2 | let githubACnameVal = `` 3 | let githubACurlVal = `` 4 | 5 | let HHAVal = `` 6 | let HHBVal = `` 7 | 8 | let MMAVal = `` 9 | let MMBVal = `` 10 | let MMCVal = `` 11 | let MMDVal = `` 12 | let MMEVal = `` 13 | let MMFVal = `` 14 | let MMGVal = `` 15 | let MMHVal = `` 16 | let MMIVal = `` 17 | let MMJVal = `` 18 | let MMKVal = `` 19 | let MMLVal = `` 20 | 21 | 22 | 23 | 24 | let githubACcookie = { 25 | githubACnameVal: githubACnameVal, 26 | githubACurlVal: githubACurlVal, 27 | githubACheaderVal: githubACheaderVal, 28 | githubACbodyVal: githubACbodyVal, 29 | 30 | HHAVal: HHAVal, 31 | HHBVal: HHBVal, 32 | MMAVal: MMAVal, 33 | MMBVal: MMBVal, 34 | MMCVal: MMCVal, 35 | MMDVal: MMDVal, 36 | MMEVal: MMEVal, 37 | MMFVal: MMFVal, 38 | MMGVal: MMGVal, 39 | MMHVal: MMHVal, 40 | MMIVal: MMIVal, 41 | MMJVal: MMJVal, 42 | MMKVal: MMKVal, 43 | MMLVal: MMLVal, 44 | 45 | 46 | } 47 | 48 | module.exports = githubACcookie 49 | -------------------------------------------------------------------------------- /Task/githubACck.js: -------------------------------------------------------------------------------- 1 | /* ziye 导出githubACck专用 务必下载或者复制到本地使用 2 | 3 | github地址 https://github.com/ziye12 4 | TG频道地址 https://t.me/ziyescript 5 | TG交流群 https://t.me/joinchat/AAAAAE7XHm-q1-7Np-tF3g 6 | boxjs链接 https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/ziye.boxjs.json 7 | 8 | 9 | 转载请备注个名字,谢谢 10 | 11 | 12 | 13 | */ 14 | 15 | //请先确定boxjs已经存在ck,想要导出哪个值,就设置为1 16 | 17 | const githubACname = 1 18 | const githubACurl = 1 19 | const githubACheader = 1 20 | const githubACbody = 1 21 | 22 | const HHA=0 23 | const HHB=0 24 | const MMA=0 25 | const MMB=0 26 | const MMC=0 27 | const MMD=0 28 | const MME=0 29 | const MMF=0 30 | const MMG=0 31 | const MMH=0 32 | const MMI=0 33 | const MMJ=0 34 | const MMK=0 35 | const MML=0 36 | 37 | 38 | const GG=''//默认为换行,也可以将需要隔开的符号填写在''内 39 | 40 | 41 | let K = 1;//从哪个账号开始 42 | 43 | let Z = 1;//到哪个账号结束 44 | 45 | 46 | 47 | const $ = Env("githubAC"); 48 | $.idx = ($.idx = ($.getval('githubACSuffix') || '1') - 1) > 0 ? ($.idx + 1 + '') : ''; // 账号扩展字符 49 | const notify = $.isNode() ? require("./sendNotify") : ""; 50 | 51 | let R=K 52 | const githubACnameArr = []; 53 | let githubACnameVal = ``; 54 | let middlegithubACNAME = []; 55 | const githubACurlArr = []; 56 | let githubACurlVal = ``; 57 | let middlegithubACURL = []; 58 | const githubACheaderArr = []; 59 | let githubACheaderVal = ``; 60 | let middlegithubACHEADER = []; 61 | const githubACbodyArr = []; 62 | let githubACbodyVal = ``; 63 | let middlegithubACBODY = []; 64 | 65 | const HHAArr = []; 66 | let HHAVal = ``; 67 | let middleHHA = []; 68 | const HHBArr = []; 69 | let HHBVal = ``; 70 | let middleHHB = []; 71 | const MMAArr = []; 72 | let MMAVal = ``; 73 | let middleMMA = []; 74 | const MMBArr = []; 75 | let MMBVal = ``; 76 | let middleMMB = []; 77 | const MMCArr = []; 78 | let MMCVal = ``; 79 | let middleMMC = []; 80 | const MMDArr = []; 81 | let MMDVal = ``; 82 | let middleMMD = []; 83 | const MMEArr = []; 84 | let MMEVal = ``; 85 | let middleMME = []; 86 | const MMFArr = []; 87 | let MMFVal = ``; 88 | let middleMMF = []; 89 | const MMGArr = []; 90 | let MMGVal = ``; 91 | let middleMMG = []; 92 | const MMHArr = []; 93 | let MMHVal = ``; 94 | let middleMMH = []; 95 | const MMIArr = []; 96 | let MMIVal = ``; 97 | let middleMMI = []; 98 | const MMJArr = []; 99 | let MMJVal = ``; 100 | let middleMMJ = []; 101 | const MMKArr = []; 102 | let MMKVal = ``; 103 | let middleMMK = []; 104 | const MMLArr = []; 105 | let MMLVal = ``; 106 | let middleMML = []; 107 | 108 | 109 | 110 | githubACnameArr.push($.getdata("githubACname")); 111 | githubACurlArr.push($.getdata("githubACurl")); 112 | githubACheaderArr.push($.getdata("githubACheader")); 113 | githubACbodyArr.push($.getdata("githubACbody")); 114 | HHAArr.push($.getdata("HHA")); 115 | HHBArr.push($.getdata("HHB")); 116 | MMAArr.push($.getdata("MMA")); 117 | MMBArr.push($.getdata("MMB")); 118 | MMCArr.push($.getdata("MMC")); 119 | MMDArr.push($.getdata("MMD")); 120 | MMEArr.push($.getdata("MME")); 121 | MMFArr.push($.getdata("MMF")); 122 | MMGArr.push($.getdata("MMG")); 123 | MMHArr.push($.getdata("MMH")); 124 | MMIArr.push($.getdata("MMI")); 125 | MMJArr.push($.getdata("MMJ")); 126 | MMKArr.push($.getdata("MMK")); 127 | MMLArr.push($.getdata("MML")); 128 | // 根据boxjs中设置的额外账号数,添加存在的账号数据进行任务处理 129 | 130 | let githubACCount = ($.getval('githubACCount') || '1') - 0; 131 | for (let i = 2; i <= githubACCount; i++) { 132 | if ($.getdata(`githubACheader${i}`)) { 133 | githubACnameArr.push($.getdata(`githubACname${i}`)); 134 | githubACurlArr.push($.getdata(`githubACurl${i}`)); 135 | githubACheaderArr.push($.getdata(`githubACheader${i}`)); 136 | githubACbodyArr.push($.getdata(`githubACbody${i}`)); 137 | HHAArr.push($.getdata(`HHA${i}`)); 138 | HHBArr.push($.getdata(`HHB${i}`)); 139 | MMAArr.push($.getdata(`MMA${i}`)); 140 | MMBArr.push($.getdata(`MMB${i}`)); 141 | MMCArr.push($.getdata(`MMC${i}`)); 142 | MMDArr.push($.getdata(`MMD${i}`)); 143 | MMEArr.push($.getdata(`MME${i}`)); 144 | MMFArr.push($.getdata(`MMF${i}`)); 145 | MMGArr.push($.getdata(`MMG${i}`)); 146 | MMHArr.push($.getdata(`MMH${i}`)); 147 | MMIArr.push($.getdata(`MMI${i}`)); 148 | MMJArr.push($.getdata(`MMJ${i}`)); 149 | MMKArr.push($.getdata(`MMK${i}`)); 150 | MMLArr.push($.getdata(`MML${i}`)); 151 | 152 | 153 | } 154 | } 155 | 156 | 157 | 158 | console.log( 159 | `============ 共${githubACurlArr.length}个${$.name}账号 =============\n` 160 | ); 161 | console.log( 162 | `============ 脚本执行-北京时间(UTC+8):${new Date( 163 | new Date().getTime() + 8 * 60 * 60 * 1000 164 | ).toLocaleString()} =============\n` 165 | ); 166 | 167 | 168 | 169 | 170 | if (ZR) 178 | $.msg($.name+R+'到'+(K-1)+'打印成功'+K+'到'+Z+'打印失败', '⚠️提示:请先获取'+K+'到'+Z+'的ck','并在boxjs里设置好账号数') 179 | 180 | if (K==R&&Z>R) 181 | $.msg($.name+K+'到'+Z+'打印失败', '⚠️提示:请先获取'+K+'到'+Z+'的ck','并在boxjs里设置好账号数') 182 | 183 | 184 | if (Z==R) 185 | $.msg($.name+K+'打印失败', '⚠️提示:请先获取'+K+'的ck','并在boxjs里设置好账号数') 186 | 187 | $.done(); 188 | } 189 | 190 | githubACnameVal = githubACnameArr[K-1]; 191 | githubACurlVal = githubACurlArr[K-1]; 192 | githubACheaderVal = githubACheaderArr[K-1]; 193 | githubACbodyVal = githubACbodyArr[K-1]; 194 | 195 | HHAVal = HHAArr[K-1]; 196 | HHBVal = HHBArr[K-1]; 197 | MMAVal = MMAArr[K-1]; 198 | MMBVal = MMBArr[K-1]; 199 | MMCVal = MMCArr[K-1]; 200 | MMDVal = MMDArr[K-1]; 201 | MMEVal = MMEArr[K-1]; 202 | MMFVal = MMFArr[K-1]; 203 | MMGVal = MMGArr[K-1]; 204 | MMHVal = MMHArr[K-1]; 205 | MMIVal = MMIArr[K-1]; 206 | MMJVal = MMJArr[K-1]; 207 | MMKVal = MMKArr[K-1]; 208 | MMLVal = MMLArr[K-1]; 209 | 210 | if(githubACname==1)console.log(githubACnameVal+GG) 211 | if(githubACurl==1)console.log(githubACurlVal+GG) 212 | if(githubACheader==1)console.log(githubACheaderVal+GG) 213 | if(githubACbody==1)console.log(githubACbodyVal+GG) 214 | 215 | if(HHA==1)console.log(HHAVal+GG) 216 | if(HHB==1)console.log(HHBVal+GG) 217 | if(MMA==1)console.log(MMAVal+GG) 218 | if(MMB==1)console.log(MMBVal+GG) 219 | if(MMC==1)console.log(MMCVal+GG) 220 | if(MMD==1)console.log(MMDVal+GG) 221 | if(MME==1)console.log(MMEVal+GG) 222 | if(MMF==1)console.log(MMFVal+GG) 223 | if(MMG==1)console.log(MMGVal+GG) 224 | if(MMH==1)console.log(MMHVal+GG) 225 | if(MMI==1)console.log(MMIVal+GG) 226 | if(MMJ==1)console.log(MMJVal+GG) 227 | if(MMK==1)console.log(MMKVal+GG) 228 | if(MML==1)console.log(MMLVal+GG) 229 | 230 | for (let i = 0; i < 1; i++) { 231 | (function (i) { 232 | setTimeout( 233 | function () { 234 | 235 | if (i == 0){ 236 | if ( K < Z ) { 237 | K += 1; 238 | all(); 239 | } else if (K == Z ) { 240 | let F=Z-R+1 241 | $.msg($.name+R+'到'+Z+',ck打印成功','✅已打印'+F+'个ck',) 242 | 243 | $.done(); 244 | 245 | 246 | } 247 | } 248 | }, 249 | 250 | (i + 1) * 10 251 | ); 252 | })(i); 253 | } 254 | } 255 | 256 | // prettier-ignore 257 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 258 | -------------------------------------------------------------------------------- /Task/iboxpay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/age174/JavaScript/058f182c19c3c1fb1c784ff5cd902eca8eae17b4/Task/iboxpay.png -------------------------------------------------------------------------------- /Task/iboxpayCOOKIE.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | //独立COOKIE文件 ck在``里面填写,多账号换行 4 | let iboxpayheaderVal= `` 5 | let refreshtokenVal= `` 6 | 7 | 8 | let iboxpaycookie = { 9 | iboxpayheaderVal: iboxpayheaderVal, 10 | refreshtokenVal: refreshtokenVal, 11 | 12 | } 13 | 14 | module.exports = iboxpaycookie 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Task/iboxpayck.js: -------------------------------------------------------------------------------- 1 | /* ziye 导出笑谱ck专用 务必下载或者复制到本地使用 2 | 3 | github地址 https://github.com/ziye12 4 | TG频道地址 https://t.me/ziyescript 5 | TG交流群 https://t.me/joinchat/AAAAAE7XHm-q1-7Np-tF3g 6 | boxjs链接 https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/ziye.boxjs.json 7 | 8 | 9 | 转载请备注个名字,谢谢 10 | 11 | 12 | 13 | */ 14 | 15 | //请先确定boxjs已经存在ck,想要导出哪个值,就设置为1 16 | 17 | //header 18 | const iboxpayheader = 1 19 | const refreshtoken = 1 20 | 21 | 22 | const GG=''//默认为换行,也可以将需要隔开的符号填写在''内 23 | 24 | 25 | let K = 1;//从哪个账号开始 26 | 27 | let Z = 1;//到哪个账号结束 28 | 29 | 30 | 31 | const $ = Env("笑谱"); 32 | $.idx = ($.idx = ($.getval('iboxpaySuffix') || '1') - 1) > 0 ? ($.idx + 1 + '') : ''; // 账号扩展字符 33 | const notify = $.isNode() ? require("./sendNotify") : ""; 34 | 35 | let R=K 36 | const iboxpayheaderArr = []; 37 | let iboxpayheaderVal = ""; 38 | 39 | const refreshtokenArr = []; 40 | let refreshtokenVal = ""; 41 | 42 | 43 | 44 | 45 | 46 | iboxpayheaderArr.push($.getdata("iboxpayheader")); 47 | refreshtokenArr.push($.getdata("refreshtoken")); 48 | // 根据boxjs中设置的额外账号数,添加存在的账号数据进行任务处理 49 | let iboxpayCount = ($.getval('iboxpayCount') || '1') - 0; 50 | for (let i = 2; i <= iboxpayCount; i++) { 51 | if ($.getdata(`iboxpayheader${i}`)) { 52 | iboxpayheaderArr.push($.getdata(`iboxpayheader${i}`)); 53 | refreshtokenArr.push($.getdata(`refreshtoken${i}`)); 54 | } 55 | } 56 | 57 | 58 | 59 | console.log( 60 | `============ 共${iboxpayheaderArr.length}个${$.name}账号 =============\n` 61 | ); 62 | console.log( 63 | `============ 脚本执行-北京时间(UTC+8):${new Date( 64 | new Date().getTime() + 8 * 60 * 60 * 1000 65 | ).toLocaleString()} =============\n` 66 | ); 67 | 68 | 69 | 70 | 71 | if (ZR) 79 | $.msg($.name+R+'到'+(K-1)+'打印成功'+K+'到'+Z+'打印失败', '⚠️提示:请先获取'+K+'到'+Z+'的ck','并在boxjs里设置好账号数') 80 | 81 | if (K==R&&Z>R) 82 | $.msg($.name+K+'到'+Z+'打印失败', '⚠️提示:请先获取'+K+'到'+Z+'的ck','并在boxjs里设置好账号数') 83 | 84 | 85 | if (Z==R) 86 | $.msg($.name+K+'打印失败', '⚠️提示:请先获取'+K+'的ck','并在boxjs里设置好账号数') 87 | 88 | $.done(); 89 | } 90 | 91 | 92 | iboxpayheaderVal = iboxpayheaderArr[K-1]; 93 | refreshtokenVal = refreshtokenArr[K-1]; 94 | if(iboxpayheader==1)console.log(iboxpayheaderVal+GG) 95 | if(refreshtoken==1)console.log(refreshtokenVal+GG) 96 | 97 | 98 | for (let i = 0; i < 1; i++) { 99 | (function (i) { 100 | setTimeout( 101 | function () { 102 | 103 | if (i == 0){ 104 | if ( K < Z ) { 105 | K += 1; 106 | all(); 107 | } else if (K == Z ) { 108 | let F=Z-R+1 109 | $.msg($.name+R+'到'+Z+',ck打印成功','✅已打印'+F+'个ck',) 110 | 111 | $.done(); 112 | 113 | 114 | } 115 | } 116 | }, 117 | 118 | (i + 1) * 10 119 | ); 120 | })(i); 121 | } 122 | } 123 | 124 | // prettier-ignore 125 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 126 | -------------------------------------------------------------------------------- /Task/sendNotify.js: -------------------------------------------------------------------------------- 1 | const $ = new Env(); 2 | // =======================================微信server酱通知设置区域=========================================== 3 | //此处填你申请的SCKEY. 4 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入PUSH_KEY) 5 | let SCKEY = ''; 6 | 7 | // =======================================Bark App通知设置区域=========================================== 8 | //此处填你BarkAPP的信息(IP/设备码,例如:https://api.day.app/XXXXXXXX) 9 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入BARK_PUSH) 10 | let BARK_PUSH = ''; 11 | //BARK app推送铃声,铃声列表去APP查看复制填写 12 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入BARK_SOUND , Value输入app提供的铃声名称,例如:birdsong) 13 | let BARK_SOUND = ''; 14 | 15 | 16 | // =======================================telegram机器人通知设置区域=========================================== 17 | //此处填你telegram bot 的Token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw 18 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入TG_BOT_TOKEN) 19 | let TG_BOT_TOKEN = ''; 20 | //此处填你接收通知消息的telegram用户的id,例如:129xxx206 21 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入TG_USER_ID) 22 | let TG_USER_ID = ''; 23 | 24 | // =======================================钉钉机器人通知设置区域=========================================== 25 | //此处填你钉钉 bot 的webhook,例如:5a544165465465645d0f31dca676e7bd07415asdasd 26 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入DD_BOT_TOKEN) 27 | let DD_BOT_TOKEN = ''; 28 | //密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 29 | let DD_BOT_SECRET = ''; 30 | 31 | if (process.env.PUSH_KEY) { 32 | SCKEY = process.env.PUSH_KEY; 33 | } 34 | if (process.env.BARK_PUSH) { 35 | if(process.env.BARK_PUSH.indexOf('https') > -1 || process.env.BARK_PUSH.indexOf('http') > -1) { 36 | //兼容BARK自建用户 37 | BARK_PUSH = process.env.BARK_PUSH 38 | } else { 39 | BARK_PUSH = `https://api.day.app/${process.env.BARK_PUSH}` 40 | } 41 | if (process.env.BARK_SOUND) { 42 | BARK_SOUND = process.env.BARK_SOUND 43 | } 44 | } else { 45 | if(BARK_PUSH && BARK_PUSH.indexOf('https') === -1 && BARK_PUSH.indexOf('http') === -1) { 46 | //兼容BARK本地用户只填写设备码的情况 47 | BARK_PUSH = `https://api.day.app/${BARK_PUSH}` 48 | } 49 | } 50 | if (process.env.TG_BOT_TOKEN) { 51 | TG_BOT_TOKEN = process.env.TG_BOT_TOKEN; 52 | } 53 | if (process.env.TG_USER_ID) { 54 | TG_USER_ID = process.env.TG_USER_ID; 55 | } 56 | 57 | if (process.env.DD_BOT_TOKEN) { 58 | DD_BOT_TOKEN = process.env.DD_BOT_TOKEN; 59 | if (process.env.DD_BOT_SECRET) { 60 | DD_BOT_SECRET = process.env.DD_BOT_SECRET; 61 | } 62 | } 63 | 64 | async function sendNotify(text, desp) { 65 | //提供四种通知 66 | await serverNotify(text, desp); 67 | await BarkNotify(text, desp); 68 | await tgBotNotify(text, desp); 69 | await ddBotNotify(text, desp); 70 | } 71 | 72 | function serverNotify(text, desp) { 73 | return new Promise(resolve => { 74 | if (SCKEY) { 75 | //微信server酱推送通知一个\n不会换行,需要两个\n才能换行,故做此替换 76 | desp = desp.replace(/[\n\r]/g, '\n\n'); 77 | const options = { 78 | url: `https://sc.ftqq.com/${SCKEY}.send`, 79 | body: `text=${text}&desp=${desp}`, 80 | headers: { 81 | 'Content-Type': 'application/x-www-form-urlencoded' 82 | } 83 | } 84 | $.post(options, (err, resp, data) => { 85 | try { 86 | if (err) { 87 | console.log('\n发送通知调用API失败!!\n') 88 | console.log(err); 89 | } else { 90 | data = JSON.parse(data); 91 | if (data.errno === 0) { 92 | console.log('\nserver酱发送通知消息成功\n') 93 | } else if (data.errno === 1024) { 94 | console.log('\nPUSH_KEY 错误\n') 95 | } 96 | } 97 | } catch (e) { 98 | $.logErr(e, resp); 99 | } finally { 100 | resolve(data); 101 | } 102 | }) 103 | } else { 104 | console.log('\n您未提供server酱的SCKEY,取消微信推送消息通知\n'); 105 | resolve() 106 | } 107 | }) 108 | } 109 | 110 | function BarkNotify(text, desp) { 111 | return new Promise(resolve => { 112 | if (BARK_PUSH) { 113 | const options = { 114 | url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}`, 115 | } 116 | $.get(options, (err, resp, data) => { 117 | try { 118 | if (err) { 119 | console.log('\nBark APP发送通知调用API失败!!\n') 120 | console.log(err); 121 | } else { 122 | data = JSON.parse(data); 123 | if (data.code === 200) { 124 | console.log('\nBark APP发送通知消息成功\n') 125 | } else { 126 | console.log(`\n${data.message}\n`); 127 | } 128 | } 129 | } catch (e) { 130 | $.logErr(e, resp); 131 | } finally { 132 | resolve(); 133 | } 134 | }) 135 | } else { 136 | console.log('\n您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知\n'); 137 | resolve() 138 | } 139 | }) 140 | } 141 | 142 | function tgBotNotify(text, desp) { 143 | return new Promise(resolve => { 144 | if (TG_BOT_TOKEN && TG_USER_ID) { 145 | const options = { 146 | url: `https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage`, 147 | body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}`, 148 | headers: { 149 | 'Content-Type': 'application/x-www-form-urlencoded' 150 | } 151 | } 152 | $.post(options, (err, resp, data) => { 153 | try { 154 | if (err) { 155 | console.log('\ntelegram发送通知消息失败!!\n') 156 | console.log(err); 157 | } else { 158 | data = JSON.parse(data); 159 | if (data.ok) { 160 | console.log('\nTelegram发送通知消息完成。\n') 161 | } else if (data.error_code === 400) { 162 | console.log('\n请主动给bot发送一条消息并检查接收用户ID是否正确。\n') 163 | } else if (data.error_code === 401){ 164 | console.log('\nTelegram bot token 填写错误。\n') 165 | } 166 | } 167 | } catch (e) { 168 | $.logErr(e, resp); 169 | } finally { 170 | resolve(data); 171 | } 172 | }) 173 | } else { 174 | console.log('\n您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知\n'); 175 | resolve() 176 | } 177 | }) 178 | } 179 | function ddBotNotify(text, desp) { 180 | return new Promise(resolve => { 181 | const options = { 182 | url: `https://oapi.dingtalk.com/robot/send?access_token=${DD_BOT_TOKEN}`, 183 | json: { 184 | "msgtype": "text", 185 | "text": { 186 | "content": ` ${text}\n\n${desp}` 187 | } 188 | }, 189 | headers: { 190 | 'Content-Type': 'application/json' 191 | } 192 | } 193 | if (DD_BOT_TOKEN && DD_BOT_SECRET) { 194 | const crypto = require('crypto'); 195 | const dateNow = Date.now(); 196 | const hmac = crypto.createHmac('sha256', DD_BOT_SECRET); 197 | hmac.update(`${dateNow}\n${DD_BOT_SECRET}`); 198 | const result = encodeURIComponent(hmac.digest('base64')); 199 | options.url = `${options.url}×tamp=${dateNow}&sign=${result}`; 200 | $.post(options, (err, resp, data) => { 201 | try { 202 | if (err) { 203 | console.log('\n钉钉发送通知消息失败!!\n') 204 | console.log(err); 205 | } else { 206 | data = JSON.parse(data); 207 | if (data.errcode === 0) { 208 | console.log('\n钉钉发送通知消息完成。\n') 209 | } else { 210 | console.log(`\n${data.errmsg}\n`) 211 | } 212 | } 213 | } catch (e) { 214 | $.logErr(e, resp); 215 | } finally { 216 | resolve(data); 217 | } 218 | }) 219 | } else if (DD_BOT_TOKEN) { 220 | $.post(options, (err, resp, data) => { 221 | try { 222 | if (err) { 223 | console.log('\n钉钉发送通知消息失败!!\n') 224 | console.log(err); 225 | } else { 226 | data = JSON.parse(data); 227 | if (data.errcode === 0) { 228 | console.log('\n钉钉发送通知消息完成。\n') 229 | } else { 230 | console.log(`\n${data.errmsg}\n`) 231 | } 232 | } 233 | } catch (e) { 234 | $.logErr(e, resp); 235 | } finally { 236 | resolve(data); 237 | } 238 | }) 239 | } else { 240 | console.log('\n您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n'); 241 | resolve() 242 | } 243 | }) 244 | } 245 | module.exports = { 246 | sendNotify, 247 | BarkNotify, 248 | SCKEY, 249 | BARK_PUSH, 250 | TG_BOT_TOKEN, 251 | TG_USER_ID, 252 | DD_BOT_TOKEN, 253 | }//这里导出SCKEY,BARK_PUSH等通知参数是jd_bean_sign.js处需要 254 | // prettier-ignore 255 | function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;$.isMute||(this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o))),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} -------------------------------------------------------------------------------- /Task/ttwkziye.js: -------------------------------------------------------------------------------- 1 | /*ZIYE 感谢 Sunert 大佬的原js 天天挖矿 2 | 3 | 4 | js制作时间:2020-10-20 5 | 6 | https://raw.githubusercontent.com/ziye12/JavaScript/master/ttwkziye.js 7 | 8 | 本脚本仅适用支付宝小程序天天挖矿,支持Actions多账号运行 9 | 获取Cookie方法: 10 | 1.将下方[rewrite_local]和[MITM]地址复制的相应的区域下 11 | 2.打开小程序,获取收益cookie,点击挖矿获取签到Cookie,获取后请注释或禁用Cookie 12 | 3.挖矿获取Cookie,已经挖矿无法获取 13 | 14 | 15 | QX 1.0.6+ : 16 | [task_local] 17 | #支付宝天天挖矿 18 | 0 9 * * * https://raw.githubusercontent.com/ziye12/JavaScript/master/ttwkziye.js 19 | [rewrite_local] 20 | https:\/\/operation-api\.jimistore\.com\/* url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/ttwkziye.js 21 | 22 | ~~~~~~~~~~~~~~~~ 23 | 24 | Loon 2.1.0+ 25 | [Script] 26 | #支付宝天天挖矿 27 | cron "04 00 * * *" script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/ttwkziye.js, enabled=true, tag=支付宝天天挖矿 28 | http-request https:\/\/operation-api\.jimistore\.com\/* script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/ttwkziye.js 29 | 30 | 31 | 32 | 33 | ~~~~~~~~~~~~~~~~ 34 | Surge 4.0 : 35 | [Script] 36 | 支付宝天天挖矿 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/ttwkziye.js,script-update-interval=0 37 | 38 | 支付宝天天挖矿 = type=http-request,pattern=https:\/\/operation-api\.jimistore\.com\/*,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/ttwkziye.js 39 | 40 | 41 | 42 | [MITM] 43 | hostname = operation-api.jimistore.com 44 | ~~~~~~~~~~~~~~~~ 45 | */ 46 | 47 | const $ = new Env('支付宝天天挖矿')//js名字 支付宝天天挖矿 48 | 49 | 50 | const notify = $.isNode() ? require('./sendNotify') : ''; 51 | let bodyArr = [],headerArr = [];//定义Secret设置 合集 52 | 53 | if (isGetCookie = typeof $request !==`undefined`) { 54 | GetCookie(); 55 | $.done() //cookie获取判定 56 | } 57 | //Secret合集循环方式判定,其中 ZFBWK_BODY ZFBWK_HEADER 为git仓库中的Secret合集等同于手机js的ck 58 | if ($.isNode()) { 59 | if (process.env.ZFBWK_BODY && process.env.ZFBWK_BODY.indexOf('#') > -1) { 60 | wkbody = process.env.ZFBWK_BODY.split('#'); 61 | console.log(`您选择的是用"#"隔开\n`) 62 | } 63 | else if (process.env.ZFBWK_BODY && process.env.ZFBWK_BODY.indexOf('\n') > -1) { 64 | wkbody = process.env.ZFBWK_BODY.split('\n'); 65 | console.log(`您选择的是用换行隔开\n`) 66 | } else { 67 | wkbody = process.env.ZFBWK_BODY.split() 68 | }; 69 | //判定读取Secret合集,赋值于bodyArr与headerArr 70 | if (process.env.ZFBWK_HEADER && process.env.ZFBWK_HEADER.indexOf('#') > -1) { 71 | wkheader = process.env.ZFBWK_HEADER.split('#'); 72 | } 73 | else if (process.env.ZFBWK_HEADER && process.env.ZFBWK_HEADER.split('\n').length > 0) { 74 | wkheader = process.env.ZFBWK_HEADER.split('\n'); 75 | } else { 76 | wkheader = process.env.ZFBWK_HEADER.split() 77 | }; 78 | Object.keys(wkbody).forEach((item) => { 79 | if (wkbody[item]) { 80 | bodyArr.push(wkbody[item]) 81 | } 82 | }); 83 | Object.keys(wkheader).forEach((item) => { 84 | if (wkheader[item]) { 85 | headerArr.push(wkheader[item]) 86 | } 87 | }); 88 | console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) 89 | console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) 90 | } else { 91 | bodyArr.push($.getdata('sy_body_wk'))//判定读取ck 92 | headerArr.push($.getdata('sy_header_wk'))//判定读取ck 93 | } 94 | //异步运行 95 | !(async () => { 96 | if (!bodyArr[0]) { 97 | $.msg($.name, '【提示】请先获取支付宝天天挖矿一cookie') 98 | return; 99 | } 100 | console.log(`------------- 共${bodyArr.length}个账号\n`) 101 | for (let i = 0; i < bodyArr.length; i++) { 102 | if (bodyArr[i]) { 103 | bodyVal = bodyArr[i]; 104 | headerVal = headerArr[i]; 105 | $.index = i + 1; 106 | console.log(`\n开始【天天挖矿${$.index}】`) 107 | await getsign(); 108 | if (headerVal !== undefined){ 109 | await getsy(); 110 | } else { 111 | wksy = `【天天挖矿】❌ 未获取Cooiekie` 112 | }; 113 | $.msg($.name, wksign,wksy)//手机js通知项 wksign headerbag docard 114 | if ($.isNode()) { 115 | await notify.sendNotify($.name+ wksign,wksy)//git通知项 wksign headerbag docard 116 | } 117 | } 118 | } 119 | })() 120 | .catch((e) => $.logErr(e)) 121 | .finally(() => $.done()) 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | // Cookie获取 131 | function GetCookie() { 132 | if ($request && $request.method != 'OPTIONS' && $request.url.match(/createSign/)) { 133 | const signurlVal = $request.url 134 | const bodyVal = $request.body 135 | const headerVal = JSON.stringify($request.headers) 136 | 137 | //const signheaderVal = JSON.stringify($request.headers) 138 | $.log(`bodyVal:${bodyVal}`) 139 | if (bodyVal) $.setdata(bodyVal, 'sy_body_wk') 140 | if (headerVal) $.setdata(headerVal, 'sy_header_wk') 141 | $.msg($.name, `获取天天挖矿Cookie: 成功`, ``) 142 | 143 | 144 | 145 | } 146 | } 147 | 148 | 149 | 150 | //天天挖矿 151 | function getsign() { 152 | return new Promise((resolve, reject) =>{ 153 | let signurl = { 154 | url: `https://operation-api.jimistore.com/api/mining/v1/sign/createSign`, 155 | headers: JSON.parse(headerVal),body: bodyVal 156 | } 157 | $.post(signurl, async(error, response, data) => { 158 | let result = JSON.parse(data) 159 | if (result.data.success == 'true'){ 160 | wksign = '【天天挖矿】✅ 挖矿成功, 收益:'+result.amount/100+'元💰\n' 161 | } 162 | else if (result.data.success == 'false'){ 163 | wksign = `【天天挖矿】 重复挖矿\n` 164 | } 165 | else if (result.code == 40101){ 166 | wksign = `【天天挖矿】 挖矿失败, 原因:${result.message}\n` 167 | } 168 | else { 169 | wksign = `【天天挖矿】 挖矿失败, 原因:`+result.errmsg 170 | $.msg($.name, wksign, ``) 171 | if ($.isNode()) { 172 | await notify.sendNotify($.name, wksign) 173 | }//git通知项 174 | return 175 | } 176 | resolve() 177 | }) 178 | }) 179 | } 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | //天天挖矿收益 188 | function getsy() { 189 | return new Promise((resolve, reject) =>{ 190 | let syurl = { 191 | url: `https://operation-api.jimistore.com/api/mining/v1/sign/showSignInfo`, 192 | headers: JSON.parse(headerVal) 193 | } 194 | $.post(syurl, async(error, response, data) => { 195 | let result = JSON.parse(data) 196 | if (result.code == 200){ 197 | wksy = '【挖矿收益】账户总收益:'+result.data.cumulativeMoney/100+`元💰\n【挖矿记录】连续挖矿${result.data.numberInRounds}天,总计挖矿${result.data.cumulativeSignCount}天\n` 198 | } 199 | 200 | else if (result.code == 40101){ 201 | wksy = `【挖矿收益】 挖矿失败, 原因:${result.message}\n` 202 | } 203 | 204 | else { 205 | wksy = `【挖矿收益】 挖矿失败, 原因:`+result.errmsg 206 | $.msg($.name, wksy, ``) 207 | if ($.isNode()) { 208 | await notify.sendNotify($.name, wksy) 209 | }//git通知项 210 | return 211 | } 212 | resolve() 213 | }) 214 | }) 215 | } 216 | 217 | 218 | 219 | 220 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 221 | -------------------------------------------------------------------------------- /Task/xiaole.js: -------------------------------------------------------------------------------- 1 | /* ziye 2 | 3 | github地址 https://github.com/ziye12 4 | TG频道地址 https://t.me/ziyescript 5 | TG交流群 https://t.me/joinchat/AAAAAE7XHm-q1-7Np-tF3g 6 | boxjs链接 https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/ziye.boxjs.json 7 | 8 | 转载请备注个名字,谢谢 9 | 10 | 11 | 1.18 修复兑换错误 12 | 1.20 调整为打卡满10次且大于等于0.3进行兑换 13 | 1.25 调整签到时间为12到13点之间 14 | 1.26 调整外部推送 15 | 16 | ⚠️小乐 17 | 可以签到 10次 共0.3 18 | 打卡 符合规则可以打卡 19 | 20 | 21 | 一共1个位置 1个ck 2条 Secrets 22 | 多账号换行 23 | 24 | 25 | 第一步 微信扫码 https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/xiaole.png 获取授权 26 | 27 | 第二步 28 | 开代理软件,添加主机名 重写 ,然后点 我的 获取url header 29 | 30 | 31 | 变量对应关系👇 32 | xiaoleurlVal 👉 XL_URL 33 | xiaoleheaderVal 👉 XL_HEADER 34 | 35 | 36 | 37 | ⚠️主机名以及重写👇 38 | 39 | hostname=minapp.xqrobot.net, 40 | 41 | ############## 圈x 42 | #小乐获取ck 43 | https:\/\/minapp\.xqrobot\.net\/* url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/xiaole.js 44 | 45 | ############## loon 46 | 47 | #小乐获取ck 48 | http-request https:\/\/minapp\.xqrobot\.net\/* script-path=https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/xiaole.js, requires-header=true, tag=小乐获取ck 49 | 50 | ############## surge 51 | 52 | #小乐获取ck 53 | 小乐获取ck = type=http-request,pattern=https:\/\/minapp\.xqrobot\.net\/*,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/xiaole.js, 54 | 55 | 56 | 57 | 58 | */ 59 | 60 | 61 | const $ = Env("小乐"); 62 | $.idx = ($.idx = ($.getval('xlSuffix') || '1') - 1) > 0 ? ($.idx + 1 + '') : ''; // 账号扩展字符 63 | const notify = $.isNode() ? require("./sendNotify") : ``; 64 | const COOKIE = $.isNode() ? require("./xiaoleCOOKIE") : ``; 65 | const logs = 0; // 0为关闭日志,1为开启 66 | const notifyttt = 1// 0为关闭外部推送,1为12 23 点外部推送 67 | const notifyInterval = 2;// 0为关闭通知,1为所有通知,2为12 23 点通知 , 3为 6 12 18 23 点通知 68 | 69 | let money; 70 | $.message = '',$.messagesss = '', $.index = '', $.clocklog = '', COOKIES_SPLIT = ''; 71 | 72 | const xiaoleurlArr = []; 73 | let xiaoleurlVal = ``; 74 | const xiaoleheaderArr = []; 75 | let xiaoleheaderVal = ``; 76 | let middlexiaoleURL = []; 77 | let middlexiaoleHEADER = []; 78 | 79 | 80 | 81 | //时间 82 | const nowTimes = new Date( 83 | new Date().getTime() + 84 | new Date().getTimezoneOffset() * 60 * 1000 + 85 | 8 * 60 * 60 * 1000 86 | ); 87 | 88 | ts = Math.round((new Date().getTime() + 89 | new Date().getTimezoneOffset() * 60 * 1000 + 90 | 8 * 60 * 60 * 1000)/1000).toString(); 91 | tts = Math.round(new Date().getTime() + 92 | new Date().getTimezoneOffset() * 60 * 1000 + 93 | 8 * 60 * 60 * 1000).toString(); 94 | if ($.isNode() && process.env.XL_URL) { 95 | COOKIES_SPLIT = process.env.COOKIES_SPLIT || "\n"; 96 | console.log( 97 | `============ cookies分隔符为:${JSON.stringify( 98 | COOKIES_SPLIT 99 | )} =============\n` 100 | ); 101 | if ( 102 | process.env.XL_URL && 103 | process.env.XL_URL.indexOf(COOKIES_SPLIT) > -1 104 | ) { 105 | middlexiaoleURL = process.env.XL_URL.split(COOKIES_SPLIT); 106 | } else { 107 | middlexiaoleURL = process.env.XL_URL.split(); 108 | } 109 | if ( 110 | process.env.XL_HEADER && 111 | process.env.XL_HEADER.indexOf(COOKIES_SPLIT) > -1 112 | ) { 113 | middlexiaoleHEADER = process.env.XL_HEADER.split(COOKIES_SPLIT); 114 | } else { 115 | middlexiaoleHEADER = process.env.XL_HEADER.split(); 116 | } 117 | } 118 | if (COOKIE.xiaoleurlVal) { 119 | XL_COOKIES = { 120 | "xiaoleurlVal": COOKIE.xiaoleurlVal.split('\n'), 121 | "xiaoleheaderVal": COOKIE.xiaoleheaderVal.split('\n'), 122 | } 123 | Length = XL_COOKIES.xiaoleurlVal.length; 124 | } 125 | if (!COOKIE.xiaoleurlVal) { 126 | if ($.isNode()) { 127 | Object.keys(middlexiaoleURL).forEach((item) => { 128 | if (middlexiaoleURL[item]) { 129 | xiaoleurlArr.push(middlexiaoleURL[item]); 130 | } 131 | }); 132 | Object.keys(middlexiaoleHEADER).forEach((item) => { 133 | if (middlexiaoleHEADER[item]) { 134 | xiaoleheaderArr.push(middlexiaoleHEADER[item]); 135 | } 136 | }); 137 | } else { 138 | xiaoleurlArr.push($.getdata("xiaoleurl")); 139 | xiaoleheaderArr.push($.getdata("xiaolehd")); 140 | // 根据boxjs中设置的额外账号数,添加存在的账号数据进行任务处理 141 | let xlCount = ($.getval('xlCount') || '1') - 0; 142 | for (let i = 2; i <= xlCount; i++) { 143 | if ($.getdata(`xiaoleurl${i}`)) { 144 | xiaoleurlArr.push($.getdata(`xiaoleurl${i}`)); 145 | xiaoleheaderArr.push($.getdata(`xiaolehd${i}`)); 146 | } 147 | } 148 | } 149 | Length = xiaoleurlArr.length 150 | } 151 | function GetCookie() { 152 | //签到 153 | if ($request && $request.url.indexOf("/user.php?mod=index&") >= 0) { 154 | const xiaoleurlVal = $request.url; 155 | if (xiaoleurlVal) $.setdata(xiaoleurlVal, "xiaoleurl" + $.idx); 156 | $.log( 157 | `[${$.name + $.idx}] 获取url✅: 成功,xiaoleurlVal: ${xiaoleurlVal}` 158 | ); 159 | $.msg($.name + $.idx, `获取url: 成功🎉`, ``); 160 | const xiaoleheaderVal = JSON.stringify($request.headers); 161 | if (xiaoleheaderVal) $.setdata(xiaoleheaderVal, "xiaolehd" + $.idx); 162 | $.log( 163 | `[${$.name + $.idx}] 获取header✅: 成功,xiaoleheaderVal: ${xiaoleheaderVal}` 164 | ); 165 | $.msg($.name + $.idx, `获取header: 成功🎉`, ``); 166 | } 167 | } 168 | console.log( 169 | `================== 脚本执行 - 北京时间(UTC+8):${new Date( 170 | new Date().getTime() + 171 | new Date().getTimezoneOffset() * 60 * 1000 + 172 | 8 * 60 * 60 * 1000 173 | ).toLocaleString()} =====================\n` 174 | ); 175 | console.log( 176 | `============ 共 ${Length} 个${$.name}账号=============\n` 177 | ); 178 | let isGetCookie = typeof $request !== 'undefined' 179 | if (isGetCookie) { 180 | GetCookie() 181 | $.done(); 182 | 183 | } else { 184 | !(async () => { 185 | await all(); 186 | await msgShow(); 187 | })() 188 | .catch((e) => { 189 | $.log('', `❌ ${O}, 失败! 原因: ${e}!`, '') 190 | }) 191 | .finally(() => { 192 | $.done(); 193 | }) 194 | } 195 | async function all() { 196 | if (!Length) { 197 | $.msg( 198 | $.name, 199 | '提示:⚠️请点击前往获取cookie\n', 200 | 'https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/xiaole.png', 201 | {"open-url": "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/xiaole.png"} 202 | ); 203 | return; 204 | } 205 | for (let i = 0; i < Length; i++) { 206 | if (COOKIE.xiaoleurlVal) { 207 | xiaoleurlVal = XL_COOKIES.xiaoleurlVal[i]; 208 | xiaoleheaderVal = XL_COOKIES.xiaoleheaderVal[i]; 209 | } 210 | if (!COOKIE.xiaoleurlVal) { 211 | xiaoleurlVal = xiaoleurlArr[i]; 212 | xiaoleheaderVal = xiaoleheaderArr[i]; 213 | } 214 | //随机时间 215 | do out = Math.floor(Math.random()*30); 216 | while( out < 15 ) 217 | O = (`${$.name + (i + 1)}🔔`); 218 | await console.log(`-------------------------\n\n🔔开始运行【${$.name+(i+1)}】`) 219 | await coin();//账户信息 220 | if (nowTimes.getHours() >= 12 &&nowTimes.getHours() <= 13 &&$.coin.info&&$.coin.info.task_list[0].state==0){ 221 | await Sign();//签到 222 | } 223 | 224 | await integral();//兑换信息 225 | await clocklog();//打卡记录 226 | if(nowTimes.getHours() >= 8 &&$.clocklog.info&&!$.clocklog.info.log.length){ 227 | await clock() 228 | };//首次打卡 229 | if(nowTimes.getHours() >= 8 &&$.clocklog.info.log.length&&$.clocklog.info.log.length<=9){ 230 | console.log('随机延迟'+out+'秒') 231 | await clock();//打卡 232 | } 233 | 234 | await index();//打卡信息 235 | if (nowTimes.getHours() >= 8 &&$.integral.info &&$.clocklog.info.log.length==10 && money >=0.3){ 236 | await exchange();//兑换 237 | } 238 | } 239 | } 240 | //通知 241 | function msgShow() { 242 | return new Promise(async resolve => { 243 | if (notifyInterval != 1) { 244 | console.log($.name + '\n' + $.message); 245 | } 246 | if (notifyInterval == 1) { 247 | $.msg($.name, ``, $.message); 248 | } 249 | if (notifyInterval == 2 && (nowTimes.getHours() === 12 || nowTimes.getHours() === 23) && (nowTimes.getMinutes() >= 0 && nowTimes.getMinutes() <= 10)) { 250 | $.msg($.name, ``, $.message); 251 | } 252 | if (notifyInterval == 3 && (nowTimes.getHours() === 6 || nowTimes.getHours() === 12 || nowTimes.getHours() === 18 || nowTimes.getHours() === 23) && (nowTimes.getMinutes() >= 0 && nowTimes.getMinutes() <= 10)) { 253 | $.msg($.name, ``, $.message); 254 | } 255 | if (notifyttt == 1 && $.isNode() && (nowTimes.getHours() === 12 || nowTimes.getHours() === 23) && (nowTimes.getMinutes() >= 0 && nowTimes.getMinutes() <= 59)) 256 | await notify.sendNotify($.name, $.messagesss); 257 | resolve() 258 | }) 259 | } 260 | //账户信息 261 | function coin(timeout = 0) { 262 | return new Promise((resolve) => { 263 | setTimeout( ()=>{ 264 | let url = { 265 | url: xiaoleurlVal, 266 | headers: JSON.parse(xiaoleheaderVal), 267 | } 268 | $.post(url, async(err, resp, data) => { 269 | try { 270 | if (logs) $.log(`${O}, 账户信息🚩: ${data}`); 271 | $.coin = JSON.parse(data); 272 | $.message +=`\n${O}`; 273 | $.message += `\n========== 【${$.coin.info.user_name}】 ==========\n`+ 274 | '【现金余额】:'+$.coin.info.user_money+'元'+'\n'+ 275 | '【今日收益】:'+$.coin.info.jiang_day1+'元'+'\n'+ 276 | '【本月收益】:'+$.coin.info.jiang_month1+'元'+'\n'+ 277 | '【签到信息】:'+$.coin.info.task_list[0].name+'\n'+ 278 | '【签到奖励】:'+$.coin.info.task_list[0].money+'\n'+ 279 | '【签到收益】:'+$.coin.info.task_list[0].desc+'\n'+ 280 | '【签到任务】:'+$.coin.info.task_list[0].btn+'\n'+ 281 | '【邀请信息】:'+$.coin.info.task_list[1].name+'\n'+ 282 | '【邀请奖励】:'+$.coin.info.task_list[1].money+'\n'+ 283 | '【邀请收益】:'+$.coin.info.task_list[1].desc+'\n' 284 | 285 | $.messagesss += `\n========== 【${$.coin.info.user_name}】 ==========\n`+ 286 | '【现金余额】:'+$.coin.info.user_money+'元'+'\n'+ 287 | '【签到任务】:'+$.coin.info.task_list[0].btn+'\n' 288 | 289 | } catch (e) { 290 | $.logErr(e, resp); 291 | } finally { 292 | resolve() 293 | } 294 | }) 295 | },timeout) 296 | }) 297 | } 298 | //签到 299 | function Sign(timeout = 0) { 300 | return new Promise((resolve) => { 301 | setTimeout( ()=>{ 302 | let body= `pesubmit=`; 303 | xiaolesignheader=xiaoleheaderVal.replace(/json/g, `x-www-form-urlencoded`); 304 | let url = { 305 | url: xiaoleurlVal.replace(/mod=index/g, `mod=sign`), 306 | headers: JSON.parse(xiaolesignheader), 307 | body: body, 308 | } 309 | $.post(url, async(err, resp, data) => { 310 | try { 311 | if (logs) $.log(`${O}, 签到🚩: ${data}`); 312 | $.Sign = JSON.parse(data); 313 | if ($.Sign.result==true) 314 | { 315 | $.message +='【签到成功】:'+$.Sign.show+'\n' 316 | $.messagesss +='【签到成功】:'+$.Sign.show+'\n' 317 | } 318 | if ($.Sign.result==false) 319 | { 320 | $.message +='【签到失败】:'+$.Sign.show+'\n' 321 | } 322 | } catch (e) { 323 | $.logErr(e, resp); 324 | } finally { 325 | resolve() 326 | } 327 | }) 328 | },timeout) 329 | }) 330 | } 331 | 332 | //兑换信息 333 | function integral(timeout = 0) { 334 | return new Promise((resolve) => { 335 | setTimeout( ()=>{ 336 | let url = { 337 | url: xiaoleurlVal.replace(`user.php?mod=index`, `daka.php?mod=my&act=integral`), 338 | headers: JSON.parse(xiaoleheaderVal), 339 | } 340 | $.get(url, async(err, resp, data) => { 341 | try { 342 | if (logs) $.log(`${O}, 兑换中心🚩: ${data}`); 343 | $.integral = JSON.parse(data); 344 | if ($.integral.result == true ){ 345 | $.mibi = $.integral.info.mibi 346 | $.money = $.integral.info.config.currency_money 347 | money=$.mibi*$.money 348 | 349 | $.message += 350 | '【米币价值】:'+$.money+'元'+'\n'+ 351 | '【米币余额】:'+($.mibi*$.money).toFixed(2)+'元'+'\n' 352 | } 353 | } catch (e) { 354 | $.logErr(e, resp); 355 | } finally { 356 | resolve() 357 | } 358 | }) 359 | },timeout) 360 | }) 361 | } 362 | 363 | //打卡记录 364 | function clocklog(timeout = 0) { 365 | return new Promise((resolve) => { 366 | setTimeout( ()=>{ 367 | let url = { 368 | url: xiaoleurlVal.replace(`user.php?mod=index`, `daka.php?mod=clock&act=log&level=1&p=1&today=1`), 369 | headers: JSON.parse(xiaoleheaderVal), 370 | } 371 | $.get(url, async(err, resp, data) => { 372 | try { 373 | if (logs) $.log(`${O}, 签到🚩: ${data}`); 374 | $.clocklog = JSON.parse(data); 375 | if ($.clocklog.result==true&& $.clocklog.info.log.length) 376 | { 377 | let v=$.clocklog.info.log.length-1 378 | let dktime = $.clocklog.info.log[v].created 379 | $.message +='【上次打卡】:'+dktime+'\n'; 380 | } 381 | } catch (e) { 382 | $.logErr(e, resp); 383 | } finally { 384 | resolve() 385 | } 386 | }) 387 | },timeout) 388 | }) 389 | } 390 | 391 | //打卡 392 | function clock(timeout = out*1000) { 393 | return new Promise((resolve) => { 394 | setTimeout( ()=>{ 395 | let url = { 396 | url: xiaoleurlVal.replace(`user.php?mod=index`, `daka.php?mod=clock&act=sign`), 397 | headers: JSON.parse(xiaoleheaderVal), 398 | } 399 | $.get(url, async(err, resp, data) => { 400 | try { 401 | if (logs) $.log(`${O}, 打卡🚩: ${data}`); 402 | $.message +='【打卡成功】:打卡次数+1\n' 403 | } catch (e) { 404 | $.logErr(e, resp); 405 | } finally { 406 | resolve() 407 | } 408 | }) 409 | },timeout) 410 | }) 411 | } 412 | 413 | //打卡信息 414 | function index(timeout = 0) { 415 | return new Promise((resolve) => { 416 | setTimeout( ()=>{ 417 | let url = { 418 | url: xiaoleurlVal.replace(`user.php?mod=index`, `daka.php?mod=index&act=today`), 419 | headers: JSON.parse(xiaoleheaderVal), 420 | } 421 | $.get(url, async(err, resp, data) => { 422 | try { 423 | if (logs) $.log(`${O}, 打卡信息🚩: ${data}`); 424 | $.index = JSON.parse(data); 425 | $.jrdk=$.index.info.today.clock 426 | $.jrcurrency=$.index.info.today.currency 427 | $.message += 428 | '【今日打卡】:'+$.jrdk+'次'+'\n'+ 429 | '【今日收益】:'+($.jrcurrency*$.money).toFixed(2)+'元'+'\n' 430 | $.messagesss += 431 | '【今日打卡】:'+$.jrdk+'次'+'\n'+ 432 | '【今日收益】:'+($.jrcurrency*$.money).toFixed(2)+'元'+'\n' 433 | 434 | } catch (e) { 435 | $.logErr(e, resp); 436 | } finally { 437 | resolve() 438 | } 439 | }) 440 | },timeout) 441 | }) 442 | } 443 | 444 | 445 | 446 | 447 | //兑换 448 | function exchange(timeout = 0) { 449 | return new Promise((resolve) => { 450 | setTimeout( ()=>{ 451 | let url = { 452 | url: xiaoleurlVal.replace(`user.php?mod=index`, `daka.php?mod=shop&act=exchange&money=${money}¤cy=${$.mibi}`), 453 | headers: JSON.parse(xiaoleheaderVal), 454 | } 455 | $.get(url, async(err, resp, data) => { 456 | try { 457 | if (logs) $.log(`${O}, 兑换🚩: ${data}`); 458 | $.message +='【兑换成功】:'+money+'元\n' 459 | $.messagesss +='【兑换成功】:'+money+'元\n' 460 | } catch (e) { 461 | $.logErr(e, resp); 462 | } finally { 463 | resolve() 464 | } 465 | }) 466 | },timeout) 467 | }) 468 | } 469 | 470 | 471 | 472 | 473 | 474 | // prettier-ignore 475 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log(``,`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,``).trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):``;if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,``):e}catch(t){e=``}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+``).substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((``+e[s]).length)));return t}msg(e=t,s=``,i=``,r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=[``,"==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log(``,`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log(``,`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log(``,`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 476 | -------------------------------------------------------------------------------- /Task/xiaole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/age174/JavaScript/058f182c19c3c1fb1c784ff5cd902eca8eae17b4/Task/xiaole.png -------------------------------------------------------------------------------- /Task/xiaoleCOOKIE.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | //独立COOKIE文件 ck在``里面填写,多账号换行 4 | let xiaoleurlVal= `` 5 | let xiaoleheaderVal= `` 6 | 7 | 8 | 9 | let xiaolecookie = { 10 | xiaoleurlVal: xiaoleurlVal, 11 | xiaoleheaderVal: xiaoleheaderVal, 12 | 13 | } 14 | 15 | module.exports = xiaolecookie 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Task/ziye.boxjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "ziye.app.sub", 3 | "name": "ziye 脚本订阅", 4 | "author": "@ZIYE", 5 | "icon": "https://raw.githubusercontent.com/ziye12/JavaScript/main/ziye.png", 6 | "repo": "https://github.com/ziye12", 7 | "apps": [{ 8 | "id": "qczjspeed", 9 | "name": "汽车之家极速版", 10 | "keys": [ "GetUserInfoheader", "taskbody", "activitybody", "addCoinbody", "addCoin2body", "GetUserInfoheader2", "taskbody2", "activitybody2", "addCoinbody2", "addCoin2body2", "GetUserInfoheader3", "taskbody3", "activitybody3", "addCoinbody3", "addCoin2body3", "GetUserInfoheader4", "taskbody4", "activitybody4", "addCoinbody4", "addCoin2body4", "GetUserInfoheader5", "taskbody5", "activitybody5", "addCoinbody5", "addCoin2body5","GetUserInfoheader6", "taskbody6", "activitybody6", "addCoinbody6", "addCoin2body6", "GetUserInfoheader7", "taskbody7", "activitybody7", "addCoinbody7", "addCoin2body7", "GetUserInfoheader8", "taskbody8", "activitybody8", "addCoinbody8", "addCoin2body8", "GetUserInfoheader9", "taskbody9", "activitybody9", "addCoinbody9", "addCoin2body9", "GetUserInfoheader10", "taskbody10", "activitybody10", "addCoinbody10", "addCoin2body10", "GetUserInfoheader11", "taskbody11", "activitybody11", "addCoinbody11", "addCoin2body11", "GetUserInfoheader12", "taskbody12", "activitybody12", "addCoinbody12", "addCoin2body12", "GetUserInfoheader13", "taskbody13", "activitybody13", "addCoinbody13", "addCoin2body13", "GetUserInfoheader14", "taskbody14", "activitybody14", "addCoinbody14", "addCoin2body14", "GetUserInfoheader15", "taskbody15", "activitybody15", "addCoinbody15", "addCoin2body15", "GetUserInfoheader16", "taskbody16", "activitybody16", "addCoinbody16", "addCoin2body16", "GetUserInfoheader17", "taskbody17", "activitybody17", "addCoinbody17", "addCoin2body17", "GetUserInfoheader18", "taskbody18", "activitybody18", "addCoinbody18", "addCoin2body18", "GetUserInfoheader19", "taskbody19", "activitybody19", "addCoinbody19", "addCoin2body19", "GetUserInfoheader20", "taskbody20", "activitybody20", "addCoinbody20", "addCoin2body20"], 11 | "author": "@ziye", 12 | "settings": [{ 13 | "id": "qczjSuffix", 14 | "name": "当前账号", 15 | "val": "1", 16 | "type": "number", 17 | "desc": "当前抓取ck记录的账号序号,如:1、2、4、" 18 | }, 19 | { 20 | "id": "qczjCount", 21 | "name": "账号个数", 22 | "val": "1", 23 | "type": "number", 24 | "desc": "指定任务最多跑几个账号,根据抓取的账号数据个数来设值" 25 | }, 26 | { 27 | "id": "qczjCASH", 28 | "name": "提现标准", 29 | "val": "0", 30 | "type": "number", 31 | "desc": "0不提现,可设置0 0.5 2 5 10 20 " 32 | }, 33 | { 34 | "id": "qczjCASHTIME", 35 | "name": "提现时间", 36 | "val": "0", 37 | "type": "number", 38 | "desc": "默认0点后提现,可设置 0 ~ 23 " 39 | } 40 | ], 41 | "repo": "https://github.com/ziye12/QCZJSPEED/blob/main/Task/qczjspeed.js", 42 | "icons": ["https://raw.githubusercontent.com/Orz-3/task/master/qczj.png", "https://raw.githubusercontent.com/Orz-3/task/master/qczj.png"], 43 | "script": "https://raw.githubusercontent.com/ziye12/QCZJSPEED/main/Task/qczjspeed.js" 44 | }, 45 | { 46 | "id": "xiaole", 47 | "name": "小乐", 48 | "keys": ["xiaoleurl", "xiaolehd","xiaoleurl2", "xiaolehd2","xiaoleurl3", "xiaolehd3","xiaoleurl4", "xiaolehd4","xiaoleurl5", "xiaolehd5","xiaoleurl6", "xiaolehd6","xiaoleurl7", "xiaolehd7","xiaoleurl8", "xiaolehd8","xiaoleurl9", "xiaolehd9","xiaoleurl10", "xiaolehd10"], 49 | "author": "@ziye", 50 | "settings": [{ 51 | "id": "xlSuffix", 52 | "name": "当前账号", 53 | "val": "1", 54 | "type": "number", 55 | "desc": "当前抓取ck记录的账号序号,如:1、2、4、" 56 | }, 57 | { 58 | "id": "xlCount", 59 | "name": "账号个数", 60 | "val": "1", 61 | "type": "number", 62 | "desc": "指定任务最多跑几个账号,根据抓取的账号数据个数来设值" 63 | } 64 | ], 65 | "repo": "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/xiaole.js", 66 | "icons": ["https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/xiaole.png", "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/xiaole.png"], 67 | "script": "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/xiaole.js" 68 | }, 69 | { 70 | "id": "iboxpay", 71 | "name": "笑谱", 72 | "keys": [ "iboxpayheader","refreshtoken", "iboxpayheader2","refreshtoken2","iboxpayheader3","refreshtoken3", "iboxpayheader4","refreshtoken4","iboxpayheader5","refreshtoken5", "iboxpayheader6","refreshtoken6", "iboxpayheader7","refreshtoken7", "iboxpayheader8","refreshtoken8", "iboxpayheader9","refreshtoken9", "iboxpayheader10","refreshtoken10","iboxpayheader11","refreshtoken11", "iboxpayheader12","refreshtoken12", "iboxpayheader13","refreshtoken13", "iboxpayheader14","refreshtoken14", "iboxpayheader15","refreshtoken15", "iboxpayheader16","refreshtoken16", "iboxpayheader17","refreshtoken17", "iboxpayheader18","refreshtoken18", "iboxpayheader19","refreshtoken19", "iboxpayheader20", "refreshtoken20"], 73 | "author": "@ziye", 74 | "settings": [{ 75 | "id": "iboxpaySuffix", 76 | "name": "当前账号", 77 | "val": "1", 78 | "type": "number", 79 | "desc": "当前抓取ck记录的账号序号,如:1、2、4、" 80 | }, 81 | { 82 | "id": "iboxpayCount", 83 | "name": "账号个数", 84 | "val": "1", 85 | "type": "number", 86 | "desc": "指定任务最多跑几个账号,根据抓取的账号数据个数来设值" 87 | }, 88 | { 89 | "id": "iboxpayLIVE", 90 | "name": "任务控制", 91 | "val": "0", 92 | "type": "number", 93 | "desc": "0开启视频,关闭直播,1开启直播,开启视频,2开启直播,关闭视频,3开启直播,开启视频,开启红包雨 " 94 | }, 95 | { 96 | "id": "iboxpayCASH", 97 | "name": "提现标准", 98 | "val": "0", 99 | "type": "number", 100 | "desc": "0不提现,可设置 0 1 15 30 100 " 101 | }, 102 | { 103 | "id": "iboxpayphone", 104 | "name": "手机号", 105 | "val": "0", 106 | "type": "number", 107 | "desc": "请输入完整手机号" 108 | }, 109 | { 110 | "id": "iboxpaysms", 111 | "name": "验证码", 112 | "val": "0", 113 | "type": "number", 114 | "desc": "输入短信验证码,默认为0,不启动获取token功能" 115 | } 116 | ], 117 | "repo": "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/iboxpay.js", 118 | "icons": ["https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/iboxpay.png", "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/iboxpay.png"], 119 | "script": "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/iboxpay.js" 120 | }, 121 | { 122 | "id": "flw", 123 | "name": "返利网", 124 | "keys": [ "flwurl","flwheader","flwspbody","flwqwbody","flwurl2","flwheader2","flwspbody2","flwqwbody2","flwurl3","flwheader3","flwspbody3","flwqwbody3","flwurl4","flwheader4","flwspbody4","flwqwbody4","flwurl5","flwheader5","flwspbody5","flwqwbody5","flwurl6","flwheader6","flwspbody6","flwqwbody6","flwurl7","flwheader7","flwspbody7","flwqwbody7","flwurl8","flwheader8","flwspbody8","flwqwbody8","flwurl9","flwheader9","flwspbody9","flwqwbody9","flwurl10","flwheader10","flwspbody10","flwqwbody10","flwurl11","flwheader11","flwspbody11","flwqwbody11","flwurl12","flwheader12","flwspbody12","flwqwbody12","flwurl13","flwheader13","flwspbody13","flwqwbody13","flwurl14","flwheader14","flwspbody14","flwqwbody14","flwurl15","flwheader15","flwspbody15","flwqwbody15","flwurl16","flwheader16","flwspbody16","flwqwbody16","flwurl17","flwheader17","flwspbody17","flwqwbody17","flwurl18","flwheader18","flwspbody18","flwqwbody18","flwurl19","flwheader19","flwspbody19","flwqwbody19","flwurl20","flwheader20","flwspbody20","flwqwbody20"], 125 | "author": "@ziye", 126 | "settings": [{ 127 | "id": "flwSuffix", 128 | "name": "当前账号", 129 | "val": "1", 130 | "type": "number", 131 | "desc": "当前抓取ck记录的账号序号,如:1、2、3、" 132 | }, 133 | { 134 | "id": "flwCount", 135 | "name": "账号个数", 136 | "val": "1", 137 | "type": "number", 138 | "desc": "指定任务最多跑几个账号,根据抓取的账号数据个数来设值" 139 | }, 140 | { 141 | "id": "flwCASH", 142 | "name": "天天领现金提现标准", 143 | "val": "0", 144 | "type": "number", 145 | "desc": "默认0,设置0.3及以上时启动天天领现金模块,且大于等于此值时自动提现" 146 | }, 147 | { 148 | "id": "flwDHCASH", 149 | "name": "兑换标准", 150 | "val": "0", 151 | "type": "number", 152 | "desc": "默认0,可设置设置 0 5 50 100" 153 | } 154 | ], 155 | "repo": "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/flw.js", 156 | "icons": ["https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/flw.png", "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/flw.png"], 157 | "script": "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/flw.js" 158 | }, 159 | { 160 | "id": "githubAC", 161 | "name": "githubAC", 162 | "keys": ["githubACname","githubACurl","githubACheader","githubACbody","HHA","HHB","MMA","MMB","MMC","MMD","MME","MMF","MMG","MMH","MMI","MMJ","MMK","MML","githubACname2","githubACurl2","githubACheader2","githubACbody2","HHA2","HHB2","MMA2","MMB2","MMC2","MMD2","MME2","MMF2","MMG2","MMH2","MMI2","MMJ2","MMK2","MML2","githubACname3","githubACurl3","githubACheader3","githubACbody3","HHA3","HHB3","MMA3","MMB3","MMC3","MMD3","MME3","MMF3","MMG3","MMH3","MMI3","MMJ3","MMK3","MML3","githubACname4","githubACurl4","githubACheader4","githubACbody4","HHA4","HHB4","MMA4","MMB4","MMC4","MMD4","MME4","MMF4","MMG4","MMH4","MMI4","MMJ4","MMK4","MML4","githubACname5","githubACurl5","githubACheader5","githubACbody5","HHA5","HHB5","MMA5","MMB5","MMC5","MMD5","MME5","MMF5","MMG5","MMH5","MMI5","MMJ5","MMK5","MML5","githubACname6","githubACurl6","githubACheader6","githubACbody6","HHA6","HHB6","MMA6","MMB6","MMC6","MMD6","MME6","MMF6","MMG6","MMH6","MMI6","MMJ6","MMK6","MML6","githubACname7","githubACurl7","githubACheader7","githubACbody7","HHA7","HHB7","MMA7","MMB7","MMC7","MMD7","MME7","MMF7","MMG7","MMH7","MMI7","MMJ7","MMK7","MML7","githubACname8","githubACurl8","githubACheader8","githubACbody8","HHA8","HHB8","MMA8","MMB8","MMC8","MMD8","MME8","MMF8","MMG8","MMH8","MMI8","MMJ8","MMK8","MML8","githubACname9","githubACurl9","githubACheader9","githubACbody9","HHA9","HHB9","MMA9","MMB9","MMC9","MMD9","MME9","MMF9","MMG9","MMH9","MMI9","MMJ9","MMK9","MML9","githubACname10","githubACurl10","githubACheader10","githubACbody10","HHA10","HHB10","MMA10","MMB10","MMC10","MMD10","MME10","MMF10","MMG10","MMH10","MMI10","MMJ10","MMK10","MML10","githubACname11","githubACurl11","githubACheader11","githubACbody11","HHA11","HHB11","MMA11","MMB11","MMC11","MMD11","MME11","MMF11","MMG11","MMH11","MMI11","MMJ11","MMK11","MML11","githubACname12","githubACurl12","githubACheader12","githubACbody12","HHA12","HHB12","MMA12","MMB12","MMC12","MMD12","MME12","MMF12","MMG12","MMH12","MMI12","MMJ12","MMK12","MML12","githubACname13","githubACurl13","githubACheader13","githubACbody13","HHA13","HHB13","MMA13","MMB13","MMC13","MMD13","MME13","MMF13","MMG13","MMH13","MMI13","MMJ13","MMK13","MML13","githubACname14","githubACurl14","githubACheader14","githubACbody14","HHA14","HHB14","MMA14","MMB14","MMC14","MMD14","MME14","MMF14","MMG14","MMH14","MMI14","MMJ14","MMK14","MML14","githubACname15","githubACurl15","githubACheader15","githubACbody15","HHA15","HHB15","MMA15","MMB15","MMC15","MMD15","MME15","MMF15","MMG15","MMH15","MMI15","MMJ15","MMK15","MML15","githubACname16","githubACurl16","githubACheader16","githubACbody16","HHA16","HHB16","MMA16","MMB16","MMC16","MMD16","MME16","MMF16","MMG16","MMH16","MMI16","MMJ16","MMK16","MML16","githubACname17","githubACurl17","githubACheader17","githubACbody17","HHA17","HHB17","MMA17","MMB17","MMC17","MMD17","MME17","MMF17","MMG17","MMH17","MMI17","MMJ17","MMK17","MML17","githubACname18","githubACurl18","githubACheader18","githubACbody18","HHA18","HHB18","MMA18","MMB18","MMC18","MMD18","MME18","MMF18","MMG18","MMH18","MMI18","MMJ18","MMK18","MML18","githubACname19","githubACurl19","githubACheader19","githubACbody19","HHA19","HHB19","MMA19","MMB19","MMC19","MMD19","MME19","MMF19","MMG19","MMH19","MMI19","MMJ19","MMK19","MML19","githubACname20","githubACurl20","githubACheader20","githubACbody20","HHA20","HHB20","MMA20","MMB20","MMC20","MMD20","MME20","MMF20","MMG20","MMH20","MMI20","MMJ20","MMK20","MML20"], 163 | "author": "@ziye", 164 | "settings": [{ 165 | "id": "githubACSuffix", 166 | "name": "当前js", 167 | "val": "1", 168 | "type": "number", 169 | "desc": "当前抓取js ck的账号序号,如:1、2、3、" 170 | }, 171 | { 172 | "id": "githubACCount", 173 | "name": "js个数", 174 | "val": "1", 175 | "type": "number", 176 | "desc": "指定任务最多跑几个js,根据抓取的js数据个数来设值" 177 | } 178 | ], 179 | "repo": "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/githubAC.js", 180 | "icons": ["https://github.githubassets.com/images/modules/site/home/astro-mona.jpg", "https://github.githubassets.com/images/modules/site/home/astro-mona.jpg"], 181 | "script": "https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/githubAC.js" 182 | } 183 | ] 184 | } 185 | -------------------------------------------------------------------------------- /dkhjziye333.js: -------------------------------------------------------------------------------- 1 | /*ziye 2 | 3 | 说明:微信扫码 https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.png 获取授权 4 | 5 | 10.8 一共20个,自行删减替换(不一定都能提现,可自行关闭) 6 | 10.14 因为大部分打卡失效,现删减整理,剩余5个 7 | 10.28 增加京优打卡和云端打卡 8 | 注意 久诺打卡用本地js 改ck=2 进行获取 9 | 11.14 剔除无用打卡 剩余4个 10 | 11.19 恢复微打卡 剩余5个 必须用本地文件获取微打卡的ck 11 | 12 | 功能如下: 13 | 1.读秒限速打卡, 14 | 2.打卡币统计,次数统计 15 | 3.现金统计,自动兑换,自动提现 (默认关闭兑换和提现,自行打开) 16 | 17 | 18 | 一,第一次进一定先授权,第一次进一定先授权,第一次进一定先授权, 19 | 20 | 二,将hostname复制粘贴进配置文件 21 | 22 | 三,将重写复制到 rewrite_local 下,开启软件,进对应程序获取ck(会卡住,但是可以获取ck),目前一共9个打卡小程序, 23 | 24 | 建议新建配置片段,获取ck后禁用, 25 | 换号则复制js文件,修改jbid的值就可以了 26 | 27 | 28 | 29 | ck=1 30 | 31 | 音乐打卡 32 | 早起打卡 33 | 云端打卡 34 | 久诺打卡 35 | 36 | 37 | ck=2 38 | 微打卡 39 | 40 | 41 | 42 | 时间设置 43 | 44 | !!!删除第一个*后面的空格!!! 自行模拟人性化修改选择 45 | 46 | 47 | 5位 第一位为分 填 10-59 如 48 | 49 | * /12 6-23 * * * dkhjziye925.js 50 | 6点到23点 0 12 24 36 48 运行1次 51 | 52 | 53 | 6位 第一位为秒 填 0-59 第二位为分 填 10-59 如 54 | 55 | 23 * /13 6-23 * * * dkhjziye925.js 56 | 6点到23点 0 13 26 39 52 的23秒运行1次 57 | 58 | 59 | 60 | 打卡限速默认设置10分钟一次,可根据情况修改, 61 | 62 | 63 | 64 | 65 | hostname=www.baimaa.com,ph0001.hezyq.com,cps.0day.fun,am.kuqi5.cn,zm.shujumagician.com, 66 | 67 | ############## 圈x 68 | 69 | //音乐打卡 70 | https:\/\/www\.baimaa\.com\/* url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js 71 | 72 | 73 | // 早起打卡 74 | https:\/\/ph0001\.hezyq\.com\/* url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js 75 | 76 | 77 | 78 | //云端打卡 79 | https:\/\/cps\.0day\.fun\/* url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js 80 | 81 | 82 | 83 | //久诺打卡 84 | https:\/\/am\.kuqi5\.cn\/* url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js 85 | 86 | 87 | 88 | //微打卡 89 | https:\/\/zm\.shujumagician\.com\/* url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js 90 | 91 | 92 | 93 | 94 | ############## loon 95 | 96 | 97 | //音乐打卡 98 | http-request https:\/\/www\.baimaa\.com\/* script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js, requires-body=true 99 | 100 | 101 | // 早起打卡 102 | http-request https:\/\/ph0001\.hezyq\.com\/* script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js, requires-body=true 103 | 104 | 105 | //云端打卡 106 | http-request https:\/\/cps\.0day\.fun\/* script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js, requires-body=true 107 | 108 | 109 | //久诺打卡 110 | http-request https:\/\/am\.kuqi5\.cn\/* script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js, requires-body=true 111 | 112 | 113 | 114 | 115 | 116 | //微打卡 117 | http-request https:\/\/zm\.shujumagician\.com\/* script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js, requires-body=true 118 | 119 | 120 | ############## surge 121 | 122 | //音乐打卡 123 | 音乐打卡 = type=http-request,pattern=https:\/\/www\.baimaa\.com\/*,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js, requires-body=true 124 | 125 | 126 | // 早起打卡 127 | 早起打卡 = type=http-request,pattern=https:\/\/ph0001\.hezyq\.com\/*,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js, requires-body=true 128 | 129 | 130 | 131 | //云端打卡 132 | 云端打卡 = type=http-request,pattern=https:\/\/cps\.0day\.fun\/*,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js, requires-body=true 133 | 134 | 135 | 136 | //久诺打卡 137 | 久诺打卡 = type=http-request,pattern=https:\/\/am\.kuqi5\.cn\/*,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js, requires-body=true 138 | 139 | 140 | 141 | //微打卡 142 | 微打卡= type=http-request,pattern=https:\/\/zm\.shujumagician\.com\/*,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/dkhjziye333.js, requires-body=true 143 | 144 | 145 | */ 146 | 147 | //////////////////////////////////////////正文 148 | 149 | const CK=1// 修改ck 获取对应程序cookie 150 | 151 | const jsname = '打卡合集' 152 | const $ = new Env(jsname)//模版引用 153 | const jbid =1// 换号则复制js,修改jbid的值就可以了 154 | const notify = 1; //通知开为1,关为0 155 | const logs = 0; // 日志开为1,关为0 156 | 157 | const dk=1//打卡开关 158 | const tj=1//统计开关 159 | const xj=1//现金开关 160 | const dm=1//读秒开关 161 | const tx=0//提现开关 162 | const dh=0//兑换开关 163 | const dd=2//运行时间,单位为秒 164 | 165 | var tz=''//通知循环 166 | 167 | 168 | 169 | 170 | const yydkname = "音乐打卡";//程序名 171 | const yydkid = 11;//ck id 172 | const yydkcs = 10;//打卡次数 173 | const yydktx = 10;//提现标准 174 | const yydkxs = 10;//限速标准.单位为分钟 175 | const yydkdh = 10;//兑换标准 176 | const yydkdhid = 22;//兑换id 177 | const yydkdhsp = "1元";//兑换商品 178 | const yydkkey = "yydkkey"+jbid //保存ck 179 | const yydkurl =$.getdata(yydkkey)//读取ck 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | const zqdkname = "早起打卡";//程序名 191 | const zqdkid = 597;//ck id 192 | const zqdkcs = 20;//打卡次数 193 | const zqdktx = 10;//提现标准 194 | const zqdkxs = 10;//限速标准.单位为分钟 195 | const zqdkdh = 5000;//兑换标准 196 | const zqdkdhid = 6;//兑换id 197 | const zqdkdhsp = "1元";//兑换商品 198 | const zqdkkey = "zqdkkey"+jbid //保存ck 199 | const zqdkurl =$.getdata(zqdkkey)//读取ck 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | const yddkname = "云端打卡";//程序名 211 | const yddkid = 2;//ck id 212 | const yddkcs = 10;//打卡次数 213 | const yddktx = 10;//提现标准 214 | const yddkxs = 10;//限速标准.单位为分钟 215 | const yddkdh = 3500;//兑换标准 216 | const yddkdhid = 4;//兑换id 217 | const yddkdhsp = "50元话费";//兑换商品 218 | const yddkkey = "yddkkey"+jbid //保存ck 219 | const yddkurl =$.getdata(yddkkey)//读取ck 220 | 221 | 222 | 223 | 224 | 225 | 226 | const jndkname = "久诺打卡";//程序名 227 | const jndkid = 8;//ck id 228 | const jndkcs = 10;//打卡次数 229 | const jndktx = 10;//提现标准 230 | const jndkxs = 10;//限速标准.单位为分钟 231 | const jndkdh = 3500;//兑换标准 232 | const jndkdhid = 4;//兑换id 233 | const jndkdhsp = "50元话费";//兑换商品 234 | const jndkkey = "jndkkey"+jbid //保存ck 235 | const jndkurl =$.getdata(jndkkey)//读取ck 236 | 237 | 238 | 239 | 240 | 241 | 242 | const wdkname = "微打卡";//程序名 243 | const wdkid = 2;//ck id 244 | const wdkcs = 20;//打卡次数 245 | const wdktx = 10;//提现标准 246 | const wdkxs = 10;//限速标准.单位为分钟 247 | const wdkdh = 13000;//兑换标准 248 | const wdkdhid = 9;//兑换id 249 | const wdkdhsp = "腾讯月卡";//兑换商品 250 | const wdkkey = "wdkkey"+jbid //保存ck 251 | const wdkurl =$.getdata(wdkkey)//读取ck 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | //CK运行 262 | 263 | let isGetCookie = typeof $request !== 'undefined' 264 | if (isGetCookie) { 265 | GetCookie() 266 | } else { 267 | all() 268 | } 269 | 270 | 271 | 272 | 273 | 274 | //1异步运行 275 | 276 | 277 | function all() 278 | 279 | { 280 | 281 | for(var i=0;i<6;i++) 282 | { (function(i) { 283 | setTimeout(function() { 284 | 285 | 286 | 287 | 288 | if(i==0) jndk(i); 289 | 290 | else if(i==1) yddk(i); 291 | 292 | else if(i==2) yydk(i); 293 | 294 | else if(i==3) zqdk(i); 295 | 296 | else if(i==4) wdk(i); 297 | 298 | else if(i==5) showmsg(i); 299 | 300 | 301 | 302 | }, (i + 1) * dd*1000); 303 | })(i) 304 | 305 | 306 | 307 | 308 | }} 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | //CK获取模块 318 | function GetCookie() { 319 | 320 | /////////////////////CK=1 321 | 322 | if (CK==1) 323 | { 324 | 325 | 326 | 327 | 328 | if ($request && $request.url.match(/i=2&/)) 329 | if ($request && $request.url.match(/action=today&contr=index/)) 330 | {const yddkurl = $request.url 331 | $.log(`yddkurl:${yddkurl}`) 332 | if (yddkurl) $.setdata(yddkurl, yddkkey) 333 | $.msg(yddkkey, `获取cookie: 成功🎉`, ``) 334 | } 335 | 336 | 337 | 338 | 339 | if ($request && $request.url.match(/i=8&/)) 340 | if ($request && $request.url.match(/action=today&contr=index/)) 341 | {const jndkurl = $request.url 342 | $.log(`jndkurl:${jndkurl}`) 343 | if (jndkurl) $.setdata(jndkurl, jndkkey) 344 | $.msg(jndkkey, `获取cookie: 成功🎉`, ``) 345 | } 346 | 347 | 348 | 349 | 350 | 351 | if ($request && $request.url.match(/i=11&/)) 352 | if ($request && $request.url.match(/action=today&contr=index/)) 353 | {const yydkurl = $request.url 354 | $.log(`yydkurl:${yydkurl}`) 355 | if (yydkurl) $.setdata(yydkurl, yydkkey) 356 | $.msg(yydkkey, `获取cookie: 成功🎉`, ``) 357 | } 358 | 359 | 360 | 361 | 362 | if ($request && $request.url.match(/i=597&/)) 363 | if ($request && $request.url.match(/action=today&contr=index/)) 364 | {const zqdkurl = $request.url 365 | $.log(`zqdkurl:${zqdkurl}`) 366 | if (zqdkurl) $.setdata(zqdkurl, zqdkkey) 367 | $.msg(zqdkkey, `获取cookie: 成功🎉`, ``) 368 | } 369 | 370 | 371 | 372 | } 373 | 374 | 375 | 376 | if (CK==2) 377 | { 378 | 379 | 380 | if ($request && $request.url.match(/i=2&/)) 381 | if ($request && $request.url.match(/action=today&contr=index/)) 382 | {const wdkurl = $request.url 383 | $.log(`wdkurl:${wdkurl}`) 384 | if (wdkurl) $.setdata(wdkurl, wdkkey) 385 | $.msg(wdkkey, `获取cookie: 成功🎉`, ``) 386 | } 387 | 388 | 389 | } 390 | 391 | 392 | 393 | } 394 | 395 | 396 | 397 | 398 | ///////////////////////////////////////运行 399 | 400 | 401 | 402 | 403 | function yydk() { 404 | var A={Y:[yydkurl,yydkname,yydkcs,yydktx,yydkxs,yydkdh,yydkdhid,yydkdhsp]} 405 | B(A) 406 | } 407 | 408 | 409 | 410 | 411 | 412 | function zqdk() { 413 | var A={Y:[zqdkurl,zqdkname,zqdkcs,zqdktx,zqdkxs,zqdkdh,zqdkdhid,zqdkdhsp]} 414 | B(A) 415 | } 416 | 417 | 418 | 419 | 420 | 421 | function yddk() { 422 | var A={Y:[yddkurl,yddkname,yddkcs,yddktx,yddkxs,yddkdh,yddkdhid,yddkdhsp]} 423 | B(A) 424 | } 425 | 426 | 427 | 428 | 429 | 430 | function jndk() { 431 | var A={Y:[jndkurl,jndkname,jndkcs,jndktx,jndkxs,jndkdh,jndkdhid,jndkdhsp]} 432 | B(A) 433 | } 434 | 435 | 436 | 437 | 438 | 439 | function wdk() { 440 | var A={Y:[wdkurl,wdkname,wdkcs,wdktx,wdkxs,wdkdh,wdkdhid,wdkdhsp]} 441 | B(A) 442 | } 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | function B(C) { 454 | 455 | return new Promise((resolve, reject) => { 456 | 457 | 458 | const Tjurl = {url: C.Y[0]}; 459 | const Xjurl = {url: C.Y[0].replace(/action=today&contr=index/g, `action=index&contr=my`)}; 460 | const Logurl = {url: C.Y[0].replace(/action=today&contr=index/g, `action=log&contr=clock&level=1&p=1&today=1`)}; 461 | 462 | const Dhurl = {url: C.Y[0].replace(/action=today&contr=index/g, `action=index&contr=shop`)}; 463 | 464 | const Dhspurl = {url: C.Y[0].replace(/do=distribute/g, `do=exchange&id=${C.Y[6]}`)}; 465 | 466 | 467 | 468 | 469 | const Txurl = {url: C.Y[0].replace(/action=today&contr=index/g, `action=withdrawals&contr=my&money=${C.Y[3]}&payment_code=`)}; 470 | 471 | const Dkurl = {url: C.Y[0].replace(/action=today&contr=index/g, `action=sign&contr=clock`) 472 | }; 473 | 474 | 475 | 476 | //统计打卡 477 | 478 | if (tj==1) 479 | $.get(Tjurl,(error, response, data) =>{ 480 | if(logs)$.log(`${C.Y[1]}统计 - data: ${data}`) 481 | tbj = JSON.parse(data) 482 | if(tbj.status == 1 && tbj.info.today.clock < C.Y[2]){tz+=C.Y[1]+'[账户信息]👤'+ 483 | '已打卡'+[Number(tbj.info.today.clock) ]+'/'+C.Y[2]+'次'+',得'+[Number(tbj.info.today.currency)]+'币'+'\n' 484 | } 485 | else {tz+=C.Y[1]+'[打卡完成]✅'+'得'+[Number(tbj.info.today.currency)]+'币'+'\n'} 486 | 487 | 488 | if (dk==1&&tbj.info.today.clock==0){ 489 | $.get(Dkurl,(error, response, data) =>{ 490 | if(logs)$.log(`${C.Y[1]}打卡- data: ${data}`) 491 | dbj = JSON.parse(data) 492 | if (dbj.status==1){ 493 | tz+=C.Y[1]+'[打卡成功]🎉'+'打卡次数+1'+'\n' 494 | 495 | } 496 | 497 | 498 | resolve() 499 | 500 | }) 501 | 502 | 503 | } 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | //读秒打卡 515 | 516 | 517 | if (dm==1) 518 | $.get(Logurl,(error, response, data) =>{ 519 | if(logs)$.log(`${C.Y[1]}限速- data: ${data}`) 520 | ybj = JSON.parse(data) 521 | 522 | var f=ybj.info.log.length-1 523 | var time = ybj.info.log[f].created 524 | var newtime=time.replace(time[10],'T') 525 | var c = new Date(newtime)/1000 526 | var now = new Date()/1000 527 | var cz=[Number((now+28800-c)/60).toFixed(0)] 528 | 529 | if (czC.Y[4]&&tbj.info.today.clock{ 539 | if(logs)$.log(`${C.Y[1]}打卡- data: ${data}`) 540 | dbj = JSON.parse(data) 541 | if (dbj.status==1){ 542 | tz+=C.Y[1]+'[打卡成功]🎉'+'打卡次数+1'+'\n' 543 | 544 | } 545 | 546 | 547 | resolve() 548 | 549 | }) 550 | 551 | 552 | } 553 | 554 | 555 | 556 | resolve() 557 | }) 558 | 559 | 560 | 561 | 562 | 563 | 564 | resolve() 565 | }) 566 | 567 | 568 | 569 | //兑换 570 | if (dh==1) 571 | $.get(Dhurl,(error, response, data) =>{ 572 | if(logs)$.log(`${C.Y[1]}兑换 - data: ${data}`) 573 | Mbj= JSON.parse(data) 574 | if(Mbj.status == 1) 575 | {tz+=C.Y[1]+"[总打卡币]💰"+'余'+ 576 | Mbj.info.member.currency+"币"+"\n" 577 | 578 | } 579 | 580 | 581 | 582 | 583 | 584 | if (dh==1&&Mbj.info.member.currency>=C.Y[5]){ 585 | $.get(Dhspurl,(error, response, data) =>{ 586 | if(logs)$.log(`${C.Y[1]}兑换商品 - data: ${data}`) 587 | nbj = JSON.parse(data) 588 | if(nbj.status == 1) { 589 | 590 | tz+=C.Y[1]+'[兑换成功]🧧,成功兑换'+C.Y[7] 591 | +'\n' 592 | 593 | } 594 | 595 | else { 596 | 597 | tz+=C.Y[1]+'[兑换失败]❓:'+nbj.info+'\n' 598 | 599 | } 600 | 601 | resolve() 602 | 603 | }) 604 | 605 | 606 | } 607 | 608 | 609 | 610 | resolve() 611 | }) 612 | 613 | 614 | 615 | 616 | 617 | //现金提现 618 | if (xj==1) 619 | $.get(Xjurl,(error, response, data) =>{ 620 | if(logs)$.log(`${C.Y[1]}现金 - data: ${data}`) 621 | xbj = JSON.parse(data) 622 | if(xbj.status == 1) 623 | {tz+=C.Y[1]+'[现金余额]💵'+xbj.info.member.money+'元'+'\n' 624 | 625 | } 626 | 627 | 628 | 629 | 630 | 631 | if (tx==1&&xbj.info.member.money>=C.Y[3]){ 632 | $.get(Txurl,(error, response, data) =>{ 633 | if(logs)$.log(`${C.Y[1]}提现 - data: ${data}`) 634 | obj = JSON.parse(data) 635 | if(obj.status == 1) { 636 | 637 | tz+=C.Y[1]+'[提现成功]🧧,提现'+C.Y[3]+'元'+'\n' 638 | 639 | } 640 | 641 | else { 642 | 643 | tz+=C.Y[1]+'[提现失败]❓:'+obj.info+'\n' 644 | 645 | } 646 | 647 | resolve() 648 | }) 649 | 650 | 651 | } 652 | 653 | 654 | 655 | 656 | resolve() 657 | }) 658 | 659 | 660 | 661 | }) 662 | } 663 | 664 | 665 | 666 | 667 | 668 | 669 | function showmsg() { 670 | 671 | 672 | 673 | if (notify ==1) 674 | $.msg(jsname,'',tz) 675 | 676 | 677 | } 678 | 679 | // prettier-ignore 680 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 681 | 682 | -------------------------------------------------------------------------------- /flwhbziye.js: -------------------------------------------------------------------------------- 1 | 2 | /*ziye 3 | 4 | //返利网 天天领现金,活动时间 不一定 5 | 6 | 下载地址 http://m.a8fdj.cn/Invite/promotion?id=775&spm=page_name.h5.pty-wxzcpv~std-65354&go=http%3A%2F%2Fhuodong.a8fdj.cn%2Fh5%2FInvitefriendsreward%2FregisterCallback%3Fuserid%3D373511081%26id%3D775%26sn%3D47ecab06aba43e015082e531d8214eb5 7 | 8 | 下载后登录 9 | 10 | 进入 我的 点击 天天领现金 获取cookie 11 | 12 | ⚠️会卡住,但是能获取到cookie,然后注释重写就行了! 13 | 提现请先微信关注返利网公众号 14 | 15 | hostname=huodong.fanli.com,passport.fanli.com 16 | 17 | 时间👇 18 | 19 | 20 | 21 | 22 | 23 | #返利网红包 24 | ############## 圈x 25 | https:\/\/huodong\.fanli\.com\/h5\/Fanlishare20201212\/ajaxInit url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/flwhbziye.js 26 | 27 | 28 | https:\/\/passport\.fanli\.com\/* url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/flwhbziye.js 29 | 30 | 31 | 32 | 33 | 34 | #返利网红包 35 | ############## loon 36 | 37 | http-request https:\/\/huodong\.fanli\.com\/h5\/Fanlishare20201212\/ajaxDoTask76728 script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/flwhbziye.js,requires-header=true, tag=返利网红包获取cookie 38 | 39 | http-request https:\/\/passport\.fanli\.com\/* script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/flwhbziye.js,requires-header=true, tag=返利网红包获取cookie 40 | 41 | 42 | #返利网红包 43 | ############## surge 44 | 45 | 返利网红包 = type=http-request,pattern=https:\/\/huodong\.fanli\.com\/h5\/Fanlishare20201212\/ajaxDoTask76728,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/flwhbziye.js, 46 | 47 | 48 | 返利网红包 = type=https:\/\/passport\.fanli\.com\/*,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/flwhbziye.js, 49 | 50 | 51 | 52 | 53 | */ 54 | 55 | 56 | 57 | 58 | 59 | const jsname='返利网红包' 60 | const $ = Env(jsname) 61 | 62 | 63 | const logs = 0; //0为关闭日志,1为开启 64 | const notifyInterval=1//0为关闭通知,1为开启 65 | const jbid=1; 66 | const txbz=1//设置余额大于等于多少提现,必须大于0.3 67 | 68 | 69 | 70 | 71 | 72 | const flwhburlKey = 'flwhburl'+jbid 73 | 74 | const flwhbheaderKey = 'flwhbhd'+jbid 75 | 76 | const flwhbdlurlKey = 'flwhbdlurl'+jbid 77 | 78 | const flwhbdlhdKey = 'flwhbdlhd'+jbid 79 | 80 | 81 | const flwhburlVal = $.getdata(flwhburlKey) 82 | 83 | const flwhbheaderVal = $.getdata(flwhbheaderKey) 84 | 85 | const flwhbbodyVal = '' 86 | 87 | 88 | 89 | const flwhbdlurlVal = $.getdata(flwhbdlurlKey) 90 | 91 | const flwhbdlhdVal = $.getdata(flwhbdlhdKey) 92 | 93 | 94 | 95 | 96 | var tz='' 97 | 98 | 99 | let isGetCookie = typeof $request !== 'undefined' 100 | if (isGetCookie) { 101 | GetCookie(); 102 | $.done(); 103 | } else { 104 | all() 105 | } 106 | 107 | 108 | 109 | 110 | 111 | function GetCookie() { 112 | 113 | 114 | 115 | if($request &&$request.url.indexOf("ajaxInit")>=0) { 116 | 117 | const flwhburlVal = $request.url 118 | if (flwhburlVal) $.setdata(flwhburlVal,flwhburlKey) 119 | $.log(`[${jsname}] 获取url请求: 成功,flwhburlVal: ${flwhburlVal}`) 120 | const flwhbheaderVal = JSON.stringify($request.headers) 121 | if (flwhbheaderVal) $.setdata(flwhbheaderVal,flwhbheaderKey) 122 | $.log(`[${jsname}] 获取Cookie: 成功,flwhbheaderVal: ${flwhbheaderVal}`) 123 | $.msg(flwhbheaderKey, `获取Cookie: 成功🎉`, ``) 124 | 125 | 126 | } 127 | 128 | if($request &&$request.url.indexOf("getUserInfo")>=0) { 129 | 130 | const flwhbdlurlVal = $request.url 131 | if (flwhbdlurlVal) $.setdata(flwhbdlurlVal,flwhbdlurlKey) 132 | $.log(`[${jsname}] 获取登录url请求: 成功,flwhbdlurlVal: ${flwhbdlurlVal}`) 133 | 134 | const flwhbdlhdVal = JSON.stringify($request.headers) 135 | if (flwhbdlhdVal) $.setdata(flwhbdlhdVal,flwhbdlhdKey) 136 | $.log(`[${jsname}] 获取登录hd请求: 成功,flwhbdlhdVal: ${flwhbdlhdVal}`) 137 | $.msg(flwhbdlhdKey, `获取登录cookie: 成功🎉`, ``) 138 | 139 | 140 | } 141 | 142 | 143 | 144 | } 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | function all() 157 | 158 | { 159 | 160 | for(var i=0;i<4;i++) 161 | { (function(i) { 162 | setTimeout(function() { 163 | 164 | if(i==0) flwhbdl(); 165 | else if(i==1) flwhbtask(); 166 | else if(i==2) flwhblh(); 167 | 168 | else if(i==3) { 169 | showmsg() 170 | $.done()} 171 | }, (i + 1) *500); 172 | })(i) 173 | 174 | 175 | }} 176 | 177 | 178 | 179 | //账户信息 180 | function flwhbtask() { 181 | return new Promise((resolve, reject) => { 182 | 183 | const toflwhburl = { 184 | 185 | url: flwhburlVal, 186 | 187 | headers: JSON.parse(flwhbheaderVal), 188 | body: flwhbbodyVal 189 | }; 190 | $.get(toflwhburl,(error, response, data) =>{ 191 | if(logs) $.log(`${jsname}, 账户信息: ${data}`) 192 | signinfo =JSON.parse(data) 193 | if (signinfo.status==1) 194 | { 195 | tz+='【收益总计】🎉:'+signinfo.data.user_total_money+'元'+'\n'+ 196 | '【账户余额】🎉:'+signinfo.data.user_current_money+'\n'+ 197 | '【今日奖励】🎉:'+signinfo.data.get_money_76728+'元'+'\n' 198 | 199 | } 200 | 201 | else 202 | tz+='【出现问题】✖️:'+signinfo.data+'\n' 203 | 204 | zhtx(signinfo.data.user_current_money) 205 | 206 | 207 | 208 | 209 | resolve() 210 | }) 211 | }) 212 | } 213 | 214 | 215 | 216 | 217 | //惊喜礼盒 218 | function flwhblh() { 219 | return new Promise((resolve, reject) => { 220 | 221 | const toflwhblhurl = { 222 | 223 | url: flwhburlVal.replace(/ajaxInit/g, `ajaxDoTask76728`), 224 | 225 | headers: JSON.parse(flwhbheaderVal), 226 | body: flwhbbodyVal 227 | }; 228 | $.get(toflwhblhurl,(error, response, data) =>{ 229 | if(logs) $.log(`${jsname}, 惊喜礼盒: ${data}`) 230 | jxlh =JSON.parse(data) 231 | if (jxlh.data.remain_num_76728>0) 232 | { 233 | tz+='【开启礼盒】🎉:'+jxlh.data.amount+'元'+'\n'+ 234 | '【剩余礼盒】🎉:'+jxlh.data.remain_num_76728+'个'+'\n' 235 | 236 | } 237 | 238 | else 239 | tz+='【开启完毕】✖️:'+'礼盒已全部开启'+'\n' 240 | 241 | 242 | 243 | 244 | resolve() 245 | }) 246 | }) 247 | } 248 | 249 | 250 | 251 | 252 | 253 | //用户登录 254 | function flwhbdl() { 255 | return new Promise((resolve, reject) => { 256 | 257 | const toflwhbdlurl = { 258 | 259 | url: flwhbdlurlVal, 260 | 261 | headers: JSON.parse(flwhbdlhdVal), 262 | //body: flwhbbodyVal 263 | }; 264 | $.get(toflwhbdlurl,(error, response, data) =>{ 265 | if(logs) $.log(`${jsname}, 用户登录: ${data}`) 266 | dlinfo =JSON.parse(data) 267 | if (dlinfo.status==1) 268 | { 269 | tz+='【用户登录】'+'登录id:'+dlinfo.data.username+'\n' 270 | 271 | } 272 | 273 | else 274 | tz+='【出现问题】✖️:'+dlinfo.data+'\n' 275 | 276 | 277 | 278 | 279 | 280 | 281 | resolve() 282 | }) 283 | }) 284 | } 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | function zhtx(y) 293 | { 294 | if(y>=txbz) 295 | flwhbtx() 296 | 297 | } 298 | 299 | 300 | 301 | 302 | 303 | 304 | //提现 305 | function flwhbtx() { 306 | return new Promise((resolve, reject) => { 307 | 308 | const toflwhbtxurl = { 309 | 310 | url: flwhburlVal.replace(/ajaxInit/g, `ajaxExchangeCash`), 311 | 312 | headers: JSON.parse(flwhbheaderVal), 313 | 314 | }; 315 | $.get(toflwhbtxurl,(error, response, data) =>{ 316 | if(logs) $.log(`${jsname}, 余额提现: ${data}`) 317 | txtx =JSON.parse(data) 318 | if (txtx.status==1) 319 | { 320 | tz+='【余额提现】🎉:提现成功,请到公众号领取'+'\n' 321 | 322 | } 323 | 324 | else 325 | tz+='【余额提现】✖️:'+txtx.info+'\n' 326 | 327 | 328 | 329 | 330 | resolve() 331 | }) 332 | }) 333 | } 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | function showmsg() { 344 | 345 | 346 | 347 | if (notifyInterval==1) 348 | $.msg(jsname,'',tz) 349 | } 350 | 351 | 352 | // prettier-ignore 353 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 354 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Sunert", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "jingxi.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/Sunert/Scripts.git" 12 | }, 13 | "keywords": [], 14 | "author": "", 15 | "license": "ISC", 16 | "bugs": { 17 | "url": "https://github.com/Sunert/Scripts/issues" 18 | }, 19 | "homepage": "https://github.com/Sunert/Scripts#readme", 20 | "dependencies": { 21 | "crypto-js": "^4.0.0", 22 | "got": "^11.7.0", 23 | "http-server": "^0.12.3", 24 | "tough-cookie": "^4.0.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sendNotify.js: -------------------------------------------------------------------------------- 1 | const $ = new Env(); 2 | // =======================================微信server酱通知设置区域=========================================== 3 | //此处填你申请的SCKEY. 4 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入PUSH_KEY) 5 | let SCKEY = ''; 6 | 7 | // =======================================Bark App通知设置区域=========================================== 8 | //此处填你BarkAPP的信息(IP/设备码,例如:https://api.day.app/XXXXXXXX) 9 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入BARK_PUSH) 10 | let BARK_PUSH = ''; 11 | //BARK app推送铃声,铃声列表去APP查看复制填写 12 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入BARK_SOUND , Value输入app提供的铃声名称,例如:birdsong) 13 | let BARK_SOUND = ''; 14 | 15 | 16 | // =======================================telegram机器人通知设置区域=========================================== 17 | //此处填你telegram bot 的Token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw 18 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入TG_BOT_TOKEN) 19 | let TG_BOT_TOKEN = ''; 20 | //此处填你接收通知消息的telegram用户的id,例如:129xxx206 21 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入TG_USER_ID) 22 | let TG_USER_ID = ''; 23 | 24 | // =======================================钉钉机器人通知设置区域=========================================== 25 | //此处填你钉钉 bot 的webhook,例如:5a544165465465645d0f31dca676e7bd07415asdasd 26 | //注:此处设置github action用户填写到Settings-Secrets里面(Name输入DD_BOT_TOKEN) 27 | let DD_BOT_TOKEN = ''; 28 | //密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 29 | let DD_BOT_SECRET = ''; 30 | 31 | if (process.env.PUSH_KEY) { 32 | SCKEY = process.env.PUSH_KEY; 33 | } 34 | if (process.env.BARK_PUSH) { 35 | if(process.env.BARK_PUSH.indexOf('https') > -1 || process.env.BARK_PUSH.indexOf('http') > -1) { 36 | //兼容BARK自建用户 37 | BARK_PUSH = process.env.BARK_PUSH 38 | } else { 39 | BARK_PUSH = `https://api.day.app/${process.env.BARK_PUSH}` 40 | } 41 | if (process.env.BARK_SOUND) { 42 | BARK_SOUND = process.env.BARK_SOUND 43 | } 44 | } else { 45 | if(BARK_PUSH && BARK_PUSH.indexOf('https') === -1 && BARK_PUSH.indexOf('http') === -1) { 46 | //兼容BARK本地用户只填写设备码的情况 47 | BARK_PUSH = `https://api.day.app/${BARK_PUSH}` 48 | } 49 | } 50 | if (process.env.TG_BOT_TOKEN) { 51 | TG_BOT_TOKEN = process.env.TG_BOT_TOKEN; 52 | } 53 | if (process.env.TG_USER_ID) { 54 | TG_USER_ID = process.env.TG_USER_ID; 55 | } 56 | 57 | if (process.env.DD_BOT_TOKEN) { 58 | DD_BOT_TOKEN = process.env.DD_BOT_TOKEN; 59 | if (process.env.DD_BOT_SECRET) { 60 | DD_BOT_SECRET = process.env.DD_BOT_SECRET; 61 | } 62 | } 63 | 64 | async function sendNotify(text, desp) { 65 | //提供四种通知 66 | await serverNotify(text, desp); 67 | await BarkNotify(text, desp); 68 | await tgBotNotify(text, desp); 69 | await ddBotNotify(text, desp); 70 | } 71 | 72 | function serverNotify(text, desp) { 73 | return new Promise(resolve => { 74 | if (SCKEY) { 75 | //微信server酱推送通知一个\n不会换行,需要两个\n才能换行,故做此替换 76 | desp = desp.replace(/[\n\r]/g, '\n\n'); 77 | const options = { 78 | url: `https://sc.ftqq.com/${SCKEY}.send`, 79 | body: `text=${text}&desp=${desp}`, 80 | headers: { 81 | 'Content-Type': 'application/x-www-form-urlencoded' 82 | } 83 | } 84 | $.post(options, (err, resp, data) => { 85 | try { 86 | if (err) { 87 | console.log('\n发送通知调用API失败!!\n') 88 | console.log(err); 89 | } else { 90 | data = JSON.parse(data); 91 | if (data.errno === 0) { 92 | console.log('\nserver酱发送通知消息成功\n') 93 | } else if (data.errno === 1024) { 94 | console.log('\nPUSH_KEY 错误\n') 95 | } 96 | } 97 | } catch (e) { 98 | $.logErr(e, resp); 99 | } finally { 100 | resolve(data); 101 | } 102 | }) 103 | } else { 104 | console.log('\n您未提供server酱的SCKEY,取消微信推送消息通知\n'); 105 | resolve() 106 | } 107 | }) 108 | } 109 | 110 | function BarkNotify(text, desp) { 111 | return new Promise(resolve => { 112 | if (BARK_PUSH) { 113 | const options = { 114 | url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}`, 115 | } 116 | $.get(options, (err, resp, data) => { 117 | try { 118 | if (err) { 119 | console.log('\nBark APP发送通知调用API失败!!\n') 120 | console.log(err); 121 | } else { 122 | data = JSON.parse(data); 123 | if (data.code === 200) { 124 | console.log('\nBark APP发送通知消息成功\n') 125 | } else { 126 | console.log(`\n${data.message}\n`); 127 | } 128 | } 129 | } catch (e) { 130 | $.logErr(e, resp); 131 | } finally { 132 | resolve(); 133 | } 134 | }) 135 | } else { 136 | console.log('\n您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知\n'); 137 | resolve() 138 | } 139 | }) 140 | } 141 | 142 | function tgBotNotify(text, desp) { 143 | return new Promise(resolve => { 144 | if (TG_BOT_TOKEN && TG_USER_ID) { 145 | const options = { 146 | url: `https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage`, 147 | body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}`, 148 | headers: { 149 | 'Content-Type': 'application/x-www-form-urlencoded' 150 | } 151 | } 152 | $.post(options, (err, resp, data) => { 153 | try { 154 | if (err) { 155 | console.log('\ntelegram发送通知消息失败!!\n') 156 | console.log(err); 157 | } else { 158 | data = JSON.parse(data); 159 | if (data.ok) { 160 | console.log('\nTelegram发送通知消息完成。\n') 161 | } else if (data.error_code === 400) { 162 | console.log('\n请主动给bot发送一条消息并检查接收用户ID是否正确。\n') 163 | } else if (data.error_code === 401){ 164 | console.log('\nTelegram bot token 填写错误。\n') 165 | } 166 | } 167 | } catch (e) { 168 | $.logErr(e, resp); 169 | } finally { 170 | resolve(data); 171 | } 172 | }) 173 | } else { 174 | console.log('\n您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知\n'); 175 | resolve() 176 | } 177 | }) 178 | } 179 | function ddBotNotify(text, desp) { 180 | return new Promise(resolve => { 181 | const options = { 182 | url: `https://oapi.dingtalk.com/robot/send?access_token=${DD_BOT_TOKEN}`, 183 | json: { 184 | "msgtype": "text", 185 | "text": { 186 | "content": ` ${text}\n\n${desp}` 187 | } 188 | }, 189 | headers: { 190 | 'Content-Type': 'application/json' 191 | } 192 | } 193 | if (DD_BOT_TOKEN && DD_BOT_SECRET) { 194 | const crypto = require('crypto'); 195 | const dateNow = Date.now(); 196 | const hmac = crypto.createHmac('sha256', DD_BOT_SECRET); 197 | hmac.update(`${dateNow}\n${DD_BOT_SECRET}`); 198 | const result = encodeURIComponent(hmac.digest('base64')); 199 | options.url = `${options.url}×tamp=${dateNow}&sign=${result}`; 200 | $.post(options, (err, resp, data) => { 201 | try { 202 | if (err) { 203 | console.log('\n钉钉发送通知消息失败!!\n') 204 | console.log(err); 205 | } else { 206 | data = JSON.parse(data); 207 | if (data.errcode === 0) { 208 | console.log('\n钉钉发送通知消息完成。\n') 209 | } else { 210 | console.log(`\n${data.errmsg}\n`) 211 | } 212 | } 213 | } catch (e) { 214 | $.logErr(e, resp); 215 | } finally { 216 | resolve(data); 217 | } 218 | }) 219 | } else if (DD_BOT_TOKEN) { 220 | $.post(options, (err, resp, data) => { 221 | try { 222 | if (err) { 223 | console.log('\n钉钉发送通知消息失败!!\n') 224 | console.log(err); 225 | } else { 226 | data = JSON.parse(data); 227 | if (data.errcode === 0) { 228 | console.log('\n钉钉发送通知消息完成。\n') 229 | } else { 230 | console.log(`\n${data.errmsg}\n`) 231 | } 232 | } 233 | } catch (e) { 234 | $.logErr(e, resp); 235 | } finally { 236 | resolve(data); 237 | } 238 | }) 239 | } else { 240 | console.log('\n您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n'); 241 | resolve() 242 | } 243 | }) 244 | } 245 | module.exports = { 246 | sendNotify, 247 | BarkNotify, 248 | SCKEY, 249 | BARK_PUSH, 250 | TG_BOT_TOKEN, 251 | TG_USER_ID, 252 | DD_BOT_TOKEN, 253 | }//这里导出SCKEY,BARK_PUSH等通知参数是jd_bean_sign.js处需要 254 | // prettier-ignore 255 | function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;$.isMute||(this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o))),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} -------------------------------------------------------------------------------- /xiaoleziye.js: -------------------------------------------------------------------------------- 1 | 2 | /*ziye 3 | 4 | 5 | 微信扫码 https://raw.githubusercontent.com/ziye12/JavaScript/master/xiaoleziye.png 获取授权 6 | 7 | 开软件,然后进签到,点签到获取cookie 8 | 9 | 10 | 10.5 增加更多通知内容 11 | 10.7 修复cookie,获取问题 12 | 13 | 14 | 15 | 16 | hostname=minapp.xqrobot.net, 17 | 18 | #小乐 19 | ############## 圈x 20 | 21 | https:\/\/minapp\.xqrobot\.net\/* url script-request-body https://raw.githubusercontent.com/ziye12/JavaScript/master/xiaoleziye.js 22 | 23 | 24 | #小乐 25 | ############## loon 26 | 27 | 28 | http-request https:\/\/minapp\.xqrobot\.net\/* script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/xiaoleziye.js, requires-body=true 29 | 30 | 31 | #小乐 32 | ############## surge 33 | 34 | 小乐签到 = type=http-request,pattern=https:\/\/minapp\.xqrobot\.net\/*,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/xiaoleziye.js, requires-body=true 35 | 36 | 37 | 38 | 39 | 40 | */ 41 | 42 | 43 | 44 | 45 | 46 | const sy = init() 47 | 48 | const jsname='小乐签到' 49 | 50 | const logs = 0; //0为关闭日志,1为开启 51 | const notifyInterval=1//0为关闭通知,1为开启 52 | const jbid=1; 53 | 54 | 55 | const xiaoleurlKey = 'xiaoleurl'+jbid 56 | 57 | const xiaoleheaderKey = 'xiaolehd'+jbid 58 | 59 | const xiaolebodyKey = 'xiaolebd'+jbid 60 | 61 | const xiaoleurlVal = sy.getdata(xiaoleurlKey) 62 | 63 | const xiaoleheaderVal = sy.getdata(xiaoleheaderKey) 64 | 65 | const xiaolebodyVal = sy.getdata(xiaolebodyKey) 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | var tz='' 75 | 76 | 77 | let isGetCookie = typeof $request !== 'undefined' 78 | if (isGetCookie) { 79 | GetCookie() 80 | } else { 81 | all() 82 | } 83 | 84 | 85 | 86 | 87 | 88 | function GetCookie() { 89 | 90 | if ($request.headers){ 91 | 92 | if($request &&$request.url.indexOf("/user.php?mod=sign&")>=0) { 93 | 94 | const xiaoleurlVal = $request.url 95 | if (xiaoleurlVal) sy.setdata(xiaoleurlVal,xiaoleurlKey) 96 | sy.log(`[${jsname}] 获取url请求: 成功,xiaoleurlVal: ${xiaoleurlVal}`) 97 | 98 | const xiaolebodyVal = $request.body 99 | if (xiaolebodyVal) sy.setdata(xiaolebodyVal,xiaolebodyKey) 100 | sy.log(`[${jsname}] 获取阅读: 成功,xiaolebodyVal: ${xiaolebodyVal}`) 101 | 102 | const xiaoleheaderVal = JSON.stringify($request.headers) 103 | if (xiaoleheaderVal) sy.setdata(xiaoleheaderVal,xiaoleheaderKey) 104 | sy.log(`[${jsname}] 获取Cookie: 成功,xiaoleheaderVal: ${xiaoleheaderVal}`) 105 | sy.msg(xiaoleheaderKey, `获取Cookie: 成功🎉`, ``) 106 | 107 | 108 | 109 | 110 | } 111 | 112 | } 113 | 114 | } 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | function all() 128 | 129 | { 130 | 131 | for(var i=0;i<5;i++) 132 | { (function(i) { 133 | setTimeout(function() { 134 | 135 | if(i==0) xiaoletask(i); 136 | 137 | else if(i==1) xiaoleuser(i); 138 | else if(i==2) xiaoletg(i); 139 | else if(i==3) xiaolesy(i); 140 | 141 | 142 | 143 | else if(i==4) showmsg(i); 144 | }, (i + 1) *1000); 145 | })(i) 146 | 147 | 148 | }} 149 | 150 | 151 | 152 | //签到 153 | function xiaoletask() { 154 | return new Promise((resolve, reject) => { 155 | 156 | const toxiaoleurl = { 157 | 158 | url: xiaoleurlVal, 159 | 160 | headers: JSON.parse(xiaoleheaderVal), 161 | body: xiaolebodyVal 162 | }; 163 | sy.post(toxiaoleurl,(error, response, data) =>{ 164 | if(logs) sy.log(`${jsname}, 签到信息: ${data}`) 165 | signinfo =JSON.parse(data) 166 | if (signinfo.result==true) 167 | { 168 | tz+='【签到成功】🎉:'+signinfo.show+'\n' 169 | } 170 | 171 | else if (signinfo.result==false) 172 | { 173 | tz+='【重复签到】✖️:'+signinfo.show+'\n' 174 | } 175 | 176 | 177 | 178 | resolve() 179 | }) 180 | }) 181 | } 182 | 183 | 184 | 185 | 186 | function xiaoleuser() { 187 | return new Promise((resolve, reject) => { 188 | 189 | const toxiaoleuserurl = { 190 | url: xiaoleurlVal.replace(/mod=sign/g, `mod=index`), 191 | headers: JSON.parse(xiaoleheaderVal), 192 | 193 | }; 194 | sy.post(toxiaoleuserurl,(error, response, data) =>{ 195 | if(logs) sy.log(`${jsname}, 用户信息: ${data}`) 196 | userinfo =JSON.parse(data) 197 | if (userinfo.result==true) 198 | { 199 | tz+='【'+userinfo.info.userlevel_name+'】👤:'+userinfo.info.user_name+'\n'+ 200 | '【现金余额】🧧:'+userinfo.info.user_money+'元'+'\n'+ 201 | '【今日收益】🧧:'+userinfo.info.jiang_day1+'元'+'\n'+ 202 | '【本月收益】🧧:'+userinfo.info.jiang_month1+'元'+'\n'+ 203 | '【签到任务】⏰:'+userinfo.info.task_list[0].name+'\n'+ 204 | '【签到收益】⏰:'+userinfo.info.task_list[0].money+'\n'+ 205 | '【签到信息】⏰:'+userinfo.info.task_list[0].desc+'\n'+ 206 | 207 | 208 | 209 | '【邀请任务】👥:'+userinfo.info.task_list[1].name+'\n'+ 210 | '【邀请收益】👥:'+userinfo.info.task_list[1].money+'\n'+ 211 | '【邀请信息】👥:'+userinfo.info.task_list[1].desc+'\n' 212 | 213 | 214 | } 215 | 216 | 217 | else if (userinfo.result==false) 218 | { 219 | tz+=userinfo.show 220 | } 221 | 222 | 223 | 224 | resolve() 225 | }) 226 | }) 227 | } 228 | 229 | 230 | 231 | 232 | 233 | function xiaoletg() { 234 | return new Promise((resolve, reject) => { 235 | 236 | const toxiaoletgurl = { 237 | url: xiaoleurlVal.replace(/mod=sign/g, `mod=tg&act=user&level=&page=1`), 238 | headers: JSON.parse(xiaoleheaderVal), 239 | 240 | }; 241 | sy.post(toxiaoletgurl,(error, response, data) =>{ 242 | if(logs) sy.log(`${jsname}, 用户信息: ${data}`) 243 | tginfo =JSON.parse(data) 244 | 245 | 246 | if (tginfo.result==true) 247 | { 248 | 249 | 250 | tz+='【好友信息】😄:'+tginfo.list[0].user_name+'\n'+ 251 | '【注册时间】🤖:'+tginfo.list[0].user_atime+'\n'+ 252 | '【好友等级】🎊:'+tginfo.list[0].userlevel_name+'\n' 253 | 254 | 255 | 256 | 257 | } 258 | 259 | 260 | else if (userinfo.result==false) 261 | { 262 | tz+='错误' 263 | } 264 | 265 | 266 | 267 | resolve() 268 | }) 269 | }) 270 | } 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | function xiaolesy() { 290 | return new Promise((resolve, reject) => { 291 | 292 | const toxiaolesyurl = { 293 | url: xiaoleurlVal.replace(/mod=sign/g, `mod=tbk_jiang&page=1`), 294 | headers: JSON.parse(xiaoleheaderVal), 295 | 296 | }; 297 | sy.post(toxiaolesyurl,(error, response, data) =>{ 298 | if(logs) sy.log(`${jsname}, 收益信息: ${data}`) 299 | syinfo =JSON.parse(data) 300 | var xx=syinfo.list[0].jiang_text 301 | var tt=xx.substring(xx.indexOf("用户")+2,xx.indexOf("奖励")); 302 | 303 | 304 | 305 | if (syinfo.result==true) 306 | { 307 | tz+= 308 | '【收益信息】👤:'+tt+'\n'+ 309 | '【下单时间】🧧:'+syinfo.list[0].jiang_adate+'\n'+ 310 | '【预计收益】🧧:'+syinfo.list[0].jiang_money+'元'+'\n' 311 | 312 | 313 | 314 | 315 | 316 | 317 | } 318 | 319 | 320 | else if (userinfo.result==false) 321 | { 322 | tz+=userinfo.show 323 | } 324 | 325 | 326 | 327 | resolve() 328 | }) 329 | }) 330 | } 331 | 332 | 333 | 334 | 335 | function showmsg() { 336 | 337 | console.log(tz) 338 | 339 | if (notifyInterval==1) 340 | sy.msg(jsname,'',tz) 341 | } 342 | 343 | 344 | function init() { 345 | isSurge = () => { 346 | return undefined !== this.$httpClient 347 | } 348 | isQuanX = () => { 349 | return undefined !== this.$task 350 | } 351 | getdata = (key) => { 352 | if (isSurge()) return $persistentStore.read(key) 353 | if (isQuanX()) return $prefs.valueForKey(key) 354 | } 355 | setdata = (key, val) => { 356 | if (isSurge()) return $persistentStore.write(key, val) 357 | if (isQuanX()) return $prefs.setValueForKey(key, val) 358 | } 359 | msg = (title, subtitle = '', body = '') => { 360 | if (isSurge()) $notification.post(title, subtitle, body) 361 | if (isQuanX()) $notify(title, subtitle, body) 362 | } 363 | log = (msg) => { 364 | console.log(`${msg}\n`) 365 | } 366 | get = (options, callback) => { 367 | if (isQuanX()) { 368 | if (typeof options == 'string') options = { url: options } 369 | options['method'] = 'GET' 370 | return $task.fetch(options).then( 371 | (response) => { 372 | response['status'] = response.statusCode 373 | callback(null, response, response.body) 374 | }, 375 | (reason) => callback(reason.error, null, null) 376 | ) 377 | } 378 | if (isSurge()) return $httpClient.get(options, callback) 379 | } 380 | post = (options, callback) => { 381 | if (isQuanX()) { 382 | if (typeof options == 'string') options = { url: options } 383 | options['method'] = 'POST' 384 | $task.fetch(options).then( 385 | (response) => { 386 | response['status'] = response.statusCode 387 | callback(null, response, response.body) 388 | }, 389 | (reason) => callback(reason.error, null, null) 390 | ) 391 | } 392 | if (isSurge()) $httpClient.post(options, callback) 393 | } 394 | done = (value = {}) => { 395 | $done(value) 396 | } 397 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 398 | } 399 | 400 | -------------------------------------------------------------------------------- /xiaoleziye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/age174/JavaScript/058f182c19c3c1fb1c784ff5cd902eca8eae17b4/xiaoleziye.png -------------------------------------------------------------------------------- /yydkziye.js: -------------------------------------------------------------------------------- 1 | /*ziye 音乐打卡 2 | 3 | 4 | 非常重要!!! 5 | 6 | 微信扫码 https://raw.githubusercontent.com/ziye12/JavaScript/master/yydkziye.png 进入小程序,登录获取授权,再启动软件获取ck 7 | 建议设置6点到23点之间打卡,时间间隔30分钟以上,否则容易封号 8 | 9 | 10 | 11 | 12 | 13 | 2020.9.8 14 | 2020.9.9 修复部分错误 15 | 2020.9.13 打卡次数调整为5 16 | 2020.9.16 打卡次数恢复为10 17 | 18 | 19 | 20 | 21 | 《《《《《《《《《《制作其他打卡js的说明 22 | 23 | 抓包小程序,然后替换以下内容来制作其他打卡js, 24 | 需要替换的内容如下,按顺序替换字符,自己用电脑或者KODE软件替换,KODE下载链接https://apps.apple.com/cn/app/koder-code-editor/id1447489375 25 | 26 | www.baimaa.com 27 | 音乐打卡 28 | cs = 10 29 | xj = 1 30 | yydkurl 31 | i=11 32 | yydk 33 | 34 | 手动替换 35 | www\.baimaa\.com 36 | 37 | 制作其他打卡js的说明》》》》》》》》》》》 38 | 39 | 40 | 41 | 42 | 43 | 44 | ////////////////////////////////////////正文 45 | 46 | 47 | 使用说明: 48 | 49 | 一,微信扫码 https://raw.githubusercontent.com/ziye12/JavaScript/master/yydkziye.png 进入小程序,登录获取授权 50 | 51 | 二,然后将hostname复制粘贴进配置文件 52 | 53 | 三,将重写复制到 rewrite_local 下,再进入程序获取ck,建议 放入新建配置片段,获取之后禁用即可 54 | 55 | 56 | 功能如下: 57 | 1.每日打卡,设置了开关,完成任务不再打卡 58 | 2.打卡币统计, 59 | 3.现金统计,自动提现 60 | 61 | hostname= www.baimaa.com, 62 | 63 | 64 | 65 | //surge 66 | 音乐打卡 = type=http-request,pattern=^https:\/\/www\.baimaa\.com\/*,requires-body=1,max-size=0,script-path= https://raw.githubusercontent.com/ziye12/JavaScript/master/yydkziye.js 67 | 68 | 69 | //圈x 70 | https:\/\/www\.baimaa\.com\/* url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/yydkziye.js 71 | 72 | //loon 73 | http-request ^https:\/\/www\.baimaa\.com\/* script-path= https://raw.githubusercontent.com/ziye12/JavaScript/master/yydkziye.js, requires-body=true, timeout=10, tag=音乐打卡 74 | 75 | 76 | 77 | */ 78 | 79 | 80 | 81 | 82 | 83 | const sy = init()//声明必须 84 | const notifyInterval = 1; //通知开为1,常关为0 85 | const logs = 0; // 日志开关 86 | const jsname = '音乐打卡' 87 | const jbid =1 88 | const sb='失败,请先关闭,进入程序获取授权' 89 | 90 | const cs = 10;//小程序打卡次数 91 | const xj = 1;//提现标准 92 | var tz='' 93 | 94 | const dkurlkey = 'yydkurl'+jbid 95 | const dkurl = sy.getdata(dkurlkey) 96 | 97 | 98 | let isGetCookie = typeof $request !== 'undefined' 99 | if (isGetCookie) { 100 | GetCookie() 101 | } else { 102 | all() 103 | } 104 | 105 | 106 | 107 | function GetCookie() { 108 | if ($request && $request.url.match(/i=11&/)) 109 | if ($request && $request.url.match(/action=today&contr=index/)) 110 | { 111 | const dkurl = $request.url 112 | sy.log(`dkurl:${dkurl}`) 113 | if (dkurl) sy.setdata(dkurl, dkurlkey) 114 | sy.msg(dkurlkey, `获取cookie: 成功🎉`, ``) 115 | } 116 | 117 | } 118 | 119 | 120 | //异步运行 121 | 122 | 123 | function all() 124 | 125 | { 126 | 127 | for(var i=0;i<3;i++) 128 | { (function(i) { 129 | setTimeout(function() { 130 | 131 | if(i==0) dktj(i); 132 | else if(i==1) dkxj(i); 133 | else if(i==2) showmsg(i); 134 | }, (i + 1) * 1000); 135 | })(i) 136 | 137 | 138 | }} 139 | 140 | 141 | 142 | 143 | //统计 144 | 145 | function dktj() { 146 | return new Promise((resolve, reject) => { 147 | 148 | const Tjurl = { 149 | url: dkurl 150 | }; 151 | sy.get(Tjurl,(error, response, data) =>{ 152 | if(logs)sy.log(`${jsname}1统计 - data: ${data}`) 153 | obj = JSON.parse(data) 154 | if(obj.status == 1 && obj.info.today.clock < cs){tz+="[账户信息]🎉"+"\n"+ 155 | "今日已打卡"+[Number(obj.info.today.clock) ]+"/"+cs+"次"+"余"+[Number(obj.info.today. currency)]+"币"+"\n" 156 | }else tz+="[打卡完成]"+"余"+[Number(obj.info.today. currency)]+"币"+"\n" 157 | 158 | 159 | 160 | 161 | 162 | cstj1(obj.info.today.clock); 163 | 164 | 165 | 166 | resolve() 167 | }) 168 | }) 169 | } 170 | 171 | 172 | //次数统计 173 | 174 | 175 | function cstj1(tjtj) 176 | { 177 | if (tjtj { 188 | 189 | const Xjurl = { 190 | url: dkurl.replace(/action=today&contr=index/g, `action=index&contr=my`) 191 | }; 192 | sy.get(Xjurl,(error, response, data) =>{ 193 | if(logs)sy.log(`${jsname}1现金 - data: ${data}`) 194 | obj = JSON.parse(data) 195 | if(obj.status == 1) { 196 | 197 | 198 | 199 | 200 | tz +="💵现金余额"+ 201 | obj.info.member.money+"元"+"\n" 202 | 203 | } 204 | 205 | else tz +=sb+"\n"; 206 | 207 | 208 | xjtj1(obj.info.member.money); 209 | 210 | 211 | 212 | resolve() 213 | }) 214 | }) 215 | } 216 | 217 | 218 | 219 | 220 | //自动提现 221 | 222 | function dktx() { 223 | return new Promise((resolve, reject) => { 224 | 225 | const Txurl = { 226 | url: dkurl.replace(/action=today&contr=index/g, `action=withdrawals&contr=my&money=${xj}&payment_code=`) 227 | }; 228 | sy.get(Txurl,(error, response, data) =>{ 229 | if(logs)sy.log(`${jsname}1提现 - data: ${data}`) 230 | obj = JSON.parse(data) 231 | if(obj.status == 1) { 232 | 233 | tz +='提现成功,成功提现'+xj+'元'+"\n" 234 | 235 | } 236 | 237 | if(obj.status == 2) { 238 | 239 | tz +='提现失败,原因:'+obj.info+"\n" 240 | 241 | } 242 | 243 | 244 | 245 | 246 | resolve() 247 | }) 248 | }) 249 | } 250 | 251 | 252 | 253 | //现金统计 254 | 255 | 256 | function xjtj1(tjtj) 257 | { 258 | if (tjtj>=xj) 259 | dktx() 260 | 261 | } 262 | 263 | 264 | 265 | //打卡 266 | function dkdk() { 267 | return new Promise((resolve, reject) => { 268 | 269 | const Dkurl = { 270 | url: dkurl.replace(/action=today&contr=index/g, `action=sign&contr=clock`) 271 | }; 272 | sy.get(Dkurl,(error, response, data) =>{ 273 | if(logs)sy.log(`${jsname}1打卡- data: ${data}`) 274 | obj = JSON.parse(data) 275 | 276 | if (obj.status==1){ 277 | tz+='[️打卡任务]:'+'打卡次数+1'+'\n' 278 | 279 | } 280 | else tz +=obj.info+'\n' 281 | 282 | 283 | resolve() 284 | }) 285 | }) 286 | } 287 | 288 | 289 | function showmsg() { 290 | 291 | console.log(tz) 292 | 293 | if (notifyInterval==1) 294 | sy.msg(jsname,'',tz) 295 | } 296 | 297 | 298 | function init() { 299 | isSurge = () => { 300 | return undefined !== this.$httpClient 301 | } 302 | isQuanX = () => { 303 | return undefined !== this.$task 304 | } 305 | getdata = (key) => { 306 | if (isSurge()) return $persistentStore.read(key) 307 | if (isQuanX()) return $prefs.valueForKey(key) 308 | } 309 | setdata = (key, val) => { 310 | if (isSurge()) return $persistentStore.write(key, val) 311 | if (isQuanX()) return $prefs.setValueForKey(key, val) 312 | } 313 | msg = (title, subtitle = '', body = '') => { 314 | if (isSurge()) $notification.post(title, subtitle, body) 315 | if (isQuanX()) $notify(title, subtitle, body) 316 | } 317 | log = (msg) => { 318 | console.log(`${msg}\n`) 319 | } 320 | get = (options, callback) => { 321 | if (isQuanX()) { 322 | if (typeof options == 'string') options = { url: options } 323 | options['method'] = 'GET' 324 | return $task.fetch(options).then( 325 | (response) => { 326 | response['status'] = response.statusCode 327 | callback(null, response, response.body) 328 | }, 329 | (reason) => callback(reason.error, null, null) 330 | ) 331 | } 332 | if (isSurge()) return $httpClient.get(options, callback) 333 | } 334 | post = (options, callback) => { 335 | if (isQuanX()) { 336 | if (typeof options == 'string') options = { url: options } 337 | options['method'] = 'POST' 338 | $task.fetch(options).then( 339 | (response) => { 340 | response['status'] = response.statusCode 341 | callback(null, response, response.body) 342 | }, 343 | (reason) => callback(reason.error, null, null) 344 | ) 345 | } 346 | if (isSurge()) $httpClient.post(options, callback) 347 | } 348 | done = (value = {}) => { 349 | $done(value) 350 | } 351 | return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } 352 | } 353 | -------------------------------------------------------------------------------- /ziye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/age174/JavaScript/058f182c19c3c1fb1c784ff5cd902eca8eae17b4/ziye.png --------------------------------------------------------------------------------