diff --git a/ .gitignore b/ .gitignore deleted file mode 100644 index 3e4350fc08..0000000000 --- a/ .gitignore +++ /dev/null @@ -1,18 +0,0 @@ - -# OSX -.DS_Store - - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Dependency directories -node_modules/ -package-lock.json - -jingxi.js -result.txt \ No newline at end of file diff --git a/.github/pull.yml b/.github/pull.yml new file mode 100644 index 0000000000..a2bbd1a57a --- /dev/null +++ b/.github/pull.yml @@ -0,0 +1,8 @@ +# 使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) + +version: "1" +rules: # Array of rules + - base: master # Required. Target branch + upstream: Sunert:master # Required. Must be in the same fork network. + mergeMethod: hardreset # Optional, one of [none, merge, squash, rebase, hardreset], Default: none. + mergeUnstable: true # Optional, merge pull request even when the mergeable_state is not clean. Default: false \ No newline at end of file diff --git a/.github/workflows/AUTO_KS.yml b/.github/workflows/AUTO_KS.yml new file mode 100644 index 0000000000..352b4c0930 --- /dev/null +++ b/.github/workflows/AUTO_KS.yml @@ -0,0 +1,42 @@ +# 快手视频刷金币测试,抓包获取secrets + +name: 快手视频浏览 + +on: + workflow_dispatch: + schedule: + - cron: '*/30 2,8,16 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + KUAISHOUMV: ${{ secrets.KUAISHOUMV }} + TZ: Asia/shanghai + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【快手视频】' + if: env.KUAISHOUMV + run: | + cd ~/Scripts + node Task/Auto_Kuaishou.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} diff --git a/.github/workflows/dianshijia.yml b/.github/workflows/dianshijia.yml new file mode 100644 index 0000000000..8622189e88 --- /dev/null +++ b/.github/workflows/dianshijia.yml @@ -0,0 +1,43 @@ + +name: 电视家 + +on: + workflow_dispatch: + schedule: + - cron: '*/15 4,12,19,23 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + DSJ_HEADERS: ${{ secrets.DSJ_HEADERS }} + DSJ_DRAWAL: ${{ secrets.DSJ_DRAWAL }} + TZ: Asia/shanghai + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【电视家】' + if: env.DSJ_HEADERS + run: | + cd ~/Scripts + node Task/dianshijia.js + env: + DSJ_NOTIFY_CONTROL: ${{ secrets.DSJ_NOTIFY_CONTROL }} + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/.github/workflows/jingxi.yml b/.github/workflows/jingxi.yml index c84eaf63eb..8cbb06e88d 100644 --- a/.github/workflows/jingxi.yml +++ b/.github/workflows/jingxi.yml @@ -1,35 +1,40 @@ -name: jingxi +name: 京喜 on: - #push: - #branches: - #- master + workflow_dispatch: schedule: - - cron: '5 23 * * *' + - cron: '1 19 * * *' watch: types: started jobs: - build: runs-on: ubuntu-latest if: github.event.repository.owner.id == github.event.sender.id + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} steps: - - uses: actions/checkout@v1 - - name: Use Node.js 10.x + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 12.x - name: npm install run: | + cd ~/Scripts npm install - name: '运行 【京喜】' + if: env.JD_COOKIE run: | + cd ~/Scripts node Task/jingxi.js env: - JD_COOKIE: ${{ secrets.JD_COOKIE }} PUSH_KEY: ${{ secrets.PUSH_KEY }} BARK_PUSH: ${{ secrets.BARK_PUSH }} TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} TG_USER_ID: ${{ secrets.TG_USER_ID }} BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/.github/workflows/jkd.yml b/.github/workflows/jkd.yml new file mode 100644 index 0000000000..fb90cc97a7 --- /dev/null +++ b/.github/workflows/jkd.yml @@ -0,0 +1,39 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: 聚看点 + +on: + workflow_dispatch: + schedule: + - cron: "*/30 * * * *" + watch: + types: [started] + repository_dispatch: + types: jkd + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: "运行 【聚看点】" + run: | + node jkd.js + env: + JKD_COOKIE: ${{ secrets.JKD_COOKIE }} + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} diff --git a/.github/workflows/joy.yml b/.github/workflows/joy.yml new file mode 100644 index 0000000000..6c3437240c --- /dev/null +++ b/.github/workflows/joy.yml @@ -0,0 +1,51 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: 疯狂的joy + +on: + workflow_dispatch: + schedule: + - cron: '30 16 * * *' + watch: + types: started + repository_dispatch: + types: joy +jobs: + build: + + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + repository: WeiMingZhan/Scripts + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Cache node_modules + uses: actions/cache@v2 # 使用 GitHub 官方的缓存 Action。 + env: + cache-name: cache-node-modules + with: + path: node_modules + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }} # 使用 package-lock.json 的 Hash 作为缓存的 key。也可以使用 package.json 代替 + - name: npm install + run: | + npm install + - name: '运行 【疯狂的joy】' + run: | + node joy.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + JD_DEBUG: ${{ secrets.JD_DEBUG }} + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} + IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY }} diff --git "a/.github/workflows/joy\346\200\273\345\212\250\345\221\230.yml" "b/.github/workflows/joy\346\200\273\345\212\250\345\221\230.yml" new file mode 100644 index 0000000000..5f6f30f64a --- /dev/null +++ "b/.github/workflows/joy\346\200\273\345\212\250\345\221\230.yml" @@ -0,0 +1,32 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: joy总动员 +on: + workflow_dispatch: + schedule: + - cron: '0 6 1 * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【joy总动员】' + run: | + node ./jd_friend.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} diff --git a/.github/workflows/kuaishou.yml b/.github/workflows/kuaishou.yml new file mode 100644 index 0000000000..d86ec4a7e2 --- /dev/null +++ b/.github/workflows/kuaishou.yml @@ -0,0 +1,41 @@ + +name: 快手视频签到 + +on: + workflow_dispatch: + schedule: + - cron: '15 19 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + KS_TOKEN: ${{ secrets.KS_TOKEN }} + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: 运行 【快手视频签到】 + if: env.KS_TOKEN + run: | + cd ~/Scripts + node Task/kuaishou.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY || github.event.client_payload.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH || github.event.client_payload.BARK_PUSH }} + BARK_SOUND: ${{ secrets.BARK_SOUND || github.event.client_payload.BARK_SOUND }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN || github.event.client_payload.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID || github.event.client_payload.TG_USER_ID }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN || github.event.client_payload.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET || github.event.client_payload.DD_BOT_SECRET }} + IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY || github.event.client_payload.IGOT_PUSH_KEY }} diff --git a/.github/workflows/midu_read.yml b/.github/workflows/midu_read.yml new file mode 100644 index 0000000000..0443355d7b --- /dev/null +++ b/.github/workflows/midu_read.yml @@ -0,0 +1,43 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: 米读 + +on: + workflow_dispatch: + schedule: + - cron: '*/15 1-14 * * *' + +jobs: + build: + runs-on: ubuntu-latest + env: + MIDU_TOKEN: ${{ secrets.MIDU_TOKEN }} + MIDU_TIME: ${{ secrets.MIDU_TIME }} + MIDU_SIGN: ${{ secrets.MIDU_SIGN }} + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + cd ~/Scripts + npm install + - name: '运行 【米读自动阅读】' + if: env.MIDU_TOKEN + run: | + cd ~/Scripts + node Task/midu_Read.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + + + diff --git a/.github/workflows/repo_sync.yml b/.github/workflows/repo_sync.yml new file mode 100644 index 0000000000..4655bfcdae --- /dev/null +++ b/.github/workflows/repo_sync.yml @@ -0,0 +1,47 @@ +# File: .github/workflows/repo-sync.yml +name: sync-Sunert-scripts +on: + schedule: + - cron: '1 0,12,22 * * *' + workflow_dispatch: + watch: + types: started + repository_dispatch: + types: sync-Sunert-scripts +jobs: + repo-sync: + env: + PAT: ${{ secrets.PAT }} #此处PAT需要申请,教程详见:https://www.jianshu.com/p/bb82b3ad1d11 + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} # 我自己同步到gitee使用,其他人可忽略 + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: sync Sunert-scripts + uses: repo-sync/github-sync@v2 + if: env.PAT + with: + source_repo: "https://github.com/Sunert/Scripts.git" + source_branch: "master" + destination_branch: "master" + github_token: ${{ secrets.PAT }} + # 我自己同步到gitee使用,其他人可忽略 + - name: sync github -> gitee + uses: Yikun/hub-mirror-action@master + if: env.dst_key + with: + # 必选,需要同步的Github用户(源) + src: github/Sunert + # 必选,需要同步到的Gitee的用户(目的) + dst: gitee/Sunert + # 必选,更新指定库名字 + static_list: "Scripts" + + # 必选,Gitee公钥对应的私钥,https://gitee.com/profile/sshkeys + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} + + # 必选,Gitee对应的用于创建仓库的token,https://gitee.com/profile/personal_access_tokens + dst_token: ${{ secrets.GITEE_TOKEN }} diff --git a/.github/workflows/txnews.yml b/.github/workflows/txnews.yml index 9c611dd79e..c331ed5a9c 100644 --- a/.github/workflows/txnews.yml +++ b/.github/workflows/txnews.yml @@ -4,14 +4,12 @@ # branches: # - master -name: txnews +name: 腾讯新闻 on: - #push: - #branches: - #- master + workflow_dispatch: schedule: - - cron: '*/7 1-14 * * *' + - cron: '*/7 * * * *' watch: types: started @@ -19,25 +17,34 @@ jobs: build: runs-on: ubuntu-latest if: github.event.repository.owner.id == github.event.sender.id + env: + TXNEWS_SIGN: ${{ secrets.TXNEWS_SIGN }} + TXNEWS_COOKIE: ${{ secrets.TXNEWS_COOKIE }} + TXNEWS_VIDEO: ${{ secrets.TXNEWS_VIDEO }} steps: - - uses: actions/checkout@v1 - - name: Use Node.js 10.x + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 12.x - name: npm install run: | + cd ~/Scripts npm install - name: '运行 【腾讯新闻】' + if: env.TXNEWS_COOKIE run: | + cd ~/Scripts node Task/txnews.js env: - cookieVal: ${{ secrets.TXNEWS_COOKIE }} - signurlVal: ${{ secrets.TXNEWS_SIGN }} - videoVal: ${{ secrets.TXNEWS_VIDEO }} PUSH_KEY: ${{ secrets.PUSH_KEY }} BARK_PUSH: ${{ secrets.BARK_PUSH }} + TXNEWS_NOTIFY_CONTROL: ${{ secrets.TXNEWS_NOTIFY_CONTROL }} TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} TG_USER_ID: ${{ secrets.TG_USER_ID }} BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} diff --git a/.github/workflows/weibo.yml b/.github/workflows/weibo.yml new file mode 100644 index 0000000000..8212569a5f --- /dev/null +++ b/.github/workflows/weibo.yml @@ -0,0 +1,42 @@ + +name: 微博每日签到打卡 + +on: + workflow_dispatch: + schedule: + - cron: '5 18 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + WB_TOKEN: ${{ secrets.WB_TOKEN }} + WB_PAY: ${{ secrets.WB_PAY }} + steps: + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + if: env.WB_TOKEN + run: | + cd ~/Scripts + npm install + - name: '运行 【新浪微博】' + if: env.WB_TOKEN + run: | + cd ~/Scripts + node Task/weibo.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + BARK_PUSH: ${{ secrets.BARK_PUSH }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + BARK_SOUND: ${{ secrets.BARK_SOUND }} + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} \ No newline at end of file diff --git a/.github/workflows/youth.yml b/.github/workflows/youth.yml index 78b92707d3..e671d4603a 100644 --- a/.github/workflows/youth.yml +++ b/.github/workflows/youth.yml @@ -1,14 +1,12 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: youth +name: 中青看点 on: - #push: - #branches: - #- master + workflow_dispatch: schedule: - - cron: '*/5 16-22 * * *' + - cron: '*/35 * * * *' watch: types: started @@ -16,28 +14,37 @@ jobs: build: runs-on: ubuntu-latest if: github.event.repository.owner.id == github.event.sender.id + env: + YOUTH_HEADER: ${{ secrets.YOUTH_HEADER }} + YOUTH_ARTBODY: ${{ secrets.YOUTH_ARTBODY }} + YOUTH_REDBODY: ${{ secrets.YOUTH_REDBODY }} + YOUTH_TIME: ${{ secrets.YOUTH_TIME }} steps: - - uses: actions/checkout@v1 - - name: Use Node.js 10.x + - name: Checkout + run: | + git clone https://github.com/Sunert/Scripts.git ~/Scripts + - name: Use Node.js 12.x uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 12.x - name: npm install + if: env.YOUTH_HEADER run: | + cd ~/Scripts npm install - name: '运行 【中青看点】' + if: env.YOUTH_HEADER run: | + cd ~/Scripts node Task/youth.js env: - YOUTH_HEADER: ${{ secrets.YOUTH_HEADER }} - YOUTH_ARTBODY: ${{ secrets.YOUTH_ARTBODY }} - YOUTH_REDBODY: ${{ secrets.YOUTH_REDBODY }} - YOUTH_TIME: ${{ secrets.YOUTH_TIME }} + YOUTH_NOTIFY_CONTROL: ${{ secrets.YOUTH_NOTIFY_CONTROL }} PUSH_KEY: ${{ secrets.PUSH_KEY }} BARK_PUSH: ${{ secrets.BARK_PUSH }} TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} TG_USER_ID: ${{ secrets.TG_USER_ID }} BARK_SOUND: ${{ secrets.BARK_SOUND }} - + DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }} + DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }} diff --git a/.github/workflows/youth_read.yml b/.github/workflows/youth_read.yml new file mode 100644 index 0000000000..00d2678d9c --- /dev/null +++ b/.github/workflows/youth_read.yml @@ -0,0 +1,57 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: 中青自动阅读 + +on: + workflow_dispatch: + schedule: + - cron: '6 1-12/2 * * *' + watch: + types: started +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + YOUTH_READ: ${{ secrets.YOUTH_READ }} + YOUTH_READ2: ${{ secrets.YOUTH_READ2 }} + YOUTH_READ3: ${{ secrets.YOUTH_READ3 }} + YOUTH_READ4: ${{ secrets.YOUTH_READ4 }} + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: | + npm install + + - name: '运行 【中青看点自动阅读一】' + if: env.YOUTH_READ + run: | + node Task/Youth_Read.js + env: + YOUTH_READ: ${{ secrets.YOUTH_READ }} + + - name: '运行 【中青看点自动阅读二】' + if: env.YOUTH_READ2 + run: | + node Task/Youth_Read.js + env: + YOUTH_READ: ${{ secrets.YOUTH_READ2 }} + + - name: '运行 【中青看点自动阅读三】' + if: env.YOUTH_READ3 + run: | + node Task/Youth_Read.js + env: + YOUTH_READ: ${{ secrets.YOUTH_READ3 }} + + - name: '运行 【中青看点自动阅读四】' + if: env.YOUTH_READ4 + run: | + node Task/Youth_Read.js + env: + YOUTH_READ: ${{ secrets.YOUTH_READ4 }} \ No newline at end of file diff --git "a/.github/workflows/\344\270\255\351\235\222\346\236\201\351\200\237\347\211\210\351\230\205\350\257\273\344\270\200.yml" "b/.github/workflows/\344\270\255\351\235\222\346\236\201\351\200\237\347\211\210\351\230\205\350\257\273\344\270\200.yml" new file mode 100644 index 0000000000..270be530f7 --- /dev/null +++ "b/.github/workflows/\344\270\255\351\235\222\346\236\201\351\200\237\347\211\210\351\230\205\350\257\273\344\270\200.yml" @@ -0,0 +1,32 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 中青极速版阅读一 +on: + workflow_dispatch: + schedule: + - cron: '0 */1 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【中青极速版阅读一】' + run: | + node ./Task/youth_Read.js + env: + PUSH_KEY: ${{ secrets.PUSH_KEY }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} diff --git "a/.github/workflows/\344\271\246\346\227\227\345\260\217\350\257\264.yml" "b/.github/workflows/\344\271\246\346\227\227\345\260\217\350\257\264.yml" new file mode 100644 index 0000000000..f5ac16e2ed --- /dev/null +++ "b/.github/workflows/\344\271\246\346\227\227\345\260\217\350\257\264.yml" @@ -0,0 +1,31 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 书旗小说 +on: + workflow_dispatch: + schedule: + - cron: '45 6,18 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【书旗小说】' + run: | + node ./sqxs.js + env: + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} diff --git "a/.github/workflows/\344\272\221\346\211\253\347\240\201.yml" "b/.github/workflows/\344\272\221\346\211\253\347\240\201.yml" new file mode 100644 index 0000000000..32f1f00d5c --- /dev/null +++ "b/.github/workflows/\344\272\221\346\211\253\347\240\201.yml" @@ -0,0 +1,31 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 云扫码 +on: + workflow_dispatch: + schedule: + - cron: '15 12,14,16,20,22 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【云扫码】' + run: | + node ./ysm.js + env: + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} diff --git "a/.github/workflows/\344\272\254\344\270\234\345\206\234\345\234\272.yml" "b/.github/workflows/\344\272\254\344\270\234\345\206\234\345\234\272.yml" new file mode 100644 index 0000000000..87eb7deb91 --- /dev/null +++ "b/.github/workflows/\344\272\254\344\270\234\345\206\234\345\234\272.yml" @@ -0,0 +1,35 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 京东农场 +on: + workflow_dispatch: + schedule: + - cron: '0 0,5,9 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【京东农场】' + run: | + node ./jd_fruit.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + JD_USER_AGENT: ${{ secrets.JD_USER_AGENT }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + FRUIT_NOTIFY_CONTROL: ${{ secrets.FRUIT_NOTIFY_CONTROL }} + FRUITSHARECODES: ${{ secrets.FruitShareCodes }} diff --git "a/.github/workflows/\344\272\254\344\270\234\345\210\206\344\272\253\347\240\201\346\217\220\344\272\244.yml" "b/.github/workflows/\344\272\254\344\270\234\345\210\206\344\272\253\347\240\201\346\217\220\344\272\244.yml" new file mode 100644 index 0000000000..7c86536e52 --- /dev/null +++ "b/.github/workflows/\344\272\254\344\270\234\345\210\206\344\272\253\347\240\201\346\217\220\344\272\244.yml" @@ -0,0 +1,33 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 京东分享码提交 +on: + workflow_dispatch: + schedule: + - cron: '5 20 1,10,20 * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【京东分享码提交】' + run: | + node ./jd_shareCode_auto.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + JD_DEBUG: ${{ secrets.JD_DEBUG }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} diff --git "a/.github/workflows/\344\272\254\344\270\234\345\256\240\346\261\252\346\261\252\345\201\267\345\245\275\345\217\213\347\213\227\347\262\256\345\222\214\347\247\257\345\210\206.yml" "b/.github/workflows/\344\272\254\344\270\234\345\256\240\346\261\252\346\261\252\345\201\267\345\245\275\345\217\213\347\213\227\347\262\256\345\222\214\347\247\257\345\210\206.yml" new file mode 100644 index 0000000000..120006b129 --- /dev/null +++ "b/.github/workflows/\344\272\254\344\270\234\345\256\240\346\261\252\346\261\252\345\201\267\345\245\275\345\217\213\347\213\227\347\262\256\345\222\214\347\247\257\345\210\206.yml" @@ -0,0 +1,36 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 京东宠汪汪偷好友狗粮和积分 +on: + workflow_dispatch: + schedule: + - cron: '0 4,22 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【京东宠汪汪偷好友狗粮和积分】' + run: | + node ./jd_joy_steal.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + JD_DEBUG: ${{ secrets.JD_DEBUG }} + JD_USER_AGENT: ${{ secrets.JD_USER_AGENT }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + jdJoyStealCoin: ${{ secrets.jdJoyStealCoin }} + JOY_HELP_FEED: ${{ secrets.JOY_HELP_FEED }} diff --git "a/.github/workflows/\344\272\254\344\270\234\345\256\240\346\261\252\346\261\252\345\226\202\351\243\237.yml" "b/.github/workflows/\344\272\254\344\270\234\345\256\240\346\261\252\346\261\252\345\226\202\351\243\237.yml" new file mode 100644 index 0000000000..567a4df283 --- /dev/null +++ "b/.github/workflows/\344\272\254\344\270\234\345\256\240\346\261\252\346\261\252\345\226\202\351\243\237.yml" @@ -0,0 +1,35 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 京东宠汪汪喂食 +on: + workflow_dispatch: + schedule: + - cron: '0 2,12,16,20 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【京东宠汪汪喂食】' + run: | + node ./jd_joy_feedPets.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + JD_DEBUG: ${{ secrets.JD_DEBUG }} + JD_USER_AGENT: ${{ secrets.JD_USER_AGENT }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + JOY_FEED_COUNT: ${{ secrets.JOY_FEED_COUNT }} diff --git "a/.github/workflows/\344\272\254\344\270\234\345\256\240\346\261\252\346\261\252\345\226\202\351\243\2372.yml" "b/.github/workflows/\344\272\254\344\270\234\345\256\240\346\261\252\346\261\252\345\226\202\351\243\2372.yml" new file mode 100644 index 0000000000..02ddd7b187 --- /dev/null +++ "b/.github/workflows/\344\272\254\344\270\234\345\256\240\346\261\252\346\261\252\345\226\202\351\243\2372.yml" @@ -0,0 +1,35 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 京东宠汪汪喂食2 +on: + workflow_dispatch: + schedule: + - cron: '40 8,22 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【京东宠汪汪喂食】' + run: | + node ./jd_joy_feedPets.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + JD_DEBUG: ${{ secrets.JD_DEBUG }} + JD_USER_AGENT: ${{ secrets.JD_USER_AGENT }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + JOY_FEED_COUNT: ${{ secrets.JOY_FEED_COUNT }} diff --git "a/.github/workflows/\344\272\254\344\270\234\347\202\270\345\271\264\345\205\275\346\227\245\345\270\270.yml" "b/.github/workflows/\344\272\254\344\270\234\347\202\270\345\271\264\345\205\275\346\227\245\345\270\270.yml" new file mode 100644 index 0000000000..2418f9f034 --- /dev/null +++ "b/.github/workflows/\344\272\254\344\270\234\347\202\270\345\271\264\345\205\275\346\227\245\345\270\270.yml" @@ -0,0 +1,32 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 京东炸年兽日常 +on: + workflow_dispatch: + schedule: + - cron: '0 8,9,10 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【京东炸年兽日常】' + run: | + node ./jd_nian.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} diff --git "a/.github/workflows/\344\272\254\344\270\234\347\202\270\345\271\264\345\205\275\351\242\206\347\210\206\347\253\271.yml" "b/.github/workflows/\344\272\254\344\270\234\347\202\270\345\271\264\345\205\275\351\242\206\347\210\206\347\253\271.yml" new file mode 100644 index 0000000000..4c1c03ed4b --- /dev/null +++ "b/.github/workflows/\344\272\254\344\270\234\347\202\270\345\271\264\345\205\275\351\242\206\347\210\206\347\253\271.yml" @@ -0,0 +1,32 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 京东炸年兽领爆竹 +on: + workflow_dispatch: + schedule: + - cron: '20 * * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【京东炸年兽领爆竹🧨】' + run: | + node ./jd_nianCollect.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} diff --git "a/.github/workflows/\344\272\254\344\270\234\347\226\257\347\213\202JOY\346\214\202\346\234\272.yml" "b/.github/workflows/\344\272\254\344\270\234\347\226\257\347\213\202JOY\346\214\202\346\234\272.yml" new file mode 100644 index 0000000000..147cdeed03 --- /dev/null +++ "b/.github/workflows/\344\272\254\344\270\234\347\226\257\347\213\202JOY\346\214\202\346\234\272.yml" @@ -0,0 +1,32 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 京东疯狂JOY挂机 +on: + workflow_dispatch: + schedule: + - cron: '0 */6 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【京东疯狂JOY挂机】' + run: | + node ./jd_crazy_joy_coin.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} diff --git "a/.github/workflows/\344\272\254\344\270\234\350\220\214\345\256\240.yml" "b/.github/workflows/\344\272\254\344\270\234\350\220\214\345\256\240.yml" new file mode 100644 index 0000000000..adf2e80fa0 --- /dev/null +++ "b/.github/workflows/\344\272\254\344\270\234\350\220\214\345\256\240.yml" @@ -0,0 +1,36 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 京东萌宠 +on: + workflow_dispatch: + schedule: + - cron: '40 4,10,14,18 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【京东萌宠】' + run: | + node ./jd_pet.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + JD_DEBUG: ${{ secrets.JD_DEBUG }} + JD_USER_AGENT: ${{ secrets.JD_USER_AGENT }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + PET_NOTIFY_CONTROL: ${{ secrets.PET_NOTIFY_CONTROL }} + PETSHARECODES: ${{ secrets.PETSHARECODES }} diff --git "a/.github/workflows/\344\272\254\345\226\234\345\267\245\345\216\202.yml" "b/.github/workflows/\344\272\254\345\226\234\345\267\245\345\216\202.yml" new file mode 100644 index 0000000000..a5bed37c42 --- /dev/null +++ "b/.github/workflows/\344\272\254\345\226\234\345\267\245\345\216\202.yml" @@ -0,0 +1,37 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 京喜工厂 +on: + workflow_dispatch: + schedule: + - cron: '0 */1 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【京喜工厂】' + run: | + node ./jd_dreamFactory.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + JD_DEBUG: ${{ secrets.JD_DEBUG }} + JD_USER_AGENT: ${{ secrets.JD_USER_AGENT }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + DREAMFACTORY_NOTIFY_CONTROL: ${{ secrets.DREAMFACTORY_NOTIFY_CONTROL }} + DREAM_FACTORY_SHARE_CODES: ${{ secrets.DREAM_FACTORY_SHARE_CODES }} + IGNORE_COOKIE_JXGC: ${{ secrets.IGNORE_COOKIE_JXGC }} #京喜工厂禁用某些cookie的执行,因为通知太烦了呀,比如要禁用第2和第四个的执行,则填入[2,4]即可,包含中括号哦 diff --git "a/.github/workflows/\345\276\256\345\256\242\344\274\227\346\231\272.yml" "b/.github/workflows/\345\276\256\345\256\242\344\274\227\346\231\272.yml" new file mode 100644 index 0000000000..758afa1ee2 --- /dev/null +++ "b/.github/workflows/\345\276\256\345\256\242\344\274\227\346\231\272.yml" @@ -0,0 +1,33 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 微客众智 +on: + workflow_dispatch: + schedule: + - cron: '25,55 1,5,9-22 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【微客众智】' + run: | + node ./wkzz.js + env: + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} + WKZHU: ${{ secrets.WKZHU }} + WKZHH: ${{ secrets.WKZHH }} diff --git "a/.github/workflows/\346\230\245\351\243\216\350\275\254.yml" "b/.github/workflows/\346\230\245\351\243\216\350\275\254.yml" new file mode 100644 index 0000000000..8d1f67b95b --- /dev/null +++ "b/.github/workflows/\346\230\245\351\243\216\350\275\254.yml" @@ -0,0 +1,31 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 春风转 +on: + workflow_dispatch: + schedule: + - cron: '7,23 10-20/1 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【春风转】' + run: | + node ./cfz.js + env: + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} diff --git "a/.github/workflows/\347\233\262\347\233\222\346\212\275\344\272\254\350\261\206.yml" "b/.github/workflows/\347\233\262\347\233\222\346\212\275\344\272\254\350\261\206.yml" new file mode 100644 index 0000000000..2b4c5c66b6 --- /dev/null +++ "b/.github/workflows/\347\233\262\347\233\222\346\212\275\344\272\254\350\261\206.yml" @@ -0,0 +1,34 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# 2020年11月30日16:53:51 https://github.com/ddgksf2013/TaskAction/blob/master/youth/Task/youth.js + +name: 盲盒抽京豆 +on: + workflow_dispatch: + schedule: + - cron: '0 */6 * * *' + watch: + types: started + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: npm install + run: | + npm install + - name: '运行 【盲盒抽京豆】' + run: | + node ./jd_mh.js + env: + JD_COOKIE: ${{ secrets.JD_COOKIE }} + JD_DEBUG: ${{ github.event.client_payload.JD_DEBUG }} + JD_USER_AGENT: ${{ github.event.client_payload.JD_USER_AGENT }} + TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} + TG_USER_ID: ${{ secrets.TG_USER_ID }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/LICENSE b/LICENSE index b8e7853f41..dbbe355815 100644 --- a/LICENSE +++ b/LICENSE @@ -1,72 +1,661 @@ -Copyright (c) [Year] [name of copyright holder] - [Software Name] is licensed under Mulan PSL v2. - You can use this software according to the terms and conditions of the Mulan PSL v2. - You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - See the Mulan PSL v2 for more details. - - - Mulan Permissive Software License,Version 2 - - Mulan Permissive Software License,Version 2 (Mulan PSL v2) - January 2020 http://license.coscl.org.cn/MulanPSL2 - - Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions: - - 0. Definition - - Software means the program and related documents which are licensed under this License and comprise all Contribution(s). - - Contribution means the copyrightable work licensed by a particular Contributor under this License. - - Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License. - - Legal Entity means the entity making a Contribution and all its Affiliates. - - Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity. - - 1. Grant of Copyright License - - Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not. - - 2. Grant of Patent License - - Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken. - - 3. No Trademark License - - No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4. - - 4. Distribution Restriction - - You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software. - - 5. Disclaimer of Warranty and Limitation of Liability - - THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - 6. Language - - THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL. - - END OF THE TERMS AND CONDITIONS - - How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software - - To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps: - - i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner; - - ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package; - - iii Attach the statement to the appropriate annotated syntax at the beginning of each source file. - - - Copyright (c) [Year] [name of copyright holder] - [Software Name] is licensed under Mulan PSL v2. - You can use this software according to the terms and conditions of the Mulan PSL v2. - You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - See the Mulan PSL v2 for more details. + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/README.md b/README.md index 6978379365..444000db6d 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,20 @@ -![Anurag’s github stats](https://github-readme-stats.vercel.app/api?username=Sunert&show_icons=true&theme=merko) +
+

本仓库不再维护

+ + + + + +
-# 本仓库不再维护 +
+ +*** ## 免责声明: -* 本仓库发布的Script项目中涉及的任何解锁和解密分析脚本,仅用于测试和学习研究,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断. +* 本仓库发布的Script项目中涉及的任何解锁和解密分析脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断. * Sunert对任何脚本问题概不负责,包括但不限于由任何脚本错误导致的任何损失或损害. @@ -17,15 +26,24 @@ * 任何以任何方式查看此项目的人或直接或间接使用该Script项目的任何脚本的使用者都应仔细阅读此声明。Sunert保留随时更改或补充此免责声明的权利。一旦使用并复制了任何相关脚本或Script项目的规则,则视为您已接受此免责声明. - **您必须在下载后的24小时内从计算机或手机中完全删除以上内容.**
-> ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此免责声明,请仔细阅读*** +- 您必须在下载后的24小时内从计算机或手机中完全删除以上内容.
+
您使用或者复制了本仓库且本人制作的任何脚本,则视为 已接受 此免责声明,请仔细阅读 +
+ +*** #### 开发者不易,请赏杯茶水费 -
+
+
+--- ### 特别感谢: -* [@NobyDa](https://github.com/NobyDa) -* [@chavyleung](https://github.com/chavyleung) + * [@chavyleung](https://github.com/chavyleung) + + * [@NobyDa](https://github.com/NobyDa) + + * [@lxk0301](https://github.com/lxk0301) + * [@id77_Github](https://github.com/id77) diff --git a/Script/xigua_ad.js b/Script/xigua_ad.js new file mode 100644 index 0000000000..8131ab9b79 --- /dev/null +++ b/Script/xigua_ad.js @@ -0,0 +1,14 @@ +/* + 西瓜视频去除内容页广告 +[rewrite_local] +https:\/\/api3-normal-c-hl\.ixigua\.com\/video\/app\/stream\/ url script-response-body xigua_ad.js +[mitm] +hostname = api*-normal-c-hl.ixigua.com +*/ + var obj = JSON.parse($response.body); + for (i=0; i< obj.data.length;i++){ + if(obj.data[i].content.indexOf("ad_label") > -1) { + delete obj.data[i].content + } + } +$done(JSON.stringify(obj)) diff --git a/Task/Auto_Kuaishou.js b/Task/Auto_Kuaishou.js new file mode 100644 index 0000000000..30cbb3a696 --- /dev/null +++ b/Task/Auto_Kuaishou.js @@ -0,0 +1,79 @@ +/* +更新时间: 2020-12-06 15:46 +赞赏:快手邀请码`774010415`,农妇山泉 -> 有点咸,万分感谢 +Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 + +请自行抓包,刷视频即,可获得更多包数据,抓包地址为"http://ali2.a.yximgs.com/ksc1/xxxxxx.kpg",在Github Actions中的Secrets新建name为'KUAISHOUMV'的一个值,拷贝抓包的请求体到下面Value的文本框中,本脚本不包含任何推送通知 + +多个请求时用'#'号或者换行隔开" ‼️ + +*/ + +const $ = new Env("快手视频") + +let ksUrl = [], ksArr = []; + + if (process.env.KUAISHOUMV && process.env.KUAISHOUMV.indexOf('#') > -1) { + ksUrl = process.env.KUAISHOUMV.split('#'); + console.log(`您选择的是用"#"隔开\n`) + } + else if (process.env.KUAISHOUMV && process.env.KUAISHOUMV.indexOf('\n') > -1) { + ksUrl = process.env.KUAISHOUMV.split('\n'); + console.log(`您选择的是用换行隔开\n`) + } else { + ksUrl = process.env.KUAISHOUMV.split() + } + Object.keys(ksUrl).forEach((item) => { + if (ksUrl[item]) { + ksArr.push(ksUrl[item]) + } + }) + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + +!(async () => { + if (!ksArr[0]) { + console.log($.name, '【提示】请把抓包地址填入Github 的 Secrets 中,请以#或者换行隔开') + return; + } + for (let i = 0; i < ksArr.length; i++) { + if (ksArr[i]) { + playUrl = ksArr[i]; + $.index = i + 1; + console.log(`-------------------------\n\n开始快手极速版第${$.index}个视频`) + } + for (let j = 0; j < 5; j++) { + await AutoRead(); + await $.wait(10000); + console.log(`\n 请等待10s后继续视频${$.index}第${j+1}次任务`) + } + }; + console.log(`-------------------------\n\n快手视频共完成任务(${$.index}*5)次,视频金币详情见App,任务全部结束`) +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + +function AutoRead(){ + return new Promise((resolve) => { + const myRequest = { + url: playUrl, + headers: { + 'Accept-Encoding' : `gzip, deflate`, + 'Connection' : `close`, + 'Accept' : `application/json`, + 'Host' : `ali2.a.yximgs.com`, + 'User-Agent' : `kwai-ios`, + 'Accept-Language' : `zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8`}, +}; + $.get(myRequest, (error, response, data) => { + if(error){ + console.log("响应数据失败:"+response.statusCode + "\n\n" + data); + } + //console.log(response.statusCode + "\n\n" + data); + //$.done(); + }) + resolve() + }) +} + +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)} diff --git a/Task/Env.js b/Task/Env.js new file mode 100644 index 0000000000..b23d708ca3 --- /dev/null +++ b/Task/Env.js @@ -0,0 +1,478 @@ +function Env(name, opts) { + class Http { + constructor(env) { + this.env = env + } + + send(opts, method = 'GET') { + opts = typeof opts === 'string' ? { url: opts } : opts + let sender = this.get + if (method === 'POST') { + sender = this.post + } + return new Promise((resolve, reject) => { + sender.call(this, opts, (err, resp, body) => { + if (err) reject(err) + else resolve(resp) + }) + }) + } + + get(opts) { + return this.send.call(this.env, opts) + } + + post(opts) { + return this.send.call(this.env, opts, 'POST') + } + } + + return new (class { + constructor(name, opts) { + this.name = name + this.http = new Http(this) + this.data = null + this.dataFile = 'box.dat' + this.logs = [] + this.isMute = false + this.isNeedRewrite = false + this.logSeparator = '\n' + this.startTime = new Date().getTime() + Object.assign(this, opts) + this.log('', `🔔${this.name}, 开始!`) + } + + 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(str, defaultValue = null) { + try { + return JSON.parse(str) + } catch { + return defaultValue + } + } + + toStr(obj, defaultValue = null) { + try { + return JSON.stringify(obj) + } catch { + return defaultValue + } + } + + getjson(key, defaultValue) { + let json = defaultValue + const val = this.getdata(key) + if (val) { + try { + json = JSON.parse(this.getdata(key)) + } catch {} + } + return json + } + + setjson(val, key) { + try { + return this.setdata(JSON.stringify(val), key) + } catch { + return false + } + } + + getScript(url) { + return new Promise((resolve) => { + this.get({ url }, (err, resp, body) => resolve(body)) + }) + } + + runScript(script, runOpts) { + return new Promise((resolve) => { + let httpapi = this.getdata('@chavy_boxjs_userCfgs.httpapi') + httpapi = httpapi ? httpapi.replace(/\n/g, '').trim() : httpapi + let httpapi_timeout = this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout') + httpapi_timeout = httpapi_timeout ? httpapi_timeout * 1 : 20 + httpapi_timeout = runOpts && runOpts.timeout ? runOpts.timeout : httpapi_timeout + const [key, addr] = httpapi.split('@') + const opts = { + url: `http://${addr}/v1/scripting/evaluate`, + body: { script_text: script, mock_type: 'cron', timeout: httpapi_timeout }, + headers: { 'X-Key': key, 'Accept': '*/*' } + } + this.post(opts, (err, resp, body) => resolve(body)) + }).catch((e) => this.logErr(e)) + } + + loaddata() { + if (this.isNode()) { + this.fs = this.fs ? this.fs : require('fs') + this.path = this.path ? this.path : require('path') + const curDirDataFilePath = this.path.resolve(this.dataFile) + const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) + const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) + const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) + if (isCurDirDataFile || isRootDirDataFile) { + const datPath = isCurDirDataFile ? curDirDataFilePath : rootDirDataFilePath + try { + return JSON.parse(this.fs.readFileSync(datPath)) + } catch (e) { + return {} + } + } else return {} + } else return {} + } + + writedata() { + if (this.isNode()) { + this.fs = this.fs ? this.fs : require('fs') + this.path = this.path ? this.path : require('path') + const curDirDataFilePath = this.path.resolve(this.dataFile) + const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) + const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) + const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) + const jsondata = JSON.stringify(this.data) + if (isCurDirDataFile) { + this.fs.writeFileSync(curDirDataFilePath, jsondata) + } else if (isRootDirDataFile) { + this.fs.writeFileSync(rootDirDataFilePath, jsondata) + } else { + this.fs.writeFileSync(curDirDataFilePath, jsondata) + } + } + } + + lodash_get(source, path, defaultValue = undefined) { + const paths = path.replace(/\[(\d+)\]/g, '.$1').split('.') + let result = source + for (const p of paths) { + result = Object(result)[p] + if (result === undefined) { + return defaultValue + } + } + return result + } + + lodash_set(obj, path, value) { + if (Object(obj) !== obj) return obj + if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [] + path + .slice(0, -1) + .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[ + path[path.length - 1] + ] = value + return obj + } + + getdata(key) { + let val = this.getval(key) + // 如果以 @ + if (/^@/.test(key)) { + const [, objkey, paths] = /^@(.*?)\.(.*?)$/.exec(key) + const objval = objkey ? this.getval(objkey) : '' + if (objval) { + try { + const objedval = JSON.parse(objval) + val = objedval ? this.lodash_get(objedval, paths, '') : val + } catch (e) { + val = '' + } + } + } + return val + } + + setdata(val, key) { + let issuc = false + if (/^@/.test(key)) { + const [, objkey, paths] = /^@(.*?)\.(.*?)$/.exec(key) + const objdat = this.getval(objkey) + const objval = objkey ? (objdat === 'null' ? null : objdat || '{}') : '{}' + try { + const objedval = JSON.parse(objval) + this.lodash_set(objedval, paths, val) + issuc = this.setval(JSON.stringify(objedval), objkey) + } catch (e) { + const objedval = {} + this.lodash_set(objedval, paths, val) + issuc = this.setval(JSON.stringify(objedval), objkey) + } + } else { + issuc = this.setval(val, key) + } + return issuc + } + + getval(key) { + if (this.isSurge() || this.isLoon()) { + return $persistentStore.read(key) + } else if (this.isQuanX()) { + return $prefs.valueForKey(key) + } else if (this.isNode()) { + this.data = this.loaddata() + return this.data[key] + } else { + return (this.data && this.data[key]) || null + } + } + + setval(val, key) { + if (this.isSurge() || this.isLoon()) { + return $persistentStore.write(val, key) + } else if (this.isQuanX()) { + return $prefs.setValueForKey(val, key) + } else if (this.isNode()) { + this.data = this.loaddata() + this.data[key] = val + this.writedata() + return true + } else { + return (this.data && this.data[key]) || null + } + } + + initGotEnv(opts) { + 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() + if (opts) { + opts.headers = opts.headers ? opts.headers : {} + if (undefined === opts.headers.Cookie && undefined === opts.cookieJar) { + opts.cookieJar = this.ckjar + } + } + } + + get(opts, callback = () => {}) { + if (opts.headers) { + delete opts.headers['Content-Type'] + delete opts.headers['Content-Length'] + } + if (this.isSurge() || this.isLoon()) { + if (this.isSurge() && this.isNeedRewrite) { + opts.headers = opts.headers || {} + Object.assign(opts.headers, { 'X-Surge-Skip-Scripting': false }) + } + $httpClient.get(opts, (err, resp, body) => { + if (!err && resp) { + resp.body = body + resp.statusCode = resp.status + } + callback(err, resp, body) + }) + } else if (this.isQuanX()) { + if (this.isNeedRewrite) { + opts.opts = opts.opts || {} + Object.assign(opts.opts, { hints: false }) + } + $task.fetch(opts).then( + (resp) => { + const { statusCode: status, statusCode, headers, body } = resp + callback(null, { status, statusCode, headers, body }, body) + }, + (err) => callback(err) + ) + } else if (this.isNode()) { + this.initGotEnv(opts) + this.got(opts) + .on('redirect', (resp, nextOpts) => { + try { + if (resp.headers['set-cookie']) { + const ck = resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString() + if (ck) { + this.ckjar.setCookieSync(ck, null) + } + nextOpts.cookieJar = this.ckjar + } + } catch (e) { + this.logErr(e) + } + // this.ckjar.setCookieSync(resp.headers['set-cookie'].map(Cookie.parse).toString()) + }) + .then( + (resp) => { + const { statusCode: status, statusCode, headers, body } = resp + callback(null, { status, statusCode, headers, body }, body) + }, + (err) => { + const { message: error, response: resp } = err + callback(error, resp, resp && resp.body) + } + ) + } + } + + post(opts, callback = () => {}) { + // 如果指定了请求体, 但没指定`Content-Type`, 则自动生成 + if (opts.body && opts.headers && !opts.headers['Content-Type']) { + opts.headers['Content-Type'] = 'application/x-www-form-urlencoded' + } + if (opts.headers) delete opts.headers['Content-Length'] + if (this.isSurge() || this.isLoon()) { + if (this.isSurge() && this.isNeedRewrite) { + opts.headers = opts.headers || {} + Object.assign(opts.headers, { 'X-Surge-Skip-Scripting': false }) + } + $httpClient.post(opts, (err, resp, body) => { + if (!err && resp) { + resp.body = body + resp.statusCode = resp.status + } + callback(err, resp, body) + }) + } else if (this.isQuanX()) { + opts.method = 'POST' + if (this.isNeedRewrite) { + opts.opts = opts.opts || {} + Object.assign(opts.opts, { hints: false }) + } + $task.fetch(opts).then( + (resp) => { + const { statusCode: status, statusCode, headers, body } = resp + callback(null, { status, statusCode, headers, body }, body) + }, + (err) => callback(err) + ) + } else if (this.isNode()) { + this.initGotEnv(opts) + const { url, ..._opts } = opts + this.got.post(url, _opts).then( + (resp) => { + const { statusCode: status, statusCode, headers, body } = resp + callback(null, { status, statusCode, headers, body }, body) + }, + (err) => { + const { message: error, response: resp } = err + callback(error, resp, resp && resp.body) + } + ) + } + } + /** + * + * 示例:$.time('yyyy-MM-dd qq HH:mm:ss.S') + * :$.time('yyyyMMddHHmmssS') + * y:年 M:月 d:日 q:季 H:时 m:分 s:秒 S:毫秒 + * 其中y可选0-4位占位符、S可选0-1位占位符,其余可选0-2位占位符 + * @param {*} fmt 格式化参数 + * + */ + time(fmt) { + let o = { + '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() + } + if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (new Date().getFullYear() + '').substr(4 - RegExp.$1.length)) + for (let k in o) + if (new RegExp('(' + k + ')').test(fmt)) + fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)) + return fmt + } + + /** + * 系统通知 + * + * > 通知参数: 同时支持 QuanX 和 Loon 两种格式, EnvJs根据运行环境自动转换, Surge 环境不支持多媒体通知 + * + * 示例: + * $.msg(title, subt, desc, 'twitter://') + * $.msg(title, subt, desc, { 'open-url': 'twitter://', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) + * $.msg(title, subt, desc, { 'open-url': 'https://bing.com', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) + * + * @param {*} title 标题 + * @param {*} subt 副标题 + * @param {*} desc 通知详情 + * @param {*} opts 通知参数 + * + */ + msg(title = name, subt = '', desc = '', opts) { + const toEnvOpts = (rawopts) => { + if (!rawopts) return rawopts + if (typeof rawopts === 'string') { + if (this.isLoon()) return rawopts + else if (this.isQuanX()) return { 'open-url': rawopts } + else if (this.isSurge()) return { url: rawopts } + else return undefined + } else if (typeof rawopts === 'object') { + if (this.isLoon()) { + let openUrl = rawopts.openUrl || rawopts.url || rawopts['open-url'] + let mediaUrl = rawopts.mediaUrl || rawopts['media-url'] + return { openUrl, mediaUrl } + } else if (this.isQuanX()) { + let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl + let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl + return { 'open-url': openUrl, 'media-url': mediaUrl } + } else if (this.isSurge()) { + let openUrl = rawopts.url || rawopts.openUrl || rawopts['open-url'] + return { url: openUrl } + } + } else { + return undefined + } + } + if (!this.isMute) { + if (this.isSurge() || this.isLoon()) { + $notification.post(title, subt, desc, toEnvOpts(opts)) + } else if (this.isQuanX()) { + $notify(title, subt, desc, toEnvOpts(opts)) + } + } + if (!this.isMuteLog) { + let logs = ['', '==============📣系统通知📣=============='] + logs.push(title) + subt ? logs.push(subt) : '' + desc ? logs.push(desc) : '' + console.log(logs.join('\n')) + this.logs = this.logs.concat(logs) + } + } + + log(...logs) { + if (logs.length > 0) { + this.logs = [...this.logs, ...logs] + } + console.log(logs.join(this.logSeparator)) + } + + logErr(err, msg) { + const isPrintSack = !this.isSurge() && !this.isQuanX() && !this.isLoon() + if (!isPrintSack) { + this.log('', `❗️${this.name}, 错误!`, err) + } else { + this.log('', `❗️${this.name}, 错误!`, err.stack) + } + } + + wait(time) { + return new Promise((resolve) => setTimeout(resolve, time)) + } + + done(val = {}) { + const endTime = new Date().getTime() + const costTime = (endTime - this.startTime) / 1000 + this.log('', `🔔${this.name}, 结束! 🕛 ${costTime} 秒`) + this.log() + if (this.isSurge() || this.isQuanX() || this.isLoon()) { + $done(val) + } + } + })(name, opts) +} diff --git a/Task/Env.min.js b/Task/Env.min.js new file mode 100644 index 0000000000..21673d2cd5 --- /dev/null +++ b/Task/Env.min.js @@ -0,0 +1 @@ +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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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)} \ No newline at end of file diff --git a/Task/GithubActions.md b/Task/GithubActions.md new file mode 100644 index 0000000000..8ced19204a --- /dev/null +++ b/Task/GithubActions.md @@ -0,0 +1,57 @@ +

Actions Secrets 环境变量配置说明 :

+ +| Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | +| :-------: | :------: | :-------: | ------ | ------- | +| YOUTH_HEADER | 中青看点 youth.yml | # | 必须 | 请求地址: "https://kd.youth.cn/TaskCenter/getSign",
中青签到请求头: { xxx } | +| YOUTH_ARTBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | +| YOUTH_REDBODY | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/article/red_packet",
惊喜红包请求体: p=xxx | +| YOUTH_TIME | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/user/app_stay.json",
阅读时长请求体: p=xxx | +| YOUTH_NOTIFY_CONTROL | 同上 | true/false | 可选 | 中青通知开关
默认当转盘次数为50或者100并且余额大于10元时推送通知 | +| | | | - | | +| YOUTH_READ | 中青阅读 youth_read.yml | &或者换行 | 必须 | 请求地址: "https://ios.baertt.com/v5/article/complete",
阅读请求体: p=xxx | +| YOUTH_START | 中青浏览赚 youth_gain.yml | & | 必须 | 请求地址: "https://ios.baertt.com/v5/task/browse_start.json",
阅读请求体: p=xxx | +| YOUTH_END | 同上 | & | 必须 | 请求地址: "https://ios.baertt.com/v5/task/browse_end.json",
阅读请求体: p=xxx | +| | | - | | | +| TXNEWS_COOKIE | 腾讯新闻 txnews.yml | & | 必须 | 请求地址: "https://api.inews.qq.com/event/v1/user/event/report?",
腾讯新闻 Cookie: openxx=xxx | +| TXNEWS_SIGN | 同上 | # | 必须 | 请求地址同上, 阅读请求地址链接 | +| TXNEWS_VIDEO | 同上 | # | 必须 | 请求地址同上, 视频请求地址链接 | +| TXNEWS_NOTIFY_CONTROL | 同上 | true/false | 可选 | 腾讯新闻通知开关
默认当余额大于2元且通知间隔为50时推送通知 | +| | | | - | | +| DSJ_HEADERS | 电视家dianshijia.yml | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/sign/signin",
签到请求头: { xxx } | +| DSJ_DRAWAL | 同上 | #或换行 | 必须 | 请求地址: "http://api.gaoqingdianshi.com/api/v2/cash/withdrawal",
即提现请求地址 | +| DSJ_NOTIFY_CONTROL | 同上 | true/false | 可选 | 电视家通知开关
默认不推送 | +| | | | - | | +| WB_TOKEN | 微博 | #或换行 | 必须 | 请求地址: "https://api.weibo.cn/xxx?gsid=",
签到token: gsid=xxx | +| WB_PAY | 同上 | #或换行 | 必须 | 请求地址:"https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do",
提现请求头 | +| | | | - | | +| JD_COOKIE | 京喜 jingxi.yml | &或换行| 必须 | 京东cookie,多个账号的cookie使用`&`隔开或者换行。具体获取参考[浏览器获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie.md) 或者 [插件获取京东cookie教程](https://github.com/lxk0301/scripts/blob/master/backUp/GetJdCookie2.md) | + +
+ +
+ + + 相关通知推送 + + + +| Name | 脚本相关YML | Value分割符 | 必须 / 可选 | 注意事项及样式(其中"xxx"代表任意字符) | +| :-------: | :------: | ------- | ------ | ------- | +| PUSH_KEY | 微信推送 | - | 可选 | cookie失效推送[server酱的微信通知](http://sc.ftqq.com/3.version) | +| BARK_PUSH | BARK推送 | - | 可选 | cookie失效推送BARK这个APP,填写内容是app提供的`设备码`,例如:https://api.day.app/123 ,那么此处的设备码就是`123`,再不懂看 [这个图](icon/bark.jpg) | +| BARK_SOUND | BARK推送 | - | 可选 | bark推送声音设置,例如`choo`,具体值请在`bark`-`推送铃声`-`查看所有铃声` | +| TG_BOT_TOKEN | telegram推送 | - | 可选 | tg推送,填写自己申请[@BotFather](https://t.me/BotFather)的Token,如`10xxx4:AAFcqxxxxgER5uw` , [具体教程](https://github.com/lxk0301/scripts/pull/37#issuecomment-692415594) | +| TG_USER_ID | telegram推送 | - | 可选 | tg推送,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](https://github.com/lxk0301/scripts/pull/37#issuecomment-692415594) | +| DD_BOT_TOKEN | 钉钉推送 | - | 可选 | 钉钉推送[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于符号后面的XXX, 注:如果钉钉推送只填写`DD_BOT_TOKEN`,那么安全设置需勾选`自定义关键词`,内容输入输入`账号`即可,其他安全设置不要勾选 | +| DD_BOT_SECRET | 钉钉推送 | - | 可选 | 密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 , 注:填写了`DD_BOT_TOKEN`和`DD_BOT_SECRET`,钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](icon/DD_bot.png) | + +
+ + ## 以上为配置方法详见[@lxk0301](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/githubAction.md) + +*** + ## ***感谢*** + * [@lxk0301](https://t.me/lxk0301) + * [@chavy](https://t.me/chavyleung) + + \ No newline at end of file diff --git a/Task/NOWLIVE.js b/Task/NOWLIVE.js new file mode 100644 index 0000000000..4d8e48284f --- /dev/null +++ b/Task/NOWLIVE.js @@ -0,0 +1,123 @@ +/* +NOW直播每日签到 + +1.打开APP首页点击"领红包"悬浮球,通知获取签到Cookie成功 +Surge 4.0: +[Script] +NOW直播 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js,script-update-interval=0 +NOW直播 = type=http-request,pattern=https:\/\/now\.qq\.com\/cgi-bin\/task\/welfare\/getUserTasks\?bkn,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js +------------------ +Loon 2.1.0+ +[Script] +# 本地脚本 +cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js, enabled=true, tag=NOWLIVE + +http-request https:\/\/now\.qq\.com\/cgi-bin\/task\/welfare\/getUserTasks\?bkn script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/NOWLIVE.js +----------------- + +#QX 1.0.7+ : +[task_local] +0 9 * * * NOWLIVE.js +[rewrite_local] +https:\/\/now\.qq\.com\/cgi-bin\/task\/welfare\/getUserTasks\?bkn url script-request-header NOWLIVE.js +~~~~~~~~~~~~~~~~~~ + +[MITM] +hostname = now.qq.com + +~~~~~~~~~~~~~~~~ + +*/ +const $ = new Env('NOW直播') +const nowid = $.getdata(`now_qq`) + +const cookieVal =$.getdata(`nowqq_cookie`) + +let isGetCookie = typeof $request !== 'undefined' +if (isGetCookie) { + GetCookie() + $.done() + } else { + !(async() => { + await getsign(); + await signinfo(); + await daojishiTask() + })() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) +} +function GetCookie() { +if ($request && $request.method != 'OPTIONS'){ + const signurlVal = $request.url + const nowid = $request.url.match(/bkn=([\d]+)/)[1] + const cookieVal = $request.headers['Cookie']; + $.log(`signurlVal:${signurlVal}`) + $.log(`cookieVal:${cookieVal}`) + if (nowid) $.setdata(nowid, +`now_qq`) + if (cookieVal) $.setdata(cookieVal, `nowqq_cookie`) + $.msg($.name, `获取签到: 成功`, ``) + } +} +//签到 +function getsign() { + return new Promise((resolve, reject) =>{ + let signurl = { + url: `https://now.qq.com/cgi-bin/task/welfare/submitTask?bkn=${nowid}`, + headers: {Cookie: cookieVal,"Referer": "https://now.qq.com/activity/c-annual-redpacket-v5/checkEntry.html"}, + body: `taskId=14&bkn=${nowid}` + } + $.post(signurl, (error, response, data) => { + let result = JSON.parse(data) + if (result.retcode == 0){ + signres = `签到成功🎉` + detail = `获得收益${result.result.rewardList.match(/\"name\"\:"([\u4e00-\u9fa5]+)/)[1]}: ${result.result.rewardList.match(/"num":(\d+)/)[1]}💰 \n` + } + else if (result.retcode == -1100){ + signres = result.retmsg + " 本月已签到"+result.result.signCnt+"次" + detail = `` + } + else { + signres = `签到失败❌` + detail = `说明: `+ result.retmsg+"\n" + } + resolve() + }) + }) +} +function signinfo() { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://now.qq.com/cgi-bin/ambient/get_all?bkn=${nowid}`, + headers: {Cookie: cookieVal,"Referer": "https://now.qq.com/activity/c-annual-redpacket-v5/checkEntry.html"} + } + $.get(infourl, (error, response, data) => { + let result = JSON.parse(data) + if (result.retcode == 0){ + detail += `现金收益: ${result.result.money/100}元 金豆收益: ${result.result.points}` + } + //$.msg($.name,signres,detail) + resolve() + }) + }) +} + +function daojishiTask() { + return new Promise((resolve, reject) =>{ + let infourl = { + url: `https://now.qq.com/cgi-bin/task/welfare/STaskClick?name_key=daojishi&auto_start=true&bkn=${nowid}`, + headers: {Cookie: cookieVal,"Referer": "https://now.qq.com/activity/hang-host/hang.html"} + } + $.get(infourl, (error, response, data) => { + let result = JSON.parse(data) + //console.log(data) + if (result.result.retcode == 0){ + //detail += `\n本次收益: ${result.result.new_info.gifts[0].num}元 ` + } + $.msg($.name,signres,detail) + resolve() + }) + }) +} + +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)} diff --git a/Task/README.md b/Task/README.md index d6aee70625..105a37bf35 100644 --- a/Task/README.md +++ b/Task/README.md @@ -21,7 +21,7 @@ ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此免责声明,请仔细阅读*** ####开发者不易,请赏杯茶水费 -
+
### 特别感谢: diff --git a/Task/Sunert_Task.json b/Task/Sunert_Task.json new file mode 100644 index 0000000000..1f8dc460a5 --- /dev/null +++ b/Task/Sunert_Task.json @@ -0,0 +1,28 @@ +{ + "name": "Sunert 任务脚本", + "description": "运行时间自定", + "task": [ + "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/tvpreview.js, tag=节目预告 ,img-url=https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png", + "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/trainquery.js, tag=12306火车时刻,img-url=https://raw.githubusercontent.com/Orz-3/task/master/12306.png", + "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/exchangeRate.js, tag=实时货币换算,img-url=https://raw.githubusercontent.com/Orz-3/task/master/exchangerate.png", + "0 0 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/telecomInfinity.js, tag=中国电信套餐 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/telecominfinty.png", + "30 9 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews.js, tag=腾讯新闻 ,img-url= https://raw.githubusercontent.com/Orz-3/task/master/txnews.png", + "30 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jddj.js, tag=京东到家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/jddj.png", + "40 10 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/lkyl.js, tag=来客有礼 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/lkyl.png", + "0 0 7,22 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js, tag=电视家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png", + "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, tag=快手极速版 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/kuaishou.png", + "0 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, tag=微博&钱包 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/weibo.png", + "10 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sinanews.js, tag=新浪新闻 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png", + "20 11 8 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth.js, tag=中青看点极速版 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", + "20 15 */2 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/Youth_Read.js, tag=中青自动阅读 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", + "20 5 10 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/youth_gain.js, tag=中青浏览赚 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/youth.png", + "4 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/mydigit.js, tag=数码之家 ,img-url=https://raw.githubusercontent.com/Orz-3/task/master/mydigit.png", + "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/jingxi.js, tag=京喜 ,img-url= https://raw.githubusercontent.com/Orz-3/task/master/jingxi.png", + "7 0 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/moji.js, tag=墨迹天气 ,img-url=https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png" + ], +} + + + + + \ No newline at end of file diff --git a/Task/Youth_Read.js b/Task/Youth_Read.js new file mode 100644 index 0000000000..1fb9c3c951 --- /dev/null +++ b/Task/Youth_Read.js @@ -0,0 +1,83 @@ +/* +更新时间: 2020-09-26 8:46 +Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 + +请自行抓包,阅读文章和看视频,倒计时转一圈显示青豆到账即可,多看几篇文章和视频,获得更多包数据,抓包地址为"https://ios.baertt.com/v5/article/complete.json",在Github Actions中的Secrets新建name为'YOUTH_READ'的一个值,拷贝抓包的请求体到下面Value的文本框中,添加的请求体越多,获得青豆次数越多,本脚本不包含任何推送通知 + +多个请求体时用'&'号或者换行隔开" ‼️ + +*/ + +//let s = 30000 //等待延迟30s +const $ = new Env("中青看点") +//const notify = $.isNode() ? require('./sendNotify') : ''; +let ReadArr = [], YouthBody = "",readscore = 0; + if (process.env.YOUTH_READ && process.env.YOUTH_READ.indexOf('&') > -1) { + YouthBody = process.env.YOUTH_READ.split('&'); + console.log(`您选择的是用"&"隔开\n`) + } + else if (process.env.YOUTH_READ && process.env.YOUTH_READ.indexOf('\n') > -1) { + YouthBody = process.env.YOUTH_READ.split('\n'); + console.log(`您选择的是用换行隔开\n`) + } else { + YouthBody = process.env.YOUTH_READ.split() + } + Object.keys(YouthBody).forEach((item) => { + if (YouthBody[item]) { + ReadArr.push(YouthBody[item]) + } + }) + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + !(async () => { + if (!ReadArr[0]) { + console.log($.name, '【提示】请把抓包的请求体填入Github 的 Secrets 中,请以&隔开') + return; + } + for (let i = 0; i < ReadArr.length; i++) { + if (ReadArr[i]) { + articlebody = ReadArr[i]; + $.index = i + 1; + console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`) + } + await AutoRead(); + } + console.log(`-------------------------\n\n中青看点共完成${$.index}次阅读,共计获得${readscore}个青豆,阅读请求全部结束`) +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + + +function AutoRead() { + return new Promise((resolve, reject) => { + let url = { + url: `https://ios.baertt.com/v5/article/complete.json`, + headers: { + 'User-Agent': 'KDApp/1.7.8 (iPhone; iOS 14.0; Scale/3.00)' + }, + body: articlebody + }; + $.post(url, async(error, response, data) => { + let readres = JSON.parse(data); + //console.log(data) + if (readres.error_code == '0' && typeof readres.items.read_score === 'number') { + console.log(`\n本次阅读获得${readres.items.read_score}个青豆,请等待30s后执行下一次阅读\n`); + readscore += readres.items.read_score; + await $.wait(30000); + } + else if (readres.error_code == '0' && typeof readres.items.score === 'number') { + console.log(`\n本次阅读获得${readres.items.score}个青豆,即将开始下次阅读\n`) + readscore += readres.items.score + } + else if (readres.success == false){ + console.log(`第${$.index}次阅读请求有误,请删除此请求`) + } + else if (readres.items.max_notice == '\u770b\u592a\u4e45\u4e86\uff0c\u63621\u7bc7\u8bd5\u8bd5') { + console.log(readres.items.max_notice) + } + resolve() + }) + }) +} + +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)} \ No newline at end of file diff --git a/Task/dianshijia.js b/Task/dianshijia.js index 3c904529cd..dfa094d529 100644 --- a/Task/dianshijia.js +++ b/Task/dianshijia.js @@ -1,19 +1,14 @@ /* -更新时间: 2020-09-08 11:21 +更新时间: 2020-11-16 09:40 赞赏:电视家邀请码`893988`,农妇山泉 -> 有点咸,万分感谢 - -本脚本仅适用于电视家签到, +本脚本仅适用于电视家签到,支持Actions多账号运行,请用'#'或者换行隔开‼️ 获取Cookie方法: 1.将下方[rewrite_local]和[Task]地址复制的相应的区域,无需添加 hostname,每日7点、12点、20点各运行一次,其他随意 2.APP登陆账号后,点击菜单栏'领现金',即可获取Cookie,进入提现页面,点击随机金额,可获取提现地址!! - 3.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 - By Facsuny 感谢 chavyleung 等 - -赞赏:电视家邀请码`893988` ~~~~~~~~~~~~~~~~~~~~ loon 2.10+ : [Script] @@ -31,7 +26,6 @@ Surge 4.0 电视家 = type=http-request,pattern=http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js 电视家 = type=http-request,pattern=http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js - ~~~~~~~~~~~~~~~~~~ QX 1.0.6+ : @@ -42,43 +36,106 @@ QX 1.0.6+ : http:\/\/api\.gaoqingdianshi\.com\/api\/v\d\/sign\/signin url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js http:\/\/api\.gaoqingdianshi\.com\/api\/v2\/cash\/withdrawal url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/dianshijia.js - ~~~~~~~~~~~~~~~~~ */ const walkstep = '20000';//每日步数设置,可设置0-20000 -const gametimes = "2888"; //游戏时长 +const gametimes = "1999"; //游戏时长 const logs = 0 //响应日志开关,默认关闭 const $ = new Env('电视家') -const signheaderVal = $.getdata('sy_signheader_dsj') -const drawalVal = $.getdata('drawal_dsj') +const notify = $.isNode() ? require('./sendNotify') : ''; +let sleeping = "",detail=``,subTitle=``; +let RewardId = $.getdata('REWARD')||'55'; //额外签到奖励,默认55为兑换0.2元额度,44为兑换1天VIP,42为兑换1888金币 +const dianshijia_API = 'http://api.gaoqingdianshi.com/api' +let tokenArr = [], DsjurlArr = [], DrawalArr = [],drawalCode=""; +if ($.isNode()) { + if (process.env.DSJ_HEADERS && process.env.DSJ_HEADERS.indexOf('#') > -1) { + Dsjheaders = process.env.DSJ_HEADERS.split('#'); + console.log(`您选择的是用"#"隔开\n`) + } + else if (process.env.DSJ_HEADERS && process.env.DSJ_HEADERS.indexOf('\n') > -1) { + Dsjheaders = process.env.DSJ_HEADERS.split('\n'); + console.log(`您选择的是用换行隔开\n`) + } else { + Dsjheaders = process.env.DSJ_HEADERS.split() + }; -if (isGetCookie = typeof $request !== 'undefined') { - GetCookie() + if (process.env.DSJ_DRAWAL && process.env.DSJ_DRAWAL.indexOf('#') > -1) { + Drawals = process.env.DSJ_DRAWAL.split('#'); + } + else if (process.env.DSJ_DRAWAL && process.env.DSJ_DRAWAL.indexOf('\n') > -1) { + Drawals = process.env.DSJ_DRAWAL.split('\n'); } else { + Drawals = process.env.DSJ_DRAWAL.split() + }; + Object.keys(Dsjheaders).forEach((item) => { + if (Dsjheaders[item]) { + tokenArr.push(Dsjheaders[item]) + } + }); + Object.keys(Drawals).forEach((item) => { + if (Drawals[item]) { + DrawalArr.push(Drawals[item]) + } + }); + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + } else { + tokenArr.push($.getdata('sy_signheader_dsj')) + DrawalArr.push($.getdata('drawal_dsj')) + } + +if (isGetCookie = typeof $request !== 'undefined') { + GetCookie(); + $.done() +} -!(async() => { + !(async () => { + if (!tokenArr[0]) { + $.msg($.name, '【提示】请先获取电视家一cookie') + return; + } + console.log(`------------- 共${tokenArr.length}个账号`) + if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')<'16'){ + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000-28800 + console.log(time) + } else if(new Date().getTimezoneOffset()/60 != '-8'&&$.time('HH')>'16'){ + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000+16*60*60 + } else { + time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 + } + for (let i = 0; i < tokenArr.length; i++) { + if (tokenArr[i]) { + signheaderVal = tokenArr[i]; + drawalVal = DrawalArr[i]; + $.index = i + 1; + console.log(`\n\n开始【电视家${$.index}】`) await signin(); // 签到 await signinfo(); // 签到信息 - await Withdrawal(); // 金额提现 -//await Withdrawal2();// 固定金额 - await taskStatus(); // 任务状态 + await Addsign(); // 额外奖励,默认额度 + if (drawalVal != undefined){ + await Withdrawal() + } else { detail += `【金额提现】❌ 请获取提现地址 \n`}; + await run(); + await tasks(); // 任务状态 await getGametime();// 游戏时长 await total(); // 总计 await cash(); // 现金 await cashlist(); // 现金列表 await coinlist(); // 金币列表 + if ($.isNode() && drawalCode == '0') { + await notify.sendNotify($.name, subTitle+'\n'+ detail) + } + } + } })() .catch((e) => $.logErr(e)) .finally(() => $.done()) - } + function GetCookie() { if ($request && $request.method != 'OPTIONS'&&$request.url.match(/\/sign\/signin/)) { - const signurlVal = $request.url const signheaderVal = JSON.stringify($request.headers) - $.log(`signurlVal:${signurlVal}`) $.log(`signheaderVal:${signheaderVal}`) - if (signurlVal) $.setdata(signurlVal, 'sy_signurl_dsj') if (signheaderVal) $.setdata(signheaderVal, 'sy_signheader_dsj') $.msg($.name, `获取Cookie: 成功`, ``) } @@ -88,33 +145,43 @@ function GetCookie() { if (drawalVal) $.setdata(drawalVal, 'drawal_dsj') $.msg($.name, `获取提现地址: 成功`, ``) } - $.done() } - - var date = new Date(); - var hour = date.getHours(); - var sleeping = ""; - if (hour>19){ - sleep(); - CarveUp(); +async function run() { + if ($.isNode()&&new Date().getTimezoneOffset() == '0') { + if ($.time('HH')>11){ + await sleep(); + await CarveUp(); + } + else if($.time('HH') > 3&&$.time('HH') <5){ + await getCUpcoin(); + await walk(); + } + else if($.time('HH') > 22 ){ + await wakeup() + } + } + else { + if ($.time('HH')>17){ + await sleep(); + await CarveUp(); + } + else if($.time('HH') > 11&&$.time('HH') <14){ + await getCUpcoin(); + await walk(); + } + else if($.time('HH') > 6&&$.time('HH') <9){ + await wakeup() + } } - else if(hour > 11&&hour <14){ - getCUpcoin(); - walk(); - } - else if(hour > 6&&hour <9){ - wakeup() - } - var time = new Date(new Date(new Date().toLocaleDateString()).getTime())/1000 +} function signin() { return new Promise((resolve, reject) => { - const url = { url: $.getdata('sy_signurl_dsj'), headers: JSON.parse(signheaderVal)} - $.get(url, (error, response, data) => + $.get({url: `${dianshijia_API}/v5/sign/signin?accelerate=0&ext=0&ticket=`, headers: JSON.parse(signheaderVal)}, async(error, response, data) => { if(logs)$.log(`${$.name}, 签到结果: ${data}\n`) - const result = JSON.parse(data) + let result = JSON.parse(data) if (result.errCode == 0) { signinres = `签到成功 ` var h = result.data.reward.length @@ -132,277 +199,194 @@ function signin() { { subTitle = `【签到结果】 失败` detail = `原因: ${result.msg}` + if ($.isNode()) { + await notify.sendNotify($.name,subTitle+'\n'+detail) + } + return } - resolve() + resolve() }) }) } function signinfo() { return new Promise((resolve, reject) => { - let awardurl = { url: `http://act.gaoqingdianshi.com/api/v4/sign/get`, headers: JSON.parse(signheaderVal)} - $.get(awardurl, (error, response, data) => + $.get({ url: `${dianshijia_API}/v4/sign/get`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { - if(logs)$.log(`${$.name}, 签到信息: ${data}\n`) - const result = JSON.parse(data) + if(logs)$.log(`${$.name}, 签到信息: ${data}\n`) + let result = JSON.parse(data) if (result.errCode == 0) { var d = `${result.data.currentDay}` for (i=0; i < result.data.recentDays.length;i++) { if (d == result.data.recentDays[i].day) - { detail += ` 连续签到${d}天\n` - var j = result.data.recentDays[i].rewards.length - if (j > 1){ - detail += `【奖励信息】今日:${result.data.recentDays[i].rewards[1].name} ` - } - else if (j == 1) - { - detail += `【奖励信息】今日: 无 ` - } - var k = result.data.recentDays[i+1].rewards.length - if ( k > 1 ) { - detail += ` 明日: `+ result.data.recentDays[i+1].rewards[1].name+`\n` - - } - else { - detail += `明日: 无\n` - - } - } + {detail += ` 连续签到${d}天\n` + } } - resolve() } + resolve() }) }) } function total() { return new Promise((resolve, reject) => { - const coinurl = { url: `http://api.gaoqingdianshi.com/api/coin/info`, - headers: JSON.parse(signheaderVal) - } - $.get(coinurl, (error, response, data) => { + $.get({url: `${dianshijia_API}/coin/info`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { if(logs)$.log(`${$.name}, 总计: ${data}\n`) - const result = JSON.parse(data) + let result = JSON.parse(data) subTitle = `待兑换金币: ${result.data.coin} ` try{ if(result.data.tempCoin){ for (i=0;i { - let url = { url: `http://api.gaoqingdianshi.com/api/cash/info`, headers: JSON.parse(signheaderVal)} - $.get(url, (error, response, data) => + $.get({ url: `${dianshijia_API}/cash/info`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { if(logs)$.log(`现金: ${data}\n`) - const cashresult = JSON.parse(data) - subTitle += '现金:'+ cashresult.data.amount/100+'元 额度:'+cashresult.data.withdrawalQuota/100+'元' - cashtotal = cashresult.data.totalWithdrawn/100 + let cashresult = JSON.parse(data) + if(cashresult.errCode=="0"){ + subTitle += '现金:'+ cashresult.data.amount/100+'元 额度:'+cashresult.data.withdrawalQuota/100+'元' + cashtotal = cashresult.data.totalWithdrawn/100 + } resolve() }) }) } function cashlist() { return new Promise((resolve, reject) => { - let url = { - url: `http://api.gaoqingdianshi.com/api/cash/detail`, - headers: JSON.parse(signheaderVal), - } - $.get(url, (error, response, data) => { - //if(logs)$.log(`提现列表: ${data}`) - const result = JSON.parse(data) - totalcash = Number() - cashres = "" - if (result.errCode == 0) { - for (i=0;i { + let result = JSON.parse(data) + let totalcash = Number(),cashres = ""; + //console.log(`提现列表: ${data}`) + if (result.errCode == 0) { + for (i=0;i=time){ - cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` +(result.data[i].type == '2' && result.data[i].ctime >= time ){ + cashres = `✅ 今日提现:`+result.data[i].amount/100+`元 ` } - } - if(cashres&&cashtotal){ + if(cashres && cashtotal){ detail += `【提现结果】`+cashres+`共计提现:`+cashtotal+`元\n` } - else if(cashtotal){ - detail += `【提现结果】今日未提现 共计提现:`+cashtotal+`元\n` + else if(!cashres&&cashtotal){ + detail += `【提现结果】今日未提现 共计提现:`+cashtotal+`元\n` } - } - resolve() + } else { + console.log(`提现列表失败,可忽略: ${data}`) + } + resolve() }) }) } -function taskStatus() { - return new Promise((resolve, reject) => { - shareurl = { url: `http://act.gaoqingdianshi.com/api/v2/task/get`, headers: JSON.parse(signheaderVal)} - $.get(shareurl, (error, response, data) => { - if(logs)$.log(`${$.name},任务状态: ${data}\n`) - let result = JSON.parse(data) - if (result.errCode == 0){ - for -(i=0;i { + let taskcode = ['1M005','1M002','playTask','SpWatchVideo','Mobilewatchvideo','MutilPlatformActive'] + for(code of taskcode){ + await dotask(code) } - resolve() - }) + resolve() }) } - -function share() { - return new Promise((resolve, reject) => { - shareurl = { url: `http://api.gaoqingdianshi.com/api/v4/task/complete?code=1M005`, headers: JSON.parse(signheaderVal)} - $.get(shareurl, (error, response, data) => { - if(logs)$.log(`${$.name}, 分享: ${data}\n`) - }) - shareurl2 = { url: `http://m3.g$xvip.com/activity/f/transfer?uid=&inviteCode=&type=mInvite&yrwe=1&code=0216Jaqu1LRHOh0AMjru1ZYgqu16Jaqy&state=code`, headers: JSON.parse(signheaderVal),} - $.get(shareurl2, (error, response, data) => { - }) -resolve() - }) -} - -function mobileOnline() { - return new Promise((resolve, reject) => { - shareurl = { url: `http://act.gaoqingdianshi.com/api/v4/task/complete?code=1M002`, headers: JSON.parse(signheaderVal)} - $.get(shareurl, (error, response, data) => { - if(logs)$.log(`${$.name}, 手机在线: ${data}\n`) +function dotask(code) { + return new Promise((resolve, reject) => { + $.get({ url: `${dianshijia_API}/v4/task/complete?code=${code}`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { + let taskres = JSON.parse(data), + taskcode = taskres.errCode; + if (taskcode == 0){ + CompCount = taskres.data.dayCompCount + CountMax = taskres.data.dayDoCountMax + console.log('任务代码:'+code+',获得金币:'+taskres.data.getCoin) + if ( code == 'playTask'&&taskres.data.doneStatus == 3) { + detail += `【播放任务】🔕 完成/共计 `+CompCount+`/`+CountMax+` 次\n` + } + } + else if (taskcode == '4000'){ + //console.log('任务代码:'+code+','+taskres.msg) + } + resolve() }) -resolve() }) } - function walk() { return new Promise((resolve, reject) => { - let url = { url: `http://act.gaoqingdianshi.com/api/taskext/getWalk?step=${walkstep}`, headers: JSON.parse(signheaderVal)} + let url = { url: `${dianshijia_API}/taskext/getWalk?step=${walkstep}`, headers: JSON.parse(signheaderVal)} $.get(url, (error, response, data) => { if(logs)$.log(`走路任务: ${data}\n`) - const result = JSON.parse(data) - walkcoin = result.data.unGetCoin - if (walkcoin>10){ -let url = { url: `http://act.gaoqingdianshi.com/api/taskext/getCoin?code=walk&coin=${walkcoin}&ext=1`, headers: JSON.parse(signheaderVal)} - $.get(url, (error, response, data) => + let result = JSON.parse(data) + if (result.data.unGetCoin>10){ + $.get({ url: `${dianshijia_API}/taskext/getCoin?code=walk&coin=${result.data.unGetCoin}&ext=1`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { }) } - resolve() + resolve() }) }) } function sleep() { return new Promise((resolve, reject) => { - let url = { url: `http://act.gaoqingdianshi.com/api/taskext/getSleep?ext=1`, headers: JSON.parse(signheaderVal)} + let url = { url: `${dianshijia_API}/taskext/getSleep?ext=1`, headers: JSON.parse(signheaderVal)} $.get(url, (error, response, data) => { try { if(logs)$.log(`睡觉任务: ${data}\n`) - const result = JSON.parse(data) - if (result.errCode==0){ - sleeping = result.data.name+'报名成功 🛌' + let sleepres = JSON.parse(data) + if (sleepres.errCode==0){ + sleeping = sleepres.data.name+'报名成功 🛌' } -else if (result.errCode==4006){ +else if (sleepres.errCode==4006){ sleeping = '睡觉中😴' } else { sleeping = '' - } + } + resolve() } catch (e) { $.msg($.name, `睡觉结果: 失败`, `说明: ${e}`)} -resolve() + resolve() }) }) } function wakeup() { return new Promise((resolve, reject) => { - let url = { url: `http://act.gaoqingdianshi.com/api/taskext/getCoin?code=sleep&coin=1910&ext=1`, + let url = { url: `${dianshijia_API}/taskext/getCoin?code=sleep&coin=1910&ext=1`, headers: JSON.parse(signheaderVal)} $.get(url, (error, response, data) => { if(logs)$.log(`睡觉打卡: ${data}\n`) }) -resolve() - }) -} - -function SpWatchVideo() { - return new Promise((resolve, reject) => { - let url = { url: `http://act.gaoqingdianshi.com/api/v4/task/complete?code=SpWatchVideo`, - headers: JSON.parse(signheaderVal)} - $.get(url, (error, response, data) => { - if(logs)$.log(`激励视频: ${data}\n`) - }) -resolve() - }) -} - -function watchvideo() { - return new Promise((resolve, reject) => { - let url = { url: `http://act.gaoqingdianshi.com/api/v4/task/complete?code=Mobilewatchvideo`, - headers: JSON.parse(signheaderVal)} - $.get(url, (error, response, data) => { - if(logs)$.log(`激励视频: ${data}\n`) - }) -resolve() - }) -} - -function double() { - return new Promise((resolve, reject) => { - let url = { url: `http://act.gaoqingdianshi.com/api/v4/task/complete?code=MutilPlatformActive`, headers: JSON.parse(signheaderVal)} - $.get(url, (error, response, data) => { - if(logs)$.log(`双端活跃 data: ${data}\n`) - }) -resolve() + resolve() }) } function coinlist() { return new Promise((resolve, reject) => { - let url = { url: `http://api.gaoqingdianshi.com/api/coin/detail`, + setTimeout(() => { + let url = { url: `${dianshijia_API}/coin/detail`, headers: JSON.parse(signheaderVal)} $.get(url, (error, response, data) => { -//$.log(`金币列表: ${data}`) - const result = JSON.parse(data) - let onlamount = Number(); - vdamount = new Number(); - gamestime = new Number() - for (i=0;i=time;i++){ - if (result.data[i].from=="签到"){ - detail += `【每日签到】✅ 获得金币`+result.data[i].amount+'\n' - } + //console.log(`金币列表: ${data}`) + let result = JSON.parse(data) + let onlamount = 0, vdamount = 0, + gamestime = 0, todaysign = 0; + try { + for (i=0;i= time;i++){ if (result.data[i].from=="领取走路金币"){ detail += `【走路任务】✅ 获得金币`+result.data[i].amount+'\n' } @@ -425,37 +409,45 @@ function coinlist() { gamestime += result.data[i].amount } if (result.data[i].from =="激励视频"){ - vdamount += result.data[i].amount + vdamount += result.data[i].amount } if (result.data[i].from=="手机在线"){ - onlamount += result.data[i].amount + onlamount += result.data[i].amount + } + if (result.data[i].from=="签到"){ + todaysign += result.data[i].amount } } -if(vdamount){ - detail += `【激励视频】✅ 获得金币`+vdamount+'\n' -} -if(onlamount){ - detail += `【手机在线】✅ 获得金币`+onlamount+'\n' -} -if(gamestime){ + if(todaysign){ + detail += `【每日签到】✅ 获得金币`+todaysign+'\n' + } + if(vdamount){ + detail += `【激励视频】✅ 获得金币`+vdamount+'\n' + } + if(onlamount){ + detail += `【手机在线】✅ 获得金币`+onlamount+'\n' + } + if(gamestime){ detail += `【游戏时长】✅ 获得金币`+gamestime+'\n' -} - if (i<7){ - detail += '【未完成/总计】'+`${i-1}/7` -} - else if (i>=7){ - detail += `【任务统计】共完成${i-1}次任务🌷` -} + } + if(i>0){ + detail += `【任务统计】共完成${i+1}次任务🌷` + } $.msg($.name+` `+sleeping, subTitle, detail) - resolve() - }) + } catch(e) { + console.log(`获取任务金币列表失败,错误代码${e}+ \n响应数据:${data}`) + $.msg($.name+` 获取金币详情失败 `, subTitle, detail) + } + resolve() + }) + },1000) }) } function CarveUp() { return new Promise((resolve, reject) => { let url = { - url: `http://api.gaoqingdianshi.com/api/v2/taskext/getCarveUp?ext=1`, + url: `${dianshijia_API}/v2/taskext/getCarveUp?ext=1`, headers: JSON.parse(signheaderVal), } $.get(url, (error, response, data) => { @@ -464,91 +456,54 @@ function CarveUp() { if (result.errCode == 0) { detail += `【金币瓜分】✅ 报名成功\n` } + resolve() }) -resolve() }) } function getCUpcoin() { return new Promise((resolve, reject) => { - let url = { - url: `http://act.gaoqingdianshi.com/api/taskext/getCoin?code=carveUp&coin=0&ext=1`, - headers: JSON.parse(signheaderVal), - } - $.get(url, (error, response, data) => { - if(logs)$.log(`瓜分百万金币: ${data}`) + $.get({ url: `${dianshijia_API}/taskext/getCoin?code=carveUp&coin=0&ext=1`, headers: JSON.parse(signheaderVal)}, (error, response, data) => { + if(logs) $.log(`瓜分百万金币: ${data}`) }) -resolve() + resolve() }) } - - function Withdrawal() { return new Promise((resolve, reject) => { - if (drawalVal !=undefined||null){ - let url = { - url: drawalVal, - headers: JSON.parse(signheaderVal), - } - $.get(url, (error, response, data) => { - if(logs)$.log(`金币随机兑换 : ${data}\n`) - const result = JSON.parse(data) - if (result.errCode == 0) { - detail += `【金额提现】✅ 到账`+result.data.price/100+`元 🌷\n` - } - resolve() - }) - } -else { - detail += `【金额提现】❌ 请获取提现地址 \n` - } -resolve() - }) -} -//暂未使用 -function Withdrawal2() { - return new Promise((resolve, reject) => { - let url = { - url: `http://api.gaoqingdianshi.com/api/v2/cash/withdrawal?code=tx000041&`, - headers: JSON.parse(signheaderVal), - } - $.get(url, (error, response, data) => { - $.log(`金额兑换 : ${data}\n`) - const result = JSON.parse(data) - if (result.errCode == 0) { - detail += `【金额提现】✅ `+result.data.price/100+`元 🌷\n` - } - resolve() + $.get({url: drawalVal, headers: JSON.parse(signheaderVal)}, (error, response, data) => { + if(logs)$.log(`金币随机兑换 : ${data}\n`) + let todrawal = JSON.parse(data); + if (todrawal.errCode == 0) { + detail += `【金额提现】✅ 到账`+todrawal.data.price/100+`元 🌷\n` + drawalCode = todrawal.errCode + } + resolve() }) }) } -function playTask() { +function getGametime() { return new Promise((resolve, reject) => { let url = { - url: `http://act.gaoqingdianshi.com/api/v4/task/complete?code=playTask`, + url: `${dianshijia_API}/v4/task/complete?code=gameTime&time=${gametimes}`, headers: JSON.parse(signheaderVal), } $.get(url, (error, response, data) => { - if(logs)$.log(`播放任务: ${data}\n`) - const result = JSON.parse(data) - if (result.errCode==0&&result.data.doneStatus == 3) { - detail += `【播放任务】🔕 完成/共计 `+result.data.dayCompCount+`/`+result.data.dayDoCountMax+` 次\n` - } + if(logs)$.log(`游戏时长: ${data}\n`) }) -resolve() + resolve() }) } -function getGametime() { +function Addsign() { return new Promise((resolve, reject) => { let url = { - url: `http://act.gaoqingdianshi.com/api/v4/task/complete?code=gameTime&time=${gametimes}`, + url: `${dianshijia_API}/sign/chooseAdditionalReward?rewardId=${RewardId}`, headers: JSON.parse(signheaderVal), } $.get(url, (error, response, data) => { - if(logs)$.log(`游戏时长: ${data}\n`) + if(logs)$.log(`额外签到: ${data}\n`) }) -resolve() + resolve() }) } - -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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} +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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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)} diff --git a/Task/exchangeRate.js b/Task/exchangeRate.js index 2ee0b1aa23..993029ab48 100644 --- a/Task/exchangeRate.js +++ b/Task/exchangeRate.js @@ -103,4 +103,4 @@ function rate() { }) } -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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} \ No newline at end of file +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)} \ No newline at end of file diff --git a/Task/jdCookie.js b/Task/jdCookie.js index 0a1dde0d12..929040fec3 100644 --- a/Task/jdCookie.js +++ b/Task/jdCookie.js @@ -1,17 +1,27 @@ /* 此文件为Node.js专用。其他用户请忽略 */ -//此处填写京东账号cookie。注:github action用户ck填写到Settings-Secrets里面 +//此处填写京东账号cookie。 +//注:github action用户cookie填写到Settings-Secrets里面,新增JD_COOKIE,多个账号的cookie使用`&`隔开或者换行 let CookieJDs = [ '',//账号一ck '',//账号二ck,如有更多,依次类推 ] // 判断github action里面是否有京东ck -if (process.env.JD_COOKIE && process.env.JD_COOKIE.split('&') && process.env.JD_COOKIE.split('&').length > 0) { - CookieJDs = process.env.JD_COOKIE.split('&'); - console.log(`\n==================脚本执行来自 github action=====================\n`) - console.log(`==================脚本执行-国际标准时间(UTC):${new Date().toLocaleString()}=====================\n`) - console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()}=====================\n`) +if (process.env.JD_COOKIE) { + if (process.env.JD_COOKIE.indexOf('&') > -1) { + console.log(`您的cookie选择的是用&隔开\n`) + CookieJDs = process.env.JD_COOKIE.split('&'); + } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { + console.log(`您的cookie选择的是用换行隔开\n`) + CookieJDs = process.env.JD_COOKIE.split('\n'); + } else { + CookieJDs = process.env.JD_COOKIE.split(); + } + console.log(`\n==================== 共有${CookieJDs.length}个京东账号Cookie =========`); + console.log(`\n================== 脚本执行来自 github action =====================\n`) + console.log(`================== 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =====================\n`) + console.log(`================== 脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =====================\n`) } for (let i = 0; i < CookieJDs.length; i++) { const index = (i + 1 === 1) ? '' : (i + 1); diff --git a/Task/jddj.js b/Task/jddj.js index f4ca7a57b5..99ee975113 100644 --- a/Task/jddj.js +++ b/Task/jddj.js @@ -87,6 +87,7 @@ function GetCookie() { } else { $.msg("写入" + CookieName + "Cookie失败‼️", "", "配置错误, 无法读取请求头, "); } + $.done() } function signinfo() { @@ -144,4 +145,4 @@ async function showmsg() { $.msg(CookieName, $.subtitle, $.detail) } -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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} \ No newline at end of file +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)} \ No newline at end of file diff --git a/Task/jingxi.js b/Task/jingxi.js index 649fe2be0e..3b5efa85e1 100644 --- a/Task/jingxi.js +++ b/Task/jingxi.js @@ -1,5 +1,5 @@ /* -更新时间:09-16 09:05 +更新时间:10-09 20:05 本脚本为京东旗下京喜app签到脚本 本脚本使用京东公共Cooike,支持双账号,获取方法请查看NobyDa大佬脚本说明 @@ -25,7 +25,6 @@ if ($.isNode()) { cookiesArr.push($.getdata('CookieJD')); cookiesArr.push($.getdata('CookieJD2')) } - !(async () => { if (!cookiesArr[0]) { $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); @@ -34,14 +33,17 @@ if ($.isNode()) { for (let i = 0; i < cookiesArr.length; i++) { if (cookiesArr[i]) { cookie = cookiesArr[i]; - UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + UserName = decodeURIComponent(cookie.match(/pt_pin=(\w+)/) && cookie.match(/pt_pin=(\w+)/)[1]) $.index = i + 1; console.log(`\n开始【京东账号${$.index}】${UserName}\n`); await getsign(); await Tasklist(); await doublesign(); await coininfo(); - await showmsg() + await showmsg(); + if ($.isNode()){ + await notify.sendNotify($.name + " 账号昵称:" + nickname, $.sub+`\n`+$.desc) + } } } })() @@ -58,20 +60,25 @@ function getsign() { Referer: "https://wqsh.jd.com/pingou/taskcenter/index.html" }, } - $.get(signurl, (err, resp, data) => { - if (data.match(/"retCode":\d+/) == '"retCode":0') { - nickname = data.split(':')[6].split(',')[0].replace(/[\"]+/g, "") - totalpoints = data.match(/[0-9]+/g)[3] - signdays = "已签" + data.match(/[0-9]+/g)[6] + "天" - if (data.match(/[0-9]+/g)[9] == 0) { + $.get(signurl, async(err, resp, data) => { + signres = JSON.parse(data) + if (signres.retCode == '0') { + nickname = signres.data.nickname + totalpoints = signres.data.pgAmountTotal + signdays = "已签" + signres.data.signDays + "天" + if (signres.data.signStatus == 0) { signresult = "签到成功" signdays += " 今日获得" + data.match(/[0-9]+/g)[4] + "积分" - } else if (data.match(/[0-9]+/g)[9] == 1) { + } else if (signres.data.signStatus == 1) { signresult = "签到重复" } - } else if (data.match(/"retCode":\d+/) == '"retCode":30003') { + } else if (signres.retCode == '30003') { $.msg($.name, '【提示】京东cookie已失效,请重新登录获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + if($.isNode()){ + await notify.sendNotify($.name + " 账号" + $.index, `【提示】京东cookie已失效,请重新登录获取`) + } + return } resolve() }) @@ -198,4 +205,4 @@ function showmsg() { } // prettier-ignore -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{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)} +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)} \ No newline at end of file diff --git a/Task/kuaishou.js b/Task/kuaishou.js index 66aba11227..84c25507d5 100644 --- a/Task/kuaishou.js +++ b/Task/kuaishou.js @@ -1,26 +1,28 @@ /* -更新时间: 2020-09-08 11:45 - -本脚本仅适用于快手极速版签到 -获取Cookie方法: -1.将下方[rewrite_local]和[MITM]地址复制的相应的区域 -下 -2.APP登陆账号后,以下方法获取Cookie -打开设置页面:"积分兑好礼" - -3.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 -仅测试Quantumult x,Surge、Loon自行测试 -by Macsuny -感谢 +更新时间: 2020-12-20 15:30 + +本脚本仅适用于快手双版本签到,注意正式版Cookie签到有时效性,但Cookie仍然可用于签到极速版,即正式版会掉签;极速版Cookie只能用于极速版 +正式版APP获取Cookie方法: + 1.将下方[rewrite_local]地址复制的相应的区域下,无需填写hostname; + 2.打开APP稍等几秒,即可获取Cookie. +极速版获取方法, + 1.把URL的正则改为 https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\?,添加hostname = nebula.kuaishou.com; + 2.点击设置页面的"积分兑好礼"即可 + +兼容Nodejs,把获取的Cookie填入KS_TOKEN,多账号用"&"分开 + +非专业人士制作,欢迎各位大佬提出宝贵意见和指导 +by Sunert +特别感谢 @Chavy @Nobyda ~~~~~~~~~~~~~~~~ Surge 4.0 : [Script] -快手极速版 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js,script-update-interval=0 +快手 = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js,script-update-interval=0 -快手极速版 = type=http-request,pattern=https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +快手 = type=http-request,pattern=http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js ~~~~~~~~~~~~~~~~ Loon 2.1.0+ @@ -28,7 +30,7 @@ Loon 2.1.0+ # 本地脚本 cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js, enabled=true, tag=快手 -http-request https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js +http-request http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js ----------------- @@ -38,107 +40,211 @@ QX 1.0.7+ : [rewrite_local] -https:\/\/nebula\.kuaishou\.com\/nebula\/task\/earning\? url script-request-header kuaishou.js - -~~~~~~~~~~~~~~~~ - -hostname = nebula.kuaishou.com +http:\/\/uploads2\.gifshow\.com\/rest\/n\/system\/speed url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/kuaishou.js ~~~~~~~~~~~~~~~~ */ -const logs = 0 //日志开关 -const $ = new Env('快手极速版') -const cookieVal = $.getdata('cookie_ks'); -let isGetCookie = typeof $request !== 'undefined' +const logs = false //日志开关 +const $ = new Env('快手视频') +let cookieArr = []; +if ($.isNode()) { + if (process.env.KS_TOKEN && process.env.KS_TOKEN.indexOf('&') > -1) { + ks_tokens = process.env.KS_TOKEN.split('&'); + } else { + ks_tokens = process.env.KS_TOKEN.split() + }; + Object.keys(ks_tokens).forEach((item) => { + if (ks_tokens[item]) { + cookieArr.push(ks_tokens[item]) + } + }) +} else { + cookieArr.push($.getdata('cookie_ks')) +} +let isGetCookie = typeof $request !== 'undefined' if (isGetCookie) { - GetCookie() + GetCookie(); + $.done() } else { - !(async() => { - await sign(); - await signifo(); - await info() +!(async() => { + if(!cookieArr[0]){ + $.msg($.name, '【提示】🉐登录快手pp获取cookie',"", {"open-url": "https://live.kuaishou.com/fission/offkwai/index?cc=share_copylink&kpf=IPHONE&traceId=27&fid=1570609569&code=3429390431&shareMethod=token&kpn=KUAISHOU&subBiz=INVITE_CODE&shareId=1000517297081&shareToken=X-1oTjAy1OkMhgQk_AO&platform=copylink&shareMode=app&shareObjectId=3429390431"}); + return + } + if ($.isNode()){ + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()}=============\n`) + } + for (let i = 0; i < cookieArr.length; i++) { + if (cookieArr[i]) { + cookieVal = cookieArr[i]; + $.index = i + 1; + console.log(`-------------------------\n\n开始【快手视频账号${$.index}】`) + await speedSign(); + await speedSignifo(); + await speedInfo(); + await officialSign(); + if(offici_code !== 100119){ + await officialSignifo(); + await officialtaskCenter(); + } + await showmsg() + } + } })() .catch((e) => $.logErr(e)) .finally(() => $.done()) } -function GetCookie() { - if ($request.headers) { - var CookieValue = $request.headers['Cookie']; - - if ($.getdata('cookie_ks') != (undefined || null)) { - if ($.getdata('cookie_ks') != CookieValue) { - var cookie = $.setdata(CookieValue, 'cookie_ks'); - if (!cookie) { - $.msg("更新" + $.name + "Cookie失败‼️", "", ""); - $.log(`[${$.name}] 获取Cookie: 失败`); - } else { - $.msg("更新" + $.name + "Cookie成功 🎉", "", ""); - $.log(`[${$.name}] 获取Cookie: 成功, Cookie: ${CookieValue}`) +function officialSign() { + return new Promise((resolve, reject) => { + let signurl = { + url: 'https://activity.m.kuaishou.com/rest/wd/taskCenter/task/signIn', + headers: {Cookie: cookieVal, +'Content-Type': 'application/json;charset=utf-8'}, + body: '{"bizId": 29}' + } + $.post(signurl, (error, response, data) => { + if(logs)$.log(`${$.name}, data: ${data}`) + let officialSign_res = JSON.parse(data) + offici_code = officialSign_res.result + if(offici_code == 100111){ + offic_sign = `签到结果: ${officialSign_res.error_msg}`; + // $.msg($.name,offic_sign,"") + logs?$.log(`错误信息: ${officialSign_res.error_msg}`):""; + resolve() + return + } else if(offici_code == 100136){ + offic_sign = `签到结果: ${officialSign_res.error_msg}` + if(logs)console.log(""+officialSign_res.error_msg) + } else if(offici_code == 1){ + offic_sign = `签到结果: ✅ +${officialSign_res.reward.rewardCount} 积分` } - } - } else { - var cookie = $.setdata(CookieValue, 'cookie_ks'); - if (!cookie) { - $.msg("首次写入" + $.name + "Cookie失败‼️", "", ""); - } else { - $.msg("首次写入" + $.name + "Cookie成功 🎉", "", ""); - } - } - } else { - $.msg("写入" + $.name + "Cookie失败‼️", "", "配置错误, 无法读取请求头, "); - } -$.done() + resolve() + }) + }) + } + +function officialSignifo() { + return new Promise((resolve, reject) => { + infourl = { + url: 'https://zt.gifshow.com/rest/zt/encourage/account/summary/withKscoinTrial?kpn=KUAISHOU&subBiz=lowActiveUserTaskEncourage', + headers: {Cookie: cookieVal, +'Content-Type': 'application/json;charset=utf-8'},} + $.get(infourl, async(error, response, data) => { + if(logs)$.log(`${$.name}, data: ${data}`) + let _info = JSON.parse(data) + if (_info.result == 1){ + offic_info = `收益: ${_info.data.accounts[0].displayBalance}积分 现金: ${_info.data.accounts[1].displayBalance}元\n` + } + resolve() + }) + }) +} +function officialtaskCenter() { + return new Promise((resolve, reject) => { + let reurl = {url:'https://activity.m.kuaishou.com/rest/wd/taskCenter/task/appStartup/reward', + headers: {Cookie: cookieVal,'Content-Type': 'application/json;charset=utf-8'}, + body: '{"bizId": 29}' + } + $.post(reurl, (error, response, data) =>{ + if(logs)$.log(`${$.name}, data: ${data}`) + let result = JSON.parse(data) + if (result.rewardSuccess == true) { + var rewards = result.reward.accounts + if (typeof result.reward.surpriseRewardCount !== undefined){ + rewards += result.reward.surpriseRewardCount + } + offic_reward = `获得收益: 💵${rewards}积分\n` + } + resolve() + }) + }) } -function sign() { +function speedSign() { return new Promise((resolve, reject) => { let signurl = { url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/sign', headers: {Cookie: cookieVal}} $.get(signurl, (error, response, data) => { - if(logs) $.log(`${$.name}, data: ${data}`) - let result = JSON.parse(data) - if(result.result == 10007){ - subTitle = `签到结果: ${result.error_msg}` - $.msg($.name,subTitle,'')} - if(logs) $.log(`错误代码: ${result.result}, 返回信息: ${result.error_msg}`) - }) - resolve() + if(logs)$.log(`${$.name}, data: ${data}`) + let speed_res = JSON.parse(data) + speed_code = speed_res.result + if(speed_code == 10007){ + speed_sign = `签到结果: ${speed_res.error_msg}`; + $.msg($.name,speed_sign,''); + if(logs) $.log(`错误信息: ${speed_res.error_msg}`) + $.done() + } else if(speed_code == 10901){ + speed_sign = `签到结果: ${speed_res.error_msg}` + } else if(speed_code == 1){ + speed_sign = `签到结果: ${speed_res.data.toast}` + } + resolve() + }) }) } -function signifo() { +function speedSignifo() { return new Promise((resolve, reject) => { earnurl = { url: 'https://nebula.kuaishou.com/rest/n/nebula/sign/query', - headers: {Cookie: cookieVal}} + headers: {Cookie: cookieVal, +'Content-Type': 'application/json;charset=utf-8'}, +} $.get(earnurl, (error, response, data) => { - if(logs)$.log(`${$.name}, data: ${data}`) + if(logs)$.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) - if (result.data.nebulaSignInPopup.button == '立即签到'){ - detail = `签到成功: ${result.data.nebulaSignInPopup.subTitle}, ${result.data.nebulaSignInPopup.title}` - } else if (result.data.nebulaSignInPopup.button == '好的'){ - detail = `重复签到: ${result.data.nebulaSignInPopup.subTitle}, ${result.data.nebulaSignInPopup.title}` + if (result.result == '1'){ + speed_info = `${result.data.nebulaSignInPopup.subTitle}, ${result.data.nebulaSignInPopup.title}\n` } resolve() }) }) } -function info() { +function speedInfo() { return new Promise((resolve, reject) => { let reurl = {url:'https://nebula.kuaishou.com/rest/n/nebula/activity/earn/overview', - headers: {Cookie:cookieVal}} + headers: {Cookie: cookieVal, +'Content-Type': 'application/json;charset=utf-8'},} $.get(reurl, (error, response, data) =>{ if(logs)$.log(`${$.name}, data: ${data}`) let result = JSON.parse(data) if (result.result == 1) { - subTitle = `现金收益: 💵${result.data.allCash}元 金币收益: 💰${result.data.totalCoin}` + speed_rewards = `现金收益: 💵${result.data.allCash}元 金币收益: 💰${result.data.totalCoin}` } - $.msg($.name,subTitle,detail) resolve() - }) - }) + }) + }) } - -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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} + +function showmsg() { + $.sub ="", $.desc = ""; +if(offici_code==1||offici_code ==100136 ){ + $.desc += `【正式版】:\n `+offic_info+" "+offic_sign +'\n' + } + +if(speed_code==1||speed_code ==10901 ){ + $.desc += `【极速版】:\n `+speed_rewards+"\n "+speed_info+" " +speed_sign + } +$.msg($.name,$.sub,$.desc) +} + +function GetCookie() { + var UA = $request.headers['User-Agent'] + if ($request && $request.method != `OPTIONS`&& UA.indexOf('ksNebula')>-1) { + const cookieVal = $request.headers['Cookie'] + if (cookieVal) $.setdata(cookieVal,'cookie_ks') + $.log(`${$.name} 获取Cookie: 成功,cookieVal: ${cookieVal}`) + $.msg($.name, `获取极速Cookie: 成功🎉`, ``) + } else if ($request && $request.method != `OPTIONS`&& UA.indexOf("ksNebula")==-1) { + const cookie = $request.headers['Cookie'] + cookieVal = cookie.match(/token=[a-z0-9-]+/)[0] + if (cookieVal) $.setdata(cookieVal,'cookie_ks') + $.log(`${$.name} 获取Cookie: 成功,cookieVal: ${cookieVal}`) + $.msg($.name, `获取正式Cookie: 成功🎉`, ``) + } +} + +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)} diff --git a/Task/lkyl.js b/Task/lkyl.js index ed0c5e75e6..c913b1e2fe 100644 --- a/Task/lkyl.js +++ b/Task/lkyl.js @@ -1,5 +1,5 @@ /* -更新时间: 2020-06-15 15:35 取消打卡挑战,ck时效短,可弃坑 +更新时间: 2020-10-09 08:35 取消打卡挑战,ck时效短,可弃坑 本脚本仅适用于京东来客有礼每日获取京豆 获取Cookie方法: @@ -42,38 +42,16 @@ const challengebean= 100 //默认挑战赛100档 const jdbean = "500" //兑换京豆数 const logs = 0 //响应日志开关,默认关闭 const cookieName = '来客有礼小程序' -const sy = init() -const signurlVal = sy.getdata('sy_signurl_lkyl') -const signheaderVal = sy.getdata('sy_signheader_lkyl') -const openid = sy.getdata('openid_lkyl') -const appid = sy.getdata('app_lkyl') +const $ = new Env(cookieName) +const signurlVal = $.getdata('sy_signurl_lkyl') +const signheaderVal = $.getdata('sy_signheader_lkyl') +const openid = $.getdata('openid_lkyl') +const appid = $.getdata('app_lkyl') let isGetCookie = typeof $request !== 'undefined' if (isGetCookie) { GetCookie() } else { - all() -} -function GetCookie() { -const requrl = $request.url -if ($request && $request.method != 'OPTIONS') { - const signurlVal = requrl - const signheaderVal = JSON.stringify($request.headers) - const openid = $request.headers['openId']; - const appid = $request.headers['App-Id']; - sy.log(`signurlVal:${signurlVal}`) - sy.log(`signheaderVal:${signheaderVal}`) - if (signurlVal) sy.setdata(signurlVal, 'sy_signurl_lkyl') - if (signheaderVal) sy.setdata(signheaderVal, 'sy_signheader_lkyl') - if (openid) sy.setdata(openid,'openid_lkyl'); - if (appid) sy.setdata(appid,'app_lkyl'); - sy.log(`openid:${openid}`) - sy.log(`appid:${appid}`) - sy.msg(cookieName, `获取Cookie: 成功🎉`, ``) - } - } - -async function all() -{ +!(async () => { await sign(); // 签到 await info(); // 账号信息 await total(); // 总计 @@ -84,14 +62,37 @@ async function all() await video(); // 视频任务 await Daily(); // 日常任务 //await exChange(); // 银豆兑换 +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) } +function GetCookie() { +const requrl = $request.url +if ($request && $request.method != 'OPTIONS') { + const signurlVal = requrl + const signheaderVal = JSON.stringify($request.headers) + const openid = $request.headers['openId']; + const appid = $request.headers['App-Id']; + $.log(`signurlVal:${signurlVal}`) + $.log(`signheaderVal:${signheaderVal}`) + if (signurlVal) $.setdata(signurlVal, 'sy_signurl_lkyl') + if (signheaderVal) $.setdata(signheaderVal, 'sy_signheader_lkyl') + if (openid) $.setdata(openid,'openid_lkyl'); + if (appid) $.setdata(appid,'app_lkyl'); + $.log(`openid:${openid}`) + $.log(`appid:${appid}`) + $.msg(cookieName, `获取Cookie: 成功🎉`, ``) + } + $.done() + } + function sign() { return new Promise((resolve, reject) =>{ let signurl = { url: `https://draw.jdfcloud.com//api/turncard/sign?openId=${openid}&petSign=true&turnTableId=131&source=HOME&channelId=87&appId=${appid}`, headers:JSON.parse(signheaderVal)} - sy.post(signurl, (error, response, data) => { - if(logs) sy.log(`${cookieName}, 签到信息: ${data}`) + $.post(signurl, (error, response, data) => { + if(logs) $.log(`${cookieName}, 签到信息: ${data}`) let result = JSON.parse(data) const title = `${cookieName}` if (result.success == true) { @@ -103,7 +104,7 @@ function sign() { } else if (result.errorCode =='L0001') { subTitle = `签到失败,Cookie 失效❌` detail = `说明: ${result.errorMessage}` - sy.msg(cookieName, subTitle, detail) + $.msg(cookieName, subTitle, detail) return } resolve() @@ -115,8 +116,8 @@ function status() { let statusurl = { url: `https://draw.jdfcloud.com//api/bean/square/silverBean/task/get?openId=${openid}&appId=${appid}`, headers: JSON.parse(signheaderVal)} - sy.get(statusurl, (error, response, data) =>{ - if(logs)sy.log(`${cookieName}, 任务状态: ${data}`) + $.get(statusurl, (error, response, data) =>{ + if(logs)$.log(`${cookieName}, 任务状态: ${data}`) taskstatus = JSON.parse(data) if (taskstatus.data.dailyTasks[0].status!='received'){ detail += `【日常抽奖】: 🔕 已完成/总计: ${doneSteps}/${totalSteps}次\n` @@ -145,8 +146,8 @@ function video() { url: `https://draw.jdfcloud.com//api/bean/square/silverBean/task/join?appId=${appid}`,headers: JSON.parse(signheaderVal),body: bodyVal} videotaskurl = { url: `https://draw.jdfcloud.com//api/bean/square/silverBean/taskReward/get?openId=${openid}&taskCode=watch_video&inviterOpenId=&appId=${appid}`,headers: JSON.parse(signheaderVal)} - sy.post(videourl, function(error, response, data){if(logs)sy.log(`${cookieName}, 视频: ${data}`)}) - sy.get(videotaskurl, function(error, response, data){if(logs)sy.log(`${cookieName}, 视频银豆: ${data}`)}) + $.post(videourl, function(error, response, data){if(logs)$.log(`${cookieName}, 视频: ${data}`)}) + $.get(videotaskurl, function(error, response, data){if(logs)$.log(`${cookieName}, 视频银豆: ${data}`)}) } } if (taskstatus.data.dailyTasks[1].status=='received'){ @@ -162,8 +163,8 @@ function lottery() { url: `https://draw.jdfcloud.com//api/bean/square/getTaskInfo?openId=${openid}&taskCode=lottery&appId=${appid}`, headers: JSON.parse(signheaderVal) } - sy.get(daytaskurl, (error, response, data) => { - if(logs) sy.log(`${cookieName}, 0元抽奖 ${data}`) + $.get(daytaskurl, (error, response, data) => { + if(logs) $.log(`${cookieName}, 0元抽奖 ${data}`) let lotteryres = JSON.parse(data) doneSteps = lotteryres.data.doneSteps totalSteps = lotteryres.data.totalSteps @@ -186,8 +187,8 @@ function info() { let infourl = { url: `https://draw.jdfcloud.com//api/user/user/detail?openId=${openid}&appId=${appid}`, headers: JSON.parse(signheaderVal)} - sy.get(infourl, (error, response, data) => { - if(logs)sy.log(`${cookieName}, 账号信息: ${data}`) + $.get(infourl, (error, response, data) => { + if(logs)$.log(`${cookieName}, 账号信息: ${data}`) let info = JSON.parse(data) uesername = `${info.data.nickName}` resolve() @@ -206,8 +207,8 @@ function challenge() { headers: JSON.parse(signheaderVal), body: '{"appId":'+' "'+appid+'"'+', "openId":'+' "'+openid+'"'+',"challengeStage":"'+nowday+'","deductAmount":'+challengebean+',"signLevelAmount":'+challengebean+'}' } - sy.post(challurl, (error, response, data) => { - sy.log(`${cookieName}, 打卡挑战赛: ${data}`) + $.post(challurl, (error, response, data) => { + $.log(`${cookieName}, 打卡挑战赛: ${data}`) let challres = JSON.parse(data) if(challres.data==true){ detail += `【打卡挑战】: 报名成功,押金: `+challengebean+'\n' @@ -229,8 +230,8 @@ function tasklist() { url: `https://draw.jdfcloud.com//api/lottery/home/v2?openId=${openid}&appId=${appid}`, headers: JSON.parse(signheaderVal)} taskurl.headers['Content-Length'] = `0`; - sy.get(taskurl, (error, response, data) => { - if(logs)sy.log(`${cookieName}, 任务列表: ${data}`) + $.get(taskurl, (error, response, data) => { + if(logs)$.log(`${cookieName}, 任务列表: ${data}`) task = JSON.parse(data) resolve() }) @@ -242,8 +243,8 @@ function cycleLucky() { let luckyurl = { url: `https://draw.jdfcloud.com//api/lottery/participate?lotteryId=${lotteryId}&openId=${openid}&formId=123&source=HOME&appId=${appid}`,headers: JSON.parse(signheaderVal),body: '{}' } - sy.post(luckyurl, (error, response, data) => { - if(logs)sy.log(`${cookieName}, 抽奖任务: ${data}`) + $.post(luckyurl, (error, response, data) => { + if(logs)$.log(`${cookieName}, 抽奖任务: ${data}`) }) resolve() }) @@ -257,13 +258,13 @@ return new Promise((resolve, reject) => { headers: JSON.parse(signheaderVal) } beanurl.headers['Content-Length'] = `0`; - sy.get(beanurl, (error, response, data) => + $.get(beanurl, (error, response, data) => { - if(logs)sy.log(`${cookieName}, 日常银豆: ${data}`) + if(logs)$.log(`${cookieName}, 日常银豆: ${data}`) }) resolve() - sy.msg(cookieName, '昵称: '+ uesername+' '+subTitle, detail) - sy.log('昵称: '+ uesername+' '+subTitle+detail) + $.msg(cookieName, '昵称: '+ uesername+' '+subTitle, detail) + $.log('昵称: '+ uesername+' '+subTitle+detail) }) } // 每周银豆 @@ -274,9 +275,9 @@ return new Promise((resolve, reject) => { headers: JSON.parse(signheaderVal) } bean2url.headers['Content-Length'] = `0`; - sy.get(bean2url, (error, response, data) => + $.get(bean2url, (error, response, data) => { - if(logs)sy.log(`${cookieName}, 本周任务: ${data}`) + if(logs)$.log(`${cookieName}, 本周任务: ${data}`) }) resolve() }) @@ -284,13 +285,12 @@ return new Promise((resolve, reject) => { function total() { return new Promise((resolve, reject) =>{ - setTimeout(() => { let lotteryurl = { url: `https://draw.jdfcloud.com//api/bean/square/silverBean/getUserBalance?openId=${openid}&appId=${appid}`, headers: JSON.parse(signheaderVal) } - sy.get(lotteryurl, (error, response, data) => { - if(logs)sy.log(`${cookieName}, 统计: ${data}`) + $.get(lotteryurl, (error, response, data) => { + if(logs)$.log(`${cookieName}, 统计: ${data}`) let result = JSON.parse(data) const title = `${cookieName}` if (result.success == true) { @@ -301,8 +301,8 @@ function total() { url: `https://draw.jdfcloud.com//api/bean/square/silverBean/getJdBeanList?openId=${openid}&appId=${appid}`, headers: JSON.parse(signheaderVal)} hinturl.headers['Content-Length'] = `0`; - sy.get(hinturl, (error, response, data) => { - if(logs)sy.log(`${cookieName}, 可兑换: ${data}`) + $.get(hinturl, (error, response, data) => { + if(logs)$.log(`${cookieName}, 可兑换: ${data}`) let excresult = JSON.parse(data) const title = `${cookieName}` exchangebean = `` @@ -331,7 +331,6 @@ else if (SilverBean == excresult.datas[0].salePrice) resolve() }) }) - }) }) } function exChange() { @@ -342,8 +341,8 @@ function exChange() { headers: JSON.parse(signheaderVal), body: '{"appId":'+' "'+appid+'"'+', "openId":'+' "'+openid+'"'+', "jdPin":'+' "'+uesername+'"'+', "productCode":"jd_bean_'+jdbean+'"}' } - sy.post(changeurl, (error, response,data) =>{ - if(logs) sy.log(`${cookieName}, 兑换京豆: ${data}`) + $.post(changeurl, (error, response,data) =>{ + if(logs) $.log(`${cookieName}, 兑换京豆: ${data}`) let result = JSON.parse(data) if (result.errorCode== "success"){ detail += '\n【自动兑换】 兑换'+result.data+'个京豆 ✅' @@ -354,46 +353,5 @@ function exChange() { }) } -function init() { - isSurge = () => { - return undefined === this.$httpClient ? false : true - } - isQuanX = () => { - return undefined === this.$task ? false : true - } - getdata = (key) => { - if (isSurge()) return $persistentStore.read(key) - if (isQuanX()) return $prefs.valueForKey(key) - } - setdata = (key, val) => { - if (isSurge()) return $persistentStore.write(key, val) - if (isQuanX()) return $prefs.setValueForKey(key, val) - } - msg = (title, subTitle, body) => { - if (isSurge()) $notification.post(title, subTitle, body) - if (isQuanX()) $notify(title, subTitle, body) - } - log = (message) => console.log(message) - get = (url, cb) => { - if (isSurge()) { - $httpClient.get(url, cb) - } - if (isQuanX()) { - url.method = 'GET' - $task.fetch(url).then((resp) => cb(null, resp, resp.body)) - } - } - post = (url, cb) => { - if (isSurge()) { - $httpClient.post(url, cb) - } - if (isQuanX()) { - url.method = 'POST' - $task.fetch(url).then((resp) => cb(null, resp, resp.body)) - } - } - done = (value = {}) => { - $done(value) - } - return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done } -} +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)} + diff --git a/Task/midu_Read.js b/Task/midu_Read.js new file mode 100644 index 0000000000..96c05ead38 --- /dev/null +++ b/Task/midu_Read.js @@ -0,0 +1,502 @@ +/* +MIDU_TOKEN 为 "https://apiwz.midukanshu.com/user/readTimeBase/readTime"此链接完整请求头; +MIDU_TIME 为 "https://apiwz.midukanshu.com/user/readTimeBase/readTime"此链接请求体,格式为 "dataEncStr=XXX; +MIDU_SIGN 为 "https://apiwz.midukanshu.com/wz/task/" 完整请求体,格式为 "fullVersion=XXX" +以上全部值不许换行,多账号用#分隔; +多账号退出一账号可能某些任务会提示失效 +由于运行时间较长,则只在Actions运行 +*/ +const cookieName = '米读阅读时长' +const $ = new Env(cookieName) +let tokenArr = [], TimeArr = [],SignArr= []; + const bind = true; +if ($.isNode()) { + if (process.env.MIDU_TOKEN && process.env.MIDU_TOKEN.indexOf('#') > -1) { + miduToken = process.env.MIDU_TOKEN.split('#'); + } else { + miduToken = process.env.MIDU_TOKEN.split() + }; + if (process.env.MIDU_TIME && process.env.MIDU_TIME.indexOf('#') > -1) { + ReadBodys = process.env.MIDU_TIME.split('#'); + } else { + ReadBodys = process.env.MIDU_TIME.split() + }; + if (process.env.MIDU_SIGN && process.env.MIDU_SIGN.split('#') && process.env.MIDU_SIGN.indexOf('#') > -1) { + SignBodys = process.env.MIDU_SIGN.split('#'); + } else { + SignBodys = process.env.MIDU_SIGN.split() + }; + Object.keys(miduToken).forEach((item) => { + if (miduToken[item]) { + tokenArr.push(miduToken[item]) + } + }); + Object.keys(ReadBodys).forEach((item) => { + if (ReadBodys[item]) { + TimeArr.push(ReadBodys[item]) + } + }); + Object.keys(SignBodys).forEach((item) => { + if (SignBodys[item]) { + SignArr.push(SignBodys[item]) + } + }); + } else { + tokenArr.push($.getdata('tokenMidu_read')); + TimeArr.push($.getdata('senku_readTimebody_midu')); + SignArr.push($.getdata('senku_signbody_midu')) +} + +!(async () => { + if (!tokenArr[0]){ + $.msg($.name, '【提示】米读一cookie'); + console.log($.name, '【提示】米读一cookie'); + return; + } + if ($.isNode()){ + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + console.log(`============ 共${tokenArr.length}个米读账号 =============\n`) + }; + + for (let i = 0; i < tokenArr.length; i++) { + if (tokenArr[i]) { + headerVal = tokenArr[i]; + bodyVal = TimeArr[i]; + drawVal = SignArr[i]; + $.index = i + 1; + //console.log(tokenArr) + console.log(`-------------------------\n\n开始【米读账号${$.index}】`) + tkVal = drawVal.match(/tk=(\w+)/)[1] + await userInfo(); + for (j=0;j<10;j++){ + await readTime() + }; + await prizeInfo(); + if (prizeinfo && prizeinfo.data && prizeinfo.data.total_num) { + await prizeTask(), + await drawPrize() + }; + await addDraw(); + await taskTime(); + await OthersAd(); + await dice_addnum(); + await dice_roll(); + await dice_double(); + if (bind) { + await Bind(); + } + await signDay(); + await signVideo() + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + + + +// 阅读时长 +function readTime() { + return new Promise((resolve, reject) => { + let request = { + url: "https://apiwz.midukanshu.com/user/readTimeBase/readTime", + headers: JSON.parse(headerVal), + body: bodyVal + } + $.post(request, async(error, response, data) => { + try { + //$.log(`❕ ${cookieName} readTime - response: ${JSON.stringify(data)}\n`) + readtime = JSON.parse(data) + let subTitle = '' + let detail = '' + if (readtime && readtime.code == 0) { + const coin = readtime.data.coin + const readTotalMinute = readtime.data.readTotalMinute + const total_coin = readtime.data.total_coin + coin == 0 ? detail += `` : detail += `【阅读时长】获得${coin}💰` + console.log("总计阅读时长"+readTotalMinute / 2+"分钟,本次获得+"+`${coin}金币,请等待30s后执行下一次阅读\n`) + readTotalMinute ? detail += ` 阅读时长${readTotalMinute / 2}分钟,该账户:${total_coin}💰` : detail += `该账户:${total_coin}💰` + await $.wait(30000); + + //$.msg(cookieName, subTitle, detail) + + } else if (readTime.code != 0) { + detail += `【阅读时长】错误代码${readtime.code},错误信息${readtime.message}` + $.msg(cookieName, subTitle, detail) + } + + } catch (e) { + $.msg(cookieName, `阅读时长: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} readTime - 签到失败: ${e}`) + $.log(`❌ ${cookieName} readTime - response: ${JSON.stringify(data)}\n`) + } + resolve() + }) + }) +} + +function drawPrize() { + return new Promise((resolve, reject) => { + const url = { + url: 'https://apiwz.midukanshu.com/wz/task/drawPrize?' + drawVal, + headers: JSON.parse(headerVal), + } + $.post(url, (error, response, data) => { + try { + $.log(`🐍🐢 ${cookieName} drawPrize - response: ${JSON.stringify(data)}\n`) + drawprize = JSON.parse(data) + if(drawprize.code==0){ + console.log("转盘抽奖任务:"+drawprize.data.title) + } + + } catch (e) { + // $.msg(cookieName, `抽奖: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} drawPrize - 抽奖失败: ${e}`) + $.log(`❌ ${cookieName} drawPrize - response: ${JSON.stringify(data)}\n`) + + } + resolve() + }) + }) +} +// 用户信息 +function userInfo() { + return new Promise((resolve, reject) => { + const url = { + url: 'https://apiwz.midukanshu.com/wz/user/getInfo', + headers: JSON.parse(headerVal), + body: bodyVal + } + $.post(url, (error, response, data) => { + try { + //$.log(`🐍🐢 ${cookieName} userInfo - response: ${JSON.stringify(data)}`) + userinfo = JSON.parse(data) + if (userinfo.code==0){ + nick = userinfo.data.nickname + total_coin = userinfo.data.goldCoin + corner = userinfo.data.goldCoinMoney + invite_code = userinfo.data.invite_code + today_coin = userinfo.data.todayGoldCoin + console.log("总计金币:"+total_coin+" 现金收益"+corner+'\n您今日所得总金币为'+ today_coin+' 您的邀请码为'+ invite_code+'\n') + } + resolve() + } catch (e) { + $.msg(cookieName, `获取用户信息: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} userInfo - 获取用户信息失败: ${e}`) + $.log(`❌ ${cookieName} userInfo - data: ${JSON.stringify(data)}`) + resolve() + } + }) + }) +} + +function Bind() { + return new Promise((resolve, reject) => { + const url = { + url: 'http://fisson.1sapp.com/nlx/shareLink/tmpBind', + headers: JSON.parse(headerVal), + body: 'app_id=7&act_type=1&act_name=grad_pupil&invite_code=A1051999596&telephone=' + userinfo.data.mobile + } + url.headers['Host'] = 'fisson.1sapp.com' + $.post(url, (error, response, data) => { + resolve() + }) + }) +} + + +// 额外奖励 +function addDraw() { + return new Promise((resolve, reject) => { + url = { + url: 'https://apiwz.midukanshu.com/wz/task/weekReward', + headers: {}, + body: drawVal+"&draw_num=28&sign=36646430333630313c3c353c6661326136333266326036353663333232363d3d" + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + $.post(url, (error, response, data) => { + try { + // $.log(`🐍🐢 ${cookieName} addDraw - response: ${JSON.stringify(data)}\n`) + add_Draw = JSON.parse(data) + if(add_Draw.code==0){ + console.log("转盘额外奖励:"+add_Draw.data.msg) + } + resolve() + } catch (e) { + // $.msg(cookieName, `额外奖励: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} addDraw - 转盘额外奖励失败: ${e}`) + $.log(`❌ ${cookieName} addDraw - response: ${JSON.stringify(data)}\n`) + resolve() + } + }) + }) +} + +function taskTime() { + return new Promise((resolve, reject) => { + const url = { + url: 'https://apiwz.midukanshu.com/wz/task/time' , + headers: {}, + body: drawVal + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + $.post(url, (error, response, data) => { + try { + // $.log(`🐍🐢 ${cookieName} taskTime - response: ${JSON.stringify(data)}\n`) + _taskTime = JSON.parse(data) + if(_taskTime.code==0){ + console.log("定时任务:"+"+"+_taskTime.data.amount) + } + resolve() + } catch (e) { + $.log(`❌ ${cookieName} taskTime - 定时任务失败: ${e}`) + $.log(`❌ ${cookieName} taskTime - response: ${JSON.stringify(data)}\n`) + resolve() + } + }) + }) +} + + +// 观看视频获取抽奖机会 +function prizeTask() { + return new Promise((resolve, reject) => { + const prizeTaskurlVal = 'https://apiwz.midukanshu.com/wz/task/prizeTask?'+drawVal + const url = { + url: prizeTaskurlVal, + headers: {}, + } + //url.headers['token'] = tokenVal + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + $.post(url, (error, response, data) => { + try { + // $.log(`🐍🐢 ${cookieName} prizeTask - response: ${JSON.stringify(data)}\n`) + prizetask = JSON.parse(data) + if(prizetask.code==0){ + console.log("抽奖次数: "+prizetask.data.title) + } + resolve() + } catch (e) { + // $.msg(cookieName, `观看视频抽奖: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} prizeTask - 观看视频抽奖失败: ${e}`) + $.log(`❌ ${cookieName} prizeTask - response: ${JSON.stringify(data)}\n`) + resolve() + } + }) + }) +} + +// 抽奖信息 +function prizeInfo() { + return new Promise((resolve, reject) => { + const url = { + url: 'https://apiwz.midukanshu.com/wz/task/prizeList', + headers: {}, + body: drawVal + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + $.post(url, (error, response, data) => { + try { + //$.log(`🐍🐢 ${cookieName} prizeInfo - response: ${JSON.stringify(data)}\n`) + if (data) { + prizeinfo = JSON.parse(data) + console.log("今日抽奖信息:"+prizeinfo.data.btnText) + } + resolve() + } catch (e) { + // $.msg(cookieName, `抽奖信息: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} prizeInfo - 抽奖信息失败: ${e}`) + $.log(`❌ ${cookieName} prizeInfo - response: ${JSON.stringify(data)}\n`) + resolve() + } + }) + }) +} + +// 掷骰子 +function dice_roll() { + return new Promise((resolve, reject) => { + const url = { + url: 'https://apiwz.midukanshu.com/wz/dice/roll', + headers: {}, + body: drawVal + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + $.post(url, (error, response, data) => { + try { + // $.log(`🐍🐢 ${cookieName} dice_roll - response: ${JSON.stringify(data)}\n`) + rollList=JSON.parse(data) + if (rollList.code == 0) { + console.log("掷骰子获得"+rollList.data.roll_coin+"金币") + } else if (rollList.code == '-10203'){ + console.log("掷骰子任务:"+rollList.message) + } + resolve() + } catch (e) { + $.msg(cookieName, `掷骰子: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} dice_roll - 掷骰子失败: ${e}`) + $.log(`❌ ${cookieName} dice_roll - response: ${JSON.stringify(data)}\n`) + resolve() + } + }) + }) +} + +// 骰子双倍奖励 +function dice_double() { + return new Promise((resolve, reject) => { + const url = { + url: 'https://apiwz.midukanshu.com/wz/dice/doubleReward', + headers: {}, + body: drawVal + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + //url.headers['token'] = tokenVal + $.post(url, (error, response, data) => { + try { + $.log(`🐍🐢 ${cookieName} dice_double - response: ${JSON.stringify(data)}\n`) + doubleList=JSON.parse(data) + if (doubleList.code == 0) { + console.log("骰子双倍奖励:"+doubleList.message) + } else if (doubleList.code == '-10205'){ + console.log("骰子双倍奖励:"+doubleList.message) + } + resolve() + } catch (e) { + $.msg(cookieName, `骰子双倍奖励: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} dice_double - 骰子双倍奖励失败: ${e}`) + $.log(`❌ ${cookieName} dice_double - response: ${JSON.stringify(data)}\n`) + resolve() + } + }) + }) +} +//获取骰子次数: +function dice_addnum() { + return new Promise((resolve, reject) => { + const dice_addnum_urlVal = 'https://apiwz.midukanshu.com/wz/dice/addChangeNumByRewardVideo?' + drawVal + const url = { + url: dice_addnum_urlVal, + headers: {} + } + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 miduapp qapp' + $.post(url, (error, response, data) => { + try { + // $.log(`🐍🐢 ${cookieName} dice_addnum - response: ${JSON.stringify(data)}`) + diceaddnum=JSON.parse(data) + if(diceaddnum.code=='-10208'){ + console.log("获取骰子次数:"+diceaddnum.message) + } + resolve() + } catch (e) { + $.msg(cookieName, `获取骰子次数: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} dice_addnum - 获取骰子次数失败: ${e}`) + $.log(`❌ ${cookieName} dice_addnum - response: ${JSON.stringify(data)}`) + resolve() + } + }) + }) +} + + +// 每日签到 +function signDay() { + return new Promise((resolve, reject) => { + const url = { + url: "https://apiwz.midukanshu.com/wz/task/signInV2?"+ drawVal, + headers: {}, + } + //url.headers['token'] = tokenVal + url.headers['Host'] = 'apiwz.midukanshu.com' + url.headers['Content-Type'] = 'application/x-www-form-urlencoded' + url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 qapp miduapp' + $.post(url, (error, response, data) => { + try { + //$.log(`🐍🐢 ${cookieName} signDay - response: ${JSON.stringify(data)}\n`) + _signDay = JSON.parse(data) + if(_signDay.code==0){ + console.log("每日签到:"+_signDay.data.amount+"金币") + } + resolve() + } catch (e) { + $.msg(cookieName, `签到结果: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} signDay - 签到失败: ${e}`) + $.log(`❌ ${cookieName} signDay - response: ${JSON.stringify(data)}\n`) + resolve() + } + }) + }) +} + +// 签到视频奖励 +function signVideo() { + return new Promise((resolve, reject) => { + const url = { + url: 'https://apiwz.midukanshu.com/wz/task/signVideoReward', + headers: {}, + body: drawVal + } + $.post(url, (error, response, data) => { + try { + // $.log(`🐍🐢 ${cookieName} signVideo - response: ${JSON.stringify(data)}\n`) + _signVideo = JSON.parse(data) + if (_signVideo.code == 0) { + console.log("签到视频奖励得"+_signVideo.data.amount+"金币") + } else { + console.log(_signVideo.message) + } + resolve() + } catch (e) { + $.msg(cookieName, `签到视频: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} signVideo - 签到视频失败: ${e}`) + $.log(`❌ ${cookieName} signVideo - response: ${JSON.stringify(data)}\n`) + resolve() + } + }) + }) +} + + +function OthersAd() { + return new Promise((resolve, reject) => { + const otherVal = 'https://apiwz.midukanshu.com/activity/dividend/videoAdReward' + const url = { + url: otherVal, + headers: {}, + body: drawVal + } + $.post(url, (error, response, data) => { + try { + // $.log(`🐍🐢 ${cookieName} OthersAd - response: ${JSON.stringify(data)}\n`) + _OthersAd = JSON.parse(data) + if(_OthersAd.code==0){ + console.log("额外奖励: "+_OthersAd.data.msg) + } + resolve() + } catch (e) { + $.msg(cookieName, `额外奖励: 失败`, `说明: ${e}`) + $.log(`❌ ${cookieName} OthersAd - 额外奖励失败: ${e}`) + $.log(`❌ ${cookieName} OthersAd - response: ${JSON.stringify(data)}\n`) + resolve() + } + }) + }) +} + + +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)} diff --git a/Task/moji.js b/Task/moji.js new file mode 100644 index 0000000000..4fa65c8bef --- /dev/null +++ b/Task/moji.js @@ -0,0 +1,292 @@ +/* +支持boxjs手动修改位置,可直接输入中文地区名 +更新时间 2020-12-19 14:36 +*/ +const $ = new Env('墨迹天气') +const City = encodeURIComponent($.getdata('city')||"北京") //可在此处修改城市 +const j = $.getdata('citynum')||"1"; +let reduction = $.getdata('cut') || 'false'; //日志 +let daylys = $.getdata('day_desc') || 'true', //每日天气 + hourlys = $.getdata('hour_desc') || 'false', //小时预报 + indexs = $.getdata('index_desc') || 'false'; //生活指数 + fortys = $.getdata('forty_desc') || 'false'; //40天预告 +let Alerts = ""; + +!(async() => { + await SearchCity(); + await fortyReport(); + await Weather(); + await TodayReport(); + await showmsg() + })() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + +function Weather() { + return new Promise((resolve, reject) =>{ + let weatherurl = { + url: `https://co.moji.com/api/weather2/weather?lang=zh&city=${cityid}` + } + $.get(weatherurl, (error, response, data) => { + try { + $.weather = JSON.parse(data); + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + }) +} + +function fortyReport() { + return new Promise((resolve, reject) =>{ + let fortyurl = { + url: `https://h5ctywhr.api.moji.com/fc40`, + headers: {'Host': 'h5ctywhr.api.moji.com',}, + body: `{"cityId": ${cityid},"cityType":${cityType}}` + } + $.post(fortyurl, (error, response, data) => { + try { + $.forty = JSON.parse(data) + realFeel = $.forty.condition.realFeel + forDay40 = $.forty.forecastDays.forecastDay40.fallTrendDesc[0] ? $.forty.forecastDays.forecastDay40.fallTrendDesc[0].desc:"" + temp40 = $.forty.forecastDays.forecastDay40.tempTrendDesc[0] ? $.forty.forecastDays.forecastDay40.tempTrendDesc[0].desc:"" + Festival = $.forty.forecastDays.forecastDay[1].festival + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + }) +} + +function Indexs() { + return new Promise((resolve, reject) =>{ + let indexsurl = { + url: `https://h5ctywhr.api.moji.com/indexDetail?cityId=${cityid}`, + headers: {}, + body: `{"cityId": ${cityid},"cityType":${cityType}}` + } + $.post(indexsurl, (error, response, data) => { +try { + $.index = JSON.parse(data); + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + }) + }) +} + +function SearchCity() { + return new Promise((resolve) =>{ + let cityurl = { + url: `https://ssch.api.moji.com/citymanage/json/h5/searchCity?keyWord=${City}`, + headers: {}, + } + $.post(cityurl, (error, response, data) => { + let result = JSON.parse(data) + if(result.city_list.length>0 && j<= result.city_list.length){ + console.log("城市或者地区名称及ID序号") + for(i=0; i0){ + Alerts = '\n【气象预警】'+"预警级别: "+$.weather.data.alerts[0].level+'\n '+$.weather.data.alerts[0].content + } + $.desc = " 当天温度: "+daytemp+" 实时温度🌡:"+nowtemp+"\n " +` 实时天气: ${today_Skycon}`+" 风速🌪: "+ windDirection + nowwindval +"级" + windSpeed(nowwindval)+ "\n 空气质量🌬: "+aqidesc+" 湿度☔️: "+nowhum+Alerts +'\n' +} + +async function showmsg() { + if(daylys == 'true'){ + $.desc += "【每周天气】\n" + await WeekReport() + } + if(hourlys == 'true'){ + $.desc += "【未来6小时变化预报】\n" + await HourlyReport() + } + if (indexs== 'true'){ + $.desc += "【生活指数】\n" + await Indexs(); + await IndexReport() + } + if (fortys == 'true'){ + $.desc += "【40天预告】\n "+forDay40+temp40 + } + $.sub = "【今日天气】" +`${mapSkycon(nowweather)[0]}` + $.msg($.weather.data.city +"天气预报 "+$.weather.data.forecast_day[0].predict_date +$.weather.data.forecast_day[0].predict_week +" "+Festival,$.sub, $.desc,{"media-url": `${mapSkycon(nowweather)[1]}` + }) +} + +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)} diff --git a/Task/mydigit.js b/Task/mydigit.js index 68c121e3ee..0a12f8496f 100644 --- a/Task/mydigit.js +++ b/Task/mydigit.js @@ -135,4 +135,4 @@ function Minfo() { } // prettier-ignore -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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} +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)} \ No newline at end of file diff --git a/Task/package.json b/Task/package.json index e8a427d084..64ae633998 100644 --- a/Task/package.json +++ b/Task/package.json @@ -19,12 +19,8 @@ "homepage": "https://github.com/Sunert/Scripts#readme", "dependencies": { "crypto-js": "^4.0.0", - "got": "^11.5.1", + "got": "^11.7.0", "http-server": "^0.12.3", - "node-schedule": "^1.3.2", - "tough-cookie": "^4.0.0", - "download": "^8.0.0", - "request": "^2.88.2", - "request-promise": "^4.2.5" + "tough-cookie": "^4.0.0" } } diff --git a/Task/sendNotify.js b/Task/sendNotify.js index 71883a75ed..c370c2fc72 100644 --- a/Task/sendNotify.js +++ b/Task/sendNotify.js @@ -1,8 +1,10 @@ +// 感谢lxk0301大佬,本代码根据@lxk0301大佬编写的代码及教程修改 + const $ = new Env(); //此处填你申请的SCKEY. //注:此处设置github action用户填写到Settings-Secrets里面(Name输入PUSH_KEY) let SCKEY = ''; - +const querystring = require("querystring"); //此处填你BarkAPP的信息(IP/设备码,例如:https://api.day.app/XXXXXXXX) //注:此处设置github action用户填写到Settings-Secrets里面(Name输入BARK_PUSH) let BARK_PUSH = ''; @@ -17,13 +19,19 @@ let TG_BOT_TOKEN = ''; //注:此处设置github action用户填写到Settings-Secrets里面(Name输入TG_USER_ID) let TG_USER_ID = ''; -//运行农场脚本是否静默运行(即:不推送通知),false打开通知推送,true关闭通知推送 -//注:此处设置github action用户填写到Settings-Secrets里面(Name输入 FRUIT_NOTIFY_CONTROL , Value填写true或者false) -let fruitNotifyControl = false;//(默认农场脚本推送通知) +//此处填你钉钉 bot 的webhook,例如:5a544165465465645d0f31dca676e7bd07415asdasd +//注:此处设置github action用户填写到Settings-Secrets里面(Name输入DD_BOT_TOKEN) +let DD_BOT_TOKEN = ''; +//密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 +let DD_BOT_SECRET = ''; +//以下为脚本运行通知开关,true为不推送,false为推送通知 +let IGOT_PUSH_KEY = ''; + +let txnewsNotifyControl = false;//(默认腾讯新闻脚本推送通知) + +let youthNotifyControl = false;//(默认中青脚本推送通知) -//运行萌宠脚本是否静默运行(即:不推送通知),false打开通知推送,true关闭通知推送 -//注:此处设置github action用户填写到Settings-Secrets里面(Name输入 PET_NOTIFY_CONTROL , Value填写true或者false) -let petNotifyControl = false;//(默认萌宠脚本推送通知) +let dsjNotifyControl = true;//(默认电视家脚本推送不通知) if (process.env.PUSH_KEY) { SCKEY = process.env.PUSH_KEY; @@ -38,6 +46,11 @@ if (process.env.BARK_PUSH) { if (process.env.BARK_SOUND) { BARK_SOUND = process.env.BARK_SOUND } +} else { + if(BARK_PUSH && BARK_PUSH.indexOf('https') === -1 && BARK_PUSH.indexOf('http') === -1) { + //兼容BARK本地用户只填写设备码的情况 + BARK_PUSH = `https://api.day.app/${BARK_PUSH}` + } } if (process.env.TG_BOT_TOKEN) { TG_BOT_TOKEN = process.env.TG_BOT_TOKEN; @@ -46,20 +59,36 @@ if (process.env.TG_USER_ID) { TG_USER_ID = process.env.TG_USER_ID; } -if (process.env.FRUIT_NOTIFY_CONTROL) { - fruitNotifyControl = process.env.FRUIT_NOTIFY_CONTROL; +if (process.env.DD_BOT_TOKEN) { + DD_BOT_TOKEN = process.env.DD_BOT_TOKEN; + if (process.env.DD_BOT_SECRET) { + DD_BOT_SECRET = process.env.DD_BOT_SECRET; + } } -if (process.env.PET_NOTIFY_CONTROL) { - petNotifyControl = process.env.PET_NOTIFY_CONTROL; + +if (process.env.IGOT_PUSH_KEY) { + IGOT_PUSH_KEY = process.env.IGOT_PUSH_KEY } + +if (process.env.YOUTH_NOTIFY_CONTROL && process.env.YOUTH_NOTIFY_CONTROL==false) { + youthNotifyControl = process.env.YOUTH_NOTIFY_CONTROL; +} +if (process.env.TXNEWS_NOTIFY_CONTROL && process.env.TXNEWS_NOTIFY_CONTROL==false) { + txnewsNotifyControl = process.env.TXNEWS_NOTIFY_CONTROL; +} +if (process.env.DSJ_NOTIFY_CONTROL && process.env.DSJ_NOTIFY_CONTROL==false) { + dsjNotifyControl = process.env.DSJ_NOTIFY_CONTROL; +} + async function sendNotify(text, desp) { //提供三种通知 await serverNotify(text, desp); await BarkNotify(text, desp); await tgBotNotify(text, desp); + await ddBotNotify(text, desp) } -function serverNotify(text, desp) { +function serverNotify(text, desp, timeout = 2100) { return new Promise(resolve => { if (SCKEY) { //微信server酱推送通知一个\n不会换行,需要两个\n才能换行,故做此替换 @@ -71,24 +100,29 @@ function serverNotify(text, desp) { 'Content-Type': 'application/x-www-form-urlencoded' } } - $.post(options, (err, resp, data) => { - try { - if (err) { - console.log('\n发送通知调用API失败!!\n') - } else { - data = JSON.parse(data); - if (data.errno === 0) { - console.log('\nserver酱发送通知消息成功\n') - } else if (data.errno === 1024) { - console.log('\nPUSH_KEY 错误\n') + setTimeout(() => { + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('\n发送通知调用API失败!!\n') + console.log(err); + } else { + data = JSON.parse(data); + if (data.errno === 0) { + console.log('\nserver酱发送通知消息成功\n') + } else if (data.errno === 1024) { + console.log('\nPUSH_KEY 错误\n') + } else { + console.log(`server酱发送通知消息异常\n${JSON.stringify(data)}`) + } } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve(data); - } - }) + }) + }, timeout) } else { console.log('\n您未提供server酱的SCKEY,取消微信推送消息通知\n'); resolve() @@ -96,16 +130,21 @@ function serverNotify(text, desp) { }) } -function BarkNotify(text, desp) { + +function BarkNotify(text, desp, params={}) { return new Promise(resolve => { if (BARK_PUSH) { const options = { - url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}`, + url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}&${querystring.stringify(params)}`, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } } $.get(options, (err, resp, data) => { try { if (err) { console.log('\nBark APP发送通知调用API失败!!\n') + console.log(err); } else { data = JSON.parse(data); if (data.code === 200) { @@ -132,15 +171,28 @@ function tgBotNotify(text, desp) { if (TG_BOT_TOKEN && TG_USER_ID) { const options = { url: `https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage`, - body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}`, + body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}&disable_web_page_preview=true`, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } } + if (process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) { + const tunnel = require("tunnel"); + const agent = { + https: tunnel.httpsOverHttp({ + proxy: { + host: process.env.TG_PROXY_HOST, + port: process.env.TG_PROXY_PORT * 1 + } + }) + } + Object.assign(options, { agent }) + } $.post(options, (err, resp, data) => { try { if (err) { console.log('\ntelegram发送通知消息失败!!\n') + console.log(err); } else { data = JSON.parse(data); if (data.ok) { @@ -163,15 +215,124 @@ function tgBotNotify(text, desp) { } }) } + +function ddBotNotify(text, desp) { + return new Promise(resolve => { + const options = { + url: `https://oapi.dingtalk.com/robot/send?access_token=${DD_BOT_TOKEN}`, + json: { + "msgtype": "text", + "text": { + "content": ` ${text}\n\n${desp}` + } + }, + headers: { + 'Content-Type': 'application/json' + } + } + if (DD_BOT_TOKEN && DD_BOT_SECRET) { + const crypto = require('crypto'); + const dateNow = Date.now(); + const hmac = crypto.createHmac('sha256', DD_BOT_SECRET); + hmac.update(`${dateNow}\n${DD_BOT_SECRET}`); + const result = encodeURIComponent(hmac.digest('base64')); + options.url = `${options.url}×tamp=${dateNow}&sign=${result}`; + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('\n钉钉发送通知消息失败!!\n') + console.log(err); + } else { + data = JSON.parse(data); + if (data.errcode === 0) { + console.log('\n钉钉发送通知消息完成。\n') + } else { + console.log(`\n${data.errmsg}\n`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + } else if (DD_BOT_TOKEN) { + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('\n钉钉发送通知消息失败!!\n') + console.log(err); + } else { + data = JSON.parse(data); + if (data.errcode === 0) { + console.log('\n钉钉发送通知消息完成。\n') + } else { + console.log(`\n${data.errmsg}\n`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + } else { + console.log('\n您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n'); + resolve() + } + }) +} + +function iGotNotify(text, desp, params={}){ + return new Promise(resolve => { + if (IGOT_PUSH_KEY) { + // 校验传入的IGOT_PUSH_KEY是否有效 + const IGOT_PUSH_KEY_REGX = new RegExp("^[a-zA-Z0-9]{24}$") + if(!IGOT_PUSH_KEY_REGX.test(IGOT_PUSH_KEY)) { + console.log('\n您所提供的IGOT_PUSH_KEY无效\n') + resolve() + return + } + const options = { + url: `https://push.hellyw.com/${IGOT_PUSH_KEY.toLowerCase()}`, + body: `title=${text}&content=${desp}&${querystring.stringify(params)}`, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('\n发送通知调用API失败!!\n') + console.log(err); + } else { + if(typeof data === 'string') data = JSON.parse(data); + if (data.ret === 0) { + console.log('\niGot发送通知消息成功\n') + } else { + console.log(`\niGot发送通知消息失败:${data.errMsg}\n`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + } else { + console.log('\n您未提供iGot的推送IGOT_PUSH_KEY,取消iGot推送消息通知\n'); + resolve() + } + }) +} module.exports = { sendNotify, - BarkNotify, SCKEY, BARK_PUSH, TG_BOT_TOKEN, TG_USER_ID, - fruitNotifyControl, - petNotifyControl + DD_BOT_TOKEN, + IGOT_PUSH_KEY } // prettier-ignore -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)} \ No newline at end of file +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)} diff --git a/Task/sinanews.js b/Task/sinanews.js index ffa7c2ffab..c02cd12a87 100644 --- a/Task/sinanews.js +++ b/Task/sinanews.js @@ -47,7 +47,7 @@ https?:\/\/lite\.sina\.cn\/\?resource=userpoint\/signIn - script-request-header */ const $ = new Env('新浪新闻') const signurlVal = $.getdata(`sy_signurl_snews`) -const infourlVal = $.getdata(`sy_ck_snews`) +const infourlVal = $.getdata(`sy_info_snews`) const signheaderVal =$.getdata(`sy_ck_snews`) const infoheaderVal =$.getdata(`sy_infoheader_snews`) @@ -84,6 +84,7 @@ if ($request && $request.method != 'OPTIONS'&& if (infoheaderVal) $.setdata(infoheaderVal, `sy_infoheader_snews`) $.msg($.name, `获取信息Cookie: 成功`, ``) } + $.done() } //签到 function getsign() { @@ -131,5 +132,4 @@ function signinfo() { }) } -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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} - +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)} \ No newline at end of file diff --git a/Task/sunert.boxjs.json b/Task/sunert.boxjs.json index d95dccfc1f..62d3ede61e 100644 --- a/Task/sunert.boxjs.json +++ b/Task/sunert.boxjs.json @@ -39,11 +39,37 @@ "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/youth.js" }, + { + "id": "youthGain", + "name": "中青浏览赚", + "keys": ["youth_start", "youth_end"], + "author": "@sunert", + "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/youth_gain.js", + "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/youth.png", "https://raw.githubusercontent.com/Orz-3/task/master/youth.png"], + "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/youth_gain.js" + }, { "id": "dianshijia", "name": "电视家", - "keys": ["sy_signurl_dsj", "sy_signheader_dsj", "drawal_dsj"], + "keys": ["sy_signheader_dsj", "drawal_dsj"], "author": "@sunert", + "settings": [{ + "id": "REWARD", + "name": "额外签到奖励", + "val": "55", + "type": "radios", + "desc": "", + "items": [{ + "key": "55", + "label": "提现额度" + }, { + "key": "44", + "label": "1天VIP" + }, { + "key": "42", + "label": "1888金币" + }] + }], "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/dianshijia.js", "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/dianshijia.png", "https://raw.githubusercontent.com/Orz-3/task/master/dianshijia.png"], "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/dianshijia.js" @@ -66,6 +92,15 @@ "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/sinanews.png", "https://raw.githubusercontent.com/Orz-3/task/master/sinanews.png"], "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/sinanews.js" }, + { + "id": "NOWLIVE", + "name": "NOW直播", + "keys": ["now_qq", "nowqq_cookie"], + "author": "@sunert", + "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/NOWLIVE.js", + "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/NOWLIVE.png"], + "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/NOWLIVE.js" + }, { "id": "chinatelecomEnquiry", "name": "电信套餐查询", @@ -96,7 +131,7 @@ { "id": "TVlist", "name": "电视预告", - "keys": [], + "keys": ["c"], "settings": [{ "id": "c", "name": "电视台", @@ -105,9 +140,68 @@ "desc": "请填写小写英文台标,示例: 北京: btv1 | 湖南: hunan | 浙江: zhejiang 河南: henan| 江苏: jiangsu|广东: guangdong 更多电视台请参加电视家网络列表" }], "author": "@sunert", "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/tvpreview.js", - "icons": ["https://raw.githubusercontent.com/Sunert/Quantumult-X/master/Rules/Images/ICON/tvpreview.png", "https://raw.githubusercontent.com/Sunert/Quantumult-X/master/Rules/Images/ICON/tvpreview.png"], + "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/tvpreview.png"], "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/tvpreview.js" }, + { + "id": "moji", + "name": "墨迹天气", + "keys": ["city","citynum","cut","day_desc","hour_desc","index_desc"], + "settings": [{ + "id": "city", + "name": "城市", + "val": "北京", + "type": "text", + "desc": "请填写中文地区" + }, + { + "id": "citynum", + "name": "城市序号", + "val": "", + "type": "number", + "placeholder": "默认1 (点击以展开说明)", + "desc": "选择地区,请填写日志内冒号前的数字序号" + }, + { + "id": "cut", + "name": "精简日志模式", + "val": false, + "type": "boolean", + "desc": "显示详情描述,默认关闭日志" + }, + { + "id": "day_desc", + "name": "每周天气", + "val": true, + "type": "boolean", + "desc": "每周天气接口,可显示6天天气情况" + }, + { + "id": "hour_desc", + "name": "小时天气", + "val": false, + "type": "boolean", + "desc": "未来6小时天气情况" + }, + { + "id": "forty_desc", + "name": "40天预告", + "val": false, + "type": "boolean", + "desc": "未来40天天气预告" + }, + { + "id": "index_desc", + "name": "生活指数", + "val": true, + "type": "boolean", + "desc": "可显示生活指数情况" + }], + "author": "@sunert", + "repo": "https://gitee.com/Sunert/Scripts/blob/master/Task/moji.js", + "icons": ["https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji_mini.png", "https://gitee.com/Sunert/ProxyConfig/raw/master/QuantumultX/Rules/Images/ICON/moji.png"], + "script": "https://gitee.com/Sunert/Scripts/raw/master/Task/moji.js" + }, { "id": "mydigit", "name": "数码之家", diff --git a/Task/telecomInfinity.js b/Task/telecomInfinity.js index 1b947121d4..00c4ae4aca 100644 --- a/Task/telecomInfinity.js +++ b/Task/telecomInfinity.js @@ -1,4 +1,5 @@ /** +更新时间: 2020-10-12 20:05 1.根据原版脚本修改,增加上月账单信息,需重新获取Cookie,打开app即可 2.适合流量畅享套餐使用,其他套餐,自行测试,此项仅供测试 3.可能因地区不同,脚本不一定适用 @@ -41,10 +42,10 @@ let config = { delay: 0, //自定义延迟签到,单位毫秒,(如填200则每个接口延迟0.2秒执行),默认无延迟 info: 1, //是否显示手机归属地,1为显示,0为不显示 } -const $ = new Env(config.name) - d = new Date(); - Y = d.getFullYear(), - M = $.getdata('Mon').slice(-2)||d.getMonth() //上月 +let $ = new Env(config.name), + Y = $.time('yyyy'), + M = $.getdata('Mon').slice(-2)||$.time('MM') ; //查询前几个月,可以')'号后减几 + let AUTHTOKEN = $.getdata(config.authTokenKey) let COOKIE = $.getdata(config.CookieKey) var requests = { @@ -61,28 +62,30 @@ var requests = { url: "https://e.189.cn/store/user/balance_new.do", headers: { "authToken": AUTHTOKEN, - "type": "alipayMiniApp" + "type": "alipayMiniApp", + "User-Agent": "TYUserCenter/2.8 (iPhone; iOS 14.0; Scale/3.00)" }, - method: "GET" + body: "t=tysuit", + method: "POST" }, info: { url: "https://e.189.cn/store/user/getExtInfo.do", headers: { "authToken": AUTHTOKEN, - "type": "alipayMiniApp" + "type": "alipayMiniApp", + // "Cookie": COOKIE }, method: "GET" }, bill: { url: `https://e.189.cn/store/user/bill.do?year=${Y}&month=${M}&t=tysuit`, headers: { - "Cookie": COOKIE, + "Cookie": COOKIE }, method: "GET" } } -//console.log(requests.bill) if (isGetCookie = typeof $request !== 'undefined') { GetCookie() $.done() @@ -101,7 +104,7 @@ function GetCookie() { if (cookieVal) { if ($.setdata(cookieVal, config.authTokenKey)) { $.msg(config.name, '获取authToken: 成功', '') - // $.log.info(`[${config.name}] 获取authToken: 成功, authToken: ${cookieVal}, Cookie: [${COOKIE}]` ) + // console.log(`[${config.name}] 获取authToken: 成功, authToken: ${cookieVal}, Cookie: [${COOKIE}]` ) } } } @@ -155,7 +158,7 @@ resolve(JSON.parse(body)); } function parseData(detail, balance, info, bill) { - return new Promise(resolve => { + return new Promise(async(resolve) => { if (!info || !detail || !balance|| !bill) { resolve("done") return @@ -175,84 +178,91 @@ function parseData(detail, balance, info, bill) { resolve("done") //return } - var balanceAvailable = Number(balance.totalBalanceAvailable) - notify(detail, balanceAvailable, info, bill) + await notify(detail, balance, info, bill) resolve("done") }) } function notify(data, balance, exdata, bldata) { -//console.log(bldata) + return new Promise((resolve) => { + let productname = "中国电信", voiceAmount = " ", voiceUsage = " ", voiceBalance = " ", msgUsage = "", msgBalance = "", msgAmount = "",usagedCommon,balanceCommon,totalCommon,message; + //console.log(data) //套餐信息 + try { var subtitle = "" if (config.info) { subtitle = "【手机】" + exdata.mobileShort + " (" + exdata.province + "-" + exdata.city + ")" + } //手机号码 + for (i = 0; i < data.items.length; i++) { + for (k = 0; k < data.items[i].items.length; k++) { + let item = data.items[i].items[k] + if (data.items[i].offerType == '11' || data.items[i].offerType == '21') { + productname = data.items[i].productOFFName + } else { + productname = data.items[0].productOFFName + } + message = "【套餐】" + productname; //主套餐名称 + if (item.nameType == '401100' || item.nameType == '431100') { + msgUsage = item.usageAmount, + msgAmount = item.ratableAmount, + msgBalance = item.balanceAmount + } + if (msgUsage) { + msginfo = "【短信】已用: " + msgUsage + "条 剩余: " + msgBalance + "条 合计: " + msgAmount + "条", + message += "\n" + msginfo + }; //短信余量 + let VoiceArr = data.items[i].items; + if (item.nameType == '131100') { + for ( Voiceiterm of VoiceArr) + voiceAmount = Voiceiterm.ratableAmount, + voiceBalance = Voiceiterm.balanceAmount, + voiceUsage = Voiceiterm.usageAmount + } + voice = "【通话】已用: " + voiceUsage + "分钟 剩余: " + voiceBalance + "分钟 合计: " + voiceAmount + "分钟"; + message += "\n" + voice; //语音 + + if (item.nameType == "331101") { + usagedCommon = formatFlow(item.usageAmount / 1024), + balanceCommon = item.ratableResourcename, + totalCommon = data.items[i].productOFFName + } // 畅享套餐 + else if (item.nameType == "331100") { + usagedCommon = formatFlow(item.usageAmount / 1024), + balanceCommon = formatFlow(item.balanceAmount / 1024), + totalCommon = formatFlow(item.ratableAmount / 1024) + }; //套餐流量 + if (usagedCommon) { + flow = "【流量】已用: " + usagedCommon + " 剩余:" + balanceCommon + " 合计:" + totalCommon, + message += "\n" + flow + } + } } - var productname = "中国电信" - if (typeof data.items[1].offerType == 11) { - productname = data.items[1].productOFFName - } - else if (typeof data.items[0].productOFFName != "undefined") { - productname = data.items[0].productOFFName - } - var message = "【套餐】" + productname - var voiceAmount = " " - var voiceUsage = " " - var voiceBalance = " " - var msgUsage = "" - var msgBalance = "" - var msgAmount = "" - if(data.usedCommon){ - usagedCommon = formatFlow(data.usedCommon/1024) -} - if(data.balanceCommon){ - balanceCommon = formatFlow(data.balanceCommon/1024) -} - if(data.totalCommon){ - totalCommon = formatFlow(data.totalCommon/1024) -} -for (i=0;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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} +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)} \ No newline at end of file diff --git a/Task/trainquery.js b/Task/trainquery.js index 0793dadab9..5116e98573 100644 --- a/Task/trainquery.js +++ b/Task/trainquery.js @@ -297,4 +297,4 @@ const subTitle = '始发站: '+startstation+ '--终点站: '+edstation+' ('+purp } -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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} \ No newline at end of file +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)} \ No newline at end of file diff --git a/Task/translate.js b/Task/translate.js index 6c32d19dfc..2b36cdf121 100644 --- a/Task/translate.js +++ b/Task/translate.js @@ -75,4 +75,4 @@ return new Promise((resolve, reject) => { } // prettier-ignore -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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} +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)} \ No newline at end of file diff --git a/Task/tvpreview.js b/Task/tvpreview.js index e26cfc0580..b8aca9019f 100644 --- a/Task/tvpreview.js +++ b/Task/tvpreview.js @@ -1,5 +1,5 @@ /* -本脚本为电视节目预告 兼容chavyleung大佬的boxjs订阅优先生效 +本脚本为电视节目预告 兼容chavyleung大佬的boxjs订阅优先生效,图片非实时直播图片 本仓库boxjs订阅地址: https://raw.githubusercontent.com/Sunert/Scripts/master/Task/sunert.boxjs.json 1.数据从电视家数据库获取 @@ -85,7 +85,7 @@ const wurl = { $.subTitle = `即将播出: ${result[`${tvnum}`].program[i+1].t}` +duration } } - $.msg($.title, $.subTitle, $.detail) + $.msg($.title, $.subTitle, $.detail,{'media-url':`http://cdn.dianshihome.com/static/channel/poster/${tvnum}.jpg`}) resolve() } catch(err) { @@ -98,4 +98,4 @@ const wurl = { //console.log(playlist) -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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} \ No newline at end of file +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)} \ No newline at end of file diff --git a/Task/txnews.js b/Task/txnews.js index 0643c6d904..bb8ffc2cbd 100644 --- a/Task/txnews.js +++ b/Task/txnews.js @@ -1,5 +1,6 @@ + /* -更新时间: 2020-09-19 21:30 +更新时间: 2020-10-18 00:50 腾讯新闻签到修改版,可以自动阅读文章获取红包,该活动为瓜分百万现金挑战赛,针对幸运用户参与 @@ -46,61 +47,104 @@ Cookie获取后,请注释掉Cookie地址。 */ const $ = new Env('腾讯新闻'); const notify = $.isNode() ? require('./sendNotify') : ''; -let s = Number($.getdata('delay'))||200 // 间隔延迟时间 +let s = parseInt($.getdata('delay'))||200 // 间隔延迟时间 let notifyInterval =$.getdata('notifynum')||50; //阅读篇数间隔通知开为1,常关为0; const TX_HOST = 'https://api.inews.qq.com/activity/v1/' - - -let signurlVal = $.getdata('sy_signurl_txnews') -let cookieVal = $.getdata( 'sy_cookie_txnews') -let videoVal = $.getdata( 'video_txnews') +let SignArr = [],SignUrl = ""; + cookiesArr = [],CookieTxnews = ""; + VideoArr = [],SignUrl = "",order = "", + detail = ``, subTitle = ``; if ($.isNode()) { - cookieVal = process.env.cookieVal; - signurlVal = process.env.signurlVal; - videoVal = process.env.videoVal -} + if (process.env.TXNEWS_COOKIE && process.env.TXNEWS_COOKIE.indexOf('&') > -1) { + CookieTxnews = process.env.TXNEWS_COOKIE.split('&'); + } else { + CookieTxnews = process.env.TXNEWS_COOKIE.split() + }; + if (process.env.TXNEWS_SIGN && process.env.TXNEWS_SIGN.indexOf('#') > -1) { + SignUrl = process.env.TXNEWS_SIGN.split('#'); + } else { + SignUrl = process.env.TXNEWS_SIGN.split() + }; + if (process.env.TXNEWS_VIDEO && process.env.TXNEWS_VIDEO.indexOf('#') > -1) { + VideoUrl = process.env.TXNEWS_VIDEO.split('#'); + } else { + VideoUrl = process.env.TXNEWS_VIDEO.split() + }; + Object.keys(CookieTxnews).forEach((item) => { + if (CookieTxnews[item]) { + cookiesArr.push(CookieTxnews[item]) + } + }) + Object.keys(SignUrl).forEach((item) => { + if (SignUrl[item]) { + SignArr.push(SignUrl[item]) + } + }) + Object.keys(VideoUrl).forEach((item) => { + if (VideoUrl[item]) { + VideoArr.push(VideoUrl[item]) + } + }) + } else { + cookiesArr.push($.getdata('sy_cookie_txnews')); + SignArr.push($.getdata( 'sy_signurl_txnews')); + VideoArr.push($.getdata( 'video_txnews')) + } let isGetCookie = typeof $request !== 'undefined' if (isGetCookie) { - GetCookie() -} else { - !(async () => { - - if(!signurlVal && !cookieVal){ - $.msg($.name, '【提示】🉐登录腾讯新闻app获取cookie',"qqnews://article_9500?tab=news_news&from=self", {"open-url": "qqnews://article_9500?tab=news_news&from=self"}) - await notify.sendNotify($.name, '【提示】请先获取腾讯新闻一Cookie',"qqnews://article_9500?tab=news_news&from=self", {"open-url": "qqnews://article_9500?tab=news_news&from=self"}); - return; + GetCookie(); + $.done() +} +!(async () => { + if(!cookiesArr[0]){ + $.msg($.name, '【提示】🉐登录腾讯新闻app获取cookie',"qqnews://article_9500?tab=news_news&from=self", {"open-url": "qqnews://article_9500?tab=news_news&from=self"}); + return + } + if ($.isNode()){ + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()}=============\n`) + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookieVal = cookiesArr[i]; + signurlVal = SignArr[i]; + videoVal = VideoArr[i]; + $.index = i + 1; + console.log(`-------------------------\n\n开始【腾讯新闻账号${$.index}】`) } - token = signurlVal.match(/devid=[a-zA-Z0-9_-]+/g)[0] - console.log("\n开始获取您的活动ID"); + ID = signurlVal.match(/devid=[a-zA-Z0-9_-]+/g)[0] + token = signurlVal.split("&mac")[1] await getsign(); await activity(); await toRead(); await lookVideo(); + await OrderID(); + if(order) { + await Pending(); + }; await StepsTotal(); - if(getreadred > 0){ + if(getreadred != 0){ redbody = `redpack_type=article&activity_id=${actid}` await Redpack() }; - if(getvideored>0){ + if(getvideored != 0){ redbody = `redpack_type=video&activity_id=${actid}` await Redpack() }; await getTotal(); await showmsg(); - if ($.isNode()){ - if (readnum%notifyInterval==0){ - await notify.sendNotify($.name,subTile+'\n'+detail); - } - else if (openreadred==readredtotal&&openvideored==videoredtotal){ - await notify.sendNotify($.name+` 今日任务已完成✅`,subTile+'\n'+ detail) - } + if ($.isNode()){ + if (readnum%notifyInterval==0&&cashtotal > 2){ + await notify.sendNotify($.name,subTile+'\n'+detail) } + } + } })() .catch((e) => $.logErr(e)) .finally(() => $.done()) -} + function GetCookie() { if ($request &&$request.body.indexOf("article_read")> -1) { @@ -148,14 +192,15 @@ function getsign() { function activity() { return new Promise((resolve, reject) => { setTimeout(()=>{ - $.get({url:`${TX_HOST}user/activity/get?isJailbreak=0&${token}`, headers: {Cookie:cookieVal}}, (error,response, data) =>{ - if (error) { - $.msg("获取活动Id失败‼️", "", error) - } else { - let obj = JSON.parse(data) - actid = obj.data.activity.id - console.log(` 您的活动ID为: `+actid+"\n") - } + $.get({url:`${TX_HOST}user/activity/get?isJailbreak=0&${ID}`, headers: {Cookie:cookieVal}}, (error,response, data) =>{ + try{ + let obj = JSON.parse(data) + actid = obj.data.activity.id + console.log(`\n您的活动ID为: `+actid+"\n") + } catch(error){ + $.msg("获取活动ID失败,详情请看日志","","") + console.log("活动ID日志:"+ data) + } resolve() }) },s) @@ -167,9 +212,16 @@ function toRead() { return new Promise((resolve, reject) => { setTimeout(()=>{ $.post({url: signurlVal, headers: {Cookie:cookieVal}, body: 'event=article_read'},(error, resp, data)=> { - $.log("正在浏览文章"+data) - }) - resolve() + try{ + let obj = JSON.parse(data) + if(obj.ret == 0){ + console.log("本次阅读领取" +obj.data.countdown_timer.countdown_tips+"\n") + } + } catch(error){ + console.log("本次阅读失败"+data+"\n") + } + resolve() + }) },s) }) } @@ -177,24 +229,68 @@ function lookVideo() { return new Promise((resolve, reject) => { setTimeout(()=>{ $.post({url: videoVal, headers: {Cookie:cookieVal},body: 'event=video_read'},(error, response, data) =>{ - if (error){ - $.msg($.name, '观看视频:'+ error) - }else{ - $.log("正在观看视频"+data) - tolookresult = JSON.parse(data) - } + try{ + let obj = JSON.parse(data) + if(obj.ret == 0){ + console.log("本次视频领取" +obj.data.countdown_timer.countdown_tips+"\n") + } + } catch(error){ + console.log("观看视频失败"+data+"\n") + } resolve() - }) + }) },s*2) }) } +function OrderID() { + return new Promise((resolve, reject) => { + $.post({url: `https://api.prize.qq.com/v1/newsapp/rp/common?isJailbreak=0&mac=${token}`, headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded"},body: 'actFrom=wxplugin&actEname=newsapp_cj'},(error, response, data) =>{ + //console.log(data) + if(response.statusCode !== 403){ + try { + let openres = JSON.parse(data) + if (openres.code == 0 ){ + meney = openres.data.money/100 + order = openres.data.orderID + console.log(` 看新闻,领红包,到账: `+meney+'元\n') + } + } catch(error){ + console.log("打开看新闻,领红包失败:"+ data) } + } + resolve() + }) + }) +} + +function Pending() { + console.log(order) + return new Promise((resolve, reject) => { + $.post({url: `https://api.prize.qq.com/v1/newsapp/rp/get_pending?isJailbreak=0&mac=${token}`, + headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded"}, + body: `orderID=${order}`},(error, response, data) =>{ + //console.log(data) + if (response.statusCode !== 403){ + try { + let res = JSON.parse(data) + if (res.code == 0 ){ + console.log( '看新闻,领红包领取成功\n') + } + } catch(error){ + console.log("看新闻,领红包失败:"+ data) + } + } + resolve() + }) + }) +} + //阅读文章统计 function StepsTotal() { return new Promise((resolve, reject) => { setTimeout(()=>{ const StepsUrl = { - url: `${TX_HOST}activity/info/get?activity_id=${actid}&${token}`, + url: `${TX_HOST}activity/info/get?activity_id=${actid}&${ID}`, headers: {Cookie: cookieVal} } $.get(StepsUrl, (error, response, data) => { @@ -232,26 +328,33 @@ function Redpack() { return new Promise((resolve, reject) => { setTimeout(()=>{ const cashUrl = { - url: `${TX_HOST}activity/redpack/get?isJailbreak=0&${token}`, - headers: {Cookie: cookieVal}, + url: `${TX_HOST}activity/redpack/get?isJailbreak=0&mac=${token}`, + headers: {Cookie:cookieVal,"Content-Type": "application/x-www-form-urlencoded","User-Agent": "QQNews/6.3.40 (iPhone; iOS 14.2; Scale/3.00)"}, body: redbody } + $.post(cashUrl, (error, response, data) => { let rcash = JSON.parse(data) + console.log(data) try{ + if(rcash.data.award.length == 1){ redpacks = rcash.data.award.num/100 - if (rcash.ret == 0&&readredpack!=0&&getreadred>0){ - redpackres = `【阅读红包】到账`+readredpack+`元 🌷\n` - $.log("阅读红包到账"+readredpack+"元\n") + if (rcash.ret == 0&&redpacks>0&&getreadred > 0){ + redpackres = `【阅读红包】到账`+redpacks+`元 🌷\n` + $.log("阅读红包到账"+redpacks+"元\n") } - else if (rcash.ret == 0&&videoredpack!=0&&getvideored>0){ - redpackres = `【视频红包】到账`+videoredpack+`元 🌷\n` - $.log("视频红包到账"+videoredpack+"元\n") + else if (rcash.ret == 0&& redpacks >0){ + redpackres = `【视频红包】到账`+redpacks+`元 🌷\n` + $.log("视频红包到账"+redpacks+"元\n") } + } else { + $.log(rcash.data.award.length+"个红包到账\n") + } } - catch(err){ - $.log("打开红包失败,响应数据: "+ data+"\n错误代码:"+err) }; - $.msg($.name, "开红包失败,详情请看日志 ❌", err) + catch(error){ + console.log("打开红包失败,响应数据: "+ data) + $.msg($.name, "开红包失败,详情请看日志 ❌", error) + }; resolve() }) },s) @@ -268,8 +371,9 @@ function getTotal() { if (error) { $.msg("获取收益信息失败‼️", "", error) } else { - const obj = JSON.parse(data) - subTile = '【收益总计】'+obj.data.wealth[0].title +'金币 '+"钱包: " +obj.data.wealth[1].title+'元' + const Total_Earn = JSON.parse(data) + cashtotal =Total_Earn.data.wealth[1].title + subTile = '【收益总计】'+ Total_Earn.data.wealth[0].title +'金币 '+"钱包: " + cashtotal+'元' // $.log("钱包收益共计"+obj.data.wealth[1].title+"元") } resolve() @@ -282,7 +386,7 @@ function showmsg() { if(readnum||videonum){ detail = signinfo + `【文章阅读】已读/再读: `+ readnum +`/`+readtitle+` 篇\n`+`【阅读红包】已开/总计: `+openreadred+`/`+readredtotal+` 个🧧\n`+ `【观看视频】已看/再看: `+ videonum +`/`+videotitle+` 分钟\n`+`【视频红包】已开/总计: `+openvideored+`/`+videoredtotal+` 个🧧\n【每日一句】`+Dictum } - console.log('-----------'+'\n'+$.name+'\n'+subTile+'\n'+ detail) + console.log($.name+'\n'+subTile+'\n'+ detail) if (readnum%notifyInterval==0){ $.msg($.name,subTile,detail,{ 'open-url': "https://news.qq.com/FERD/cjRedDown.htm", 'media-url': imgurl } ) } @@ -294,4 +398,4 @@ function showmsg() { } // prettier-ignore -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{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)} +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)} diff --git a/Task/txnews2.js b/Task/txnews2.js deleted file mode 100644 index b2bc627025..0000000000 --- a/Task/txnews2.js +++ /dev/null @@ -1,286 +0,0 @@ -/* -更新时间: 2020-09-10 13:30 - -腾讯新闻签到修改版,可以自动阅读文章获取红包,该活动为瓜分百万现金挑战赛,针对幸运用户参与 - -获取Cookie方法: -1.把以下配置复制到响应配置下 -2.打开腾讯新闻app,阅读几篇文章,倒计时结束后即可获取阅读Cookie; -3.看一次推荐视频获取视频地址 -4.可能腾讯有某些限制,有些号码无法领取红包,手动阅读几篇,能领取红包,一般情况下都是正常的, -5.此脚本根据阅读篇数开启通知,默认阅读50篇通知一次,此版本不支持Boxjs ‼️ -版本更新日志: -1.01 修复无法自动获取视频红包,修改通知为阅读篇数间隔,即阅读篇数除以间隔余0时通知,或者自定义常开或常关, -1.02 增加通知跳转链接https://news.qq.com/FERD/cjRedDown.htm,需手动领取此红包 ---------------------- -Surge 4.0 -[Script] -腾讯新闻 = type=cron,cronexp=0 8 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js,script-update-interval=0 - -腾讯新闻 = type=http-request,pattern=https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js, requires-body=true - -~~~~~~~~~~~~~~~~~~~~~ -Loon 2.1.0+ -[Script] -# 本地脚本 -cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js, enabled=true, tag=腾讯新闻 - -http-request https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js, requires-body=true - ------------------ - -QX 1.0.7+ : - [task_local] -0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js, tag=腾讯新闻 - [rewrite_local] -https:\/\/api\.inews\.qq\.com\/event\/v1\/user\/event\/report\? url script-request-body https://raw.githubusercontent.com/Sunert/Scripts/master/Task/txnews2.js - -~~~~~~~~~~~~~~~~~~ - [MITM] -hostname = api.inews.qq.com - ---------------------------- - -Cookie获取后,请注释掉Cookie地址。 - -*/ -const cookieName = '腾讯新闻'; -let s = 500 // 间隔延迟时间 -const $ = new Env(cookieName); -let notifyInterval =$.getdata('notifynum')||50; //阅读篇数间隔通知开为1,常关为0; - -const signurlVal = $.getdata('sy_signurl_txnews2') -const cookieVal = $.getdata( 'sy_cookie_txnews2') -const videoVal = $.getdata( 'video_txnews2') - -let isGetCookie = typeof $request !== 'undefined' -if (isGetCookie) { - GetCookie() -} else { - -!(async () => { -{ -if(signurlVal){ - ID = signurlVal.match(/devid=[a-zA-Z0-9_-]+/g) -} -$.log("\n开始获取您的活动ID") - await getsign(); - await activity(); - await toRead(); - await lookVideo(); - await StepsTotal(); -if(getreadred > 0){ - redbody = `redpack_type=article&activity_id=${actid}` - await Redpack() -}; -if(getvideored>0){ -redbody = `redpack_type=video&activity_id=${actid}` - await Redpack() -}; - await getTotal(); - await showmsg() - } -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) -} - -function GetCookie() { -if ($request &&$request.body.indexOf("article_read")> -1) { - const signurlVal = $request.url - const cookieVal = $request.headers['Cookie']; - $.log(`signurlVal:${signurlVal}`) - $.log(`cookieVal:${cookieVal}`) - if (signurlVal) $.setdata(signurlVal, 'sy_signurl_txnews2') - if (cookieVal) $.setdata(cookieVal, 'sy_cookie_txnews2') - $.msg(cookieName, `获取Cookie: 成功🎉`, ``) - } -if ($request &&$request.body.indexOf("video_read")> -1) { - const videoVal = $request.url - $.log(`videoVal:${videoVal}`) - if (videoVal) $.setdata(videoVal, 'video_txnews2') - $.msg(cookieName, `获取视频地址: 成功🎉`, ``) - } - } - - -//签到 -function getsign() { - return new Promise((resolve, reject) => { - const llUrl = { - url: `https://api.inews.qq.com/task/v1/user/signin/add?`,headers:{Cookie: cookieVal} - }; - $.post(llUrl, (error, response, data) => { - const obj = JSON.parse(data) - if (obj.info=="success"){ - next = obj.data.next_points - tip = obj.data.tip_soup||obj.data.share_tip - imgurl= obj.data.share_img - Dictum = tip.replace(/[\<|\.|\>|br]/g,"")+""+obj.data.author.replace(/[\<|\.|\>|br|图|腾讯网友]/g,"") - signinfo = '【签到信息】连续签到' + obj.data.signin_days+'天 '+'明日+'+ next +'金币 成功🎉\n'} - else { - $.msg('签到失败,🉐登录腾讯新闻app获取cookie', "", "") - console.log('签到失败,🉐登录腾讯新闻app获取cookie'+data) - return - } - resolve() - }) - }) -} - -function activity() { - return new Promise((resolve, reject) => { - setTimeout(()=>{ - const actUrl = { - url: `https://api.inews.qq.com/activity/v1/user/activity/get?isJailbreak=0&${ID}`, - headers: {Cookie: cookieVal}}; - $.get(actUrl, function(error,response, data) { - if (error) { - $.msg("获取活动Id失败‼️", "", error) - } else { - const obj = JSON.parse(data) - actid = obj.data.activity.id - console.log(` 您的活动ID为: `+actid+"\n") - } - resolve() - }) - },s) - }) - } - -//阅读阶梯 -function toRead() { - return new Promise((resolve, reject) => { - setTimeout(()=>{ - $.post({url: signurlVal, headers: {Cookie:cookieVal},body: 'event=article_read'},(error, resp, data)=> { - $.log("正在阅读文章\n") - }) - resolve() - },s) - }) -} -function lookVideo() { - return new Promise((resolve, reject) => { - setTimeout(()=>{ - $.post({url: videoVal, headers: {Cookie:cookieVal},body: 'event=video_read'},(error, response, data) =>{ - if (error){ - $.msg(cookieName, '观看视频:'+ error) - }else{ - $.log("正在浏览视频\n") - tolookresult = JSON.parse(data) - } - resolve() - }) - },s*2) - }) -} - -//阅读文章统计 -function StepsTotal() { -return new Promise((resolve, reject) => { - setTimeout(()=>{ - const StepsUrl = { - url: `https://api.inews.qq.com/activity/v1/activity/info/get?activity_id=${actid}&${ID}`, - headers: {Cookie: cookieVal} - } - $.get(StepsUrl, (error, response, data) => { - totalred = JSON.parse(data) - $.log("正在统计阅读数据:") - totalcion = totalred.data.extends.today_total_coin - if (totalred.ret == 0){ - for (i=0;i { - setTimeout(()=>{ - const cashUrl = { - url: `https://api.inews.qq.com/activity/v1/activity/redpack/get?isJailbreak=0&${ID}`, - headers: {Cookie: cookieVal}, - body: redbody - } - $.post(cashUrl, (error, response, data) => { - let rcash = JSON.parse(data) - try{ - redpacks = rcash.data.award.num/100 - if (rcash.ret == 0&&readredpack!=0&&getreadred>0){ - redpackres = `【阅读红包】到账`+readredpack+`元 🌷\n` - $.log("阅读红包到账"+readredpack+"元\n") - } - else if (rcash.ret == 0&&videoredpack!=0&&getvideored>0){ - redpackres = `【视频红包】到账`+videoredpack+`元 🌷\n` - $.log("视频红包到账"+videoredpack+"元\n") - } - } - catch(err){ - $.log("打开红包失败,响应数据: "+ data+"\n错误代码:"+err) - } - - resolve() - }) - },s) - }) -} - - -//收益总计 -function getTotal() { -return new Promise((resolve, reject) => { - const totalUrl = { - url: `https://api.inews.qq.com/activity/v1/usercenter/activity/list?isJailbreak`, - headers: {Cookie: cookieVal}}; - $.post(totalUrl, function(error,response, data) { - if (error) { - $.msg("获取收益信息失败‼️", "", error) - } else { - const obj = JSON.parse(data) - subTile = '【收益总计】'+obj.data.wealth[0].title +'金币 '+"钱包: " +obj.data.wealth[1].title+'元' - $.log("钱包收益共计"+obj.data.wealth[1].title+"元") - } - resolve() - }) - }) - } - -function showmsg() { - return new Promise((resolve, reject) => { - if(readnum||videonum){ - detail = signinfo + `【文章阅读】已读/再读: `+ readnum +`/`+readtitle+` 篇\n`+`【阅读红包】已开/总计: `+openreadred+`/`+readredtotal+` 个🧧\n`+ `【观看视频】已看/再看: `+ videonum +`/`+videotitle+` 分钟\n`+`【视频红包】已开/总计: `+openvideored+`/`+videoredtotal+` 个🧧\n【每日一句】`+Dictum - } - if -(readnum%notifyInterval==0){ - $.msg(cookieName,subTile,detail,{ 'open-url': "https://news.qq.com/FERD/cjRedDown.htm", 'media-url': imgurl } ) - } - else if (openreadred==readredtotal&&openvideored==videoredtotal){ - $.msg(cookieName+` 今日任务已完成✅`,subTile,detail,{ 'open-url': "https://news.qq.com/FERD/cjRedDown.htm", 'media-url': imgurl } ) - } - resolve() - }) -} - -// prettier-ignore -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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} diff --git a/Task/weibo.js b/Task/weibo.js index 74ca718add..6004d19ef8 100644 --- a/Task/weibo.js +++ b/Task/weibo.js @@ -1,7 +1,7 @@ /* -更新时间: 2020-09-07 21:25 +更新时间: 2020-10-13 21:25 -本脚本仅适用于微博每日签到 +本脚本仅适用于微博每日签到,支持Actions多账号运行 获取Cookie方法: 1.将下方[rewrite_local]和[MITM]地址复制的相应的区域下 2.打开微博App,刷微博视频,获取Cookie,获取后请注释或禁用Cookie @@ -16,7 +16,7 @@ Surge 4.0 : weibo.js = type=cron,cronexp=35 5 0 * * *,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js,script-update-interval=0 # 获取微博 Cookie. -weibo.js = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/video\/machine\?gsid,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +weibo.js = type=http-request,pattern=https:\/\/api\.weibo\.cn\/\d\/page\/\w+\?gsid,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js # 微博钱包签到Cookie weibo.js = type=http-request,pattern=https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\?,script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js @@ -26,7 +26,7 @@ Loon 2.1.0+ # 本地脚本 cron "04 00 * * *" script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js, enabled=true, tag=新浪微博 -http-request https:\/\/api\.weibo\.cn\/\d\/video\/machine\?gsid script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +http-request https:\/\/api\.weibo\.cn\/\d\/page\/\w+\?gsid script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js http-request https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? script-path=https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js @@ -37,7 +37,7 @@ QX 1.0.6+ : 0 9 * * * https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js [rewrite_local] -https:\/\/api\.weibo\.cn\/\d\/video\/machine\?gsid url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js +https:\/\/api\.weibo\.cn\/\d\/page\/\w+\?gsid url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js # 钱包签到Cookie https:\/\/pay\.sc\.weibo\.com\/aj\/mobile\/home\/welfare\/signin\/do\? url script-request-header https://raw.githubusercontent.com/Sunert/Scripts/master/Task/weibo.js @@ -49,43 +49,85 @@ hostname = api.weibo.cn, pay.sc.weibo.com */ const $ = new Env('新浪微博') -const token = $.getdata('sy_token_wb') -const payheaderVal = $.getdata('sy_payheader_wb') +const notify = $.isNode() ? require('./sendNotify') : ''; +let tokenArr = [],payArr = [],paybag; if (isGetCookie = typeof $request !==`undefined`) { - GetCookie() -} else { - !(async() => { - await getsign(); - await doCard(); - if (payheaderVal !== undefined||null){ - await paysign() - }; - //await getst(); - //await userinfo(); - await showmsg() + GetCookie(); + $.done() +} +if ($.isNode()) { + if (process.env.WB_TOKEN && process.env.WB_TOKEN.indexOf('#') > -1) { + wbtoken = process.env.WB_TOKEN.split('#'); + console.log(`您选择的是用"#"隔开\n`) + } + else if (process.env.WB_TOKEN && process.env.WB_TOKEN.indexOf('\n') > -1) { + wbtoken = process.env.WB_TOKEN.split('\n'); + console.log(`您选择的是用换行隔开\n`) + } else { + wbtoken = process.env.WB_TOKEN.split() + }; + if (process.env.WB_PAY && process.env.WB_PAY.indexOf('#') > -1) { + wbPay = process.env.WB_PAY.split('#'); + } + else if (process.env.WB_PAY && process.env.WB_PAY.split('\n').length > 0) { + wbPay = process.env.WB_PAY.split('\n'); + } else { + wbPay = process.env.WB_PAY.split() + }; + Object.keys(wbtoken).forEach((item) => { + if (wbtoken[item]) { + tokenArr.push(wbtoken[item]) + } + }); + Object.keys(wbPay).forEach((item) => { + if (wbPay[item]) { + payArr.push(wbPay[item]) + } + }); + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + } else { + tokenArr.push($.getdata('sy_token_wb')) + payArr.push($.getdata('sy_payheader_wb')) +} + +!(async () => { + if (!tokenArr[0]) { + $.msg($.name, '【提示】请先获取新浪微博一cookie') + return; + } + console.log(`------------- 共${tokenArr.length}个账号\n`) + for (let i = 0; i < tokenArr.length; i++) { + if (tokenArr[i]) { + token = tokenArr[i]; + payheaderVal = payArr[i]; + $.index = i + 1; + console.log(`\n开始【微博签到${$.index}】`) + await getsign(); + await doCard(); + if (payheaderVal !== undefined){ + await paysign() + } else { + paybag = `【钱包签到】❌ 未获取Cooiekie` + }; + await showmsg() + } + } })() .catch((e) => $.logErr(e)) .finally(() => $.done()) -} + function GetCookie() { -if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/video\/machine/)) { +if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/\d\/[a-z]+\/\w+\?gsid/)) { const signurlVal = $request.url const token = signurlVal.split(`?`)[1] - const signheaderVal = JSON.stringify($request.headers) + //const signheaderVal = JSON.stringify($request.headers) $.log(`token:${token}`) - //if (signheaderVal) $.setdata(signheaderVal, 'sy_signheader_wb') if (token) $.setdata(token, 'sy_token_wb') $.msg($.name, `获取微博签到Cookie: 成功`, ``) -} else if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/ug\/v2\/signin/)) { - const infourl = $request.url - const infoheaderVal = JSON.stringify($request.headers) - //if (infourl) $.setdata(infourl, 'infourl_wb') - //if (infoheaderVal) $.setdata(infoheaderVal, 'infoheader_wb') -// $.msg($.name, `获取微博信息Cookie: 成功`, ``) -} -else if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/home\/welfare\/signin\/do\?_=[1-9]+/)) { +} else if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/home\/welfare\/signin\/do\?_=[1-9]+/)) { const payheaderVal = JSON.stringify($request.headers) if (payheaderVal) $.setdata(payheaderVal, 'sy_payheader_wb') $.msg($.name, `获取微博钱包Cookie: 成功`, ``)} @@ -97,7 +139,7 @@ function getsign() { let signurl = { url: `https://api.weibo.cn/2/checkin/add?${token}`, headers: {"User-Agent": `Weibo/46902 (iPhone; iOS 14; Scale/3.00)`}} - $.post(signurl, (error, response, data) => { + $.post(signurl, async(error, response, data) => { let result = JSON.parse(data) if (result.status == 10000){ wbsign = `【微博签到】✅ 连续签到${result.data.continuous}天,收益: ${result.data.desc}💰\n` @@ -111,6 +153,9 @@ function getsign() { else { wbsign = `【每日签到】 ❌ 签到失败`+result.errmsg $.msg($.name, wbsign, ``) + if ($.isNode()) { + await notify.sendNotify($.name, wbsign) + } return } resolve() @@ -141,61 +186,31 @@ function doCard() { // 钱包签到 function paysign() { return new Promise((resolve, reject) =>{ - let payurl = { - url: `https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do?_=${$.startTime+50}`, - headers: JSON.parse($.getdata('sy_payheader_wb'))} -$.post(payurl, (error, response, data) => { - try{ + $.post({url: `https://pay.sc.weibo.com/aj/mobile/home/welfare/signin/do?_=${$.startTime+10}`,headers: JSON.parse(payheaderVal) + }, (error, response, data) => { let result = JSON.parse(data) if (result.status == 1){ paybag = `【微博钱包】 ✅ +`+ result.score+' 分\n' } - else if (result.code == 100000){ + else if (result.status == '2'){ paybag = `【微博钱包】 🔁\n` } - } - catch(e){ - paybag = `【钱包签到】❌ 签到失败`+ e+ '\n' - } - resolve() - }) - }) -} - -function getst() { - return new Promise((resolve, reject) =>{ - let sturl = { - url: `https://m.weibo.cn/c/checkin?ua=iPhone10%2C2__weibo__10.8.3__iphone__os14&from=10A8393010`, - headers: JSON.parse($.getdata('infoheader_wb'))} - sturl.headers['Accept']='json' -$.post(sturl, (error, response, data) => { - st = data.split(":")[7].replace("login","").replace(/[\'\,\s]+/g,"") - resolve() + else { + paybag = `【钱包签到】❌ Cookie失效`+'\n' + } + resolve() }) }) } - -function userinfo() { - return new Promise((resolve, reject) =>{ - let infourl = { - url: `https://m.weibo.cn/c/checkin/ug/v2/signin/signin?st=${st}`, - headers: JSON.parse($.getdata('infoheader_wb')) -} - //console.log(infourl) -$.post(infourl, (error, response, data) => { - $.log(data) - resolve() - }) - }) +async function showmsg() { + if (paybag) { + $.msg($.name, nickname, wbsign+paybag+docard); + if ($.isNode()) { + await notify.sendNotify($.name, nickname+'\n'+ wbsign+paybag+docard) + } + } } + -function showmsg() { - if (payheaderVal == undefined||null){ - paybag = `【钱包签到】❌ 未获取Cooiekie` - } - $.sub = nickname - $.desc = wbsign+paybag+docard - $.msg($.name, $.sub, $.desc) -} -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{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||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};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)} +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)} diff --git a/Task/youth.js b/Task/youth.js index a9f933f085..3ca4e0f38c 100644 --- a/Task/youth.js +++ b/Task/youth.js @@ -1,25 +1,20 @@ /* -更新时间: 2020-09-19 22:15 - +更新时间: 2020-12-12 23:00 赞赏:中青邀请码`46308484`,农妇山泉 -> 有点咸,万分感谢 - 本脚本仅适用于中青看点极速版领取青豆 -增加每日打卡,打卡时间每日5:00-8:00❗️,请不要忘记设置运行时间,共3条Cookie,请全部获取,获取请注释掉 - 获取Cookie方法: 1.将下方[rewrite_local]和[MITM]地址复制的相应的区域 -下, -2.进入app,进入任务中心或者签到一次,即可获取Cookie. 阅读一篇文章,获取阅读请求body,并获取阅读时长,在阅读文章最下面有个惊喜红包,点击获取惊喜红包请求 -3.可随时获取Cookie. -4.增加转盘抽奖通知间隔,为了照顾新用户,前三次会有通知,以后默认每10次转盘抽奖通知一次,可自行修改❗️ 转盘完成后通知会一直开启 -5.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 -6.更新日志: - 31/05 v1.01 取消激励视频Cookie,添加阅读时长 - -阅读奖励和看视频得奖励一个请求只能运行三次‼️,请不要询问为什么,次日可以继续 - -by Macsuny +下,运行时间自行配置 +2. 获取Cookie方法,可随时更新 + ① 进入app,进入任务中心或者签到一次,即可获取Cookie. + ② 阅读一篇文章,获取阅读请求body, + ③ 同时获取阅读时长, + ④ 在阅读文章最下面有个惊喜红包,点击获取惊喜红包请求 +3.增加转盘抽奖通知间隔,为了照顾新用户,前三次会有通知,以后默认每50次转盘抽奖通知一次,可自行修改❗️ 转盘完成后通知会一直开启 +4.非专业人士制作,欢迎各位大佬提出宝贵意见和指导 +5.增加每日打卡,打卡时间每日5:00-8:00❗️,请不要忘记设置运行时间,共4条Cookie,请全部获取,获取请注释 +6. 支持Github Actions多账号运行,填写'YOUTH_HEADER'值多账号时用'#'号隔开,其余值均用'&'分割 ‼️,当转盘次数为50或者100并且余额大于10元时推送通知 ~~~~~~~~~~~~~~~~ Surge 4.0 : @@ -66,67 +61,156 @@ hostname = *.youth.cn, ios.baertt.com */ -let s = 0 //各数据接口延迟 +let s = 200 //各数据接口延迟 const $ = new Env("中青看点") let notifyInterval = $.getdata("notifytimes")||50 //通知间隔,默认抽奖每50次通知一次,如需关闭全部通知请设为0 const YOUTH_HOST = "https://kd.youth.cn/WebApi/"; const notify = $.isNode() ? require('./sendNotify') : ''; -let logs = $.getdata('zqlogs')||false, signresult; -let signheaderVal = $.getdata('youthheader_zq'); -let timebodyVal = $.getdata('readtime_zq'); -let articlebodyVal = $.getdata('read_zq'); -let redpbodyVal = $.getdata('red_zq'); +let logs = $.getdata('zqlogs')||false, rotaryscore=0,doublerotary=0,signresult; +let cookiesArr = [], signheaderVal = '', + readArr = [], articlebodyVal ='', + timeArr = [], timebodyVal = '', + redpArr = [], redpbodyVal = '', + detail = ``, subTitle = ``; +let CookieYouth = [], ARTBODYs = [], + REDBODYs = [], READTIME = []; +if ($.isNode()) { + if (process.env.YOUTH_HEADER && process.env.YOUTH_HEADER.indexOf('#') > -1) { + CookieYouth = process.env.YOUTH_HEADER.split('#'); + } else { + CookieYouth = process.env.YOUTH_HEADER.split() + }; + + if (process.env.YOUTH_ARTBODY && process.env.YOUTH_ARTBODY.indexOf('&') > -1) { + ARTBODYs = process.env.YOUTH_ARTBODY.split('&'); + } else { + ARTBODYs = process.env.YOUTH_ARTBODY.split() + }; + + if (process.env.YOUTH_REDBODY && process.env.YOUTH_REDBODY.indexOf('&') > -1) { + REDBODYs = process.env.YOUTH_REDBODY.split('&'); + } else { + REDBODYs = process.env.YOUTH_REDBODY.split() + }; + + if (process.env.YOUTH_TIME && process.env.YOUTH_TIME.indexOf('&') > -1) { + READTIME = process.env.YOUTH_TIME.split('&'); + }else { + READTIME = process.env.YOUTH_TIME.split() + }; +} + +if ($.isNode()) { + Object.keys(CookieYouth).forEach((item) => { + if (CookieYouth[item]) { + cookiesArr.push(CookieYouth[item]) + } + }) + Object.keys(ARTBODYs).forEach((item) => { + if (ARTBODYs[item]) { + readArr.push(ARTBODYs[item]) + } + }) + Object.keys(REDBODYs).forEach((item) => { + if (REDBODYs[item]) { + redpArr.push(REDBODYs[item]) + } + }) + Object.keys(READTIME).forEach((item) => { + if (READTIME[item]) { + timeArr.push(READTIME[item]) + } + }) + console.log(`============ 共${cookiesArr.length}个中青账号 =============\n`) + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + } else { + cookiesArr.push($.getdata('youthheader_zq')); + redpArr.push($.getdata('red_zq')); + readArr.push($.getdata('read_zq')); + timeArr.push($.getdata('readtime_zq')); +} const firstcheck = $.getdata('signt'); const runtimes = $.getdata('times'); const opboxtime = $.getdata('opbox'); -if ($.isNode()) { - signheaderVal = process.env.YOUTH_HEADER; - articlebodyVal = process.env.YOUTH_ACTBODY; - redpbodyVal = process.env.YOUTH_REDBODY; - timebodyVal = process.env.YOUTH_TIME -} - if (isGetCookie = typeof $request !== 'undefined') { - GetCookie() -} else { + GetCookie(); + $.done() +} + !(async () => { -if (!signheaderVal) { - return $.msg($.name, `请先获取Cookie`, ``) + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取中青看点一cookie') + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + signheaderVal = cookiesArr[i]; + articlebodyVal = readArr[i]; + timebodyVal = timeArr[i]; + redpbodyVal = redpArr[i]; + $.index = i + 1; + console.log(`-------------------------\n\n开始【中青看点${$.index}】`) } await sign(); await signInfo(); - console.log("\n开始每日任务 ⛳️"); - await Invitant(); + await friendsign(); if($.time('HH')>12){ await punchCard() }; -if($.time('HH')<9&&$.time('HH')>4){ +if ($.isNode()&& $.time('HH')>20&&$.time('HH')<22){ await endCard(); - if(punchcardend.code==1){ - await Cardshare() - } -}; + } +else if ($.time('HH')>4&&$.time('HH')<8){ + await endCard(); + } + await SevCont(); + await comApp(); + await ArticleShare(); await openbox(); -if (boxres.code == 1){ - await boxshare(); - } await getAdVideo(); await gameVideo(); -if(runtimes<8){ await readArticle(); -} await Articlered(); await readTime(); +for ( k=0;k<5;k++){ + console.log("等待5s进行下一次任务") + await $.wait(5000); await rotary(); +if (rotaryres.status == 0) { + rotarynum = ` 转盘${rotaryres.msg}🎉`; + break + } else if(rotaryres.status == 1){ + rotaryscore += rotaryres.data.score + rotarytimes = rotaryres.data.remainTurn + } + if (rotaryres.status == 1 && rotaryres.data.doubleNum !== 0) { + await TurnDouble(); + if (Doubleres.status == 1) { + doublerotary += Doubleres.data.score + } + } +} +if (rotaryres.status == 1) { + detail += `【转盘抽奖】+${rotaryscore}个青豆 剩余${rotaryres.data.remainTurn}次\n` +} +if (rotaryres.status !== 0&&rotaryres.data.doubleNum !== 0){ + detail += `【转盘双倍】+${doublerotary}青豆 剩余${rotaryres.data.doubleNum}次\n` +} await rotaryCheck(); await earningsInfo(); - await showmsg() + await showmsg(); + if ($.isNode()&&rotaryres.code !== '10010') + if( rotarytimes && rotarytimes%90 == 0 && cash >= 10){ + await notify.sendNotify($.name + " " + nick, "您的余额约为"+cash+"元,已可以提现"+'\n'+`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n${detail}`) + } + } })() .catch((e) => $.logErr(e)) .finally(() => $.done()) -} + function GetCookie() { if ($request && $request.method != `OPTIONS`&& $request.url.match(/\/TaskCenter\/(sign|getSign)/)) { @@ -169,7 +253,8 @@ function sign() { $.msg($.name, signresult, ""); return; } else if (signres.status == 1) { - detail = `【签到结果】成功 🎉 金币: +${signres.score},明日金币: +${signres.nextScore}\n` + signresult = `【签到结果】成功 🎉 明日+${signres.nextScore} ` + //detail = `【签到结果】成功 🎉 青豆: +${signres.score},明日青豆: +${signres.nextScore}\n` $.setdata(1,'times') if(firstcheck==undefined||firstcheck!=date){ $.setdata(date,'signt'); @@ -178,9 +263,8 @@ function sign() { signresult = `【签到结果】重复`; detail = ""; if(runtimes!==undefined){ - $.setdata(`${Number(runtimes)+1}`,'times') + $.setdata(`${parseInt(runtimes)+1}`,'times') } - } resolve() }) @@ -194,16 +278,13 @@ function signInfo() { headers: JSON.parse(signheaderVal), } $.post(infourl, (error, response, data) => { - signinfo = JSON.parse(data); - //console.log(signinfo) if (signinfo.status == 1) { cash = signinfo.data.user.money subTitle = `【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元`; nick = `账号: ${signinfo.data.user.nickname}`; - detail = `${signresult}(+${signinfo.data.sign_score}青豆) 已连签: ${signinfo.data.sign_day}天`; - $.log(subTitle+'\n'+detail) - detail +='\n<本次收益>:\n' + detail = `${signresult}(今天+${signinfo.data.sign_score}青豆) 已连签${signinfo.data.sign_day}天`; + detail +='\n<本次收益>:\n' } else { subTitle = `${signinfo.msg}`; detail = ``; @@ -221,7 +302,6 @@ function punchCard() { headers: JSON.parse(signheaderVal), } $.post(url, (error, response, data) => { - //$.log(`每日开启打卡`); punchcardstart = JSON.parse(data); if (punchcardstart.code == 1) { detail += `【打卡报名】打卡报名${punchcardstart.msg} ✅ \n`; @@ -244,11 +324,12 @@ function endCard() { const url = { url: `${YOUTH_HOST}PunchCard/doCard?`,headers: JSON.parse(signheaderVal), } - $.post(url, (error, response, data) => { + $.post(url,async(error, response, data) => { punchcardend = JSON.parse(data) if (punchcardend.code == 1) { detail += `【早起打卡】${punchcardend.data.card_time}${punchcardend.msg}✅\n` $.log("早起打卡成功,打卡时间:"+`${punchcardend.data.card_time}`) + await Cardshare(); } else if (punchcardend.code == 0) { // TODO .不在打卡时间范围内 //detail += `【早起打卡】${punchcardend.msg}\n` @@ -259,8 +340,6 @@ function endCard() { },s) }) } - - //打卡分享 function Cardshare() { return new Promise((resolve, reject) => { @@ -281,7 +360,6 @@ function Cardshare() { shareres = JSON.parse(data) if (shareres.code == 1) { detail += `+${shareres.data.score}青豆\n` - $.log(`【打卡分享】成功,获得`+shareres.data.score+"个青豆") } else { //detail += `【打卡分享】${shareres.msg}\n` //$.log(`${shareres.msg}`) @@ -294,6 +372,43 @@ function Cardshare() { }) } +function SevCont() { + return new Promise((resolve, reject) => { + setTimeout(() => { + $.post({url: `${YOUTH_HOST}PunchCard/luckdraw?`, + headers: JSON.parse(signheaderVal), + }, async(error, response, data) => { + sevres = JSON.parse(data) + if (sevres.code == 1) { + + detail += `【七日签到】+${sevres.data.score}青豆 \n` + + }else if (sevres.code == 0){ + //detail += `【七日签到】${sevres.msg}\n` + // $.log(`${boxres.msg}`) + } + resolve() + }) + },s) + }) +} + +function ArticleShare() { + return new Promise((resolve, reject) => { + setTimeout(() => { + const url = { + url: `https://focu.youth.cn/article/s?signature=0Z3Jgv96wqmVPeM7obRdNpHXgAmRhxNPJ6y4jpGDnANbo8KXQr&uid=46308484&phone_code=26170a068d9b9563e7028f197c8a4a2b&scid=33007686&time=1602937887&app_version=1.7.8&sign=d21dd80d0c6563f6f810dd76d7e0aef2`, + headers: JSON.parse(signheaderVal), + } + $.post(url, async(error, response, data) => { + //boxres = JSON.parse(data) + resolve() + }) + },s) + }) +} + + //开启时段宝箱 function openbox() { return new Promise((resolve, reject) => { @@ -302,13 +417,13 @@ function openbox() { url: `${YOUTH_HOST}invite/openHourRed`, headers: JSON.parse(signheaderVal), } - $.post(url, (error, response, data) => { + $.post(url, async(error, response, data) => { boxres = JSON.parse(data) if (boxres.code == 1) { boxretime = boxres.data.time $.setdata(boxretime, 'opbox') detail += `【开启宝箱】+${boxres.data.score}青豆 下次奖励${boxres.data.time / 60}分钟\n` - $.log(`开启时段宝箱成功,获得`+boxres.data.score+`个青豆,${boxretime / 60}`+"后开启下一个宝箱") + await boxshare(); }else{ //detail += `【开启宝箱】${boxres.msg}\n` // $.log(`${boxres.msg}`) @@ -332,7 +447,6 @@ function boxshare() { shareres = JSON.parse(data) if (shareres.code == 1) { detail += `【宝箱分享】+${shareres.data.score}青豆\n` - $.log(`分享宝箱任务成功,获得${shareres.data.score}青豆`) }else{ //detail += `【宝箱分享】${shareres.msg}\n` //$.log(`${shareres.msg}`) @@ -343,36 +457,46 @@ function boxshare() { }) } -function Invitant() { - return new Promise((resolve, reject) => { - const url = { - url: `${YOUTH_HOST}User/fillCode`, - headers: JSON.parse(signheaderVal), - body: `{"code": "46308484"}`, -} - $.post(url, (error, response, data) => - { - // $.log(`Invitdata:${data}`) - }) - aticleshare() - resolve() - }) +function friendsign(uid) { + return new Promise((resolve, reject) => { + const url = { + url: `https://kd.youth.cn/WebApi/ShareSignNew/getFriendActiveList`, + headers: JSON.parse(signheaderVal) + } + $.get(url, async(error, response, data) => { + let addsign = JSON.parse(data) + if (addsign.error_code == "0"&& addsign.data.active_list.length>0) { + friendsitem = addsign.data.active_list + for(friends of friendsitem){ + if(friends.button==1){ + await friendSign(friends.uid) + } + } + } + resolve() + }) + }) } -function aticleshare() { + +function friendSign(uid) { return new Promise((resolve, reject) => { - //const rand = Math.random().toFixed(3).toString().substr(2).replace("0", "7"); - shareurl = { - url: `https://kandian.youth.cn/u/CMB8o`, - headers: { Cookie: JSON.parse(signheaderVal)['Cookie'] }, + const url = { + url: `https://kd.youth.cn/WebApi/ShareSignNew/sendScoreV2?friend_uid=${uid}`, + headers: JSON.parse(signheaderVal) } - $.get(shareurl, (error, response, data) => { - // $.log(`aticleshare:${data}`); - resolve(); + $.get(url, (error, response, data) => { + friendres = JSON.parse(data) + if (friendres.error_code == "0") { + //detail += `【好友红包】+${friendres.score}个青豆\n` + console.log(`好友签到,我得红包 +${friendres.score}个青豆`) + } + resolve() }) }) } + //看视频奖励 function getAdVideo() { return new Promise((resolve, reject) => { @@ -385,7 +509,6 @@ function getAdVideo() { adVideores = JSON.parse(data) if (adVideores.status == 1) { detail += `【观看视频】+${adVideores.score}个青豆\n` - $.log("获得"+adVideores.score+"个青豆") } resolve() }) @@ -402,7 +525,6 @@ function gameVideo() { gameres = JSON.parse(data) if (gameres.success == true) { detail += `【激励视频】${gameres.items.score}\n` - $.log("获得"+gameres.items.score) }else{ if(gameres.error_code == "10003"){ //detail += `【激励视频】${gameres.message}\n` @@ -412,24 +534,48 @@ function gameVideo() { }) }) } - +function comApp() { + return new Promise((resolve, reject) => { + const url = { + url: `https://ios.baertt.com/v5/mission/msgRed.json`, + headers: { + 'User-Agent': 'KDApp/1.8.0 (iPhone; iOS 14.2; Scale/3.00)' + }, + body: articlebodyVal, + } + $.post(url, (error, response, data) => { + redres = JSON.parse(data) + if (redres.success == true) { + detail += `【回访奖励】+${redres.items.score}个青豆\n` + }else{ + if(redres.error_code == "100009"){ + //detail += `【回访奖励】${redres.message}\n` + } + } + resolve() + }) + }) +} //阅读奖励 function readArticle() { return new Promise((resolve, reject) => { const url = { url: `https://ios.baertt.com/v5/article/complete.json`, + headers: { + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + }, body: articlebodyVal, } $.post(url, (error, response, data) => { - readres = JSON.parse(data); - if (readres.items.read_score !== undefined) { + readres = JSON.parse(data); + if (typeof readres.items.read_score === 'number') { detail += `【阅读奖励】+${readres.items.read_score}个青豆\n`; - $.log("本次阅读获得"+readres.items.read_score+"个青豆") } //else if (readres.items.max_notice == '\u770b\u592a\u4e45\u4e86\uff0c\u63621\u7bc7\u8bd5\u8bd5') { //detail += `【阅读奖励】看太久了,换1篇试试\n`; - // $.log(readres.items.max_notice)} + // $.log(readres.items.max_notice)} + resolve() }) }) @@ -439,13 +585,15 @@ function Articlered() { return new Promise((resolve, reject) => { const url = { url: `https://ios.baertt.com/v5/article/red_packet.json`, + headers: { + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + }, body: redpbodyVal, } $.post(url, (error, response, data) => { redres = JSON.parse(data) if (redres.success == true) { detail += `【惊喜红包】+${redres.items.score}个青豆\n` - $.log("惊喜红包获得"+redres.items.score+"个青豆") }else{ if(redres.error_code == "100001"){ //detail += `【惊喜红包】${redres.message}\n` @@ -455,6 +603,34 @@ function Articlered() { }) }) } + +function readTime() { + return new Promise((resolve, reject) => { + const url = { + url: `https://ios.baertt.com/v5/user/stay.json`, + headers: { + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' + }, + body: timebodyVal, + } + $.post(url, (error, response, data) => { + let timeres = JSON.parse(data) + if (timeres.error_code == 0) { + readtimes = timeres.time / 60 + detail += `【阅读时长】共计` + Math.floor(readtimes) + `分钟\n` + } else { + if (timeres.error_code == 200001) { + detail += `【阅读时长】❎ 未获取阅读时长Cookie\n` + }else{ + detail += `【阅读时长】❎ ${timeres.msg}\n` + $.log(`阅读时长统计失败,原因:${timeres.msg}`) + } + } + resolve() + }) + }) +} + //转盘任务 function rotary() { const rotarbody = signheaderVal.split("&")[15] + '&' + signheaderVal.split("&")[8] @@ -467,22 +643,13 @@ function rotary() { body: rotarbody } $.post(url,async (error, response, data) => { - - rotaryres = JSON.parse(data) - - if (rotaryres.status == 1) { - rotarytimes = rotaryres.data.remainTurn - detail += `【转盘抽奖】+${rotaryres.data.score}个青豆 剩余${rotaryres.data.remainTurn}次\n` - $.log("转盘抽奖获得"+rotaryres.data.score+"个青豆,转盘次数还有"+rotarytimes+"次") - if (rotaryres.data.doubleNum != 0) { - await TurnDouble(); - } - } - if (rotaryres.code == 10010) { - rotarynum = ` 转盘${rotaryres.msg}🎉` - $.log("转盘任务已全部完成") + try{ + rotaryres = JSON.parse(data) + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() } - resolve(); }) }, s); }) @@ -490,7 +657,7 @@ function rotary() { //转盘宝箱判断 function rotaryCheck() { - return new Promise(async resolve => { + return new Promise(async(resolve) => { if (rotaryres.code == 10010) { return resolve(); } @@ -501,7 +668,7 @@ function rotaryCheck() { } i++; } - resolve(); + resolve(); }) } @@ -516,14 +683,12 @@ function runRotary(index) { body: rotarbody } $.post(url, (error, response, data) => { - const rotaryresp = JSON.parse(data); + const rotaryresp = JSON.parse(data); if (rotaryresp.status == 1) { detail += `【转盘宝箱${index}】+${rotaryresp.data.score}个青豆\n`; - $.log("开启宝箱"+index+",获得"+rotaryresp.data.score+"个青豆") }else{ if(rotaryresp.code == "10010"){ detail += `【转盘宝箱${index}】+今日抽奖完成\n`; - $.log("转盘宝箱已全部开启") } } resolve(); @@ -536,56 +701,22 @@ function TurnDouble() { const rotarbody = signheaderVal.split("&")[15] + '&' + signheaderVal.split("&")[8] return new Promise((resolve, reject) => { setTimeout(() => { - const time = (new Date()).getTime() + let time = (new Date()).getTime() const url = { - url: `${YOUTH_HOST}RotaryTable/toTurnDouble?_=${time}`, - headers: JSON.parse(signheaderVal), - body: rotarbody - } - $.post(url, (error, response, data) => { - + url: `${YOUTH_HOST}RotaryTable/toTurnDouble?_=${time}`,headers: JSON.parse(signheaderVal),body: rotarbody} + $.post(url, (error, response, data) => { + try{ Doubleres = JSON.parse(data) - if (Doubleres.status == 1) { - detail += `【转盘双倍】+${Doubleres.data.score1}青豆 剩余${rotaryres.data.doubleNum}次\n` - $.log(`转盘双倍奖励成功,获得${Doubleres.data.score1}青豆`) - }else{ - //detail += `【转盘双倍】失败 ${Doubleres.msg}\n` - + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() } + resolve() }) - resolve() },s) }) } - -function readTime() { - return new Promise((resolve, reject) => { - const url = { - url: `https://ios.baertt.com/v5/user/stay.json`, - headers: { - 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' - }, - body: timebodyVal, - } - $.post(url, (error, response, data) => { - let timeres = JSON.parse(data) - if (timeres.error_code == 0) { - readtimes = timeres.time / 60 - detail += `【阅读时长】共计` + Math.floor(readtimes) + `分钟\n` - $.log(`共计阅读时长为`+Math.floor(readtimes)+"分钟") - } else { - if (timeres.error_code == 200001) { - detail += `【阅读时长】❎ 未获取阅读时长Cookie\n` - }else{ - detail += `【阅读时长】❎ ${timeres.msg}\n` - $.log(`阅读时长统计失败,原因:${timeres.msg}`) - } - } - resolve() - }) - }) -} - function earningsInfo() { return new Promise((resolve, reject) => { setTimeout(() => { @@ -607,21 +738,18 @@ function earningsInfo() { },s) }) } - async function showmsg() { - if ($.isNode()){ - if (cash >= 10&&rotaryres.code==10010) { - await notify.sendNotify($.name + " " + nick, "您的余额约为"+cash+"元,已可以提现"+'\n'+`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n${detail}`) - } - } - console.log('-----------'+'\n'+$.name+`\n【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n`+ detail) +async function showmsg() { if (rotaryres.status == 1 && rotarytimes >= 97) { $.msg($.name + " " + nick, subTitle, detail) //默认前三次为通知 }else if (rotaryres.status == 1 && rotarytimes % notifyInterval == 0) { - $.msg($.name + " " + nick, subTitle, detail) //转盘次数/间隔整除时通知; + $.msg($.name + " " + nick, subTitle, detail) //转盘次数/间隔整除时通知; }else if (rotaryres.code == 10010 && notifyInterval != 0) { rotarynum = ` 转盘${rotaryres.msg}🎉` - $.msg($.name+" "+nick+" "+rotarynum,subTitle,detail)//任务全部完成且通知间隔不为0时通知; + $.msg($.name+" "+nick+" "+rotarynum,subTitle,detail)//任务全部完成且通知间隔不为0时通知; } + else { + console.log(`【收益总计】${signinfo.data.user.score}青豆 现金约${cash}元\n`+ detail) + } } -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{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)} +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)} diff --git a/Task/youth_Read.js b/Task/youth_Read.js new file mode 100644 index 0000000000..462e1d0f87 --- /dev/null +++ b/Task/youth_Read.js @@ -0,0 +1,87 @@ +/* +更新时间: 2020-09-26 8:46 +Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 + +请自行抓包,阅读文章和看视频,倒计时转一圈显示青豆到账即可,多看几篇文章和视频,获得更多包数据,抓包地址为"https://ios.baertt.com/v5/article/complete.json",在Github Actions中的Secrets新建name为'YOUTH_READ'的一个值,拷贝抓包的请求体到下面Value的文本框中,添加的请求体越多,获得青豆次数越多,本脚本不包含任何推送通知 + +多个请求体时用'&'号或者换行隔开" ‼️ + +*/ + +//let s = 30000 //等待延迟30s +const $ = new Env("中青看点") +const notify = $.isNode() ? require('./sendNotify') : ''; +// 自用body +let remoteBody = "p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFGy2mL_St_aljuIMydSPQB1lNc3t_AS5lo3AeAnqJC3cmNHmIecjoCKwpGYvJaJ8dCSgqbfNc37xy2ABpP50jJCWV4dElW3hiLMiYh6Epivbht4zaJXmFG1tQr67KVMFk6-QFeTYWhsZFa3B1-7hkL3nnQSl1cgL82vsUB_HUsL-EZOnAZWd4NN-d4T8zOXCaiNGxbukUL3FFO-EkOyayyK7oKcujABBIQRKDtUK-cMSi28diC_NzYz9mjDHxnHz4Atlb-_p333FlVuf262KYouBUiR4ocYxjJ0XyYcCC1KeMYrbzh2okMhVHr8A3bXrjN1XjYdCGEPipW6S5QYltNydsMiJQVpmw768V_XhvvEt6sFcnHMznFcbm3QBi3zQAfx6CVDnCwV2_8V5fgwjSlc3hthA1ErnSGEiwNnGh0ABptseeEHumuFUeG9cF52bpngeMSSWJVOPk3tK-fxoJuLPzn26WxCo-omFJJ0SvehFlonQPnZyCOY7-wCMW2BUeqW5iy8MOJUuiicj3qCsWpoiKuH6H_lfrL0wsdoqj06nlTDm-W9KZY0cXoGNtfJjdg%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFMRXqLwpEmiks16WMmGpPEYeff69pFFE-Iyy0UMo25_1MJuBHFCgJMoJnMmfD95-e5HTP_NSMui_1Uu5QUEWjsX6vyxJ9hjx-YHUUUXJYauIWYSElYYJxRKluB6DfoPudy5pCGmHFSi8-sCIWbVMEndypSzHLFAXTbO_-k4NuLou9otV04pqgBBxLUfL17gEOb_znkkcu3qNI5NJ6IJAWiBaLUr7fWLmRZWfupYM2n9V7LjjNJ-lg66nyqabI1263HPQgDp4xVOQd7FQRWMFfD5Magq83HlPIL5ogZKMDk8GptkINHE4n_ZSQA2H9gzlDmxHKN0ltvO3ngU9NszKlnDgMPgDwBdgWZhb2PgFfBuFiPS9pZ3cxYJdx2lD1I7ai7kwYy8qZb4gvdmrG-xjNMLwUiyBV2Dkllj0MiZy4c2hYHZFG1X15DehHL_CzJTQMLfLp3nq3qH-PmSmnhsbwpc8Gj_BZS3AH_eyWW32YibgAuP2jB9EmRYcgHxtTc_Ceq9JuEhbCJcxiE6tCZxlWcoCzZJVDguOWcPzyVQ_8xo9p26lCT5Xq8ilxZwXmOr45A%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFEJx0CrvW5BXp52kZFoxkXgBLZQKTSQ-Hq4Br5aDN7CIXVcA5NWk31vVNpaif-CsBMHslt3OLT79CJGAV-C6ELIbmauTvqOIPe8fgUzuglgaYCUGiwWotVJZHPIji51bvgHLdpJYF48ukH8wB5QHgOn0eKbp8vlQXQqX43hrAdk-RZYMrU1jwCx472ligwXnyDeNJu2ADtEUKNtBYMfdPYvMfWMTYJCG46b5Sxe2vAIJwvt_4P7RtESGssT5-YNgM1l3P9RIyVXkU3WBFSrq8W5DziMZHUGNfc_nISa_yvotQYRewzLZguKfqfn2zE-E01-zOZ9WGc9RJO3eo_7QNJiqhXS047txk51d5PQPFQ4z3LOac_fY328fS9R7mfgKkw86rojANv0k6UgJ0FrvBky-UQfpHsudwapFKNW9XspS167ZNBsVKdxTJpJV7sQpr4xUD-52v3w31jHRGwMawgjfgpnmbwbM8hLh6IKaTD2axeS05drTd0TJxLpS-t17uEdP1diIfts9O2zboya_45WbxFS2j6vSJuoEQflfOI-zMHepcpI2mf6NGP9E61aWOA%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFCcbUtSjUDmsFzlio1PzkVsc6bRNKy_4PsZILi1KRBHbVnMQfimKPp4WAv6eFIflHqaU1PkRBs1mGpUQheC3XkwFN770ndsLHTEv-4RyTY4k70qvRFkSuoblj0Ic0NDpFQFXVJpv7fBorC0aKrwxk_LGB5iGiWrekd_UdEL5EBczBRB9oWp-Tmpsixmo1wdd-5XctBjjuY0WCnTW54qc-MQ7mbpkn2GAjGQW01jPWw33BVnddyz7i5oFgNOZVVXqONCbeJyEaxFsBD2T8C2pVxYtqdcEF0pcq7RRQez4raGA0dW2AwIj4EHxq4yp7sUguV6e-iCGvO00Pp1yPrNNsqQqvLdj5cKFRa9Eb5O-VQyjE_h6aSQx-BfMe6RYgKBeDPhwZ_x5WzG32tVxYeiOLCBwEmkRVz53Pghg-VnbWG9EFthr-hO59SviOzWhRDOkTeCPBmX0MwmJxjRlrX42XCHHajKLFTd2q6r2vlLgfwpnDdUq8uDQVDXn3ysOoIwnm_Lm0ZX5YtkN35nOav8r6l44oMwM8D_dLSJDfPyytCwM-oaPWrMMQ79uUVr4eNOflg%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFCaXSRjVdqA1VxCzB2EpnPDmEFQyO8CxvNeg2RqrqaKlpPbzcxHisFkNS1S-phiI2dLHxzZSmkh6xjb-oU0h5exDLuRglVoGPaqM0xy96839XBDZIGCtbmbJKoOWhUu2gdjM1vqcMP2jTu3bfZQRB_d4aO2tLPde--kCscBbNEcnctHov7i_ncAkWUt8DMMjnR6K6APDkGncvFcofNfS9j03ZZq9XI1VFLm5giOE5OmzVQo4zCoi4Jb8FZxBOxntG5G0B3gM1rEWJTo2SGUYKLQwUvxnfcEZQkFFjnrFYIlu8nT2APrSJRfhsDnn-ZpHB36ZoGZ2Aw9CUMwxLbh0KpBuBB_J3Ln_vnBT6DFDhCozYdqRa8AESIQddc_XrBl7I2ihNT0sDVwTVtxP3MWIy_E6CiJjnX9dUDw6djqCkuq_EZD26YwswB6F2H97Qc3MpcXCdFz-BAujYAGKNrKWpBk_9xKSyFYkjJBOQsMY0jyz4t_CM5sS5uUyCGwxaA2yBj92pIc6yEEFA6gdNu7Q0HpaQ7djV93_fhIs3Y4oXjVgFDvaTLgivgIiH-qbQHwuWA%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFCOmnQM7FbcZ9PQKagoBw92bbDB9a9RXSAaRX_bKjN4viffVNeDUElzarlZBM6meQ8DWb_23bCsnZG6lHqovAXkbo3HrNLPsQARfIr0jibApXQKbBmnGAyUMhK8-QYRAsGK6RmvM1OMYJw9xTOj6QQFaTZ_0nDwP5ARSC5A7y_bXOPY0mWitplbXOJLm5gIevRbJpV9dCd613DppN_HnhE4JxLu9-20X3uWSgaSfio8smSIxaANCpa099abW2qMvVNbvWf8gtOVW1PPP1VJ6Fwmh5ys9sDED1Sk4XOcRO5KNjIq0XbFgvWlCCecIisEO2g3_YCTTfacc6lF4feG8bB-dEe-6_vvsX_cAuss5t13ForfPm3fnOWNf8bO7intmocs8OlFKBHA0WIAOR8Zf9d9yNHVXbdvZJmZ8gelKBWki8OcZUMaY964cEaF3Y8Za7ekCrvS5cyAJvmjuqscGSnD8SfnrdbLmg-vbq2jOh98Df9MturMFeMpemRni6xMXWpnT8vpzf3BIfLvJMHZy3dSfLhUyGCics2SQedYZUgASrNYdVWu3MZJSSh9_b8N_Sw%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFI4aTYlhQw8KT64zSlmAbo1bMG2IxlkcxUHpqdTYiDCQF7eUmqE71fW4LLmfE4IvrCgFikThjjpgYLdbGxFo9GaWQJVDXPiJgl4AsX7jTLbmL3PEKlGhBfGuhM_3GFGSDC4QcH5jhfWAcWVNMCujB80mMT4fcAsRaGnCiUipgatynM78ZCua2D8040O0XIcEUS7fp3GFXKFAxTQnayXs2aY7ukuVooX-16VLJLtdFLFoloTdMlBx9hAW-sZc5qU6zuM6zP3gyNZc828cxuteiFWsnl0Uo7gEKzxrqV5Of_buxobS3ZHZNFMgGQGw-mysfGyuqw1lJchwjFvb_2ISqlj689qzaQZvoBRQAVYcmwTsN2Z0A2DXQ18T6xdrVU1R2ucuJxE0WDK2-gIZT2VJe0_oCAX4LJflGDUwcyFA-oiRBl8hwLfHOItPhFhr8DmKOv9xhyCTIatqPZey97twEYSStiBcRaSHCx5-3ykZtuj9FPQFNOUFnzILG8RK80xQokqnYwHfz9gWRETFJQAAewHLEv02cq81Yc-5ZrE6UFKEv1fHr-KmfK2BXkTC9XDMkA%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFB-LSWIEXXm81xDOVVagi1ixBWdFegEeXTI2ZoRZxZSJQvSZC2qo9_CWOOWmJ0C714cS6pR1Lfn8gKNWZgl-z9kyKI6CM-azXK7DHroPUuWYThxW7tbjtbvdCkkx5FG-f-g0mNIqtl3YveOwXXX81j39uO5pzF6tv0AYMM_Tv5XnyexPw3Bfu_x2ptgY4-VMKppJ3ZCLgPTf-kX4msrLKhSaFLftk_pYTw2A2_ikE-bsg-uIMKOiNwVKvj5obTfc6c1F0qxc6NmIGRx9fzWAIyEgdw8PiS0AQnKdqin3e3sKcGS1miGto7UNOUjhu3aoM3nd-EvYsAVkLHtDWS3Qsvn-ONzKd8gz7aUYPhva_z9qHuz3xT8o7tOB4tJfOiqYqR9TNxFgT-HGM9lZu13PNjRsUGfsoEXCwoneK6u05apfQ_APNnJOML1usRZlHFVLC7huIJR5eb-a75osW_eLNQ6cy_KeH2tXkx3uB_MflZ7K-enMGnbjYZz1aRKiK7IYdISjo87ZS6fnBG282V6Jm8_7MqEgQCuNdfawZfRWPTvELERWg9WAR5-A2NS-0U2Q1Q%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFM6-EQQQNK470e6Ye64_dXaL5b6ijI1uRXQsDi5o_aiFQzRd72TBcFkSfR_a5SBil_COuuBGgJwGgqlHbmqHju3lB6HHroAJfHXAJuls-SyE4N4iu2H2vJnwwPrOUI1LPzXLXCJlnx_PeMFgZbcwO2Y6_qd0R7C0L4jO_Jm65tO9nMbxWSgWqK7jq9Cv2KgK5LIztlWa1Tr4FzkpJoKSNNXkBeYS3-qvB0pDv13DSqjjCC0QzSsvy9qyRRnen0TBJb5J8qYv6LE2KGEp25LGvjBBo7nhcPonqTxUuo_qTEtO_Ta0DJUaJGfs-MTkZwc_lwFShYm_mhLdJkZL4UM04YqVaUyuQOpFqpbH5NE3qA0dfQMeok6W3jseu2uwUUFJE-TOk5Mvldz0PslWKYde-rEDM2CyDAU3i1mvMi0KzgoGQa40b9aQyFbCY2hjha93HwuONXftbCtpb8KQJr9rE6x9vSEuAmOuUmHMfNtH2CWF0eD-Lj99uBJ388IRTlMVL5QMhDozOnzjoS84qyY1xXtjkVMOSPCL0KuHw6CX4ySXWwl5azafjUdeWcwXl6or5g%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFL_mQF4QQkEHiPy-XF5d2ZOfW32VMCRjUWVNscpC_mgZTwENoR32ybQEIuTjaAoAAevKjH4vME8PIF9c2TTz4jdswE88vbV-oYEKP8DyEAgwyDVjkNXNk3HkXfzYYKhFu5EeDa9hNQhxohzAqpnRCRNkreOa6zB7ac52zH8XhBNaKqALc8icfYh9oRqge8OQy4J7sKd7R0QX0n_nKXOQh9z535McnyNrewuqbtrnVg0cfgTofj68qPCG1509WkoJfc9e7NRsXyZbd7S1Asq7FDBhA3b1xamZMStUlpRAAnDC3dwQhZDv50hiyQhO0uG7wMuGTUVKCiqsE8dl2F5A4xdcrGkO_Fslsu20UI4u9eI1oarw-UBLWvjujEeeGYiFAuKgP8WSBVv_3V6M9y1totMO7cG9Sx0wnlmFVnOLkFysd4bKpgDWJRmIEfVp9BWsggKxSjlXeitaEyychE-aoi8-LnUp1Z0BtxvNX1a4dGorkjndwHa6UyKVLi_WYUoj-MnH1WALswWC7WjSslfaIBSpufskUCAhClBF8dleTCvKd9-F6iXfTdQig_YxRHFy2w%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFM_hU5OXbhH_JaWOb4GmxAhgKAGrQm29d_6eG5dWI2O_oW1QgDWPXzwTrQ3DUPHqe933kGLxeTheLWnwDvKYgpVqriUbdNMr9yuGBt6RzAVi6BIrEBcpSnm7kEcXvtKt2fkKxwDvUzcP-NVdFD18iDCpxEZjLt5Cr3fWw70y-ywgag6MwrkuIqBgES6m-CTD35aBE-LJaRDfqoqg7q1fK9dlHQaUh1NCnEs9Y1OCDuXTo92KzATCff6QEYsyOcxJ27nsz8mqUdfATkxLf0dh14wm7ZPiKO4UeOhd5bOFQrq9_xkR6PfY54YbtlL2MHQOCVu99sQnctOcQmY5eyYJ9zfuZH7rGlt5npd21tb4nhzRYEFy6SkrIDH9nyu-ckh9UaZwWxJZr3Iz289Gzse6S0lcAq82W42QTybR5dtUMu1jAkWmQb6EHaCH1wflvUaQv4fMZDiLFi_9XzBN6fDHzXgjhg6XV5rt65jeKNY5hxPVKBfz8i0k3bkkly5lK-YsoauaXb1vr2JeaycTSBAA4sfJPmdQ1VspZkHm4gWZ0F9lHHz8ogxD_SropIkDq_uZQA%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFLfIi_Lw9KvJuB8vv6vYP_BZMfcU2JpiyTCudXmho9i5Ee3ysZ1oOKvBEEl1NSJxiDQxpyUw1m-uw5-nazWlk7qarCLmEZjUtkT2ubV2YZrfYEnfKZQJ-HQT9kBMuaRruReCIuf_bImpO_9MzVXtJtKYnj5DnRBvtU41hB2OVTRVpGbcn4y5PPChs3jffqNlEX6juEGtwjTjkd_4ZG1Ipz0iEIiVjwf7mURanf3adSHhmsHUNLOC1l8jrHVSD61xDNYLLVYxMrS8FopeyiVEmQaHW1kfcDAmpeX1eyOKig4HerGjf_4X1LDuWl2ach2LBlXrGV247yGHj4bGzx3y3Scbd52-AtVhWDpgc5ge7MjDID66oLVCGQooKTdXU5uU1Kz_3U1ZeSVE9ywE8vItHc1J7lgOkchugdKO1yS5Ev3XbymUN-MoE3Ils2hr5kK7gubRPgC5ZFLNHIM4MuXwdK9bzs_A-HDIPb8L2n0Yg9XfjcN44m95Ttng3RjjA012pKA3nQ77bqPKDUWe51IVCPlgyzSMt8xKOHKun8SPkwHTwjxZSmJu8ILpQ9lwZAZ66Q%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFGTg9HHHyH-6U_R4EcLX0ptKzrR8PbUc2znpfssDBicsOuMoVIAh1WDvBV10JI_CApbIdIT7t-pv0qn3NDom5CHiDKHTFiESm-jbZ83rDxk_x8DLwXiB1kWXttPFRdnJtP0BYS07k7RQw-nEIGLNIzT1XXTsrxUnfGSfrKyTjZ0wye4zLJ9WrzGb8--zjEecpjPeCB_-wU1GyhsNJl536drQvZ51eRfryb5Zz_tm3ZEnIwxpidu2z9ZH8xntyocQNFQZVQyg3aIZ94nWh9Q_s6sVhFHRYqNmfkFW4x4fwms8asephBA4AUG3amsRUl-t5AT6_E_3qjgenxSPP3BceJQ32ISdOpx8D1E_ZS9ca_n-O0w3hFFlqepz4PbCHtmLrUNP-9ueM5q7eB5CDwAM1YBzRoI9Rf69GEkLRXXsjqGE1Cy6LjeQNhx9z-uBsUBiw4siRHKMgdf0XSj5LUSXcYBwljebJYtBv3ojonixtG9-OLifZZpERsAUQZGkbs4NoMjxfwazKzXt4V0gxf7MBUOaEGhGz4toL88fib1GN-sjlxd5dcHerLQIj748ncxXQw%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFCNi787S57c5yp2KqI4aOjeChRxgdlKewomZAq-N2rzDjiShll7pmZTxWF6imfnsgHqLGhQGNALSvnD0n3gCegvscbRhypXd2VfpFG68qnBvh9N17GVeoBeGGN0Sv2ZDAvd0h_MW-JYetRgtpP7gi6XGF11h-nqoqDXQPf3IjqynKPTuURC5edA8xC9Fcl7hkcnxJqvR9odq9vK_4fC2E2h_WbQ1s8g0lO43-54-Br9lQYaC49FlU0bCbm1zy3TSip49umFoXefBoEWqFKM97FdFrC-UrDWBbLQ27G0g2ilIq_CHGXwvVX5Gv7Fv63kK3Mi9CcjfPGMahSgT0fzNFlL5Qa91qnTXwQOnS8qkz7r_20IcahJAuY8OTIfQCtWircLH19qMIjkyZfVKI-FaknT4DYEB5xSby0aJSMEDA4Ig3kKtI5ayeEEQsJ0hFwUKGdNUZ2YQKbSKr0SuWEnRJjNVtYLIfV_MVr6wRdtSYkeFz86LULj8dlPJ2CdvuPcWEQtgVcAhdAg1btBmug_O6K3Cflgo6EmEMiFyog3prXsZDi5kU8TDcOO_K-w20BhPCA%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFOLduJLG0FXyDu3kEeRTLkojxXLqFYwBhsyrcFphIfHz8LOaqAB25YJAXqjygYQPocvSz-a_eUrf9T3Wnr54QM0LNALtUgLhlPrAV2Urzhzzoo_ajsToV8rO5ybY8quSDyBkZOOv94s1DZcQfEvD0vbL4NuWUjQQMTVgs6JZjWNn_nOdpr1LBr-tpiXqo0WY_9DX-VWsHxhqEBYSxxFXGddYOGEeiBP4APYw3ClkJelEqzWc85zTHSdjPD1ekKev9xcrWv2zkt_d1tXCLLG5lGBjYvVdWbdQnkFPy4UICojqzbEC6-lJwVoYvPMm1sQLwz6NP1Bu2kBzLNs8vt16wQmAT8v7lPUwc0lZ2HgpGJ8EPTDOiXWFd_dKJjKEcie5_2kAeS8MBksQ3YBGI-An91nykIhR-bJJY6rr-I3XYEuYOdZJfOBFwKmrza5aVcfkVVJIS2iabUaNOGyIQflShxgYuuBGKImWBG1y_LFnKOBan6uoGjvzNwZkEOQ2BQoSgpUeS_w3uxqnuU24QyaPJOkZUSgbkTQkTIKxJ5yQD3YeVwadL_bUnSvvt1oQOFXMog%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFF-lVpLriY3_K-n4uzIjIaDksdA8ptOKPNSjcgjbnXR2V0Hc0qZSl5awdFY-G9XWduXO9JJsUgwA4-HWLx8X5TOD8N49MX9jtGZrhyjmRepEnQBOWVD97KJpPXuEYekX6OtC2kBG8XUZjiI3xF5KKLETMdEYTJdv-_BY_A-0zbNPTsbqB_xCRo-UD1lxH1ZguzrX01ywYaAyUd_4J_syBmTnCzkslIgEo4ttX0dXpMMWvV79AojtUtlJP4Dc5fPUAQz5F08psnKC30B_UoNz6ochvxFiYYtVOtCEpx3k9HMgeVke7EjwFCNQEN0cHKu1PaAFExvvSBLMlVoEglGwdyzmyL4H6QbT7nao-R2MuhQB0kw-kkGDPycpDGu2W4itiNDzUundsn3Q2b2GyJLP1KI7C9VH79th3HlfsFthoGgtFwhcjjfnJuVEmM8DUsAK9NKXZZjXR07u8oaclmVv7kcfNlJGEMN0atYhgpKLWktGIqS3qCV6DqTYFDOMbjX-qthcBYPTQskXOqSsDUnn6tQnLAf1O1gX1I_rSVAOFMEpD-5lyROuiEQMNfvu6xNC4g%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFLSJPG-QWWZPbCkqQaPVr-9MriMJQwOfLlirunkJlJhy_AeHXCmHqly9RsjvXudtTFJeSUdEov_5Xd2T0FPGKleEYGN6eviUdxRuWFKvyugKdwAfvLubrZdOkLzlfUODtGLqMwhdSfIbTrnyZ2IJ26n24uFXK7xgX6zjaTVAsBg0NKtAlyxDZLRR7Vpv8VRUYmzlTcXMwdNbluRRpbXSdvmtVbQ6VUl694PLVLvjWbJfhHe1PLlscnUqtMDZLxRRlrNOJzlo4ZlPRLABYzA8dEKZsLGAZ8q-0FqHLVO99_oMq7UTunnT69rnsvg-W2k7PZjdZKnxyJOWE2ZCYrnMFfRR2c0KdfDmirDQlzuKP8iYIID0FK27LMYD8Hgq1iNflz_Xpew8hoUojGhBqMoQMZjaAPf3UqH_B2MZIxq5LPphem85mkb6I_5hbcq2HgTYXMSg_6zd4WhIbZVw0E5VeFV6esJJgUn82LYBikW9PGgAzkYYut6IY84XrWZQEqS6FiFZ_iSMXgiFXkUT42PtnrvLjeggg6Y8FnqsGUlHXJLsk-zXAedMncVFrvpa07-5_Q%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFJdSASVtAg2h20A6tlgSRzGB3UstiOldbaxz2XVXa-mBxHe9Atb4XMGV0KPulJPuYInULgWZqNa3guhG7rBM_HEO4XtwCT7jaTEanApHJByiL1ZgWqiECfaY9yXDMTMd067G_IK14GknPU9mnCGYNyt1TF8js62XqqGlVHHj8U_jsBAi7mb7Er1mb2Tnp_PKG5qITRYxogNFpaX0GOQJbDhfCJfi4l9z8u8l_c0AOSDF8aj0eR5SpulJ5u4RWkihHb248wox6dUegloiMtvamhgIqeHM-YnFne-cAeiehnfaLa8ybjibSNUefu0gixMiID6XA60VVF7mPp3gMbR_Wq8QlJG2vP110OzE4f1zIV_S2Oy4VkgF373OrRA8UZr2P2vuq1Hy9xoLN3tLD8El1m2CTefG2P2yEA2QARvNWSWCBcM6kwcDEzZZhmwAFcRS17qnklbmuj7YvHH9wubeiQ9DhKBer0KoSky6qzurW2hJZ55WmXJ2CVzMLVE15PsfS5qKZukjcNgxrgIMv6i0otwM5e3BC4JuoSskSHxGTJSTHLRw_pGNXb9aoLG9LVmIcg%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFNbiA4W73UMXyN8VxZ78DgCVnH4BrXuY8gii3bL2zVvQmew0NcBdXxeuGBeQiuHC0Iinz9kcVSX0p3YUsK3X0kGHtKN8U0xaTSfIh7PoZiyz6q50xuV2bSMfs_TSPpyi2XLYWjDf55exXQnlk4FDaxLoRSKSD0gmHyRTCTa2w4ouotYsAm_XT9f4x1agGQzJU7kMCmSS3ocyp21BWkR48AE0DrFFW5JQ3Y3TeDdH7DYFWPBjcT88sIS7BNJF3Uu6QjTeK85AnHniIe4Bhl8jyU4AtaJOg57huF9OVWMUMRWXRUjsvttn2t8STbxZb1kU2bTk3sq8co395EEs6x48Y_IDnKArhHV6VKwN5rK6s3AnQiLcu3Fos9gwJTKwE-dn6eW8i4oe0-NWlEcphiLZwB8MDf2PRkds9GScMBPkUV6whY_O8JE_hIsriBUrdXBkhKI2j3mc16LfmhAZ7ny-PvtInkJ-1KJSrKSIFhP8ic9h-wAzNx5l4iF5R-KmnO9Z3Po9sVIqNS3RizB1OCOiu-vmwpG4QwRJYSQWJ2OmsRWajd_wS7wpFTrnEJ5kr1QKZA%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFEfRRsfCpDiK2JUrTwN-6BWoqEnoZQ_E2Wr4cvw_xU7ePpnLW9kH-Dk5DhsDpg6iDezkroK5ybVgsxoR6kr94g5u7DLANJFZwmty0Bz-eQx-EtLbFfCxQ_BTrdTJJrycUH0g0f_s31TWN6aola2x2ndo3dmBjQ-iWoWH2AcJhiaPDmGHXd2OflkkhJEWR9aPrJ3wZhn1lspemaos-r0sm8ySI2Kqh-neX-ruPIsCpgeje9o4VwGhBJp4CRsW_F0aR-Q55KXFOFVsTl9WUJEbrhmewn3PGwr02onF0indzyFWLAjWtjThEtl17AH7lMVCvLae2fJYGotiTxNg7kVYXQ5w6hW-h3NI9zz7CIiV5CgWyFUBjrKGwzPRiXakenGkZXrmspQskH84k2nrt6FZNJVxAIZpOb_TFt5Tn-TrnfrRjjOX4ut-haakucLKKk-fIT4tvxLq_2hbQYwuvU9Jcq0-q2oQONLba-UgEIa2v4afBsRzJe9jzP9qAUzlL1cupXslOnsf_MsgPf-fxog5yUZr0NpcpqRM8rVyn7OntvOu4yDcRvMPEkhHal9P9okumw%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFB-GbPsT5j_N3HB_Bjtu2-dnBkUuTCZeNtS-Rb10p1_1xWg9AwVIYa96g3AVNm9gWhcpBFbgqgVDBKt43Fa2gIWX7CqQy8GDPXp4MTxHXEuf14Ky_ssgyZU33ZLy9dG5m8c6vI-7ErwAgnB-YyPHF7l2eL6WNLz6FamMSIprl8wStfYNKVH15TJUIHKcNLe_n9Fty1k9YjyF1gTmzmtcTyfw5fIZE_IEY6hh2-9gufSSg1HgqCjIkKJ6VUDNha9yfHV6cIDptnpIRhT2qRo9HLyJb1z8aFVEhk640B2rIp3bOwfzPRTeZgytoY4QSWqV5kLP4q-rI1zYz_lVKFcsr4Y8-gV5Zo-QQgjMivEMYGrGvN-BhHcewxkUHA7tNNiBNA5kECe0r81Y1Gx0HSNyx8YpJZJmU1ilWTV42Ms-9C_lQYVMMaqRG8fKDjN-ZyPNqP4wzeDLw4wmXQRrCeBXkAO-j2_UiTwSmhfVXdGq2EVKf_3nGmLTSzsA1YiS9pD6Lm89EkOEVSY3zGLOZxdaHje278EMm4lZ1E2r_MtLV39-KSgXla0kaW9KHOlkgfXQag%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFCiErqGm0PvK7B7u-QqDJu_wezpIFCl1govwn7VIb5ntCBmE9GRZrL7riu8EZ3Rpns_WSWer55_lxCZjtvY49V_pMX97vvjZK3O5aOtpUHwatvIoitd9ZYscswR8rB3hw_3Hk1gyHDx48YB8tOW5ELEASG9EoGpnrtidb9CieN6ILyss8nzV7tHLKG_HdPX7nNO8IZ3onyd12-MhckmYff2521gDiOdBgUmNxbkLP7vs_TJ7GEgefYoTG9dwlgbBlzqkHtku-OBJGO93ROM3zBBKNc7fJQRlksFzevyKSiyeZeF3FYUsDUYKbZN-nE0Mq_V3TZ9Al-1sJiH8hcMZrXsuCJBDad84cLmIoSbgsTpvptCoD8tpT1gqOjfATzLjYFBxH5PGjNZCNNU2PhtIwUKyX_feSoWj0_uJkKUE2fa-2sc_ZTlpipGmHfDxMLGf4cYLD9OY1f4XKfTSgA13v0YTDsIyhSc1QfYuLh9Fjr9NQvCk54WFlop4FbqGdOYWRIWkZbUsZQ5H-qvY4YB5Oj8QvJvjIboFXyn50cRSdyzF6tK_OY-UUEWuWM2xgMXicQ%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFDePeE5nLRoKTP6tZGEcXgz-sRJ3KD5bLNKDEEwJ1ydnp953vnbcj_EoIdeENAUHFPPK-ezl8VUU21bqw_wd3Sw2jfv6mBjMEGek0fYC_cUCDRcwc79tidbnl3iuBo8OY94skIMW6L_ybG88XdCyI7O_f5UArcecfjRNXipbJmBZlhscmcmrPEBcKTZ7dgDaN4cnaAn8oqL5HuLdHnuoZC-AlFdXefSOUD1s9lGG-RmE2N6P36WvdjUQyANM8TYx-7j0LwEX3zODs78tkH_RUHXy9CPKPpSw1Ez3cLzMNtjN6f7Vrk5dzGhaKg8vV0C6ApEl4Yfz3SDHgZtDfr8uSOsVS3FZqpaLV5uUznLJHL69pvka41dgNB9lGOb66Wqrx6ql5TrkjYiiYeQxjyu8mDF_e5zb77I8OrLQpz5V4xBroExYwbfaBKEcbxLXairvZ-x4PkWHbbr25Vwq5hkg4uRL3po7dnKzV_mdGT0OzKvwUj09xqlTfNHSlwUhbqXTuESGtsDHoQE_g8nO5QAvoX4WgrIiJFzx9keYTz3QVo2dajpCD8ILILgCnPUHeXfEOQ%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFKku2cATaf916iHSRLn4yrwK7Z2zzl5vn8IiRkasrO9vybBrjGiwTqLB5cOcbb7Ury6KV80FhcFB5KcYoceDW9RobXZN8E3CxCy_colHqqJ9nEpF3FoEvRVgytqTiivSEQU2MQaZxumjHzKhA_eeaiKw1jErZVH2K8TC9UFwxHOaXlfo4GpoijFXwaRer4vhJGCadiIBYHzMkDriRxaEKzkYJ8CByIvraJdw7nS-gJ7C6oBgbEmtIRTx6BZeVg7-NfilnV32DKJKjSx_zTpPHWi97uls7CVg7ePKGRWCkrVQfCMyRwgHXZm6Pq2TA4Fx2wz_j0fgmDHa0nPq7kk_dNtLNWfenOu_EMCt9mSJzh6MxFmZRya3rdvXyv2PgrAQWKz7Ug8pEoTjFlK4WV2_JuRtZQ5oX2jwMLbZATMRbYNQaOJoBg5P-UnUuyjKYHx7Cid6C2dEYHXQ32CUX6_HOxxIwo9jOVEf9UGjbrnxmCaUq0_r57mcA2Fa7LsDWVCph5VpqV4QMJTQXtU60X7aLOl6QRHrXJno-ojnEg6zCoprWAvaNR04WVeUUJiCU7Yy9g%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFBamibUnlipM7XPZlWWbZWgi1aI1Q8-wwc9ucwuEoE5uwhGVvSoqS6Pk4Fd1e_nwHVzjr3t2INC2AoHKzPGbv0oiV_xhy0AkHTKdaqLcpJlc35fPDjcIPyhIa_bRhNvARQbmr4MnI_g61_k-zsxgLds_zVL5i33tuUj4srDqxqBWRSQQpYRYEbemsIleQHjSfhjJyan56RMha1AxmMETxZbROfUvl5J9PweekBmmbd8qqhWFheYb5NtTmtm3DeiEPdbQp8nSlS3VJIb6XD3Mmf9QobPrNbkii_tgGJLnmeGY99TCVuUvREzDfq4VSBqpSL9xm8QcirRD3sh883c6ETDKJPYsrcIMsbdF4X-H34fgaCc8d-YgCx-PxUqQX-dywR9T3YIiSgc7r56yW7cB22IAGEiBgu7dFml6UtDQ7gEhJxRYQSdwziaMSQQRX55WTo0D8yAGmsrqyXL1ZE0troELHXHOGs-Cgw6DL_SVqwHH86Gxw7B3zfGf8Ev7HB7fpPLwMMUUiv4yDmoeJ72GO34Dioaz10J0Jkvl2Bv4ZLVnychq0XhOYzn2UQPrYb0jEA%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFO7R1MCDr8sL4pN8a42esIvPS8Ff06bjYfQhgVZBhd6pZxS-4e4_ijFV6zN-hGEPl19y55JWz2OkWogNqDO2Jsym1St9kH7Qia071yNW4-wzDnu2nDV38hvo5uei53tqzZbGx-PaLmxxeZl7Jgth_7h6J6y1-6jp9CCgbT1OrrL2Mt17fOeW1Tey3Cli6QLWNZvO_-uiZAICeEGmB5X2Hk4qSXe4Hxb2PNTBNcHR8njYgPWKTdB5wO5w38VLA0qcjUJNbDtP9P9fLaLiewI4bc2DkzaRPeeA5FEX7vyd3kBd92IfnF0SQAoExumFleuWJLiL52EuWWwXESjlMuhKpThQ4k3ZoIJdpuXAbhLguNrHGg9OmtkCYfQ_1qrkJRY8Hszyg8uruymzvaCugMe8NekJjdLnbodwhR2kx91Z5ttceRg0e-UgzqgMbcq-b_7Qq-08tCN_eXBZ3reQ3EWyNmAc_LdhzeHYL9cG6G7c8ZLRXgcPpmeCM0VBd60BP_nTfbN8Ivq9gJ5OrY6-8E3BvCqY5mxc4t3hM8dWfNtbK0oDNf09FjR7UUGkHm3kdX4RIw%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFBpNk0bCuVJlZn9Wu9edxnrOyvuNp9ZtgzX6iXl5cfVodCbXTljq_VrRKuOfeb20aeFWnkWvz73JEmYDK_2xryid1YmlED9noASCWvkQEUQIqsGn4xS1ZWNCldPOUVEViJ5tZ_hl__p9IQ4c2Ajl8-LiVKxL8jhcRAEmcGQ2ybWcoMuuthaEDGV1_mCqz0jycmGwHCJEAxY14YYytGWzk8H4rWiHXEquxNrrQ3qFkQwTA8V4kTUP5HqyGdQW7XWvbDq6YhC8E1i5aXfiteqNTalrC1OXkSXqKdg3ujEq2e7EHQZLUA3TN8xQ_ypBSxR9JkIKOUX2UIcAyqmx03po3LEwCzC_jkAs5DiDkPnW8Wi6AMU-rcJLMXOniluGsULeBPihSlXH24_C9LowIgBnG1OLNLpIkq0kEL9euGPF01C_lvN_tY4LtDw5jp2Ppd6sqkYkEHkIpOT37KhnObGXlgz6evnR-gLtMvWNWcYq3VL6u9vYV3yW_mOytYxUJAXURb4kr-Fwkx2zruIx9oOYYgmdPBtlbk4hmpVNFGVwH519BfGmBqYn2GVJfU-Fdt7yZg%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFIoZG8iXvj-QZE-e67g0t9Tp62uVGMp915vydOOOA2V-g2mbgihG8uE2vdbla46F7jMZ08-Yulh2juemjVbnGPTn0-7E_fF-0XhbVdat39QyqkVuo6hbkNBhHFvZKq-1TgaAVptwvGI93TpVFGsjxu_8IDIajW-Xr5E5yvnyLJbyg4tAbiZGq-WXf7CUyCfALfIJC_7yAaWlPFo7iw__s26UFDiQ3ja9tyRdhlNB0xb21sfq19FENd0LyYe7lEhNgQGFyY4Y4caJT50YmdvQZUp-o7snVcYA6shB1x-KkdPUD3YC8doksOrTenQn3bpq7Af4nFpPe-pQZkIOTxXWk6MG4XfBnpUUf0sGNK0q981cG-RfYSySsOhx7caWO3ii3nHLI2g4DQSZg0Sej6Svm8S9ZMtyWz2qFlandkisTQEJA92o3uE5JWsa6N3wbxot9NC-bDp88oZc-DLdHV6MgSVJ1oYTRXg6oaLtwBV2pQdfBKk7QX6f8otLY8UjubW3Jx10meVSxSQFbgK2KeK64_ORCHTPHzlIGpkpfSTVOuPPDhH1yErHgfXEutTUci80Fw%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFCbDbVjhfRPnRHdDEdmVdwU-9pSnx68VWpHvxofxqfk1vgLoMbiBZ4RbwLWP_-hja44iV-NdgdQB4inM-USWgG40_qtqiv7gjq31KNKmv1goOOHkFuKeKSI_hbhZD8y1EeK-Pwbh-8A5Jszi_0JI5JXitEKJ6PDVlfC4zOxEmDomrDOKf5K-KBkoLkjYTFj534toahw7Xai6jbMcITguB2R60diJ4LSA_M27JhrnAb44vLZpX6WtJQBC5AqFhZWCtsjN_o90nNrmuK7O8BvbJFOEXEy1k5luZXsrxic5K1Az4K12kMs4Rh59fNapbBdE9qOdrZZys-PEtRJRTrMg9oGKrO-QpOMNsB_DbKfdMaBd8kfej8dHC9AFft30hjitM-qu86kaBFhZGsz2dwTZl3-bFmWp1Lec0e87VOF3QmoWkAkG5xFjYxastPx0hc-UX07aMMHrjifAJpY5qMVkdpezT7zTN3f48m6naKLiWHye4YQt2Z4FNGHzW_TCRHB9rNEuJmwUosYLqRk6ndvQnG43J7-yiTgVkvWTW_f5ORA5eDGijwaqBl11k-LYOqJ3qg%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFFXoblns1sQD-Fqx1S5-HVd8eGBhPvHk1ZiDeIYz2_Ski_IcVeGIhWZ_2fYM9MgumM9O7dfjcfMxhpyC30CuFiOJYovylyXFIWrpXRXcpc9NQBggA096Tf_WfwsrZYkf92BInN8l91-1E7SouxKbF0tpFj0jAZWoie051oypLWiQpCeSLl6UR47r8X_DayCdzcsws8WqMoPMgdPWKC9YV2-zYG6iJ3AHpWlJV3Gqjqj5MHXAXYbV76pwRWJ_s07U14yTF04vteBCg1uKbTSIO1hOwq8FQtR3HJ6PVcAxYnkneJVPo9lHEzcBNb9YyVOD-vIO3ysyyihaiLD8swB8sD_qocK0R0C2ls2ipj7a57bAUVpkDLFxZOAmNz358fq9JRuFWfFHvXmi2aWJtMoWGQnz-gH490V7gugFRM82kqpkyJB6RVb2zyURVrZ85WYEmsM49kfu4AgrcmDAkO-qOGKTd383pC3ECMTIQP4j5hvXgRYiAA5S1CloyZguS08cGJiFXZXNYJX1elgUoTnFmH8H5pVu4G1irYNZ4EE1p3Qh7PgR6Oqyt4zHzgkkpsgbzA%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFEBiCUxk_bz_Wmrua1dg8Ae9zYjKD1pKaIrH_8w88ckdPwkt6OOaY8JE9iY6noXxZOaR00LRI2iYgKlvstYI0nGrVJ5XHl3merFOq60uIADwAAsoLPRJz7xUueyYHKViIfSacMqvFZDv_Y779PuWdcei8I2Vpdu5VCAZcOAR1waDc0HyeXorF9A0CfhY1Lm0LKg7EDPshvTYG4mWeG56T2CewUwkA4nMJdkppeaEoDBKVeybdZAVdv_1cYUQl9vWcBj7bpnKAYUiw_yyoHgL1gS0XXsTiHeyLtFOiBCG3SV2nOlobbInPdACMP8tNvzRl4Yh4dWgv5YnTqq07VrkQpFw2nKAqr5SzF9Kjx3JiRYP5eSejMtrczO5JlWzs2V8gsuq8zaESkNSgfbLX-x0AV_67PSsgLZR6hhX8rcdg7a8z0GMvFk3CLxKIPZsmB4yUgMNfiOEZdewNtsqR6XvNhWm40lQ6J7MMZ2I3sfc5nzSk7X8kU14m3ZV8kvbnQwEw0SbDxRrUstPkx4ln5DvnkwEqc2Q1srXX-NNaGGKzrCbG02caFvA8nPEYF0m9KiXhA%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFB8MqibXt28ZYzmpxfYNCVY-UZ5BiReJrE1n50jLWJwqWAeO1nsz2bqU8G6gQ42O5YtYhsIjtLPfD03DmSA8wZE9NhvdpjYPJr-MHD43w9K2Z8jyIFUb2b4W-sjFsjiUmrAcXcXvvEYsIj2it-HzxnVb03JCqh1PQqFocYJooOSKobG7KcP2pVyCm7uig-MnWg48cZ-DSPUjAndj8CKl3pGdltLLKbqd14VH8PKGdLiD8rKtTO3uUx3Y-VWMSfOalJwJ-tgvBh6ASXThzej2tapAzOwbWFP4JY0BSzx58mVPVouMa1YT1X1fgmjYHPjWHYJoEdiaX7ThY33ue1nPJng4MfbXUOXAowbofsVvJUzVMewIVOtaT2R_sq8oY2JFn1EWjOeRGQBtszubJ_vhHippPEECPadzHJTP_npqZ_FaoElTC5_-5NukzIdu1IB-7bldlm0H59finf3YFU7ZFrbh6lqIfy8OxhFnzZ1HxL_9r0BmizqHfhkW7_fzHb6rgjFKVgnh3n4GKnCjo8UppLGGONnqaE6rJl7EqNAV9JbnSD1loAcJccR_P9biuCITEA%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qR2UOnMkNnW5OM16_tkUZQflNSkYJrv5T1UHkHa0M_z83c4rt8Px13WUvvpICBJ5ngnC5CgZ2MUCrIyr9ggOUZAiVxLgqbbW7SrbMdb0ibUnxnNErgyo3b1xA2NRdLPJfXviiWXiL6kVQXMTOrRdh2-HhMBuqVcfrN4cA1opQtflAUyt_ZZ4ya4iXTomRp87Wc6s9MldDvvh2jvfbCk12w_Pwh8sAor9JIcAyJ6-dSKc7_0U6NQc7H4FtzsqcepneOJ5lVukpcU4cnpDaXCn5togYvyl1bEwBAOQ15j9gfq5xRdvb0iBxOvaDjFkXA9tN7hrIFTujVEGuZvmFXM7I_AIqRL8DR7nnbDqHZaUsk5Cprk3cAo9x95Z8sP4W_Hxb41wSSeHWxn_sz-ahHWAfUnRv2W5GJvcIoI010Xbw04WMhUbAUxy1RqfWg4uBD4IPyFILNtREOIBrHrS5UuXVYhahY6BJTQq_FdBjhXrPnm2IM4GDetJRKp_xZqko5CQH5gTtI68mPl9fe94wMZTD6IPHClFmm6-uQ9n4MxAeComXXzjm7R7Jx1Pmee5LOXRze9SsAYkit-0Q%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFNUjf9Xk8zIP_mQuEqzVw1qj0o4WitwtO7aE-JAoSnxvLsuH2RaGKYwlJSvMLZd2RzOZWh7ohu6akel5UyzMcYyrBAJmrcpvEkLKMJ-B1hPQDofrauaURnNLOC3udMz0vYpuI3E81v8_p-pA8GLgzpQoALuDXBSy4lyuCjM6QIEb8QBinSkDooDJZ-CYtF8SUTKSQJ2RyvDjzyTiJ4kMpoEAuBi-XS7Gwp8lQSLk1HpMS5IGBQA5E3k52L9Ty3il4ooHJFJ2WSZAGbWjJTpLMt6WZwrQBrIiubKGeyx-IwQz7Ia3Rh5ekU0zw6VbczHvxo6TTreH3_EWNY_PI5Na_M1Y5iJUknu8BBQy9tJVPbXi44LMXII76SkU3eBtrZolJZ7KOHnhCu58ZLA0vhEnH6wdb9a8tBxO7-3uz6iHC1GnWL5QUfgfhDejMxbXBIMwLAAqkHDXL2KdSC8eEu-w4NnUmHqRmZf9NlJOomHNHNo064xv75_n_4xB5TaEYarbNb9go0iwMvYTSQSozha1fcJLtvNcyoHoos3w8Qx0NVQ2QX8yCLuFeRsh2t1KZs6CRQ%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFAQTfLDX4h1J6r-URm5aPX8RPfHQKJqKPXxfVrcipqXoGG1zT5CchTt7m-cffuwIpHmXVpiz8ZvjTh2g9Q2Jhl6mzgW7Lxn1pHPYbQiIr5DclATjLX_fFEcsceM7pK6whvyxCGXx9iSIs7Bv8mXtejyRgArbi_J5Jman0YFLID2zdhIBOWqyI5BXhR6NMHQTqYlBG_bvIExElUXB9pu9jFJQ2pQ9_Jx5kJ4Pm2c1VBeQRynNRj228_NPl4AP2DqJ2gb10Yc0xZbc7cHniP0IC6qlMXuonaJTcBeQBvvSBe_uJiveBK1xVedfLrGHcsvBIdWhu8WjXB3u6zgj64asx8M4P8Awtft788nrE9tChzGB9CCJfyCea_u8DCuE2CFosNPcCX7P9v9H2QBzQuVvIa3ywqMMnuJ4IoCPbx3LzHF0PJ17HSojvS8OQIC5SSZ1A-tXxmL_P9YRkWJdFrT-EJPE9HHuI7BrWiyJSftpFrsgc2o8Fj-pF5FgAlTu60Lo8xEoiRbFRkNhqVKDVFKktWOrYY41MlyTLDyOiuwLKzoYqwiHirSBqTnXFzuwGh-Ndg%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFGwllDusINXfv7z5mUvntblpyCU58zuLcTbQBNk-BOPdFA16TGlDOodaDexN-oBoq2gxLcBwUTQulRyv9fEXs4hRb_sVTVado1tB-YOC1T_J0PPJwZNjrsN_4b-xd16OpIs-XeC1K8oxWSvH-7VuXeJ-ZxbtoSO9evZNP47VJY-_7fgTK8-R9j0S899uHEsA2EGv3gZJZesfR7LwPW3E5AB5g2P8ip-9LlBA9d2aNMLP5bsN6O6jtrxRQ758Mxt4TrBfi4SmfdpB_J14m99kJk8F1PGOI0MJZMH5BvWrY6WfkmKN1HlxqDDdSJJioEyQeBZ9eCVAYs3o4fK80rP2kxqEbUz2r17XV5d32UDKxTx_pjRxd_amNB-UwVJ3YkbMnIQCx5b-vz9fICLKsL3S4ycNdG34SCQFEhhj-fW-ZxLZNLiOukfVWBSmQVwHAWC9EnxdLVfunJCJ-WIzOsjIqi4kKb__yO_pHwDBMQSczxHKE3i-0CCn3mseDvzWbjgzELjcqPacg-XrSIudok2UD8mBnR6cmg3ZHfN0pIzEaAGKYTsnf15ioHSSlD9SA7DJyQ%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFPdrliZz1z4d3-vxNGKw-PHPInTbelaNJI7wIT-8kzaXRrw9_lWh3g-toz7pEOA7yhn0vSwCjL8xW1nK8ielncMXfbz28dkX4Ydbb8tBagZavOYZwbyXLLgEJRse17n-b-ehwMckudZcFq84l9IM1_xhPK192V1t7G8w6_e5SEY2MTnawv8DZ9_rykPu5EDtJJyL1N3JtbPvUFxiG5EXezc-i0TrTwO5mD3rpg9AK9-WHLZtDHLt1jZch4HqOX7gUM9_T02q8ge5Fc8ofFUQ8yWPIQLYkSFq90woAq09rGJoENwhwGex82s3ydVAeSeOk7I_bHDYHnkMfotpFlX6taSv2aatSx_u-EHMnc61lzpu6FxqrodDyJRVlbNljOWHH81zala8JNfH6dzJuP4g6zcMNfjm5H5xwn8ylwhhSz6p1nfjeqGPNl9rDLwukz_pk03VbnaLvKc7hGU8bzK9rBG1x5QSBU_RAU4CBuIBTxTRbxrhrKE6UEaHQ9iXCWXj0pAU7ICzgrQLEGx_NjRiDwKfopkwiHu-c-s_kcflLa3r4XPxaPp7hNAnBFgQLFnexg%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3G&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFNIvOTYPKwoO7e2RQzw1gGK-QWcLkRZCdSbDE-2zFX-FwLZfTCA8e1NCCek9FwatUjjRji5n6NUZfqvr-M2Bt0CYUc3Gs0PSDLP_0LPk_sEWfFG5qFB9QFdFFivDcS__n4UI8JfdQkMkYOOQn-U-2jNsaRr4NdJQ5bjP1PPT68vwZEtOUYUt618gdGfR7syMy7_nMqmPWjiRs9aTvmGThYF3sIxhvKC-EpXCuGa9picDNT7LxEFz0onKtqzosQHmc306XdERpNQy3vguaLTFb3-pIImH2CZHegzo37WK7IN4vE_Q50xQSBhFxf1Gkm65474ai2PQ3FPWRabLSQ867H0fmXEV3tiaNncM7qh1VCPOVT2Sza8klPFVG7mfvn3y03M93lAaCI-99VV_BOzFBI_cUVcAKZkMeOtOdw5fruh_5iErCUXDgFXdvibCsL2kfc8snBoFQyrVgou6YOFVcgsltCAuLZ2LRWewMD1U1d8-q-TLsIH-gixwW90rToJ9lQj07Wz1WUQhuJm82STKxz8e03-NRIZx1oTCJ5md1IOuUnszkGjGMfRCaGYBl8Pcqg%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFBvoZDSv-1RTufIY_xwO3kqYxIZCy8zVOuxK1xn-ZUprUVRer-ASPn-RhiCp3ZQ-yZA9-qRCtwzi15_CyIcxBE2QlVnya6FXeV388_yEX0Zm2aXXkESLItR3qIOW3dFEEVNzKkpA15Lt8FG6YZCPy9wYSwwBrR-m9BnnIYsvuwtjW1DNQ-fK6Eb5XjT2k3xKj9wyfnFco4xOiit1Wcon_u49Q252YsnoCjt9PJVm_o6B9Mn9kYPPO0Kexhm5IKDiNro7HxWrU9hcvCitL0UMzkb_NIxqsb_HHLEpjthVrn3laC6T9Bzc5D4pd0XJTmAe5fCDTEL4GKdRipajqbTC8bXLL5jJb7GOoSsO2f5u9XFYJgXZHZPfp8-cne8bdWZ3QVAwi7x0UNJ-YCTYAOUsR7tGmxJ7TFPQrm_AqZBwFUPj5xOu-ljA-uM5E6OUVEPPckRbxUU9q7YuVN2m6vN9gz7DDvRsjIVo2QaYLm8S2Rfko2rwHc1IVR9WowI-IZBKwgMe7uxsQRADpzh3I1X1u-vUNbxZenSbUigCT75AeRjiudb48EgzUHcc3ATZtiTTCQ%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFMhiPKiHjUjgEca7LyGxzU0hH_issFt2TiH8nrDsrkJqU19bHvKEjOyQgtLBmRCos5s_4iu4yFGvF5USNpyQBQeGaWJxFLJ_hC3xkPH_SaagyeN_xyTkxOIasBdJyc60dhFz9Q1zXO_AFq99L_781VI8tL3hMKwxgTtQhVuOjbnvxuAUHVc0z0vNqyMjf9enZKtaBaJ_CKeGdh0OMqUHm1XhOpi0mqDoUKW_oyhOVV5vaCcaGP6BF6cqvI-5qsNLyOcDkwvAwT-mnO2NF7WfhIM97GIV5bYAnDWg_sbbk-z0cs9RsAdwh9iTKiywdLEBD_qTPfDbNlMNbNUQGvzOTABlPQ2N5QdBP3tC61jLXj_QBzQCNekbama_cfO1e-kKTKnn3EdYYpb_7msCrtyMom-sSVNxq70fOXW1MQHEpJ1HfoCD-YY6nT_gZuBhgG0vRHK4QWRuoLZclQdcVLPhDEAsKdZ5Rz9Kqir253X3DQOk76n-ID3v7tSgFrTccKgXNdzGn3OcnBjtOH4GsZ1iT6Ztb4QVOOg1an1oWYHM9ntBEMwScjmy-uR-e5yqrSrdHg%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFOfho04cpztxA4UaaR8S9BDaLkrLJd0DaFsh9_Nsh-28r2H0ZDYDKkjwpEHGY4sszijt_atIxVTecv7b_uil_f8j8aAJ1Tvg4C2hwSd_xVIAG5XEAtqnWjtNG7x9GGG8D-9HSsPdZ8x3pd9HxCsVjuh2yuQXP6z94xVj5sRYYip1UyDyFK2B5BC7rXrYFcF-SNkQzBByfWfgSjLN4PhtxNJ1KS7RHgGt-vb_w6q4qUDqGjMudQ4a6VeESwkSaSB0EdeJtGQ-8QpotuvE5JD2B2kmZpj8Xc8TBFLz0oICqcKICMQYTPgXe9i2XjkB6t5tXH8EwGXHh1K9AOjdzeOYZLwvjYdHTU0nwuEjPUKsVlQn2PhkNcXW_iljUkvl70HHtzXkmdxAcOCCSONTPvEGOsEXQeiup9KDBN6d8cWc_vE4eQ65Q6P2rJOxu6ksMkt38jvmUfSWsMfVjmiCBdwj1BK7_JXbBQjfkmi-o2Ec0U7UmtjIi38cYmRGRV9Kkug6S76oFQAaDeKeym0h_cEDdD3Llq9m6RM8fC4PXESrmd_zKd_3wTdX0wxZAnSESxiEiA%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFFYMtHPwx-jgOzSNxHFm_iX58NfbSN3pp1uP41aPwwY1H0ppwNXjEAeyHvlEfNeePp07JU-ui8AqGcseypQM3Q0j3BQczy7f-F7RcxKcQW4EXKyiBgaNj2Lgv3sSUSUywO7b5toeE82Kr1KjWeHIUOAmsz-eyfNR0snV8JS6J57xknv01UuH48mz033hmiHMXje7wauntInpwh3Uldndul3dt80luvxgWzBlk4VOzz_Fh-Ms5u-mHD0_I2o0IBH_tRy1pVrCecAfDiHyFsMb0_XU6PbMZVXzMXNB3o-zSP_rvgGBIaPd7YvmXoZkRbcu92Jj32uhnlRVy98YVN37nWaTKMkd4FhfSvNgASGmyAKlBjdJueZtopE8B5lYys6XI0o-BKFZy9-oZ1GjY7fc42aAen3sAzT2vteH-sp4QwtMUM8_c80L97JNZlcuPDzQNct6qljN-x2bVwS-sZ6zj4wVhsSoG5m-YZfWm8WVAwC4xmQeW75VJpzPhRlVbg0Dz3CQAl4jbVhlP1X3sTrU66XPEwVuO64dvFnzswKgwtGe1CiBH-E4n_FCGzwLdX2OWQ%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFD1bRK7U7SURwAAR62srV07eZ19LcNqVmUUPMNC_5UkgKW1bOpGR-oCNpvXn2t4UBrw8bq4ljbIiE5W_yRErCdEk-sXHUPwEcTd0o4K5b2LmZLtg7QcA2SKDd7X8d1woB6NWecWexBK9IkgWGvSRmfvm7HMi7HCbwQ3ydeNYOEnrOvjBbG7moHOl9xmYhzXefwUMNmV8StwVtV3lz1nTHfb18WgPRVqSzzPZXIQX_sGiyi7EAEZE3-2s0onXGfKKv3Dtv3zHMtzJINQGBaRPUeEAy0WrFj3g7y4vieYtMn8D9WIDGbywklnstOoaKJirgBavOCFuxtoF3o5szcJUmJZKO3rPEvtay_KpcUMn30s2j7LEx6ts4ZJnok1SjzvKRDLICiONhUd6AeLqD4fKwdbXOSUNf-36sJ-ckRKGbCRit3VZVsWOMT5yQL3iVTLLpW_oD_TKIp67z8UzA9WZItlTgY0H9DoyJKDpIeg8yHBsEdfggsaDjm5mC_pWBKxy09WE1EjH7s3jkBT_Fen6FVvOjHFIj9tY03ILQhcHmg1WDQkxu6FoFIuODiUr25u2OQ%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFCu7pfW1NO-u28MHnSjbnO9qLy72tYPUKAzJ7HMOu5D80QjQ5QmMgFHPqbVnb75nuAQSpid2MO6APw7Dd3lcBrMuvbTnvmdS2kFWlqXrYElYfiiHIFZWqBAZaFiP7KBCjk0PWQhYeUAz-awVo1Cwb-kJSbcFKZ0zFdcJKObW4L7e5fDv3oCxKf8Q6d-XpQp0Httg5LqnpcR3-0bpACU8nwWOMTxjybo3scQYz-oNxWKM5HBBfA-jen5BgHp_CJ4VdTLkf6s-Pudk-1045ibvBJ7ou0HaW3G6riqVy1sfc5eQzfKRfardRpGlLg6Ty--DntroLqfcz2UORoHm_fPVKqcoTJtZxteS-BP5vt48Af_2-KiX_zBFRHL0aNHQ69yqzrRi6l3iHLLIxjFynDCYMXHyND4WbNVko11aygMmo539FDSVOlUBeWderIp4sc9W4Rlsnk0U2dqVzA01ZFgwgQZIpDU_WqbICdmzcU68Y7riUHGjgclmql2Rmtv41ZM9RaDVecBojmfW9ytzhG4hHI2AbsMej5ZLq69EO2128GC6YLxFr1pluHn5dOhsS-sP2w%3D%3D&p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFDGyPql7U3HDu7KK5iKFaww0gNv5Q8lc7N0DSAHTMah3n8KxX4MeXfxdHrAY_CI5e4lScDjA-e14Z43jqyjlKiZcT9rsbEV5HSYC4uUc9XiiMVJQhE04dYeh0F7wpI0uHaRtOnBrMF7syBpx59NdXbVKAZLUuYxF8E6tSxHWo9eQtP5CizOpEpuTW2bn_rrJ6h4WpFjNEAFhoKyfUrx2ZDr_BZ8lUKbqAT2Zvf5NeAuhHn50fWubQxGbxufnGD0rdma5GlfWfQIJ9OreJBvgcmBbGINMkDHLRQ7cw50b338jKfbcTIENiPL_fWbmdSgU76Qn6-9o9H_vwLO2dbl5zgdoJb9Jenu_EVHwmPpiRnMOLm9ElhRSaszIoIyPu8oCm5exHmCQ9wF90Zk66m0c_EFAvZqmBLNQ9wHmGrWO2u5XHGZejBz9jh1F7Xk2kY8Pq2pMLHVdzqT5DtBcN8dtxjtPY4FTtGfteJ0tmzsbRgbRUvQwdmWtkPn9wxfTxOsENfxgedGFsYP7R9TGxgaC4axiWOv_Qj5LsiLyfOXTG2g0zboRLEsq7MNIGl5CV6fyAw%3D%3D &p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFCrzQFgu-lbZZRVEa5x99noFBNsssnHDoQIsssJHA8JwyBDjBVVEkhFmEF1wfd6rFTgoFvdg0B64AIPZAgda_MX_8Ikz5Ak2a6eLoX_dJu-ruOafEvQhEqijhT0h7w_JrY3UKy4lrbHtAgJAHuWBF1IYzssXkhKzetxm01S175P40FH5WxcT3g4uEjEqSjkMZM_PREpfpgYTwKxK1HsH2hXdahmorrFEb3wkcXDaSRCuUXnY_JcOptneGeWoXwmchByK-FtmSE5ZMarg6lrWQVudRJR5ouJ9FWc7sf8tWOMeDHj074nzIIzpPt4SVCIfhYmSGNoMUSINFmcaI83gtmUqGg1YrHas9juJv9d4SE2m0msHz-cOpGMgzaBWzFXVvnAZk4S1YciidsGDq9e2K7G7O4hTEYVC1QOi86OJCBH6qzl5EPsAh28TO9r41H6sg39HpivZ9oaIs_zSLgKhbdZqa1ugHn-hlxRJFOzCUmQphSYt8MyHOv0PbAZ6WkPhRfnwJ-SXb4gJF7w4x06eTn5NLbNd_sA8fszIXhWNUlgEgx9rWNZWhHnsU2DdtQmRCQ%3D%3D &p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFMzN4aL2ev9meT0pgOTfSUVFAnCuDUaEVa6eHg6C-IE_mN71cQzsmZOWRPrgJReHvTnLZLTke29AeMk6gd6pA-_nBSQ8YpHUB0H4xNOF4eiNZ2nS3GzpRZsyledC3xr7yZ2h6NKyDdfltXdIcUwDx3YyAP6FHZO1csMh_0kubgE62BHJog2eyBF78lMiFQF7pyAbjddQ7t2yOSKkzpeTWXyV1rvQP4rapnP2RjEnpsPOKNHK7cpXKeLeLvgwjdd3SNItLn5ZIwP3PfXeX2O95hfV079zs_HjYLD4Qr4DMrZjTMi_LYvv5qDU0Aeq0QjTfntv8Zfv-aGZJF1YJghGGsnfapBfLFZ14jIAjVxTxl56r79q4TyQE8YElDB5YZfLxmT9jWv8HFgv9xwIp7sNGYxPT9blg2RZK2pDK_3iNWSpW0snfls7YJYctssWFsz9Z5o78KV3Izu6JVD7sbz_2legrEy2n9AmWaTNtHCOV6418MIXuONld5WzNEnvDaKsPcSY8TbWjoU8CEbUNVNlQ8PpMm20ghMNuaez9kJ1HMuZz0nsquEqD4_GBgjYjxjHSg%3D%3D &p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFEOtMFciaGv-zMb3DAStSXg41AyFKVz3NLHFh3iDQkmNXhwlVYIyKHrv0sdmAXLSaICWszxfSYw-Gi3eP7XI_8BU7iamRu4YPibRc-yaOai9yTk63hx8rHoC-w0bqoAmsZntif521hNCJf1qbosOgZGmFIaLf-tI6IDFBi0pXKjLY-5LizwvBmkMEx2GolmR9pCGP3bjRvbeqTgrlkTqShXeE8TE5j4kbUCSO2O3po8mVWKmqWmJilJlMpkZuGrOoUaOQTTu1VXDLa_Psal0EGk1UbSpqBPovWqIUt-BRc_vnigkjb7Vu0IHP4LGfoqTdzW7d-aPbidffJ2Ghd-NwVZD0-ZqD45k3lh8ApUE00sX70f7ODK6OvCowdG1sveDSnKMQoItruwwaKXEd-P_Wd2_yazS3osEvEUNKyH7wzHbuKHz2yf_FQ5z3hhUY1MnMYgYSB8zWCYtRNLL05qa11HDghCivs84Az_AzafUhjCb4vitwmUisGMw8aW_Ak_O7WXSAndR6OI4QO442fyAwF8UU3DMER7wpS-lpAZuFvEhLO09OknfZ5I5hQGBlboa_g%3D%3D &p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFDHj-ELbbQMXHCTTNXJkt23ANsDW788PvPqIScGwwrFUoxS7D2zcFvekY5XrPGW6XzaKoU1lrOjlrUE7jgRf9wbstAjS51ebqafzakbtpwze15Op6nASruo51tCZmM4ryzH9e5-9WBWIN6mOC4lHbdx4_h-YrMW-hO1Ck3ovPMMKmBjWobz39RgoNEIo9v1WrKbykGmaiL6JI_Icu6CVHX1bdgo2ii3It5i0vW8y1J_53C173uh67vRf7BQX4qsejZNZeZAPa_d9oQtzMc1UPG7K0fCHdMN4r2-Zj5DwbioIli43c429TlMxsfyQFCETHnnXDTZDhrQ_Gld17MQ8m2fKSr_oU0s0cSczIvxcGXFytNFDNDTEwP-RhkGDwBiExiGHzWXWOi8_b6MllJnME43cKxU8NC6ygU8JWe8CTFPhPU44TAQw7R9MVyzN_-iAwjvQBdLc2S13jZPYodpya9BJGtHBp4JtdceSPTpkM9fboXiWY3eCGerb4Bsq3FKwOMVCmWOUDye5BUg5QR25V6wTpVHXWqoIGJ5PaG9BlQZx6fBEAaBKhQK90H74kVVdZA%3D%3D &p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFN_50GlRtri6kmxTkR5P5BbGXduxq_MKFsFg2ZHEUbTpzVWJom7qlY6glPu4n67_RA0bLovqi8aBA4RPtVwBiSVoIeS2ZkvAydZ5J0LprIKUfceTOhiYEhUn1K2wPSqFOcZFLsacJivbwy_JvKgR1M8A5WMJdZ_PHWwkga7FWhFZiNHNqwl0m4qzuEw6lHzjezP9pwZznreYLDIGS0gQ1kuy6e_Any7Z45Emk2OwMjwDC2DW4eBm_yRWMyeqxM0Z0UdwZ5XC9W3hu79N6cqO7zAGnUqIWti3SSbXd_G0RQYyGoeaIjCNoNlNy0gpDVU-xuVzm_n_oXvzfV8VGroiC_xUkyegcR4EB_6IXKBBseBMnV8P8n7ZqtvNmNC2WsokYIfaoYUV0MkxpCx8imTY4490p1zVzPNssGU563GiXjsIWHnpX1oNebS9TwgIcMYzcGxWc0n1WlVqJH55NsaOK5Z9GomAtE7iiIH529PM42lodtRqHoYx0Fw0mb_gpsUi5fbqWQ9iYLroael46v5RluMZB0LSnLrL1FKQmbxXrW3WfMD5MT_NTQofHW_M1DpeUQ%3D%3D &p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFAoh76UyM-82oyxMsB322EiVu7ZPl4MW033khZ0wFXK-3jORfb6HGXEd-4gtllfdFFoaKPoKxqEVHNZP1pWh1y5aSbOpQyHGwTaEfrKW7kCgxpaosweiMXQEFZWrykuzdEbD8VYXU0RggGfHuczBaamTrg1OCUpsFVpcyIElVIbk-YdrJqL_01hLk2-CPS2E4KswWtg-AutE2Tj8ZrCbdXY6d8DBMiSdOTXI1-IbYY9teSTRmhfbExhpOYYKAcpPiOm0Eibvoj_BcP6GQeZQK2UuzNj0IhcxOwBIL0ODv-X4U12h2oZhkM_OVcghfTghgQdjaXaNtcleSk8Nvtu3WwsI7Xg7vMt0WbWBa16AFslLSKMaTwtcbZ9baXHk0q_nlY5USpQN0bm1D48quVd5ttYLNkKMRufwgr2dYvzfIZ1JkEZNg2bA3d8G8sajsUrktTLpXuJTpu5ST59gs6ekBlTxiMyjxDujsXjkt_KU_zJVZ41m6qyZ2q2G2fOaEXxl2uhMJCPadZgD2GV2bF_YlttMr8cuym1yk8pScBOQC-ms3F2-__578pZgvCF95pKzGw%3D%3D &p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFHrQM9WOmKyosVg-eLitpVTgpDc7az0wWajLdKzcNZxGmJwDSGouTZnsINXQZ7jYtS6afmnrcirWqaGtKyGP_hNBBwOhOWWwATTxe42PQHBZhfYo0-c1uUubQjAj80HjJvdiQFCHuWtYzJ349a-uWnXzOj708Mp0Bw2WBsz6jwdAMmUbR4ywtkpzVg5a9NNdyAIXydRkYzxHX1WShqrJluZW-3AA-IrhD7tWq7cizr7JDBj2OWwIQhhP8q0dK5RDAy4JUws_2JqHI-CX-_vR8MTvWJmILgggQ-ZCc7Ltz9w_j5i0ukkPi_23MjmT7e-VO_YzFEoku4umuqAH9xuBF-CF3xWIVzpan1TcHLwzJeTeYHDpE6mOnhV0GpmR_40g-V-41OgEoLdIwOf-ncop73XjegpZUud6k4kupLCeR9bU4OCubjwXlAu5_RuB16MfB5knirytVPq4xKCPbgQCjP3SDldm0LTLfME06Y--j8d_mTE5qVHgpaLy7IJ75pzva3THjhHwqrYrvidK_EcLwmYOGuR3bl_GTDCsV9W8oKupHquSXkhjm0T4B4z7KmwgiQ%3D%3D &p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFFLwBmB-YvDFDXuSrXkE8WVn5AZbAVhdhVvFuEp0k6AsklW_V8TIM5gnlP9tH28SMwsZsuIOVYeZJzfPVinWbdbRb7nyP2R5CsSY7bZodzjq2Gv65zdeuqZxLmFnx2h_B54EHDet1Q2q-Swl9dO0rCBZ2M0Ju90y0QeiHhXrELltJWEBvo6YQDB5W-RExCkRN3riTD3MkFznVdd6MbSSV198XFnTTR5i_TYaZJ5OQM_FkWKrMSh3xl6Sjy88jxLvBY1lFE9keVSTlIj8zC3oUMYyQGfRMtfnITIxjWJ--a3LmL0XbO5AuLEFE8PXIX2JUoOAZgA7XCpBFkZMKu1f9YoOlsI7CQ7Qt7DSGsYSGCaiywrQ6MmogwShVAMNOUGGp3TMkuQDIMwZ1vm8X8fo2nmNg7H_VFA6AutK2yMGXBTnbBk5IagexOigdNbzAk6uCzKKVP2FZnQzXILdS58EyrECl498Lb8cLUpLuXIPBhq0fMdXMSUD1DAgGcqUehw4m_QdUmWxf5vmGtuhWvHA-qipLXsNo7a5iWyhD8gyEsGQfgIF0MjadpmlSJeCxXHwUQ%3D%3D &p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFKzmhkVi-aYXBDBaXOTyRzr2IXIQm0YZ6Onjf_lVUZpgWTMseBd2vhkWHf7L4qmWdCHC4k2ADbBD0OVA-j11Fq866b3H3fFgS995ME35sbZk9E8ARuLVMU7skBoMCd9zoXdgCcdcmXPVNThlc_kq75x8-891i5QMK1Z8KoScRUG4gmS1RCOke3TbQJAp5gtHNgUShzDgWzl9DXBYjLXrWcpgyVZnxMh49oXfc34WvY_iKBkLslafoE5_WNVNDeh4hYIqKgrK-5A4pjUs9h-Izb3f3fYxkj3Ujkm2C0p7W3aqvJcJbI7dLRMZq6GIoMsGD6k3zr6Lqexm6031d8rQOZaB1_7vPVR8u3rO2c-QPyLMu0r5wRGtQQaQWtEgv4GujD3Cq3z8NWXMTLCr8YtW-Tm6N8UtrirAA8tn9FwLS3YjCkuR5zj4AEWOrPevMngEnK1AiZoRm9edycogmlCRPGxiMFR3UGnFPgPvcqjutxLRZwWe_1SYkoFAtZVco9Mi12gpepvHCQrau6avaLs8DbtPKEd90otmbxLYvPFCMU44W1f6h4oh7kC1xIVZXfwMFg%3D%3D &p=9NwGV8Ov71o%3DgW5NEpb6rjb84bkaCQyOq-myT0C-Ktb_kF97hamPuz4ZZk3rmRrVU_m2Z51XN3szZYaCPxNG07BYjyjwYkBVGTfTGYPVecze9u-jGHCQmfvey4yZrPyKR-cA01PbV3h61GBiHFc-skGrpoDK0eliCfJPX7f9_IVT-MEKcW_xpZDBt9WJyAFp02V_v1KZL11uGnpYEXDMHIJS3uf-rfarIsLvh8nMqh4FXYxyqzeDHqaIXHzsPeO1R0UxCvqSsCm3GyHhPrli_qSEikgmHlKgFL8PMb2UFUwhj1rQM8cxpTJQTOuH9jrNFjsjYHWNvku2Vl82c1axgwnBsyWMPVLuP0885rnRPTKRrptVrr5NolcoYs6aVVl1eszbEG1erwmL1woVFpgzifPLL3cykQ4vRxgnFEuCnnXQCHMRZu1E-m9C1XBXJZKR5r_Vm83C_b4UhFQVG9jzRucp7hl7Qdrvfu_6aa6GzCTgf22BmW03FpgoCVQE-IxiJQnVphhrWSAW-s0OjJZN4vmDDYV09nCcYqoijrWzHufOnJB6G45-1n28vgGgrVnPOl_lMrvZVs2f6CfX1Lje5rmSTK_tvhjXdEjmdwd40eY6sWLfoshdMXIiLTtdberzcxSAhskTVDMsYOXtUR2fMEOA17kMEupSWEw1CF_AN0itMSwof33AjZto29z2RbkSNwMGzqzPPX15R-Zp7H2QzHEEaUPrQa6QE3axNW4EDkwljpMDmk_X4yAzQJcFHUTz0DxMUf00LPO4_YFs6D_kQZQbQHEQNaHNVApcX2aSO3NolUuQDpuqWwqRumJUIeUHECL6F3se6kSukrYaMY_UUw5JL75eEyX1wQ%3D%3D"; +let ReadArr = [], YouthBody = remoteBody.split('&'),readscore = 0; +// if (process.env.YOUTH_READ && process.env.YOUTH_READ.indexOf('&') > -1) { +// YouthBody = process.env.YOUTH_READ.split('&'); +// console.log(`您选择的是用"&"隔开\n`) +// } +// else if (process.env.YOUTH_READ && process.env.YOUTH_READ.indexOf('\n') > -1) { +// YouthBody = process.env.YOUTH_READ.split('\n'); +// console.log(`您选择的是用换行隔开\n`) +// } else { +// YouthBody = process.env.YOUTH_READ.split() +// } + Object.keys(YouthBody).forEach((item) => { + if (YouthBody[item]) { + ReadArr.push(YouthBody[item]) + } + }) + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) + !(async () => { + if (!ReadArr[0]) { + console.log($.name, '【提示】请把抓包的请求体填入Github 的 Secrets 中,请以&隔开') + return; + } + for (let i = 0; i < ReadArr.length; i++) { + if (ReadArr[i]) { + articlebody = ReadArr[i]; + $.index = i + 1; + console.log(`-------------------------\n\n开始中青看点第${$.index}次阅读`) + } + await AutoRead(); + } + if ($.isNode() && readscore>0) { + await notify.sendNotify(`中青看点任务收益`,`中青看点共完成${$.index}次阅读,共计获得${readscore}个青豆,阅读请求全部结束`) + } + console.log(`-------------------------\n\n中青看点共完成${$.index}次阅读,共计获得${readscore}个青豆,阅读请求全部结束`) +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + +function AutoRead() { + return new Promise((resolve, reject) => { + let url = { + url: `https://ios.baertt.com/v5/article/complete.json`, + headers: { + 'User-Agent': 'KDApp/1.7.8 (iPhone; iOS 14.3; Scale/2.00)' + }, + body: articlebody + }; + $.post(url, async(error, response, data) => { + let readres = JSON.parse(data); + //console.log(data) + if (readres.error_code == '0' && typeof readres.items.read_score === 'number') { + console.log(`\n本次阅读获得${readres.items.read_score}个青豆,请等待30s后执行下一次阅读\n`); + readscore += readres.items.read_score; + await $.wait(30000); + } + else if (readres.error_code == '0' && typeof readres.items.score === 'number') { + console.log(`\n本次阅读获得${readres.items.score}个青豆,即将开始下次阅读\n`) + readscore += readres.items.score + } + else if (readres.success == false){ + console.log(`第${$.index}次阅读请求有误,请删除此请求`) + } + else if (readres.items.max_notice == '\u770b\u592a\u4e45\u4e86\uff0c\u63621\u7bc7\u8bd5\u8bd5') { + console.log(readres.items.max_notice) + } + resolve() + }) + }) +} + +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)} diff --git a/Task/youth_gain.js b/Task/youth_gain.js new file mode 100644 index 0000000000..1da51903ac --- /dev/null +++ b/Task/youth_gain.js @@ -0,0 +1,165 @@ +/* +更新时间: 2020-12-16 22:06 +Github Actions使用方法见[@lxk0301](https://raw.githubusercontent.com/lxk0301/scripts/master/githubAction.md) 使用方法大同小异 + +中青看点浏览赚任务,手动完成任务,获取请求体,支持boxjs及Github Actions,多请求用"&"分开,支持自动获取请求 + +https:\/\/ios\.baertt\.com\/v5\/task\/browse_(start|end)\.json url script-request-body youth_gain.js + + +多个请求体时用'&'号或者换行隔开" ‼️ + +*/ + + +const $ = new Env("中青看点浏览赚") +const notify = $.isNode() ? require('./sendNotify') : ''; +let StartBody = [], EndBody = [], gainscore = Number(); +let startArr = [],endArr = []; +let startbodys = $.getdata('youth_start') +let endbodys = $.getdata('youth_end') +if (isGetCookie = typeof $request !==`undefined`) { + GetCookie(); + $.done() +} + +if ($.isNode()) { + if (process.env.YOUTH_START && process.env.YOUTH_START.indexOf('&') > -1) { + StartBody = process.env.YOUTH_START.split('&'); + }else { + StartBody = process.env.YOUTH_START.split() + }; + if (process.env.YOUTH_END && process.env.YOUTH_END.indexOf('&') > -1) { + EndBody = process.env.YOUTH_END.split('&'); + } else { + EndBody = process.env.YOUTH_END.split() + } +} else { + StartBody = $.getdata('youth_start').split('&'); + EndBody = $.getdata('youth_end').split('&'); +} + Object.keys(StartBody).forEach((item) => { + if (StartBody[item]) { + startArr.push(StartBody[item]) + } + }) + + Object.keys(EndBody).forEach((item) => { + if (EndBody[item]) { + endArr.push(EndBody[item]) + } + }) +if ($.isNode()) { + console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) + console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) +} + !(async () => { + if (!startArr[0]) { + console.log($.name, '【提示】请把抓包的请求体填入Github 的 Secrets 中,请以&隔开') + return; + } + console.log(`您共提供${startArr.length}次浏览赚任务`) + for (let i = 0; i < startArr.length; i++) { + if (startArr[i]) { + gainStartbody = startArr[i]; + gainEndbody = endArr[i] + $.index = i + 1; + console.log(`-------------------------\n\n开始中青看点浏览赚第${$.index}次任务`) + } + await GainStart(); + } + console.log(`-------------------------\n\n中青看点共完成${$.index}次任务,共计获得${gainscore}个青豆,浏览赚任务全部结束`); + $.msg($.name, `共完成${$.index}次任务`, `共计获得${gainscore}个青豆`) + if ($.isNode()){ + //await notify.sendNotify($.name,`共完成${$.index}次任务,\n共计获得${gainscore}个青豆` +} +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + +function GainStart() { + return new Promise((resolve, reject) => { + let url = { + url: `https://ios.baertt.com/v5/task/browse_start.json`, + headers: { + 'User-Agent': 'KDApp/1.7.8 (iPhone; iOS 14.0; Scale/3.00)', + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: gainStartbody + }; + $.post(url, async(error, response, data) => { + let startres = JSON.parse(data); + if(startres.items.comtele_state ==0){ + $.log("任务开始,"+startres.items.banner_id+startres.message) + await $.wait(10000); + await GainEnd() + } else if(startres.items.comtele_state ==1){ + $.log("任务:"+startres.items.banner_id+"已完成,本次跳过") + await $.wait(2000); + } + resolve() + }) + }) +} + +function GainEnd() { + return new Promise((resolve, reject) => { + let url = { + url: `https://ios.baertt.com/v5/task/browse_end.json`, + headers: { + 'User-Agent': 'KDApp/1.7.8 (iPhone; iOS 14.0; Scale/3.00)', + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: gainEndbody + }; + $.post(url, async(error, response, data) => { + let endres = JSON.parse(data); + if(endres.success==true){ + $.log("任务"+endres.items.banner_id+endres.message+",恭喜获得"+endres.items.score+"个青豆") + gainscore += Number(endres.items.score) + } else ( + $.log(endres.message) + ) + resolve() + }) + }) +} + +function GetCookie() { +if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/browse_start\.json/)) { + const startbodyVal = $request.body; + if(startbodys){ + if(startbodys.indexOf(startbodyVal)>-1){ + $.msg($.name,'阅读请求重复,本次跳过'); + return + }else if(startbodys.indexOf(startbodyVal)==-1) + { + startbodys += "&"+startbodyVal + } + } else { + startbodys = $request.body + } + $.setdata(startbodys,'youth_start') + $.log("看看赚开始请求: "+startbodyVal) + $.msg($.name,'获取开始请求成功'); + }; + +if ($request && $request.method != 'OPTIONS' && $request.url.match(/\/browse_end\.json/)) { + const endbodyVal = $request.body + if(endbodys){ + if(endbodys.indexOf(endbodyVal)>-1){ + $.msg($.name,'获取任务开始请求重复,本次跳过'); + return + } else if(endbodys.indexOf(endbodyVal)==-1){ + endbodys += "&"+endbodyVal + } + }else { + endbodys = $request.body + } + $.setdata(endbodys,'youth_end') + $.log("看看赚结束请求: "+endbodyVal) + $.msg($.name,'获取任务结束请求成功'); + } +} + +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)} diff --git a/USER_AGENTS.js b/USER_AGENTS.js new file mode 100644 index 0000000000..ba26fcfe2e --- /dev/null +++ b/USER_AGENTS.js @@ -0,0 +1,18 @@ +const USER_AGENTS = [ + "jdapp;android;9.3.6;10;5636468336161683-6303634683165353;network/wifi;model/GM1910;addressid/2441329936;aid/ecd8caa8606d8a55;oaid/;osVer/29;appBuild/86533;partner/jingdong;eufv/1;jdSupportDarkMode/0;Mozilla/5.0 (Linux; Android 10; GM1910 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", + "jdapp;iPad;9.3.5;14.3;58b78c48c17dc6ef7f35cc119e024d817d7b7719;network/wifi;ADID/BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4;supportApplePay/0;hasUPPay/0;hasOCPay/0;model/iPad7,5;supportBestPay/0;appBuild/167515;jdSupportDarkMode/0;addressid/0;pv/1.9;apprpd/Home_Main;ref/JDMainPageViewController;psq/8;ads/;psn/58b78c48c17dc6ef7f35cc119e024d817d7b7719|1;jdv/0|;adk/;app_device/IOS;pap/JA2015_311210|9.3.5|IOS 14.3;Mozilla/5.0 (iPad; CPU OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", + "jdapp;android;9.3.4;10;8363736373630343332303639353-13D2338343732636262346435656;network/wifi;model/SEA-AL10;addressid/946167137;aid/16c340e71120b8d9;oaid/aefe73da-fbfe-277e-fee3-ffd7ffbb0285;osVer/29;appBuild/86388;psn/OYOIE1MXRxOYjm0CljxAFPV8ctWKTcRXnRFw4zvYk5M=|488;psq/1;adk/;ads/;pap/JA2015_311210|9.3.4|ANDROID 10;osv/10;pv/447.2;jdv/0|kong|t_1000089893_|tuiguang|af7f5b41a5fd4cf687ac1bd082a235a9|1610972386;ref/com.jingdong.app.mall.home.JDHomeFragment;partner/huawei;apprpd/Home_Main;eufv/1;jdSupportDarkMode/0;Mozilla/5.0 (Linux; Android 10; SEA-AL10 Build/HUAWEISEA-AL10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36", +] +/** + * 生成随机数字 + * @param {number} min 最小值(包含) + * @param {number} max 最大值(不包含) + */ +function randomNumber(min = 0, max = 100) { + return Math.min(Math.floor(min + Math.random() * (max - min)), max); +} +const USER_AGENT = USER_AGENTS[randomNumber(0, USER_AGENTS.length)]; + +module.exports = { + USER_AGENT +} diff --git a/app.js b/app.js deleted file mode 100644 index e4da561783..0000000000 --- a/app.js +++ /dev/null @@ -1,66 +0,0 @@ -// version v0.0.1 -// create by ruicky -// detail url: https://github.com/ruicky/jd_sign_bot - -const exec = require('child_process').execSync -const fs = require('fs') -const rp = require('request-promise') -const download = require('download') - -// 公共变量 -const KEY = process.env.JD_COOKIE -const serverJ = process.env.PUSH_KEY - -async function downFile () { - // const url = 'https://cdn.jsdelivr.net/gh/NobyDa/Script@master/JD-DailyBonus/JD_DailyBonus.js' - const url = 'https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js' - await download(url, './') -} - -async function changeFiele () { - let content = await fs.readFileSync('./JD_DailyBonus.js', 'utf8') - content = content.replace(/var Key = ''/, `var Key = '${KEY}'`) - await fs.writeFileSync( './JD_DailyBonus.js', content, 'utf8') -} - -async function sendNotify (text,desp) { - const options ={ - uri: `https://sc.ftqq.com/${serverJ}.send`, - form: { text, desp }, - json: true, - method: 'POST' - } - await rp.post(options).then(res=>{ - console.log(res) - }).catch((err)=>{ - console.log(err) - }) -} - -async function start() { - if (!KEY) { - console.log('请填写 key 后在继续') - return - } - // 下载最新代码 - await downFile(); - console.log('下载代码完毕') - // 替换变量 - await changeFiele(); - console.log('替换变量完毕') - // 执行 - await exec("node JD_DailyBonus.js >> result.txt"); - console.log('执行完毕') - - if (serverJ) { - const path = "./result.txt"; - let content = ""; - if (fs.existsSync(path)) { - content = fs.readFileSync(path, "utf8"); - } - await sendNotify("京东签到-" + new Date().toLocaleDateString(), content); - console.log('发送结果完毕') - } -} - -start() \ No newline at end of file diff --git a/cfz.js b/cfz.js new file mode 100644 index 0000000000..08b14c34d9 --- /dev/null +++ b/cfz.js @@ -0,0 +1,612 @@ +/* +软件名称:春风转 +更新时间:2021-03-11 @肥皂 +脚本说明:春风转 +脚本为自动阅读新闻 +每天三元上限? +脚本运行时间未知,我也不知道啥时候能跑完 +每日任务我慢慢添加,暂时没加入 + + +下载地址 + +https://ss.tblk.me/Cpwav + +二维码地址 https://raw.githubusercontent.com/age174/-/main/9DE99CAF-DF19-4F86-94A9-D9112BB77A2B.jpeg + +本脚本以学习为主! +使用方法: +打开春风转,点击文章赚钱,下拉刷新一下,获得阅读数据 + +3.12更新,修改缩小分页的随机数范围,加入部分每日任务和时段奖励,修改为每次运行十次,每日的阅读次数上限是200次,所以每天跑二十次就行了,请避开高峰期运行脚本,错开脚本的运行时间,不要cron都设置的一样 +比如可以设置为 15,45 10-21 * * * 15和45可以自己修改,自己计算二十次的运行时间来设置cron最好 + +TG电报群: https://t.me/hahaha8028 + +boxjs地址 : + +https://raw.githubusercontent.com/age174/-/main/feizao.box.json + + +春风转 +圈X配置如下,其他软件自行测试,定时可以多设置几次,没任务会停止运行的 +[task_local] +#春风转 +15,45 10-21 * * * https://raw.githubusercontent.com/age174/-/main/cfz.js, tag=春风转, img-url=https://ae01.alicdn.com/kf/U8a3a2572bf5d4584928d1d7cde52b50ba.jpg, enabled=true + + +[rewrite_local] +#春风转 +http://cf-api.douzhuanapi.cn:10002/api/ url script-request-header https://raw.githubusercontent.com/age174/-/main/cfz.js + + + +#loon +http://cf-api.douzhuanapi.cn:10002/api/ script-path=https://raw.githubusercontent.com/age174/-/main/cfz.js, requires-header=true, timeout=10, tag=春风转 + + + +#surge + +春风转 = type=http-request,pattern=http://cf-api.douzhuanapi.cn:10002/api/,requires-header=1,max-size=0,script-path=https://raw.githubusercontent.com/age174/-/main/cfz.js,script-update-interval=0 + + +[MITM] +hostname = cf-api.douzhuanapi.cn + + +*/ + + +const $ = new Env('春风转'); +let status; +status = (status = ($.getval("cfzstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 +const cfzurlArr = ['http://cf-api.douzhuanapi.cn:10002/api/article/list?city_type=1&page=2&slide=1&tag_id=0&type=1','http://cf-api.douzhuanapi.cn:10002/api/article/list?city_type=1&page=1&slide=1&tag_id=3&type=1'], +cfzhdArr = ['{"Connection":"keep-alive","Accept-Encoding":"gzip, deflate","X-V":"1","osType":"iOS","User-Agent":"NormalDemo/1 (iPad; iOS 14.4; Scale/2.00)","platform":"iOS","Authorization":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI2MDQ5NzczYjE0Y2FlIiwiaWF0IjoxNjE1NDI3Mzg3LCJuYmYiOjE2MTU0MjczODcsImV4cCI6MTYxODAxOTM4NywidWlkIjoxMjEyMjEyLCJuYW1lIjoiXHU1ZmQ4XHU1ZmU3IiwiY3JlYXRlZF9hdCI6IjIwMjEtMDMtMTEgMDk6NDk6NDciLCJjaXR5X25hbWUiOm51bGwsImNpdHlfY29kZSI6bnVsbH0.W7Ab9_3QvZy03TRFBrdIBgnF-aVQCMCxDMl8jJWuTl8","X-IMEI":"F4F363C3-B217-451B-A49F-CB5633572CDB","versioncode":"1","Host":"cf-api.douzhuanapi.cn:10002","phoneModel":"iPad7,5","Accept-Language":"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8","Accept":"*/*","X-CCMS":"SXBJamdka2pnZC5kbHBhcGw="}','{"Connection":"keep-alive","Accept-Encoding":"gzip, deflate","X-V":"1","osType":"iOS","User-Agent":"NormalDemo/1 (iPad; iOS 14.4; Scale/2.00)","platform":"iOS","Authorization":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI2MDRhYWE4MzcyNTQyIiwiaWF0IjoxNjE1NTA2MDUxLCJuYmYiOjE2MTU1MDYwNTEsImV4cCI6MTYxODA5ODA1MSwidWlkIjoxMjEzNTI2LCJuYW1lIjoiXHU1M2U0XHU2MjE2XHU0ZWNhIiwiY3JlYXRlZF9hdCI6IjIwMjEtMDMtMTIgMDc6NDA6NTEiLCJjaXR5X25hbWUiOm51bGwsImNpdHlfY29kZSI6bnVsbH0.JwSL8ZPrdrnGIPO915KPNo-cnC3U3XMDHZ42k0uu1UU","X-IMEI":"F4F363C3-B217-451B-A49F-CB5633572CDB","versioncode":"1","Host":"cf-api.douzhuanapi.cn:10002","phoneModel":"iPad7,5","Accept-Language":"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8","Accept":"*/*","X-CCMS":"SXBJamphcElqeS5na3RJZ2E="}'], +cfzsbhdArr = [] +let concurrency = ($.getval('cfzConcurrency') || '2') - 0; // 并发执行任务的账号数,默单账号循环执行 +concurrency = concurrency < 1 ? 1 : concurrency; +let sdid = '';sdlqid = '';tc = 0 +!(async () => { + if (typeof $request !== "undefined") { + await cfzck() + + } else { + let cfzcount = ($.getval('cfzcount') || '2'); + let execAcList = []; + let slot = cfzhdArr.length % concurrency == 0 ? cfzhdArr.length / concurrency : parseInt(cfzhdArr.length / concurrency) + 1; + cfzhdArr.forEach((o, i) => { + if(o){ + let idx = i % slot; + if (execAcList[idx]) { + execAcList[idx].push({no: i + 1, cfzhd: o, cfzsbhd: cfzsbhdArr[i], cfzid: ''}); + } else { + execAcList[idx] = [{no: i + 1, cfzhd: o, cfzsbhd: cfzsbhdArr[i], cfzid: ''}]; + } + } + }); + $.log(`----------- 共${cfzhdArr.length}个账号分${execAcList.length}组去执行 -----------`); + for (let arr of execAcList) { + let allAc = arr.map(ac => ac.no).join(', '); + $.log(`\n=======================================\n开始【${$.name}账号:${allAc}】`); + await Promise.all(arr.map((ac, i) => execTask(ac, i))); + } + } + +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + +function execTask(ac, i) { + return new Promise(async resolve => { + try { + await $.wait(i * 500) + for (let i = 0; i < 10; i++) { + if(tc == 1){ + return; +} + $.log(`春风转开始执行循环阅读,本次共执行10次,已执行${i+1}次`) + await cfzqd(ac) + await $.wait(31000) + } +await cfzrw1(ac) +await $.wait(1000) +await cfzrw2(ac) +await $.wait(1000) +await cfzrw3(ac) +await $.wait(1000) +await cfzrw4(ac) +await $.wait(1000) +await cfzsdid(ac) + } catch (e) { + $.logErr(`账号${ac.no} 循环执行任务出现异常: ${e}`) + } finally { + resolve() + } + }) +} + +//春风转数据获取 +function cfzck() { + if ($request.url.indexOf("list?city_type") > -1) { + const cfzurl = $request.url + if(cfzurl) $.setdata(cfzurl,`cfzurl${status}`) + $.log(cfzurl) + const cfzhd = JSON.stringify($request.headers) + if(cfzhd) $.setdata(cfzhd,`cfzhd${status}`) +$.log(cfzhd) + $.msg($.name,"",'春风转'+`${status}` +'阅读数据获取成功!') + } +} + + +//春风转阅读 +function cfzyd(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/self_read_report?item_id='+ac.cfzid, + headers : JSON.parse(ac.cfzhd), + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + console.log('\n春风转[领取阅读奖励]回执:成功🌝 \n获得奖励: '+result.data.amount+'金币,等待30秒继续领取') + await cfzsb(ac); + + +} else { + if(result.message == '您的自阅已超过次数'){ + tc =1 +} +if(result.message=='系统错误!'){ +console.log('\n春风转[领取阅读奖励]回执:失败🌚'+result.message+'\n恭喜您,您的账号黑了,尝试上报数据修复,提示上报数据成功请关闭脚本等待一分钟再次运行试试') +await cfzxf(ac); +}else{ + +console.log('\n春风转[领取阅读奖励]回执:失败🌚'+result.message+'脚本已停止运行') +} + + +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} + +//春风转上报数据 +function cfzsb(ac, timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/self_read_init?item_id='+ac.cfzid, + headers : JSON.parse(ac.cfzhd), + + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + //console.log('\n春风转[数据上报]回执:成功🌝'+result.message) +await cfztj(ac) +} else { +console.log('\n春风转[上报数据]回执:失败🌚'+result.message) + +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} + +//春风转上报提交数据 +function cfztj(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/ad_sense/report', + headers : JSON.parse(ac.cfzhd), + body : 'ad_source=1&location=3&position=8&report_type=1', + + } + $.post(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + console.log('\n春风转[数据上报]回执:成功🌝'+result.data) +} else { +console.log('\n春风转[上报数据]回执:失败🌚'+result.message) + +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} + + +//春风转修复系统错误 +function cfzxf(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/ad_sense/report', + headers : JSON.parse(ac.cfzhd), + body : 'ad_source=1&location=3&position=8&report_type=1', + + } + $.post(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + console.log('\n春风转[数据上报]回执:成功🌝'+result.data) +} else { +console.log('\n春风转[上报数据]回执:失败🌚'+result.message) + +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} +//春风转列表 +function cfzqd(ac, timeout = 0) { + return new Promise((resolve) => { + setTimeout(() => { + let sjs = Math.floor(Math.random() * 100); //生成随机数 +let sj = Math.floor(Math.random() * 100); //生成随机数 + let url = { + url: 'http://cf-api.douzhuanapi.cn:10002/api/article/list?city_type=1&page=' + sjs + '&slide=' + sj + '&tag_id=0&type=1', + headers: JSON.parse(ac.cfzhd) + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if (result.code == 200) { + let list = (result.data && result.data.list) || [] + if (list.length > 0) { + ac.cfzid = list[0].id + console.log('\n春风转[阅读列表]回执:成功🌝 \n📄阅读ID:' + ac.cfzid + '\n📑开始阅读:' + list[0].title) + await $.wait(500); + await cfzyd(ac); + } else { + console.log('春风转[阅读列表]回执:失败🚫 无文章数据') + } + } else { + console.log('春风转[阅读列表]回执:失败🚫 ' + result.message) + } + } + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + }) + }, timeout) + }) +} + +//春风转每日任务阅读新闻 +function cfzrw1(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/get_red_task_gold?id=13', + headers : JSON.parse(ac.cfzhd), + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + console.log('\n春风转[每日任务阅读新闻]回执:成功🌝 \n获得奖励: '+result.data.amount) + +} else { + +console.log('\n春风转[每日任务阅读新闻]回执:失败🌚'+result.message) +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} +//春风转每日任务阅读60分钟 +function cfzrw2(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/get_red_task_gold?id=14', + headers : JSON.parse(ac.cfzhd), + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + console.log('\n春风转[每日任务阅读60分钟]回执:成功🌝 \n获得奖励: '+result.data.amount) + + +} else { + +console.log('\n春风转[每日任务阅读60分钟]回执:失败🌚'+result.message) +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} + +//春风转每日任务福利视频 +function cfzrw3(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/get_red_task_gold?id=15', + headers : JSON.parse(ac.cfzhd), + + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + console.log('\n春风转[每日任务福利视频]回执:成功🌝 \n获得奖励: '+result.data.amount) + + +} else { + +if(result.message =='该任务您还未完成'){ +console.log('\n春风转[每日任务福利视频]回执:失败🌚'+result.message) +for (let i = 0; i < 3; i++) { + + $.log(`春风转开始执行观看福利视频,本次共执行3次,已执行${i+1}次`) + await cfzrwsp(ac) + } +}else{console.log('\n春风转[每日任务福利视频]回执:失败🌚'+result.message)} + +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} + +//春风转每日任务晒图奖励 +function cfzrw4(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/get_red_task_gold?id=5', + headers : JSON.parse(ac.cfzhd), + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + console.log('\n春风转[每日任务晒图奖励]回执:成功🌝 \n获得奖励: '+result.data.amount) + + +} else { + +if(result.message =='该任务您还未完成'){ +console.log('\n春风转[每日任务晒图奖励]回执:失败🌚'+result.message) +for (let i = 0; i < 3; i++) { + + $.log(`春风转开始执行观看福利视频,本次共执行3次,已执行${i+1}次`) + await cfzrwst(ac) + } +}else{console.log('\n春风转[每日任务晒图奖励]回执:失败🌚'+result.message)} + +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} + + +//春风转每日任务看视频 +function cfzrwsp(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/red_task_report?item_id=15&task_type=2', + headers : JSON.parse(ac.cfzhd), + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + console.log('\n春风转[看广告视频]回执:成功🌝 \n获得奖励: '+result.data) + + +} else { + +console.log('\n春风转[看广告视频]回执:失败🌚'+result.message) +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} + +//春风转每日任务晒图 +function cfzrwst(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/red_task_report?item_id=5&task_type=5', + headers : JSON.parse(ac.cfzhd), + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + console.log('\n春风转[晒图奖励]回执:成功🌝 \n获得奖励: '+result.data) + + +} else { + +console.log('\n春风转[晒图奖励]回执:失败🌚'+result.message) +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} + +//春风转每时段id +function cfzsdid(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/treasure_box_opt', + headers : JSON.parse(ac.cfzhd), + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + sdid = result.data.treasureBox_id + console.log('\n春风转[时段ID]回执:成功🌝 \n时段ID: '+sdid) + await cfzsdlq(ac); + +} else { + +console.log('\n春风转[时段ID]回执:失败🌚'+result.message) +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} +//时段领取 +function cfzsdlq(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/treasure_box_gain?treasure_box_id='+sdid+'&type=1', + headers : JSON.parse(ac.cfzhd), + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + sdlqid = result.data.gold_gain_id + console.log('\n春风转[时段领取]回执:成功🌝 \n时段ID: '+result.data.gold_amount) + await cfzsdfb(ac); + +} else { + +console.log('\n春风转[时段领取]回执:失败🌚'+result.message) +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} +//时段翻倍领取 +function cfzsdfb(ac,timeout = 0) { + return new Promise((resolve) => { +let url = { + url : 'http://cf-api.douzhuanapi.cn:10002/api/treasure_box_gain?gold_gain_id='+sdlqid+'&treasure_box_id='+sdid+'&type=2', + headers : JSON.parse(ac.cfzhd), + } + $.get(url, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if(result.code == 200){ + console.log('\n春风转[时段翻倍]回执:成功🌝 \n时段ID: '+result.data.gold_amount) + +} else { + +console.log('\n春风转[时段翻倍]回执:失败🌚'+result.message) +} +} + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${url.url}\n${e}\ndata: ${resp && resp.body}`); + } finally { + resolve() + } + },timeout) + }) +} + +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)} diff --git a/fqkk.js b/fqkk.js new file mode 100644 index 0000000000..e0c4627d2b --- /dev/null +++ b/fqkk.js @@ -0,0 +1,398 @@ +/* +软件名称:番茄看看 微信扫描二维码打开 +更新时间:2021-03-05 @肥皂 +脚本说明:番茄看看自动阅读 +脚本为自动完成番茄看看的阅读任务 +每日收益2.7元左右,可多号撸。提现秒到 + +任务打开二维码地址 https://raw.githubusercontent.com/age174/-/main/3F545C70-389B-4155-ACB1-15B6FDA95501.jpeg + +可以去boxjs修改自动提现金额 +最低提现额度为0.3元,默认提现1元 + +本脚本以学习为主! +首次运行脚本,会提示获取数据 +去番茄看看,点击阅读A任务,开始阅读, +完成一次阅读即可获取数据。 + +TG电报群: https://t.me/hahaha8028 + +我的邀请码 : 3950781 感谢大佬们填写 + + +注意:如果重定向跳转失败或者跑脚本没有key没有提交成功,请手动去做一个阅读A任务再执行脚本。 + +2.24更新 运行日志加入boxjs设置的循环次数和提现金额,key提交因为有很多302重定向,如跑脚本没有金币请查看日志的重定向是否错误 +已修改循环方式,方式循环方式为一直阅读,直到当前无任务可做自动停止 + +2.27修复番茄看看因跟换域名无法获取数据的问题,自行更换重写和mitm +3.2增加剩余阅读次数查询 +3.5番茄看看更新,优化为不指定账号抓包方便羊毛党等多账号;以前抓到的数据可以迁移一次,通过boxjs设置跑一次脚本就可以 ,现在番茄看看可以并发执行了,简而言之就是多账号不需要一个账号跑完再去跑下一个账号,而是多个账号同时跑任务了,需要并发几个账号就去boxjs修改数值就可以了 + +感谢@ztxtop大佬pr + +boxjs地址 : + +https://raw.githubusercontent.com/age174/-/main/feizao.box.json + + +番茄看看 +圈X配置如下,其他软件自行测试 +[task_local] +#番茄看看 +15 12,14,16,20 * * * https://raw.githubusercontent.com/age174/-/main/fqkk.js, tag=番茄看看, img-url=https://ftp.bmp.ovh/imgs/2021/02/f8306006536eb49c.jpeg, enabled=true + + +[rewrite_local] +#番茄看看 +^http://m.*./reada/getTask url script-request-header https://raw.githubusercontent.com/age174/-/main/fqkk.js + + + +#loon +^http://m.*./reada/getTask script-path=https://raw.githubusercontent.com/age174/-/main/fqkk.js, requires-header=true, timeout=10, tag=番茄看看 + + + +#surge + +番茄看看 = type=http-request,pattern=^http://m.*./reada/getTask,requires-header=1,max-size=0,script-path=https://raw.githubusercontent.com/age174/-/main/fqkk.js,script-update-interval=0 + + + + +[MITM] +hostname = m.* + + +*/ + + +const $ = new Env('番茄看看'); +const fqkkurlArr = [], fqkkhdArr = [] +let fqkk = $.getjson('fqkk', []) +let fqkkBanfirstTask = $.getval('fqkkBanfirstTask') || 'false' // 禁止脚本执行首个任务,避免每日脚本跑首次任务导致微信限制 +let fqkkCkMoveFlag = $.getval('fqkkCkMove') || '' +let fqtx = ($.getval('fqtx') || '100'); // 此处修改提现金额,0.3元等于30,默认为提现一元,也就是100 +let concurrency = ($.getval('fqkkConcurrency') || '1') - 0; // 并发执行任务的账号数,默单账号循环执行 +concurrency = concurrency < 1 ? 1 : concurrency; +let fqkktz = '' +!(async () => { + if (typeof $request !== "undefined") { + await fqkkck(); + } else if (fqkkCkMoveFlag == 'true') { + await fqkkCkMove(); + } else { + let acList = fqkk.filter(o => o.hd).map((o, i) => ({no: i+1, uid: o.uid, gold: 0, score: 0, rest: 0, num: 0, url: o.url, headers: JSON.parse(o.hd)})); + let execAcList = []; + let slot = acList.length % concurrency == 0 ? acList.length / concurrency : parseInt(acList.length / concurrency) + 1; + acList.forEach((o, i) => { + let idx = i % slot; + if (execAcList[idx]) { + execAcList[idx].push(o); + } else { + execAcList[idx] = [o]; + } + }); + $.log(`番茄看看当前设置的提现金额为: ${fqtx / 100} 元`, `----------- 共${acList.length}个账号分${execAcList.length}组去执行 -----------`); + for (let arr of execAcList) { + let allAc = arr.map(ac=>ac.no).join(', '); + $.log(`\n=======================================\n开始【${$.name}账号:${allAc}】`); + let rtList = await Promise.all(arr.map((ac, i) => execTask(ac, i))); + for (let ac of rtList) { + let msg = ''; + if (ac.uid && ac.gold >= fqtx) { + $.log(`检测到账号${ac.no}已满足设置的提现金额,前去执行提现任务\n`) + msg = await fqkktx(ac); + } + ac.msg = msg; + } + fqkktz += rtList.map(ac => `\n【账号${ac.no}】\n余额:${ac.gold}币\n今日奖励:${ac.score}\n已阅读数:${ac.num}\n待阅读数:${ac.rest}${ac.msg?'\n'+ac.msg:''}`).join('\n'); + } + $.log('\n======== [脚本运行完毕,打印日志结果] ========\n'+fqkktz) } +})() +.catch((e) => $.logErr(e)) + .finally(() => $.done()); + +function execTask(ac, i) { + return new Promise(resolve => { + setTimeout(async () => { + try { + let msg = await fqkk3(ac, ''); + if (ac.rest) { + let skip = false; +if(fqkkBanfirstTask == 'true' && ac.num <= 0){ + skip = true; +} + if (ac.rest <= 0 || skip) { + $.log(`账号${ac.no}今日已阅读${ac.num}次,本阶段待阅读${ac.rest}次,跳过阅读,\n您已开启了限制脚本首次阅读,请前去扫码手动阅读一次,如需关闭该功能请前往Boxjs关闭限制脚本跑每日首次任务`); + } else { + $.log(`账号${ac.no}今日已阅读${ac.num}次,本阶段待阅读${ac.rest}次,开始阅读\n`); + let flag = 0; + let count = 1; + let allowErrorCount = 3; + do { + let [f, m] = await fqkk1(ac, count++); + flag = f; + msg = m; + if (flag > 0) { + $.log(`🌝账号${ac.no}在本阶段还有${ac.rest}次阅读待执行,立即阅读\n`); + } else if (flag < 0) { + allowErrorCount--; + } else { + $.log(`🌝账号${ac.no}在本阶段待阅读任务已完成:\n${msg}`); + } + } while (flag && allowErrorCount); + } + } else { + $.log(`账号${ac.no}今日已阅读${ac.num}次,本阶段还有${ac.rest}次待阅读:\n${msg}`); + } + let host = ac.url.match(/http?:\/\/(.+?)\//)[1]; + let ck = ac.headers['Cookie'] || ac.headers['cookie']; + let [userId, gold] = await userInfo(host, ck); + ac.gold = gold; + } catch (e) { + $.logErr(e, `账号${ac.no} 循环执行任务出现异常`); + } finally{ + resolve(ac); + } + }, i * 500); + }) +} + +//番茄看看数据获取 +async function fqkkck() { + if ($request.url.indexOf("getTask") > -1) { + const fqkkurl = $request.url; + const fqkkhd = JSON.stringify($request.headers); + let host = fqkkurl.match(/http?:\/\/(.+?)\//)[1]; + let ck = $request.headers['Cookie'] || $request.headers['cookie']; + let [userId, gold] = await userInfo(host, ck); + if (userId) { + // 获取到用户ID,记录 + let status = 1; + let no = fqkk.length; + for (let i = 0, len = no; i < len; i++) { + let ac = fqkk[i] || {}; + if (ac.uid) { + if (ac.uid == userId) { + no = i; + status = 0; + break; + } + } else if (no == len) { + no = i; + } + } + fqkk[no] = {uid: userId, url: fqkkurl, hd: fqkkhd}; + $.setdata(JSON.stringify(fqkk, null, 2), 'fqkk'); + $.log(fqkkhd) + $.log(fqkkurl) + $.msg($.name, "", `番茄看看[账号${no+1}] ${status?'新增':'更新'}数据成功!`); + } else { + // 未获取到用户ID,提示 + $.msg($.name, "", '番茄看看用户ID获取失败⚠️'); + } + } +} + +async function fqkkCkMove() { + let fqkkcount = ($.getval('fqkkcount') || '0') - 0; + for (let i = 1; i <= fqkkcount; i++) { + fqkkurlArr.push($.getdata(`fqkkurl${i>1?i:''}`)) + fqkkhdArr.push($.getdata(`fqkkhd${i>1?i:''}`)) + } + if (fqkkhdArr.length > 0) { + let existsId = fqkk.map(o => o.uid - 0); + for (let i = 0, len = fqkkhdArr.length; i < len; i++) { + fqkkurl = fqkkurlArr[i]; + fqkkhd = fqkkhdArr[i]; + if(!fqkkurl || !fqkkhd){ + continue; +} + let host = fqkkurl.match(/http?:\/\/(.+?)\//)[1]; + let hd = JSON.parse(fqkkhd); + let ck = hd['Cookie'] || hd['cookie'] + let [userId, gold] = await userInfo(host, ck); + if (userId && !existsId.includes(userId)) { + fqkk.push({uid: userId, url: fqkkurl,hd: fqkkhd}); + existsId.push(userId); + } + } + $.setdata(JSON.stringify(fqkk, null, 2), 'fqkk'); + $.msg($.name, "", `番茄看看数据迁移后共${fqkk.length}个账号!`); + } + $.setval('', 'fqkkCkMove'); +} + +function userInfo(host, ck) { + return new Promise((resolve) => { + let opts = { + url: `http://${host}/user/`, + headers: { + Cookie: ck + } + } + $.get(opts, async (err, resp, data) => { + let userId = 0; + let gold = -1; + try { + if (err) { + $.logErr(`❌ 用户信息API请求失败,清检查网络设置 \n ${JSON.stringify(err)}`) + } else { + userId = (data.match(/\[用户ID:(\d+?)\]/) || ['', '0'])[1] - 0; + if (userId) { + gold = (data.match(/余额.+?([\d\.]+?)币/) || ['', '0'])[1] - 0; + } + } + } catch (e) { + $.log(`=================\nurl: ${opts.url}\ndata: ${resp && resp.body}`); + $.logErr(e, resp); + } finally { + resolve([userId, gold]) + } + }) + }) +} + +//番茄看看领取 +function fqkk3(ac, fqkey) { + return new Promise(resolve => { + let opts = { + url: ac.url.replace('getTask', 'finishTask'), + headers: ac.headers, + body: `readLastKey=${fqkey||''}`, + } + $.post(opts, (err, resp, data) => { + let msg = '未知问题'; + try { + if (err) { + $.log(`${$.name} ${ac.no} 请求失败,请检查网路重试\n url: ${opts.url} \n data: ${JSON.stringify(err, null, 2)}`); + } else { + const result = JSON.parse(data); + if (result.data && result.data.infoView) { + ac.rest = (result.data.infoView.rest || 0) - 0; + ac.num = (result.data.infoView.num || 0) - 0; + ac.score = (result.data.infoView.score || 0) - 0; + msg = ac.rest > 0 ? '-' : (result.data.infoView.msg || result.msg || msg); + } else { + msg = result.msg || msg; + } + if (fqkey) { + if (result.code == 0) { + $.log(`🌝账号${ac.no}:${result.msg}`, `今日阅读次数: ${result.data.infoView.num}, 今日阅读奖励: ${result.data.infoView.score}`); + } else { + ac.rest = -1; + $.log(`🚫账号${ac.no}:${result.msg}`, `今日阅读次数: ${result.data.infoView.num}, 今日阅读奖励: ${result.data.infoView.score}`, `resp: ${JSON.stringify(resp||'', null, 2)}`); + } + } + } + if (msg == '未知问题') { + msg += `: ${data}` + } + } catch (e) { + $.log(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\ndata: ${resp && resp.body}`); + $.logErr(e, resp); + } finally { + resolve(msg) + } + }) + }) +} + +function fqkk2(ac, fqkey) { + return new Promise((resolve) => { + let opts = { + url: ac.url.replace('getTask', `jump?key=${fqkey}`), + headers: ac.headers + }; + $.get(opts, (err, resp, data) => { + let rtObj = ''; + try { + if (err) { + $.log(`${$.name} ${ac.no} 请求失败,请检查网路重试\n url: ${opts.url} \n data: ${JSON.stringify(err, null, 2)}`); + } else { + rtObj = $.toObj(data, {}); + } + } catch (e) { + $.log(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\ndata: ${resp && resp.body}`); + $.logErr(e, resp); + } finally { + resolve(rtObj) + } + }) + }) +} + +//番茄看看key +function fqkk1(ac, fqjs, timeout = 0) { + return new Promise((resolve) => { + setTimeout(() => { + let opts = { + url: ac.url, + headers: ac.headers, + body: '', + } + $.post(opts, async (err, resp, data) => { + let f = -1; + let m = ''; + try { + const result = JSON.parse(data) + if (result.code == 0 && result.data && result.data.jkey) { + $.log(`🌝账号${ac.no}获取key回执成功,开始第${fqjs}次跳转阅读📖`); + let jumpObj = await fqkk2(ac, result.data.jkey); + if (jumpObj) { + $.log(`🌝账号${ac.no}等待10秒后提交本次阅读领取奖励`); + await $.wait(10000); + m = await fqkk3(ac, result.data.jkey); + f = ac.rest; + } else { + $.log(`🌝账号${ac.no}jump接口请求失败,重新执行阅读任务`); + } + } else { + f = 0; + $.log(`🚫账号${ac.no}获取key回执失败:${result.msg}`); + } + } catch (e) { + $.log(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\ndata: ${resp && resp.body}`); + // $.logErr(e, resp); + } finally { + resolve([f, m]); + } + }) + }, timeout) + }) +} + +//提现 +function fqkktx(ac) { + return new Promise((resolve) => { + let opts = { + url: ac.url.match(/^(https?:\/\/.+?)\//)[1] + '/withdrawal/doWithdraw', + headers: ac.headers, + body: `amount=${fqtx}` + } + $.post(opts, async (err, resp, data) => { + let msg = ''; + try { + const result = JSON.parse(data) + if (result.code == 0) { + msg = `提现成功🌝\n`; + $.msg(`番茄看看账号 ${ac.no}`,'','成功提现至微信: '+fqtx / 100 +' 元') + } else { + msg = `提现失败🚫: ${result.msg}\n\n`; + $.msg(`番茄看看账号 ${ac.no}`,'',`提现失败🚫: ${result.msg}`) + } + } catch (e) { + $.log(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\ndata: ${resp && resp.body}`); + $.logErr(e, resp); + msg = `提现异常:${e}`; + } finally { + resolve(msg) + } + }) + }) +} + + +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)} diff --git a/jdCookie.js b/jdCookie.js new file mode 100644 index 0000000000..4eb2bb76f0 --- /dev/null +++ b/jdCookie.js @@ -0,0 +1,33 @@ +/* +此文件为Node.js专用。其他用户请忽略 + */ +//此处填写京东账号cookie。 +//注:github action用户cookie填写到Settings-Secrets里面,新增JD_COOKIE,多个账号的cookie使用`&`隔开或者换行 +let CookieJDs = [ + '',//账号一ck,例:pt_key=XXX;pt_pin=XXX; + '',//账号二ck,例:pt_key=XXX;pt_pin=XXX;如有更多,依次类推 +] +// 判断github action里面是否有京东ck +if (process.env.JD_COOKIE) { + if (process.env.JD_COOKIE.indexOf('&') > -1) { + console.log(`您的cookie选择的是用&隔开\n`) + CookieJDs = process.env.JD_COOKIE.split('&'); + } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { + console.log(`您的cookie选择的是用换行隔开\n`) + CookieJDs = process.env.JD_COOKIE.split('\n'); + } else if (process.env.JD_COOKIE.indexOf('\\n') > -1) { + //环境变量兼容腾讯云和docker下\n会被转义成\\n + console.log(`您的cookie选择的是用换行隔开\\n`) + CookieJDs = process.env.JD_COOKIE.split('\\n'); + } else { + CookieJDs = [process.env.JD_COOKIE]; + } + CookieJDs = [...new Set(CookieJDs)] + console.log(`\n====================共有${CookieJDs.length}个京东账号Cookie=========\n`); + console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()}=====================\n`) + // console.log(`\n==================脚本执行来自 github action=====================\n`) +} +for (let i = 0; i < CookieJDs.length; i++) { + const index = (i + 1 === 1) ? '' : (i + 1); + exports['CookieJD' + index] = CookieJDs[i]; +} diff --git a/jdDreamFactoryShareCodes.js b/jdDreamFactoryShareCodes.js new file mode 100644 index 0000000000..8092924b04 --- /dev/null +++ b/jdDreamFactoryShareCodes.js @@ -0,0 +1,31 @@ +/* +京喜工厂互助码 +此文件为Node.js专用。其他用户请忽略 +支持京东N个账号 + */ +//云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。 +// github action用户的好友互助码填写到Action->Settings->Secrets->new Secret里面(Name填写 DREAM_FACTORY_SHARE_CODES(此处的Name必须按此来写,不能随意更改),内容处填写互助码,填写规则如下) +// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 +// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 +let shareCodes = [ + 'V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k=@Bo-jnVs_m9uBvbRzraXcSA==@-OvElMzqeyeGBWazWYjI1Q==',//账号一的好友shareCode,不同好友中间用@符号隔开 + '1uzRU5HkaUgvy0AB5Q9VUg==@PDPM257r_KuQhil2Y7koNw==@-OvElMzqeyeGBWazWYjI1Q==',//账号二的好友shareCode,不同好友中间用@符号隔开 +] +// 判断github action里面是否有京喜工厂互助码 +if (process.env.DREAM_FACTORY_SHARE_CODES) { + if (process.env.DREAM_FACTORY_SHARE_CODES.indexOf('&') > -1) { + console.log(`您的互助码选择的是用&隔开\n`) + shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split('&'); + } else if (process.env.DREAM_FACTORY_SHARE_CODES.indexOf('\n') > -1) { + console.log(`您的互助码选择的是用换行隔开\n`) + shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split('\n'); + } else { + shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split(); + } +} else if (process.env.DREAM_FACTORY_SHARE_CODES) { + console.log(`由于您secret里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`) +} +for (let i = 0; i < shareCodes.length; i++) { + const index = (i + 1 === 1) ? '' : (i + 1); + exports['shareCodes' + index] = shareCodes[i]; +} diff --git a/jdFruitShareCodes.js b/jdFruitShareCodes.js new file mode 100644 index 0000000000..d06c92d1d5 --- /dev/null +++ b/jdFruitShareCodes.js @@ -0,0 +1,31 @@ +/* +东东农场互助码 +此文件为Node.js专用。其他用户请忽略 +支持京东N个账号 + */ +//云服务器腾讯云函数等NOde.js用户在此处填写京东东农场的好友码。 +// github action用户的好友互助码填写到Action->Settings->Secrets->new Secret里面(Name填写 FruitShareCodes(此处的Name必须按此来写,不能随意更改),内容处填写互助码,填写规则如下) +// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 +// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 +let FruitShareCodes = [ + '0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a',//账号一的好友shareCode,不同好友中间用@符号隔开 + '6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3',//账号二的好友shareCode,不同好友中间用@符号隔开 +] +// 判断github action里面是否有东东农场互助码 +if (process.env.FRUITSHARECODES) { + if (process.env.FRUITSHARECODES.indexOf('&') > -1) { + console.log(`您的东东农场互助码选择的是用&隔开\n`) + FruitShareCodes = process.env.FRUITSHARECODES.split('&'); + } else if (process.env.FRUITSHARECODES.indexOf('\n') > -1) { + console.log(`您的东东农场互助码选择的是用换行隔开\n`) + FruitShareCodes = process.env.FRUITSHARECODES.split('\n'); + } else { + FruitShareCodes = process.env.FRUITSHARECODES.split(); + } +} else if (process.env.JD_COOKIE) { + console.log(`由于您secret里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`) +} +for (let i = 0; i < FruitShareCodes.length; i++) { + const index = (i + 1 === 1) ? '' : (i + 1); + exports['FruitShareCode' + index] = FruitShareCodes[i]; +} diff --git a/jdPetShareCodes.js b/jdPetShareCodes.js new file mode 100644 index 0000000000..d9421d0a0c --- /dev/null +++ b/jdPetShareCodes.js @@ -0,0 +1,31 @@ +/* +东东萌宠互助码 +此文件为Node.js专用。其他用户请忽略 +支持京东N个账号 + */ +//云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。 +// github action用户的好友互助码填写到Action->Settings->Secrets->new Secret里面(Name填写 PetShareCodes(此处的Name必须按此来写,不能随意更改),内容处填写互助码,填写规则如下) +// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 +// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 +let PetShareCodes = [ + 'MTAxODc2NTEzNTAwMDAwMDAwMjg3MDg2MA==@MTAxODc2NTEzMzAwMDAwMDAyNzUwMDA4MQ==@MTAxODc2NTEzMjAwMDAwMDAzMDI3MTMyOQ==@MTAxODc2NTEzNDAwMDAwMDAzMDI2MDI4MQ==',//账号一的好友shareCode,不同好友中间用@符号隔开 + 'MTAxODc2NTEzMjAwMDAwMDAzMDI3MTMyOQ==@MTAxODcxOTI2NTAwMDAwMDAyNjA4ODQyMQ==@MTAxODc2NTEzOTAwMDAwMDAyNzE2MDY2NQ==',//账号二的好友shareCode,不同好友中间用@符号隔开 +] +// 判断github action里面是否有东东萌宠互助码 +if (process.env.PETSHARECODES) { + if (process.env.PETSHARECODES.indexOf('&') > -1) { + console.log(`您的东东萌宠互助码选择的是用&隔开\n`) + PetShareCodes = process.env.PETSHARECODES.split('&'); + } else if (process.env.PETSHARECODES.indexOf('\n') > -1) { + console.log(`您的东东萌宠互助码选择的是用换行隔开\n`) + PetShareCodes = process.env.PETSHARECODES.split('\n'); + } else { + PetShareCodes = process.env.PETSHARECODES.split(); + } +} else if (process.env.JD_COOKIE) { + console.log(`由于您secret里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`) +} +for (let i = 0; i < PetShareCodes.length; i++) { + const index = (i + 1 === 1) ? '' : (i + 1); + exports['PetShareCode' + index] = PetShareCodes[i]; +} diff --git a/jdPlantBeanShareCodes.js b/jdPlantBeanShareCodes.js new file mode 100644 index 0000000000..faba2b6b7f --- /dev/null +++ b/jdPlantBeanShareCodes.js @@ -0,0 +1,31 @@ +/* +京东种豆得豆互助码 +此文件为Node.js专用。其他用户请忽略 +支持京东N个账号 + */ +//云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。 +// github action用户的好友互助码填写到Action->Settings->Secrets->new Secret里面(Name填写 PLANT_BEAN_SHARECODES(此处的Name必须按此来写,不能随意更改),内容处填写互助码,填写规则如下) +// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 +// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 +let PlantBeanShareCodes = [ + '66j4yt3ebl5ierjljoszp7e4izzbzaqhi5k2unz2afwlyqsgnasq@olmijoxgmjutyrsovl2xalt2tbtfmg6sqldcb3q@e7lhibzb3zek27amgsvywffxx7hxgtzstrk2lba@olmijoxgmjutyx55upqaqxrblt7f3h26dgj2riy',//账号一的好友shareCode,不同好友中间用@符号隔开 + '4npkonnsy7xi3p6pjfxg6ct5gll42gmvnz7zgoy@6dygkptofggtp6ffhbowku3xgu@mlrdw3aw26j3wgzjipsxgonaoyr2evrdsifsziy@mlrdw3aw26j3wgzjipsxgonaoyr2evrdsifsziy',//账号二的好友shareCode,不同好友中间用@符号隔开 +] +// 判断github action里面是否有种豆得豆互助码 +if (process.env.PLANT_BEAN_SHARECODES) { + if (process.env.PLANT_BEAN_SHARECODES.indexOf('&') > -1) { + console.log(`您的种豆互助码选择的是用&隔开\n`) + PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split('&'); + } else if (process.env.PLANT_BEAN_SHARECODES.indexOf('\n') > -1) { + console.log(`您的种豆互助码选择的是用换行隔开\n`) + PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split('\n'); + } else { + PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split(); + } +} else if (process.env.JD_COOKIE) { + console.log(`由于您secret里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`) +} +for (let i = 0; i < PlantBeanShareCodes.length; i++) { + const index = (i + 1 === 1) ? '' : (i + 1); + exports['PlantBeanShareCodes' + index] = PlantBeanShareCodes[i]; +} diff --git a/jd_cash.js b/jd_cash.js new file mode 100644 index 0000000000..f90709ffba --- /dev/null +++ b/jd_cash.js @@ -0,0 +1,564 @@ +/* +签到领现金,每日2毛~5毛 +可互助,助力码每日不变,只变日期 +活动入口:京东APP搜索领现金进入 +更新时间:2021-04-28 +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +============Quantumultx=============== +[task_local] +#签到领现金 +2 0-23/4 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_cash.js, tag=签到领现金, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true + +================Loon============== +[Script] +cron "2 0-23/4 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_cash.js,tag=签到领现金 + +===============Surge================= +签到领现金 = type=cron,cronexp="2 0-23/4 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_cash.js + +============小火箭========= +签到领现金 = type=cron,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_cash.js, cronexpr="2 0-23/4 * * *", timeout=3600, enable=true + */ +const $ = new Env('签到领现金'); +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '', message; +let helpAuthor = true; +const randomCount = $.isNode() ? 20 : 5; +let cash_exchange = true;//是否消耗2元红包兑换200京豆,默认是 +const inviteCodes = [ + `eU9YL5XqGLxSmRSAkwxR@eU9YaO7jMvwh-W_VzyUX0Q@eU9YaurkY69zoj3UniVAgg@eU9YaOnjYK4j-GvWmXIWhA@eU9YMZ_gPpRurC-foglg@eU9Ya77gZK5z-TqHn3UWhQ@eU9Yaui2ZP4gpG-Gz3EThA@eU9YaeizbvQnpG_SznIS0w`, + `-4msulYas0O2JsRhE-2TA5XZmBQ@eU9Yar_mb_9z92_WmXNG0w@eU9YaO7jMvwh-W_VzyUX0Q@eU9YaurkY69zoj3UniVAgg@eU9YaOnjYK4j-GvWmXIWhA@eU9YaO23bvtyozuGyHsR1A` +] +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; +} else { + cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); +} +const JD_API_HOST = 'https://api.m.jd.com/client.action'; +let allMessage = ''; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + return; + } + await requireConfig() + await getAuthorShareCode(); + await getAuthorShareCode2(); + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + await TotalBean(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + await jdCash() + } + } + if (allMessage) { + if ($.isNode() && (process.env.CASH_NOTIFY_CONTROL ? process.env.CASH_NOTIFY_CONTROL === 'false' : !!1)) await notify.sendNotify($.name, allMessage); + $.msg($.name, '', allMessage); + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) +async function jdCash() { + await index() + await shareCodesFormat() + await helpFriends() + await getReward() + await getReward('2'); + $.exchangeBeanNum = 0; + cash_exchange = $.isNode() ? (process.env.CASH_EXCHANGE ? process.env.CASH_EXCHANGE : `${cash_exchange}`) : ($.getdata('cash_exchange') ? $.getdata('cash_exchange') : `${cash_exchange}`); + if (cash_exchange === 'true') { + console.log(`\n\n开始花费2元红包兑换200京豆,一周可换四次`) + for (let item of ["-1", "0", "1", "2", "3"]) { + $.canLoop = true; + if ($.canLoop) { + for (let i = 0; i < 4; i++) { + await exchange2(item);//兑换200京豆(2元红包换200京豆,一周四次。) + } + if (!$.canLoop) { + console.log(`已找到符合的兑换条件,跳出\n`); + break + } + } + } + if ($.exchangeBeanNum) { + message += `兑换京豆成功,获得${$.exchangeBeanNum * 100}京豆\n`; + } + } + await index(true) + // await showMsg() +} +function index(info=false) { + return new Promise((resolve) => { + $.get(taskUrl("cash_mob_home",), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if(data.code===0 && data.data.result){ + if(info){ + if (message) { + message += `当前现金:${data.data.result.signMoney}元`; + allMessage += `京东账号${$.index}${$.nickName}\n${message}${$.index !== cookiesArr.length ? '\n\n' : ''}`; + } + console.log(`\n\n当前现金:${data.data.result.signMoney}元`); + return + } + // console.log(`您的助力码为${data.data.result.inviteCode}`) + console.log(`\n【京东账号${$.index}(${$.UserName})的${$.name}好友互助码】${data.data.result.inviteCode}\n`); + let helpInfo = { + 'inviteCode': data.data.result.inviteCode, + 'shareDate': data.data.result.shareDate + } + $.shareDate = data.data.result.shareDate; + // $.log(`shareDate: ${$.shareDate}`) + // console.log(helpInfo) + for(let task of data.data.result.taskInfos){ + if (task.type === 4) { + for (let i = task.doTimes; i < task.times; ++i) { + console.log(`去做${task.name}任务 ${i+1}/${task.times}`) + await doTask(task.type, task.jump.params.skuId) + await $.wait(5000) + } + } + else if (task.type === 2) { + for (let i = task.doTimes; i < task.times; ++i) { + console.log(`去做${task.name}任务 ${i+1}/${task.times}`) + await doTask(task.type, task.jump.params.shopId) + await $.wait(5000) + } + } + else if (task.type === 16 || task.type===3 || task.type===5 || task.type===17 || task.type===21) { + for (let i = task.doTimes; i < task.times; ++i) { + console.log(`去做${task.name}任务 ${i+1}/${task.times}`) + await doTask(task.type, task.jump.params.url) + await $.wait(5000) + } + } + } + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +async function helpFriends() { + $.canHelp = true + for (let code of $.newShareCodes) { + console.log(`去帮助好友${code['inviteCode']}`) + await helpFriend(code) + if(!$.canHelp) break + await $.wait(1000) + } + // if (helpAuthor && $.authorCode) { + // for(let helpInfo of $.authorCode){ + // console.log(`去帮助好友${helpInfo['inviteCode']}`) + // await helpFriend(helpInfo) + // if(!$.canHelp) break + // await $.wait(1000) + // } + // } +} +function helpFriend(helpInfo) { + return new Promise((resolve) => { + $.get(taskUrl("cash_mob_assist", {...helpInfo,"source":1}), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if( data.code === 0 && data.data.bizCode === 0){ + console.log(`助力成功,获得${data.data.result.cashStr}`) + // console.log(data.data.result.taskInfos) + } else if (data.data.bizCode===207){ + console.log(data.data.bizMsg) + $.canHelp = false + } else{ + console.log(data.data.bizMsg) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function doTask(type,taskInfo) { + return new Promise((resolve) => { + $.get(taskUrl("cash_doTask",{"type":type,"taskInfo":taskInfo}), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if( data.code === 0){ + console.log(`任务完成成功`) + // console.log(data.data.result.taskInfos) + }else{ + console.log(data) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function getReward(source = 1) { + return new Promise((resolve) => { + $.get(taskUrl("cash_mob_reward",{"source": Number(source),"rewardNode":""}), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.code === 0 && data.data.bizCode === 0) { + console.log(`领奖成功,${data.data.result.shareRewardTip}【${data.data.result.shareRewardAmount}】`) + message += `领奖成功,${data.data.result.shareRewardTip}【${data.data.result.shareRewardAmount}元】\n`; + // console.log(data.data.result.taskInfos) + } else { + // console.log(`领奖失败,${data.data.bizMsg}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function exchange2(node) { + let body = ''; + const data = {node,"configVersion":"1.0"} + if (data['node'] === '-1') { + body = `body=${encodeURIComponent(JSON.stringify(data))}&uuid=8888888&client=apple&clientVersion=9.4.1&st=1619595890027&sign=92a8abba7b6846f274ac9803aa5a283d&sv=102`; + } else if (data['node'] === '0') { + body = `body=${encodeURIComponent(JSON.stringify(data))}&uuid=8888888&client=apple&clientVersion=9.4.1&st=1619597882090&sign=e00bd6c3af2a53820825b94f7a648551&sv=100`; + } else if (data['node'] === '1') { + body = `body=${encodeURIComponent(JSON.stringify(data))}&uuid=8888888&client=apple&clientVersion=9.4.1&st=1619595655007&sign=2e72bbd21e5f5775fe920eac129f89a2&sv=111`; + } else if (data['node'] === '2') { + body = `body=${encodeURIComponent(JSON.stringify(data))}&uuid=8888888&client=apple&clientVersion=9.4.1&st=1619597924095&sign=c04c70370ff68d71890de08a18cac981&sv=112`; + } else if (data['node'] === '3') { + body = `body=${encodeURIComponent(JSON.stringify(data))}&uuid=8888888&client=apple&clientVersion=9.4.1&st=1619597953001&sign=4c36b3d816d4f0646b5c34e7596502f8&sv=122`; + } + return new Promise((resolve) => { + const options = { + url: `${JD_API_HOST}?functionId=cash_exchangeBeans&t=${Date.now()}&${body}`, + body: `body=${escape(JSON.stringify(data))}`, + headers: { + 'Cookie': cookie, + 'Host': 'api.m.jd.com', + 'Connection': 'keep-alive', + 'Content-Type': 'application/x-www-form-urlencoded', + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-cn', + 'Accept-Encoding': 'gzip, deflate, br', + } + } + $.post(options, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['code'] === 0) { + if (data.data.bizCode === 0) { + console.log(`花费${data.data.result.needMoney}元红包兑换成功!获得${data.data.result.beanName}\n`) + $.exchangeBeanNum += parseInt(data.data.result.needMoney); + $.canLoop = false; + } else { + console.log('花费2元红包兑换200京豆失败:' + data.data.bizMsg) + if (data.data.bizCode === 504) $.canLoop = true; + if (data.data.bizCode === 120) $.canLoop = false; + } + } else { + console.log(`兑换京豆失败:${JSON.stringify(data)}\n`); + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function showMsg() { + return new Promise(resolve => { + if (!jdNotify) { + $.msg($.name, '', `${message}`); + } else { + $.log(`京东账号${$.index}${$.nickName}\n${message}`); + } + resolve() + }) +} +function readShareCode() { + console.log(`开始`) + return new Promise(async resolve => { + $.get({url: `https://code.chiang.fun/api/v1/jd/jdcash/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) + data = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + await $.wait(10000); + resolve() + }) +} +//格式化助力码 +function shareCodesFormat() { + return new Promise(async resolve => { + // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`) + $.newShareCodes = []; + if ($.shareCodesArr[$.index - 1]) { + $.newShareCodes = $.shareCodesArr[$.index - 1].split('@'); + } else { + console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) + const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1); + $.newShareCodes = inviteCodes[tempIndex].split('@'); + let authorCode = deepCopy($.authorCode) + $.newShareCodes = [...(authorCode.map((item, index) => authorCode[index] = item['inviteCode'])), ...$.newShareCodes]; + } + const readShareCodeRes = await readShareCode(); + if (readShareCodeRes && readShareCodeRes.code === 200) { + $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])]; + } + $.newShareCodes.map((item, index) => $.newShareCodes[index] = { "inviteCode": item, "shareDate": $.shareDate }) + console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`) + resolve(); + }) +} + +function requireConfig() { + return new Promise(resolve => { + console.log(`开始获取${$.name}配置文件\n`); + let shareCodes = []; + if ($.isNode()) { + if (process.env.JD_CASH_SHARECODES) { + if (process.env.JD_CASH_SHARECODES.indexOf('\n') > -1) { + shareCodes = process.env.JD_CASH_SHARECODES.split('\n'); + } else { + shareCodes = process.env.JD_CASH_SHARECODES.split('&'); + } + } + } + console.log(`共${cookiesArr.length}个京东账号\n`); + $.shareCodesArr = []; + if ($.isNode()) { + Object.keys(shareCodes).forEach((item) => { + if (shareCodes[item]) { + $.shareCodesArr.push(shareCodes[item]) + } + }) + } else { + if ($.getdata('jd_cash_invite')) $.shareCodesArr = $.getdata('jd_cash_invite').split('\n').filter(item => !!item); + console.log(`\nBoxJs设置的京喜财富岛邀请码:${$.getdata('jd_cash_invite')}\n`); + } + console.log(`您提供了${$.shareCodesArr.length}个账号的${$.name}助力码\n`); + resolve() + }) +} +function deepCopy(obj) { + let objClone = Array.isArray(obj) ? [] : {}; + if (obj && typeof obj === "object") { + for (let key in obj) { + if (obj.hasOwnProperty(key)) { + //判断ojb子元素是否为对象,如果是,递归复制 + if (obj[key] && typeof obj[key] === "object") { + objClone[key] = deepCopy(obj[key]); + } else { + //如果不是,简单复制 + objClone[key] = obj[key]; + } + } + } + } + return objClone; +} +function taskUrl(functionId, body = {}) { + return { + url: `${JD_API_HOST}?functionId=${functionId}&body=${escape(JSON.stringify(body))}&appid=CashRewardMiniH5Env&appid=9.1.0`, + headers: { + 'Cookie': cookie, + 'Host': 'api.m.jd.com', + 'Connection': 'keep-alive', + 'Content-Type': 'application/json', + 'Referer': 'http://wq.jd.com/wxapp/pages/hd-interaction/index/index', + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"), + 'Accept-Language': 'zh-cn', + 'Accept-Encoding': 'gzip, deflate, br', + } + } +} + +function getAuthorShareCode(url = "http://qr6pzoy01.hn-bkt.clouddn.com/jd_cash.json") { + return new Promise(resolve => { + $.get({url, headers:{ + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" + }, timeout: 200000,}, async (err, resp, data) => { + $.authorCode = []; + try { + if (err) { + } else { + $.authorCode = JSON.parse(data) + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function getAuthorShareCode2(url = "https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_updateCash.json") { + return new Promise(resolve => { + $.get({url, headers:{ + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" + }, timeout: 200000,}, async (err, resp, data) => { + $.authorCode2 = []; + try { + if (err) { + } else { + $.authorCode2 = JSON.parse(data) + if ($.authorCode2 && $.authorCode2.length) { + $.authorCode.push(...$.authorCode2); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + if (data['retcode'] === 0) { + $.nickName = (data['base'] && data['base'].nickname) || $.UserName; + } else { + $.nickName = $.UserName + } + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} +// prettier-ignore +function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);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("",`🔔${this.name}, 开始!`)}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("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(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"),--Morthis.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();s&&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,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/jd_crazy_joy_coin.js b/jd_crazy_joy_coin.js new file mode 100644 index 0000000000..3b18c8f3c9 --- /dev/null +++ b/jd_crazy_joy_coin.js @@ -0,0 +1,688 @@ +/* +crazy joy +挂机领金币/宝箱专用 + + +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +============Quantumultx=============== +[task_local] +#crazyJoy挂机 +10 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy_coin.js, tag=crazyJoy挂机, enabled=true + +================Loon============== +[Script] +cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy_coin.js,tag=crazyJoy挂机 + +===============Surge================= +crazyJoy挂机 = type=cron,cronexp="10 * * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy_coin.js + +============小火箭========= +crazyJoy挂机 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy_coin.js, cronexpr="10 * * * *", timeout=200, enable=true + + */ + + +const $ = new Env('crazyJoy挂机'); +const JD_API_HOST = 'https://api.m.jd.com/'; + +const notify = $.isNode() ? require('./sendNotify') : ''; +let cookiesArr = [], cookie = '', message = ''; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { + }; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +!function (n) { + "use strict"; + + function t(n, t) { + var r = (65535 & n) + (65535 & t); + return (n >> 16) + (t >> 16) + (r >> 16) << 16 | 65535 & r + } + + function r(n, t) { + return n << t | n >>> 32 - t + } + + function e(n, e, o, u, c, f) { + return t(r(t(t(e, n), t(u, f)), c), o) + } + + function o(n, t, r, o, u, c, f) { + return e(t & r | ~t & o, n, t, u, c, f) + } + + function u(n, t, r, o, u, c, f) { + return e(t & o | r & ~o, n, t, u, c, f) + } + + function c(n, t, r, o, u, c, f) { + return e(t ^ r ^ o, n, t, u, c, f) + } + + function f(n, t, r, o, u, c, f) { + return e(r ^ (t | ~o), n, t, u, c, f) + } + + function i(n, r) { + n[r >> 5] |= 128 << r % 32, + n[14 + (r + 64 >>> 9 << 4)] = r; + var e, i, a, d, h, l = 1732584193, g = -271733879, v = -1732584194, m = 271733878; + for (e = 0; e < n.length; e += 16) + i = l, + a = g, + d = v, + h = m, + g = f(g = f(g = f(g = f(g = c(g = c(g = c(g = c(g = u(g = u(g = u(g = u(g = o(g = o(g = o(g = o(g, v = o(v, m = o(m, l = o(l, g, v, m, n[e], 7, -680876936), g, v, n[e + 1], 12, -389564586), l, g, n[e + 2], 17, 606105819), m, l, n[e + 3], 22, -1044525330), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 4], 7, -176418897), g, v, n[e + 5], 12, 1200080426), l, g, n[e + 6], 17, -1473231341), m, l, n[e + 7], 22, -45705983), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 8], 7, 1770035416), g, v, n[e + 9], 12, -1958414417), l, g, n[e + 10], 17, -42063), m, l, n[e + 11], 22, -1990404162), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 12], 7, 1804603682), g, v, n[e + 13], 12, -40341101), l, g, n[e + 14], 17, -1502002290), m, l, n[e + 15], 22, 1236535329), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 1], 5, -165796510), g, v, n[e + 6], 9, -1069501632), l, g, n[e + 11], 14, 643717713), m, l, n[e], 20, -373897302), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 5], 5, -701558691), g, v, n[e + 10], 9, 38016083), l, g, n[e + 15], 14, -660478335), m, l, n[e + 4], 20, -405537848), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 9], 5, 568446438), g, v, n[e + 14], 9, -1019803690), l, g, n[e + 3], 14, -187363961), m, l, n[e + 8], 20, 1163531501), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 13], 5, -1444681467), g, v, n[e + 2], 9, -51403784), l, g, n[e + 7], 14, 1735328473), m, l, n[e + 12], 20, -1926607734), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 5], 4, -378558), g, v, n[e + 8], 11, -2022574463), l, g, n[e + 11], 16, 1839030562), m, l, n[e + 14], 23, -35309556), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 1], 4, -1530992060), g, v, n[e + 4], 11, 1272893353), l, g, n[e + 7], 16, -155497632), m, l, n[e + 10], 23, -1094730640), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 13], 4, 681279174), g, v, n[e], 11, -358537222), l, g, n[e + 3], 16, -722521979), m, l, n[e + 6], 23, 76029189), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 9], 4, -640364487), g, v, n[e + 12], 11, -421815835), l, g, n[e + 15], 16, 530742520), m, l, n[e + 2], 23, -995338651), v = f(v, m = f(m, l = f(l, g, v, m, n[e], 6, -198630844), g, v, n[e + 7], 10, 1126891415), l, g, n[e + 14], 15, -1416354905), m, l, n[e + 5], 21, -57434055), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 12], 6, 1700485571), g, v, n[e + 3], 10, -1894986606), l, g, n[e + 10], 15, -1051523), m, l, n[e + 1], 21, -2054922799), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 8], 6, 1873313359), g, v, n[e + 15], 10, -30611744), l, g, n[e + 6], 15, -1560198380), m, l, n[e + 13], 21, 1309151649), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 4], 6, -145523070), g, v, n[e + 11], 10, -1120210379), l, g, n[e + 2], 15, 718787259), m, l, n[e + 9], 21, -343485551), + l = t(l, i), + g = t(g, a), + v = t(v, d), + m = t(m, h); + return [l, g, v, m] + } + + function a(n) { + var t, r = "", e = 32 * n.length; + for (t = 0; t < e; t += 8) + r += String.fromCharCode(n[t >> 5] >>> t % 32 & 255); + return r + } + + function d(n) { + var t, r = []; + for (r[(n.length >> 2) - 1] = void 0, + t = 0; t < r.length; t += 1) + r[t] = 0; + var e = 8 * n.length; + for (t = 0; t < e; t += 8) + r[t >> 5] |= (255 & n.charCodeAt(t / 8)) << t % 32; + return r + } + + function h(n) { + return a(i(d(n), 8 * n.length)) + } + + function l(n, t) { + var r, e, o = d(n), u = [], c = []; + for (u[15] = c[15] = void 0, + o.length > 16 && (o = i(o, 8 * n.length)), + r = 0; r < 16; r += 1) + u[r] = 909522486 ^ o[r], + c[r] = 1549556828 ^ o[r]; + return e = i(u.concat(d(t)), 512 + 8 * t.length), + a(i(c.concat(e), 640)) + } + + function g(n) { + var t, r, e = ""; + for (r = 0; r < n.length; r += 1) + t = n.charCodeAt(r), + e += "0123456789abcdef".charAt(t >>> 4 & 15) + "0123456789abcdef".charAt(15 & t); + return e + } + + function v(n) { + return unescape(encodeURIComponent(n)) + } + + function m(n) { + return h(v(n)) + } + + function p(n) { + return g(m(n)) + } + + function s(n, t) { + return l(v(n), v(t)) + } + + function C(n, t) { + return g(s(n, t)) + } + + function A(n, t, r) { + return t ? r ? s(t, n) : C(t, n) : r ? m(n) : p(n) + } + + $.md5 = A +}(this); +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + return; + } + let count = 0 + while (true) { + count++ + console.log(`============开始第${count}次挂机=============`) + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + await TotalBean(); + console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`); + if (!$.isLogin) { + $.log(`\n京东账号${$.index} ${$.nickName || $.UserName}\ncookie已过期,请重新登录获取\n`) + continue + } + await jdJxStory() + } + } + $.log(`\n\n`) + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +async function jdJxStory() { + $.coin = 0 + $.bean = 0 + + $.canBuy = true + await getJoyList() + await $.wait(1000) + await getJoyShop() + await $.wait(1000) + if ($.joyIds && $.joyIds.length > 0) { + $.log('当前JOY分布情况') + $.log(`\n${$.joyIds[0]} ${$.joyIds[1]} ${$.joyIds[2]} ${$.joyIds[3]}`) + $.log(`${$.joyIds[4]} ${$.joyIds[5]} ${$.joyIds[6]} ${$.joyIds[7]}`) + $.log(`${$.joyIds[8]} ${$.joyIds[9]} ${$.joyIds[10]} ${$.joyIds[11]}\n`) + } + + // 如果格子全部被占有且没有可以合并的JOY,只能回收低级的JOY (没有34级JOY时才会执行) + if(checkHasFullOccupied() && !checkCanMerge() && !checkHas34Level()) { + const minJoyId = Math.min(...$.joyIds); + const boxId = $.joyIds.indexOf(minJoyId); + console.log(`格子全部被占有且没有可以合并的JOY,回收${boxId + 1}号位等级为${minJoyId}的JOY`) + await sellJoy(minJoyId, boxId); + await getJoyList(); + } + + for (let i = 0; i < $.joyIds.length; ++i) { + if (!$.canBuy) { + $.log(`金币不足,跳过购买`) + break + } + if ($.joyIds[i] === 0) { + await buyJoy($.buyJoyLevel) + await $.wait(1000) + } + } + await getJoyList() + let obj = {}; + $.joyIds.map((vo, idx) => { + if (vo !== 0) { + if (obj[vo]) { + obj[vo].push(idx) + } else { + obj[vo] = [idx] + } + } + }) + for (let idx in obj) { + const vo = obj[idx] + if (idx < 34 && vo.length >= 2) { + await mergeJoy(vo[0], vo[1]) + await $.wait(3000) + } + } + + await hourBenefit() + await $.wait(1000) + await getCoin() + await $.wait(1000) + await getUserBean() + await $.wait(5000) + console.log(`当前信息:${$.bean} 京豆,${$.coin} 金币`) +} + +function checkHasFullOccupied() { + return !$.joyIds.includes(0); +} + +// 查询是否有34级JOY +function checkHas34Level() { + return $.joyIds.includes(34); +} + +function checkCanMerge() { + let obj = {}; + let canMerge = false; + $.joyIds.forEach((vo, idx) => { + if (vo !== 0 && vo !== 34) { + if (obj[vo]) { + obj[vo].push(idx) + canMerge = true; + } else { + obj[vo] = [idx] + } + } + }); + return canMerge; +} + +function getJoyList() { + $.joyIds = [] + return new Promise(async resolve => { + $.get(taskUrl('crazyJoy_user_gameState'), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.success && data.data.joyIds) { + $.joyIds = data.data.joyIds + } else + console.log(`joy信息获取信息失败`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function getJoyShop() { + const body = {"paramData": {"entry": "SHOP"}} + return new Promise((resolve) => { + $.get(taskUrl('crazyJoy_joy_allowBoughtList', JSON.stringify(body)), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + if (data.success && data.data && data.data.shop) { + const shop = data.data.shop.filter(vo => vo.status === 1) || [] + $.buyJoyLevel = shop.length ? shop[shop.length - 1]['joyId'] : 1;//可购买的最大等级 + if ($.isNode() && process.env.BUY_JOY_LEVEL) { + $.log(`当前可购买的最高JOY等级为${$.buyJoyLevel}级\n`) + $.buyJoyLevel = (process.env.BUY_JOY_LEVEL * 1) > $.buyJoyLevel ? $.buyJoyLevel : process.env.BUY_JOY_LEVEL * 1; + $.cost = shop[$.buyJoyLevel - 1]['coins'] + } else { + $.cost = shop.length ? shop[shop.length - 1]['coins'] : Infinity + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} + +function mergeJoy(x, y) { + let body = {"operateType": "MERGE", "fromBoxIndex": x, "targetBoxIndex": y} + return new Promise(async resolve => { + $.get(taskUrl('crazyJoy_joy_moveOrMerge', JSON.stringify(body)), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.success && data.data.newJoyId) { + console.log(`合并成功,获得${data.data.newJoyId}级Joy`) + } else + console.log(`合并失败,错误`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function buyJoy(joyId) { + const body = {"action": "BUY", "joyId": joyId, "boxId": ""} + return new Promise((resolve) => { + $.get(taskUrl('crazyJoy_joy_trade', JSON.stringify(body)), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + if (data.success) { + if (data.data.eventInfo) { + await openBox(data.data.eventInfo.eventType, data.data.eventInfo.eventRecordId) + $.canBuy = false + return + } + $.log(`购买${joyId}级joy成功,剩余金币【${data.data.totalCoins}】`) + $.coin = data.data.totalCoins + } else { + console.log(data.message) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} + +// 出售(回收)joy +function sellJoy(joyId, boxId) { + const body = {"action": "SELL", "joyId": joyId, "boxId": boxId} + return new Promise((resolve) => { + $.get(taskUrl('crazyJoy_joy_trade', JSON.stringify(body)), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + if (data.success) { + if (data.data.eventInfo) { + await openBox(data.data.eventInfo.eventType, data.data.eventInfo.eventRecordId) + $.canBuy = false + return + } + $.log(`回收${joyId}级joy成功,剩余金币【${data.data.totalCoins}】`) + $.coin = data.data.totalCoins + } else { + console.log(data.message) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} + +function hourBenefit() { + let body = {"eventType": "HOUR_BENEFIT"} + return new Promise(async resolve => { + $.get(taskUrl('crazyJoy_event_obtainAward', JSON.stringify(body)), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.success) + console.log(`金币补给领取成功,获得${data.data.coins}金币`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function getUserBean() { + return new Promise(async resolve => { + $.get(taskUrl('crazyJoy_user_getJdBeanInfo'), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.success && data.data && data.data.totalBeans) + $.bean = data.data.totalBeans + else + console.log(`京豆信息获取信息失败`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function getCoin() { + return new Promise(async resolve => { + $.get(taskUrl('crazyJoy_joy_produce'), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data && data.data.tryMoneyJoyBeans) { + console.log(`分红狗生效中,预计获得 ${data.data.tryMoneyJoyBeans} 京豆奖励`) + } + if (data.data && data.data.totalCoinAmount) { + $.coin = data.data.totalCoinAmount; + } else { + $.coin = `获取当前金币数量失败` + } + if (data.data && data.data.luckyBoxRecordId) { + await openBox('LUCKY_BOX_DROP',data.data.luckyBoxRecordId) + } + if (data.data) { + $.log(`此次在线收益:获得 ${data.data['coins']} 金币`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function openBox(eventType = 'LUCKY_BOX_DROP', boxId) { + let body = { eventType, "eventRecordId": boxId} + return new Promise(async resolve => { + $.get(taskUrl('crazyJoy_event_getVideoAdvert', JSON.stringify(body)), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['success']) { + $.log(`点击幸运盒子成功,剩余观看视频次数:${data.data.advertViewTimes}, ${data.data.advertViewTimes > 0 ? '等待30秒' : '跳出'}`) + if (data.data.advertViewTimes > 0) { + await $.wait(30000) + await rewardBox(eventType, boxId); + } + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function rewardBox(eventType, boxId) { + let body = { eventType, "eventRecordId": boxId} + return new Promise(async resolve => { + $.get(taskUrl('crazyJoy_event_obtainAward', JSON.stringify(body)), async (err, resp, data) => { + try { + if (err) { + $.log(`${JSON.stringify(err)}`) + $.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['success']) { + $.log(`幸运盒子奖励领取成功,获得:${data.data.beans}京豆,${data.data.coins}金币`) + } else { + $.log(`幸运盒子奖励领取失败,错误信息:${data.message || JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function getGrowState() { + let body = {"paramData":{"eventType":"GROWTH_REWARD"}} + return new Promise(async resolve => { + $.get(taskUrl('crazyJoy_event_getGrowthAndSceneState', JSON.stringify(body)), async (err, resp, data) => { + try { + if (err) { + $.log(`${JSON.stringify(err)}`) + $.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['success'] && data.data) { + for(let vo of data.data){ + if(vo['status']){ + console.log(`${vo['joyId']}升级奖励可以领取`) + } + } + } else { + $.log(`幸运盒子奖励领取失败,错误信息:${data.message || JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function taskUrl(functionId, body = '') { + let t = Date.now().toString().substr(0, 10) + let e = body || "" + e = $.md5("aDvScBv$gGQvrXfva8dG!ZC@DA70Y%lX" + e + t) + e = e + Number(t).toString(16) + return { + url: `${JD_API_HOST}?uts=${e}&appid=crazy_joy&functionId=${functionId}&body=${escape(body)}&t=${t}`, + headers: { + 'Cookie': cookie, + 'Host': 'api.m.jd.com', + 'Accept': '*/*', + 'Connection': 'keep-alive', + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-cn', + 'Referer': 'https://crazy-joy.jd.com/', + 'origin': 'https://crazy-joy.jd.com', + 'Accept-Encoding': 'gzip, deflate, br', + } + } +} + +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + return []; + } + } +} +// prettier-ignore +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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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)} diff --git a/jd_dreamFactory.js b/jd_dreamFactory.js new file mode 100644 index 0000000000..eceba2195d --- /dev/null +++ b/jd_dreamFactory.js @@ -0,0 +1,1501 @@ +/* +京东京喜工厂 +更新时间:2021-1-17 +活动入口 :京东APP->游戏与互动->查看更多->京喜工厂 +或者: 京东APP首页搜索 "玩一玩" ,造物工厂即可 + + +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +============Quantumultx=============== +[task_local] +#京喜工厂 +10 * * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_dreamFactory.js, tag=京喜工厂, enabled=true + +================Loon============== +[Script] +cron "10 * * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_dreamFactory.js,tag=京喜工厂 + +===============Surge================= +京喜工厂 = type=cron,cronexp="10 * * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_dreamFactory.js + +============小火箭========= +京喜工厂 = type=cron,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_dreamFactory.js, cronexpr="10 * * * *", timeout=200, enable=true + + */ + + +const $ = new Env('京喜工厂'); +const JD_API_HOST = 'https://m.jingxi.com'; + +const notify = $.isNode() ? require('./sendNotify') : ''; +let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 +const randomCount = $.isNode() ? 20 : 5; +let tuanActiveId = `6S9y4sJUfA2vPQP6TLdVIQ==`; +const jxOpenUrl = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://wqsd.jd.com/pingou/dream_factory/index.html%22%20%7D`; +let cookiesArr = [], cookie = '', message = ''; +const inviteCodes = ['V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k=@0WtCMPNq7jekehT6d3AbFw==', 'PDPM257r_KuQhil2Y7koNw==', "gB99tYLjvPcEFloDgamoBw==", '-OvElMzqeyeGBWazWYjI1Q==', 'GFwo6PntxDHH95ZRzZ5uAg==']; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +$.tuanIds = []; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { + }; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +!(async () => { + await requireConfig(); + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + $.ele = 0; + $.pickEle = 0; + $.pickFriendEle = 0; + $.friendList = []; + $.canHelpFlag = true;//能否助力朋友 + await TotalBean(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + await jdDreamFactory() + } + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + console.log(`${$.UserName}去参加第一个cookie账号开的团`) + cookie = cookiesArr[i]; + if ($.tuanIds.length > 0) { + await JoinTuan($.tuanIds[0]); + } + await joinLeaderTuan();//参团 + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +async function jdDreamFactory() { + await userInfo(); + await QueryFriendList();//查询今日招工情况以及剩余助力次数 + // await joinLeaderTuan();//参团 + await helpFriends(); + if (!$.unActive) return + await getUserElectricity(); + await taskList(); + await investElectric(); + await QueryHireReward();//收取招工电力 + await PickUp();//收取自家的地下零件 + await stealFriend(); + await tuanActivity(); + await QueryAllTuan(); + await exchangeProNotify(); + await showMsg(); +} + + +// 收取发电机的电力 +function collectElectricity(facId = $.factoryId, help = false, master) { + return new Promise(async resolve => { + // let url = `/dreamfactory/generator/CollectCurrentElectricity?zone=dream_factory&apptoken=&pgtimestamp=&phoneID=&factoryid=${facId}&doubleflag=1&sceneval=2&g_login_type=1`; + // if (help && master) { + // url = `/dreamfactory/generator/CollectCurrentElectricity?zone=dream_factory&factoryid=${facId}&master=${master}&sceneval=2&g_login_type=1`; + // } + let body = `factoryid=${facId}&apptoken=&pgtimestamp=&phoneID=&doubleflag=1&_stk=_time,apptoken,doubleflag,factoryid,pgtimestamp,phoneID,timeStamp,zone`; + if (help && master) { + body += `factoryid=${facId}&master=${master}`; + } + $.get(taskurl(`generator/CollectCurrentElectricity`, body), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + if (help) { + $.ele += Number(data.data['loginPinCollectElectricity']) + console.log(`帮助好友收取 ${data.data['CollectElectricity']} 电力,获得 ${data.data['loginPinCollectElectricity']} 电力`); + message += `【帮助好友】帮助成功,获得 ${data.data['loginPinCollectElectricity']} 电力\n` + } else { + $.ele += Number(data.data['CollectElectricity']) + console.log(`收取 ${data.data['CollectElectricity']} 电力`); + message += `【收取发电站】收取成功,获得 ${data.data['CollectElectricity']} 电力\n` + } + } else { + if (help) { + console.log(`收取好友电力失败:${data.msg}\n`); + } else { + console.log(`收取电力失败:${data.msg}\n`); + } + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +// 投入电力 +function investElectric() { + return new Promise(async resolve => { + // const url = `/dreamfactory/userinfo/InvestElectric?zone=dream_factory&productionId=${$.productionId}&sceneval=2&g_login_type=1`; + $.get(taskurl('userinfo/InvestElectric', `productionId=${$.productionId}`), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.ret === 0) { + console.log(`成功投入电力${data.data.investElectric}电力`); + message += `【投入电力】投入成功,共计 ${data.data.investElectric} 电力\n`; + } else { + console.log(`投入失败,${data.msg}`); + message += `【投入电力】投入失败,${data.msg}\n`; + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +// 初始化任务 +function taskList() { + return new Promise(async resolve => { + // const url = `/newtasksys/newtasksys_front/GetUserTaskStatusList?source=dreamfactory&bizCode=dream_factory&sceneval=2&g_login_type=1`; + $.get(newtasksysUrl('GetUserTaskStatusList'), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + let userTaskStatusList = data['data']['userTaskStatusList']; + for (let i = 0; i < userTaskStatusList.length; i++) { + const vo = userTaskStatusList[i]; + if (vo['awardStatus'] !== 1) { + if (vo.completedTimes >= vo.targetTimes) { + console.log(`任务:${vo.description}可完成`) + await completeTask(vo.taskId, vo.taskName) + await $.wait(1000);//延迟等待一秒 + } else { + switch (vo.taskType) { + case 2: // 逛一逛任务 + case 6: // 浏览商品任务 + case 9: // 开宝箱 + for (let i = vo.completedTimes; i <= vo.configTargetTimes; ++i) { + console.log(`去做任务:${vo.taskName}`) + await doTask(vo.taskId) + await completeTask(vo.taskId, vo.taskName) + await $.wait(1000);//延迟等待一秒 + } + break + case 4: // 招工 + break + case 5: + // 收集类 + break + case 1: // 登陆领奖 + default: + break + } + } + } + } + console.log(`完成任务:共领取${$.ele}电力`) + message += `【每日任务】领奖成功,共计 ${$.ele} 电力\n`; + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +// 获得用户电力情况 +function getUserElectricity() { + return new Promise(async resolve => { + // const url = `/dreamfactory/generator/QueryCurrentElectricityQuantity?zone=dream_factory&factoryid=${$.factoryId}&sceneval=2&g_login_type=1` + $.get(taskurl(`generator/QueryCurrentElectricityQuantity`, `factoryid=${$.factoryId}`), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + console.log(`\nnextCollectDoubleFlag::${data.data.nextCollectDoubleFlag}`); + console.log(`nextCollectDoubleType::${data.data.nextCollectDoubleType}\n`); + $.log(`下次集满收取${data.data.nextCollectDoubleFlag === 1 ? '可' : '不可'}双倍电力`) + console.log(`发电机:当前 ${data.data.currentElectricityQuantity} 电力,最大值 ${data.data.maxElectricityQuantity} 电力`) + if (data.data.nextCollectDoubleFlag === 1) { + if (data.data.currentElectricityQuantity === data.data.maxElectricityQuantity && data.data.doubleElectricityFlag) { + console.log(`发电机:电力可翻倍并收获`) + // await shareReport(); + await collectElectricity() + } else { + message += `【发电机电力】当前 ${data.data.currentElectricityQuantity} 电力,未达到收获标准\n` + } + } else { + //再收取双倍电力达到上限时,直接收取,不再等到满级 + await collectElectricity() + } + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +//查询有多少的招工电力可收取 +function QueryHireReward() { + return new Promise(async resolve => { + // const url = `/dreamfactory/friend/HireAward?zone=dream_factory&date=${new Date().Format("yyyyMMdd")}&type=0&sceneval=2&g_login_type=1` + $.get(taskurl('friend/QueryHireReward'), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + for (let item of data['data']['hireReward']) { + if (item.date !== new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).Format("yyyyMMdd")) { + await hireAward(item.date, item.type); + } + } + } else { + console.log(`异常:${JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +// 收取招工/劳模电力 +function hireAward(date, type = 0) { + return new Promise(async resolve => { + // const url = `/dreamfactory/friend/HireAward?zone=dream_factory&date=${new Date().Format("yyyyMMdd")}&type=0&sceneval=2&g_login_type=1` + $.get(taskurl('friend/HireAward', `date=${date}&type=${type}&_stk=_time,date,type,zone`), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + console.log(`打工电力:收取成功`) + message += `【打工电力】:收取成功\n` + } else { + console.log(`打工电力:收取失败,${data.msg}`) + message += `【打工电力】收取失败,${data.msg}\n` + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +async function helpFriends() { + let Hours = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).getHours(); + if ($.canHelpFlag && Hours >= 6) { + await shareCodesFormat(); + for (let code of $.newShareCodes) { + if (code) { + if ($.encryptPin === code) { + console.log(`不能为自己助力,跳过`); + continue; + } + const assistFriendRes = await assistFriend(code); + if (assistFriendRes && assistFriendRes['ret'] === 0) { + console.log(`助力朋友:${code}成功,因一次只能助力一个,故跳出助力`) + break + } else if (assistFriendRes && assistFriendRes['ret'] === 11009) { + console.log(`助力朋友[${code}]失败:${assistFriendRes.msg},跳出助力`); + break + } else { + console.log(`助力朋友[${code}]失败:${assistFriendRes.msg}`) + } + } + } + } else { + $.log(`今日助力好友机会已耗尽\n`); + } +} +// 帮助用户 +function assistFriend(sharepin) { + return new Promise(async resolve => { + // const url = `/dreamfactory/friend/AssistFriend?zone=dream_factory&sharepin=${escape(sharepin)}&sceneval=2&g_login_type=1` + const options = { + 'url': `https://m.jingxi.com/dreamfactory/friend/AssistFriend?zone=dream_factory&sharepin=${escape(sharepin)}&sceneval=2&g_login_type=1`, + 'headers': { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Host": "m.jingxi.com", + "Referer": "https://st.jingxi.com/pingou/dream_factory/index.html", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36" + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + // if (data['ret'] === 0) { + // console.log(`助力朋友:${sharepin}成功`) + // } else { + // console.log(`助力朋友[${sharepin}]失败:${data.msg}`) + // } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +//查询助力招工情况 +function QueryFriendList() { + return new Promise(async resolve => { + $.get(taskurl('friend/QueryFriendList'), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + data = data['data']; + const { assistListToday = [], assistNumMax, hireListToday = [], hireNumMax } = data; + if (assistListToday.length === assistNumMax) { + $.canHelpFlag = false; + } + $.log(`【今日招工进度】${hireListToday.length}/${hireNumMax}`); + message += `【招工进度】${hireListToday.length}/${hireNumMax}\n`; + } else { + console.log(`QueryFriendList异常:${JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +// 任务领奖 +function completeTask(taskId, taskName) { + return new Promise(async resolve => { + // const url = `/newtasksys/newtasksys_front/Award?source=dreamfactory&bizCode=dream_factory&taskId=${taskId}&sceneval=2&g_login_type=1`; + $.get(newtasksysUrl('Award', taskId), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + switch (data['data']['awardStatus']) { + case 1: + $.ele += Number(data['data']['prizeInfo'].replace('\\n', '')) + console.log(`领取${taskName}任务奖励成功,收获:${Number(data['data']['prizeInfo'].replace('\\n', ''))}电力`); + break + case 1013: + case 0: + console.log(`领取${taskName}任务奖励失败,任务已领奖`); + break + default: + console.log(`领取${taskName}任务奖励失败,${data['msg']}`) + break + } + // if (data['ret'] === 0) { + // console.log("做任务完成!") + // } else { + // console.log(`异常:${JSON.stringify(data)}`) + // } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +// 完成任务 +function doTask(taskId) { + return new Promise(async resolve => { + // const url = `/newtasksys/newtasksys_front/DoTask?source=dreamfactory&bizCode=dream_factory&taskId=${taskId}&sceneval=2&g_login_type=1`; + $.get(newtasksysUrl('DoTask', taskId, '_time,bizCode,configExtra,source,taskId'), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + console.log("做任务完成!") + } else { + console.log(`DoTask异常:${JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +// 初始化个人信息 +function userInfo() { + return new Promise(async resolve => { + $.get(taskurl('userinfo/GetUserInfo', `pin=&sharePin=&shareType=&materialTuanPin=&materialTuanId=`), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + data = data['data']; + $.unActive = true;//标记是否开启了京喜活动或者选购了商品进行生产 + $.encryptPin = ''; + $.shelvesList = []; + if (data.factoryList && data.productionList) { + const production = data.productionList[0]; + const factory = data.factoryList[0]; + const productionStage = data.productionStage; + $.factoryId = factory.factoryId;//工厂ID + $.productionId = production.productionId;//商品ID + $.commodityDimId = production.commodityDimId; + $.encryptPin = data.user.encryptPin; + // subTitle = data.user.pin; + await GetCommodityDetails();//获取已选购的商品信息 + if (productionStage['productionStageAwardStatus'] === 1) { + $.log(`可以开红包了\n`); + await DrawProductionStagePrize();//领取红包 + } else { + $.log(`再加${productionStage['productionStageProgress']}电力可开红包\n`) + } + console.log(`当前电力:${data.user.electric}`) + console.log(`当前等级:${data.user.currentLevel}`) + console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${data.user.encryptPin}`); + console.log(`已投入电力:${production.investedElectric}`); + console.log(`所需电力:${production.needElectric}`); + console.log(`生产进度:${((production.investedElectric / production.needElectric) * 100).toFixed(2)}%`); + message += `【京东账号${$.index}】${$.nickName}\n` + message += `【生产商品】${$.productName}\n`; + message += `【当前等级】${data.user.userIdentity} ${data.user.currentLevel}\n`; + message += `【生产进度】${((production.investedElectric / production.needElectric) * 100).toFixed(2)}%\n`; + if (production.investedElectric >= production.needElectric) { + $.log(`可以对方商品了`) + // await exchangeProNotify() + } + } else { + $.unActive = false;//标记是否开启了京喜活动或者选购了商品进行生产 + if (!data.factoryList) { + console.log(`【提示】京东账号${$.index}[${$.nickName}]京喜工厂活动未开始\n请手动去京东APP->游戏与互动->查看更多->京喜工厂 开启活动\n`); + // $.msg($.name, '【提示】', `京东账号${$.index}[${$.nickName}]京喜工厂活动未开始\n请手动去京东APP->游戏与互动->查看更多->京喜工厂 开启活动`); + } else if (data.factoryList && !data.productionList) { + console.log(`【提示】京东账号${$.index}[${$.nickName}]京喜工厂未选购商品\n请手动去京东APP->游戏与互动->查看更多->京喜工厂 选购\n`) + let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); + if (nowTimes.getHours() % 12 === 0) { + //如按每小时运行一次,则此处将一天推送2次提醒 + $.msg($.name, '提醒⏰', `京东账号${$.index}[${$.nickName}]京喜工厂未选择商品\n请手动去京东APP->游戏与互动->查看更多->京喜工厂 选择商品`); + if ($.isNode()) await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `京东账号${$.index}[${$.nickName}]京喜工厂未选择商品\n请手动去京东APP->游戏与互动->查看更多->京喜工厂 选择商品`) + } + } + } + } else { + console.log(`GetUserInfo异常:${JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +//查询当前生产的商品名称 +function GetCommodityDetails() { + return new Promise(async resolve => { + // const url = `/dreamfactory/diminfo/GetCommodityDetails?zone=dream_factory&sceneval=2&g_login_type=1&commodityId=${$.commodityDimId}`; + $.get(taskurl('diminfo/GetCommodityDetails', `commodityId=${$.commodityDimId}`), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + data = data['data']; + $.productName = data['commodityList'][0].name; + } else { + console.log(`GetCommodityDetails异常:${JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +// 查询已完成商品 +function GetShelvesList(pageNo = 1) { + return new Promise(async resolve => { + $.get(taskurl('userinfo/GetShelvesList', `pageNo=${pageNo}&pageSize=12`), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + data = data['data']; + const { shelvesList } = data; + if (shelvesList) { + $.shelvesList = [...$.shelvesList, ...shelvesList]; + pageNo ++ + GetShelvesList(pageNo); + } + } else { + console.log(`GetShelvesList异常:${JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +//领取红包 +function DrawProductionStagePrize() { + return new Promise(async resolve => { + // const url = `/dreamfactory/userinfo/DrawProductionStagePrize?zone=dream_factory&sceneval=2&g_login_type=1&productionId=${$.productionId}`; + $.get(taskurl('userinfo/DrawProductionStagePrize', `productionId=${$.productionId}`), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + console.log(`领取红包功能(测试中):${data}`); + // if (safeGet(data)) { + // data = JSON.parse(data); + // if (data['ret'] === 0) { + // + // } else { + // console.log(`异常:${JSON.stringify(data)}`) + // } + // } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +async function PickUp(encryptPin = $.encryptPin, help = false) { + $.pickUpMyselfComponent = true; + const GetUserComponentRes = await GetUserComponent(encryptPin, 500); + if (GetUserComponentRes && GetUserComponentRes['ret'] === 0) { + const { componentList } = GetUserComponentRes['data']; + if (componentList && componentList.length <= 0) { + if (help) { + $.log(`好友【${encryptPin}】地下暂无零件可收`) + } else { + $.log(`自家地下暂无零件可收`) + } + $.pickUpMyselfComponent = false; + } + for (let item of componentList) { + await $.wait(1000); + const PickUpComponentRes = await PickUpComponent(item['placeId'], encryptPin); + if (PickUpComponentRes) { + if (PickUpComponentRes['ret'] === 0) { + const data = PickUpComponentRes['data']; + if (help) { + console.log(`收取好友[${encryptPin}]零件成功:获得${data['increaseElectric']}电力\n`); + $.pickFriendEle += data['increaseElectric']; + } else { + console.log(`收取自家零件成功:获得${data['increaseElectric']}电力\n`); + $.pickEle += data['increaseElectric']; + } + } else { + if (help) { + console.log(`收好友[${encryptPin}]零件失败:${PickUpComponentRes.msg},直接跳出`) + } else { + console.log(`收自己地下零件失败:${PickUpComponentRes.msg},直接跳出`); + $.pickUpMyselfComponent = false; + } + break + } + } + } + } +} +function GetUserComponent(pin = $.encryptPin, timeout = 0) { + return new Promise(resolve => { + setTimeout(() => { + $.get(taskurl('usermaterial/GetUserComponent', `pin=${pin}`), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + + } else { + console.log(`GetUserComponent失败:${JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }, timeout) + }) +} +//收取地下随机零件电力API + +function PickUpComponent(index, encryptPin) { + return new Promise(resolve => { + $.get(taskurl('usermaterial/PickUpComponent', `placeId=${index}&pin=${encryptPin}&_stk=_time,pin,placeId,zone`), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + // if (data['ret'] === 0) { + // data = data['data']; + // if (help) { + // console.log(`收取好友[${encryptPin}]零件成功:获得${data['increaseElectric']}电力\n`); + // $.pickFriendEle += data['increaseElectric']; + // } else { + // console.log(`收取自家零件成功:获得${data['increaseElectric']}电力\n`); + // $.pickEle += data['increaseElectric']; + // } + // } else { + // if (help) { + // console.log(`收好友[${encryptPin}]零件失败:${JSON.stringify(data)}`) + // } else { + // console.log(`收零件失败:${JSON.stringify(data)}`) + // } + // } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +//偷好友的电力 +async function stealFriend() { + if (!$.pickUpMyselfComponent) { + $.log(`今日收取零件已达上限,偷好友零件也达到上限,故跳出`) + return + } + await getFriendList(); + $.friendList = [...new Set($.friendList)]; + for (let i = 0; i < $.friendList.length; i++) { + let pin = $.friendList[i];//好友的encryptPin + if (pin === 'V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k=' || pin === 'Bo-jnVs_m9uBvbRzraXcSA==') { + continue + } + await PickUp(pin, true); + // await getFactoryIdByPin(pin);//获取好友工厂ID + // if ($.stealFactoryId) await collectElectricity($.stealFactoryId,true, pin); + } +} +function getFriendList(sort = 0) { + return new Promise(async resolve => { + $.get(taskurl('friend/QueryFactoryManagerList', `sort=${sort}`), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + data = data['data']; + if (data.list && data.list.length <= 0) { + console.log(`查询好友列表完成,共${$.friendList.length}好友,下面开始拾取好友地下的零件\n`); + return + } + let friendsEncryptPins = []; + for (let item of data.list) { + friendsEncryptPins.push(item.encryptPin); + } + $.friendList = [...$.friendList, ...friendsEncryptPins]; + if (!$.isNode()) return + await getFriendList(data.sort); + } else { + console.log(`QueryFactoryManagerList异常:${JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function getFactoryIdByPin(pin) { + return new Promise((resolve, reject) => { + // const url = `/dreamfactory/userinfo/GetUserInfoByPin?zone=dream_factory&pin=${pin}&sceneval=2`; + $.get(taskurl('userinfo/GetUserInfoByPin', `pin=${pin}`), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + if (data.data.factoryList) { + //做此判断,有时候返回factoryList为null + // resolve(data['data']['factoryList'][0]['factoryId']) + $.stealFactoryId = data['data']['factoryList'][0]['factoryId']; + } + } else { + console.log(`异常:${JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +async function tuanActivity() { + const tuanConfig = await QueryActiveConfig(); + if (tuanConfig && tuanConfig.ret === 0) { + const { activeId, surplusOpenTuanNum, tuanId } = tuanConfig['data']['userTuanInfo']; + console.log(`今日剩余开团次数:${surplusOpenTuanNum}次`); + $.surplusOpenTuanNum = surplusOpenTuanNum; + if (!tuanId && surplusOpenTuanNum > 0) { + //开团 + $.log(`准备开团`) + await CreateTuan(); + } else if (tuanId) { + //查询词团信息 + const QueryTuanRes = await QueryTuan(activeId, tuanId); + if (QueryTuanRes && QueryTuanRes.ret === 0) { + const { tuanInfo } = QueryTuanRes.data; + for (let item of tuanInfo) { + const { realTuanNum, tuanNum, userInfo } = item; + $.log(`\n开团情况:${realTuanNum}/${tuanNum}\n`); + if (realTuanNum === tuanNum) { + for (let user of userInfo) { + if (user.encryptPin === $.encryptPin) { + if (user.receiveElectric && user.receiveElectric > 0) { + console.log(`您在${new Date(user.joinTime * 1000).toLocaleString()}开团奖励已经领取成功\n`) + if ($.surplusOpenTuanNum > 0) await CreateTuan(); + } else { + $.log(`开始领取开团奖励`); + await tuanAward(item.tuanActiveId, item.tuanId);//isTuanLeader + } + } + } + } else { + $.tuanIds.push(tuanId); + $.log(`\n此团未达领取团奖励人数:${tuanNum}人\n`) + } + } + } + } + } +} +//可获取开团后的团ID,如果团ID为空并且surplusOpenTuanNum>0,则可继续开团 +//如果团ID不为空,则查询QueryTuan() +function QueryActiveConfig() { + return new Promise((resolve) => { + const options = { + 'url': `https://m.jingxi.com/dreamfactory/tuan/QueryActiveConfig?activeId=${escape(tuanActiveId)}&_time=${Date.now()}&_=${Date.now()}&sceneval=2&g_login_type=1`, + "headers": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Host": "m.jingxi.com", + "Referer": "https://st.jingxi.com/pingou/dream_factory/divide.html", + "User-Agent": "jdpingou;iPhone;3.15.2;13.5.1;90bab9217f465a83a99c0b554a946b0b0d5c2f7a;network/wifi;model/iPhone12,1;appBuild/100365;ADID/696F8BD2-0820-405C-AFC0-3C6D028040E5;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/14;pap/JA2015_311210;brand/apple;supportJDSHWK/1;" + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + const { userTuanInfo } = data['data']; + console.log(`\n团活动ID ${userTuanInfo.activeId}`); + console.log(`团ID ${userTuanInfo.tuanId}\n`); + } else { + console.log(`QueryActiveConfig异常:${JSON.stringify(data)}`); + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function QueryTuan(activeId, tuanId) { + return new Promise((resolve) => { + const options = { + 'url': `https://m.jingxi.com/dreamfactory/tuan/QueryTuan?activeId=${escape(activeId)}&tuanId=${escape(tuanId)}&_time=${Date.now()}&_=${Date.now()}&sceneval=2&g_login_type=1`, + "headers": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Host": "m.jingxi.com", + "Referer": "https://st.jingxi.com/pingou/dream_factory/divide.html", + "User-Agent": "jdpingou;iPhone;3.15.2;13.5.1;90bab9217f465a83a99c0b554a946b0b0d5c2f7a;network/wifi;model/iPhone12,1;appBuild/100365;ADID/696F8BD2-0820-405C-AFC0-3C6D028040E5;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/14;pap/JA2015_311210;brand/apple;supportJDSHWK/1;" + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + // $.log(`\n开团情况:${data.data.tuanInfo.realTuanNum}/${data.data.tuanInfo.tuanNum}\n`) + } else { + console.log(`异常:${JSON.stringify(data)}`); + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +//开团API +function CreateTuan() { + return new Promise((resolve) => { + const options = { + 'url': `https://m.jingxi.com/dreamfactory/tuan/CreateTuan?activeId=${escape(tuanActiveId)}&isOpenApp=1&_time=${Date.now()}&_=${Date.now()}&sceneval=2&g_login_type=1&_stk=_time,activeId,isOpenApp`, + "headers": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Host": "m.jingxi.com", + "Referer": "https://st.jingxi.com/pingou/dream_factory/divide.html", + "User-Agent": "jdpingou;iPhone;3.15.2;13.5.1;90bab9217f465a83a99c0b554a946b0b0d5c2f7a;network/wifi;model/iPhone12,1;appBuild/100365;ADID/696F8BD2-0820-405C-AFC0-3C6D028040E5;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/14;pap/JA2015_311210;brand/apple;supportJDSHWK/1;" + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + console.log(`开团成功tuanId为\n${data.data['tuanId']}`); + } else { + console.log(`异常:${JSON.stringify(data)}`); + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +async function joinLeaderTuan() { + if ($.tuanIdS && $.tuanIdS.tuanIds) { + for (let tuanId of $.tuanIdS.tuanIds) { + if (!tuanId) continue + await JoinTuan(tuanId); + } + } + $.tuanIdS = null; + if (!$.tuanIdS) await updateTuanIdsCDN('https://gitee.com/shylocks/updateTeam/raw/main/jd_updateFactoryTuanId.json'); + if ($.tuanIdS && $.tuanIdS.tuanIds) { + for (let tuanId of $.tuanIdS.tuanIds) { + if (!tuanId) continue + await JoinTuan(tuanId); + } + } +} +function JoinTuan(tuanId) { + return new Promise((resolve) => { + const options = { + 'url': `https://m.jingxi.com/dreamfactory/tuan/JoinTuan?activeId=${escape(tuanActiveId)}&tuanId=${escape(tuanId)}&_time=${Date.now()}&_=${Date.now()}&sceneval=2&g_login_type=1`, + "headers": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Host": "m.jingxi.com", + "Referer": "https://st.jingxi.com/pingou/dream_factory/divide.html?exchange=%7B%22activeId%22:%22ilOin38J30PcT9xnWbx9lw%3D%3D%22,%22sTuanId%22:%22QvqM7GtgQQJUO8jaz1CYBA%3D%3D%22,%22sPin%22:%22V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k%3D%22,%22sType%22:%22101%22%7D&ptag=139022.1.2?srv=jinshusongjin_https://wq.jd.com/cube/front/activePublish/dream_factory_report/380556.html_jing", + "User-Agent": "jdpingou" + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + console.log(`参团成功\n${JSON.stringify(data)}\n`); + } else { + console.log(`参团失败:${JSON.stringify(data)}`); + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +//查询所有的团情况(自己开团以及参加别人的团) +function QueryAllTuan() { + return new Promise((resolve) => { + const options = { + 'url': `https://m.jingxi.com/dreamfactory/tuan/QueryAllTuan?activeId=${escape(tuanActiveId)}&pageNo=1&pageSize=10&_time=${Date.now()}&_=${Date.now()}&sceneval=2&g_login_type=1`, + "headers": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Host": "m.jingxi.com", + "Referer": "https://st.jingxi.com/pingou/dream_factory/divide.html", + "User-Agent": "jdpingou;iPhone;3.15.2;13.5.1;90bab9217f465a83a99c0b554a946b0b0d5c2f7a;network/wifi;model/iPhone12,1;appBuild/100365;ADID/696F8BD2-0820-405C-AFC0-3C6D028040E5;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/14;pap/JA2015_311210;brand/apple;supportJDSHWK/1;" + } + } + $.get(options, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + const { tuanInfo } = data; + for (let item of tuanInfo) { + if (item.tuanNum === item.realTuanNum) { + // console.log(`参加团主【${item.tuanLeader}】已成功`) + const { userInfo } = item; + for (let item2 of userInfo) { + if (item2.encryptPin === $.encryptPin) { + if (item2.receiveElectric && item2.receiveElectric > 0) { + console.log(`${new Date(item2.joinTime * 1000).toLocaleString()}参加团主【${item2.nickName}】的奖励已经领取成功`) + } else { + console.log(`开始领取${new Date(item2.joinTime * 1000).toLocaleString()}参加团主【${item2.nickName}】的奖励`) + await tuanAward(item.tuanActiveId, item.tuanId, item.tuanLeader === $.encryptPin);//isTuanLeader + } + } + } + } else { + console.log(`${new Date(item.beginTime * 1000).toLocaleString()}参加团主【${item.tuanLeader}】失败`) + } + } + } else { + console.log(`QueryAllTuan异常:${JSON.stringify(data)}`); + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +//开团人的领取奖励API +function tuanAward(activeId, tuanId, isTuanLeader = true) { + return new Promise((resolve) => { + const options = { + 'url': `https://m.jingxi.com/dreamfactory/tuan/Award?activeId=${escape(activeId)}&tuanId=${escape(tuanId)}&_time=${Date.now()}&_=${Date.now()}&sceneval=2&g_login_type=1`, + "headers": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Host": "m.jingxi.com", + "Referer": "https://st.jingxi.com/pingou/dream_factory/divide.html", + "User-Agent": "jdpingou;iPhone;3.15.2;13.5.1;90bab9217f465a83a99c0b554a946b0b0d5c2f7a;network/wifi;model/iPhone12,1;appBuild/100365;ADID/696F8BD2-0820-405C-AFC0-3C6D028040E5;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/14;pap/JA2015_311210;brand/apple;supportJDSHWK/1;" + } + } + $.get(options, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['ret'] === 0) { + if (isTuanLeader) { + console.log(`开团奖励(团长)${data.data['electric']}领取成功`); + message += `【开团(团长)奖励】${data.data['electric']}领取成功\n`; + if ($.surplusOpenTuanNum > 0) { + $.log(`开团奖励(团长)已领取,准备开团`); + await CreateTuan(); + } + } else { + console.log(`参团奖励${data.data['electric']}领取成功`); + message += `【参团奖励】${data.data['electric']}领取成功\n`; + } + } else if (data['ret'] === 10212) { + console.log(`${JSON.stringify(data)}`); + + if (isTuanLeader && $.surplusOpenTuanNum > 0) { + $.log(`团奖励已领取,准备开团`); + await CreateTuan(); + } + } else { + console.log(`异常:${JSON.stringify(data)}`); + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function updateTuanIds(url = 'https://raw.githubusercontent.com/LXK9301/updateTeam/master/jd_updateFactoryTuanId.json') { + return new Promise(resolve => { + $.get({url}, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + } else { + $.tuanIdS = JSON.parse(data); + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function updateTuanIdsCDN(url) { + return new Promise(async resolve => { + $.get({url, + headers:{ + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" + }}, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + } else { + if (safeGet(data)) { + $.tuanIdS = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + await $.wait(3000) + resolve(); + }) +} +function checkExchange() { + +} +//商品可兑换时的通知 +async function exchangeProNotify() { + await GetShelvesList(); + let exchangeEndTime, exchangeEndHours, nowHours; + //脚本运行的UTC+8时区的时间戳 + let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); + if ($.shelvesList && $.shelvesList.length > 0) console.log(`\n 商品名 兑换状态`) + for (let shel of $.shelvesList) { + console.log(`${shel['name']} ${shel['exchangeStatus'] === 1 ? '未兑换' : shel['exchangeStatus'] === 2 ? '已兑换' : '兑换超时'}`) + if (shel['exchangeStatus'] === 1) { + exchangeEndTime = shel['exchangeEndTime'] * 1000; + $.picture = shel['picture']; + // 兑换截止时间点 + exchangeEndHours = new Date(exchangeEndTime + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).getHours(); + //兑换截止时间(年月日 时分秒) + $.exchangeEndTime = new Date(exchangeEndTime + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString('zh', {hour12: false}); + //脚本运行此时的时间点 + nowHours = nowTimes.getHours(); + } + } + if (exchangeEndTime) { + //比如兑换(超时)截止时间是2020/12/8 09:20:04,现在时间是2020/12/6 + if (nowTimes < exchangeEndTime) { + //还可以兑换 + // 一:在兑换超时这一天(2020/12/8 09:20:04)的前2小时内通知 + if ((exchangeEndTime - nowTimes) <= 3600000 * 2) { + $.msg($.name, ``, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}${(exchangeEndTime - nowTimes) / 60*60*1000}分钟后兑换超时\n【兑换截止时间】${$.exchangeEndTime}\n请速去京喜APP->首页->好物0元造进行兑换`, {'open-url': jxOpenUrl, 'media-url': $.picture}) + if ($.isNode()) await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}${(exchangeEndTime - nowTimes) / 60*60*1000}分钟后兑换超时\n【兑换截止时间】${$.exchangeEndTime}\n请速去京喜APP->首页->好物0元造进行兑换`, { url: jxOpenUrl }) + } + //二:在兑换超时日期前的时间一天通知三次(2020/12/6 9,10,11点,以及在2020/12/7 9,10,11点各通知一次) + if (nowHours === exchangeEndHours || nowHours === (exchangeEndHours + 1) || nowHours === (exchangeEndHours + 2)) { + $.msg($.name, ``, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}已可兑换\n【兑换截止时间】${$.exchangeEndTime}\n请速去京喜APP->首页->好物0元造进行兑换`, {'open-url': jxOpenUrl, 'media-url': $.picture}) + if ($.isNode()) await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}已可兑换\n【兑换截止时间】${$.exchangeEndTime}\n请速去京喜APP->首页->好物0元造进行兑换`, { url: jxOpenUrl }) + } + } else { + //兑换已超时 + $.msg($.name, ``, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}兑换已超时,请重新选择商品生产\n【兑换截止时间】${$.exchangeEndTime}`, {'open-url': jxOpenUrl}) + if ($.isNode()) await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}兑换已超时,请重新选择商品生产\n【兑换截止时间】${$.exchangeEndTime}`, { url: jxOpenUrl }) + } + } +} +async function showMsg() { + return new Promise(async resolve => { + message += `【收取自己零件】${$.pickUpMyselfComponent ? `获得${$.pickEle}电力` : `今日已达上限`}\n`; + message += `【收取好友零件】${$.pickUpMyselfComponent ? `获得${$.pickFriendEle}电力` : `今日已达上限`}\n`; + let ctrTemp; + if ($.isNode() && process.env.DREAMFACTORY_NOTIFY_CONTROL) { + ctrTemp = `${process.env.DREAMFACTORY_NOTIFY_CONTROL}` === 'false'; + } else if ($.getdata('jdDreamFactory')) { + ctrTemp = $.getdata('jdDreamFactory') === 'false'; + } else { + ctrTemp = `${jdNotify}` === 'false'; + } + if (ctrTemp) { + $.msg($.name, '', message); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `${message}`); + } + } else if (new Date().getHours() === 22) { + $.msg($.name, '', `${message}`) + $.log(`\n${message}`); + } else { + $.log(`\n${message}`); + } + resolve() + }) +} +function readShareCode() { + console.log(`开始`) + return new Promise(async resolve => { + $.get({url: `http://jd.turinglabs.net/api/v2/jd/jxfactory/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) + data = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + await $.wait(10000); + resolve() + }) +} +//格式化助力码 +function shareCodesFormat() { + return new Promise(async resolve => { + // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`) + $.newShareCodes = []; + if ($.shareCodesArr[$.index - 1]) { + $.newShareCodes = $.shareCodesArr[$.index - 1].split('@'); + } else { + console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) + const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1); + $.newShareCodes = inviteCodes[tempIndex].split('@'); + } + const readShareCodeRes = await readShareCode(); + if (readShareCodeRes && readShareCodeRes.code === 200) { + $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])]; + } + console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`) + resolve(); + }) +} +function requireConfig() { + return new Promise(async resolve => { + await updateTuanIdsCDN('https://gitee.com/lxk0301/updateTeam/raw/master/jd_updateFactoryTuanId.json'); + if (!$.tuanIdS) await updateTuanIds(); + if (!$.tuanIdS) await updateTuanIdsCDN('https://cdn.jsdelivr.net/gh/LXK9301/updateTeam@master/jd_updateFactoryTuanId.json'); + if ($.tuanIdS && $.tuanIdS.tuanActiveId) { + tuanActiveId = $.tuanIdS.tuanActiveId; + } + console.log(`开始获取${$.name}配置文件\n`); + console.log(`tuanActiveId: ${tuanActiveId}`) + //Node.js用户请在jdCookie.js处填写京东ck; + const shareCodes = $.isNode() ? require('./jdDreamFactoryShareCodes.js') : ''; + console.log(`共${cookiesArr.length}个京东账号\n`); + $.shareCodesArr = []; + if ($.isNode()) { + Object.keys(shareCodes).forEach((item) => { + if (shareCodes[item]) { + $.shareCodesArr.push(shareCodes[item]) + } + }) + } + // console.log(`\n种豆得豆助力码::${JSON.stringify($.shareCodesArr)}`); + console.log(`您提供了${$.shareCodesArr.length}个账号的${$.name}助力码\n`); + resolve() + }) +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1" + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function taskurl(functionId, body = '') { + return { + url: `${JD_API_HOST}/dreamfactory/${functionId}?zone=dream_factory&${body}&sceneval=2&g_login_type=1&_time=${Date.now()}&_=${Date.now()}`, + headers: { + 'Cookie': cookie, + 'Host': 'm.jingxi.com', + 'Accept': '*/*', + 'Connection': 'keep-alive', + 'User-Agent': 'jdpingou;iPhone;3.14.4;14.0;ae75259f6ca8378672006fc41079cd8c90c53be8;network/wifi;model/iPhone10,2;appBuild/100351;ADID/00000000-0000-0000-0000-000000000000;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/62;pap/JA2015_311210;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', + 'Accept-Language': 'zh-cn', + 'Referer': 'https://wqsd.jd.com/pingou/dream_factory/index.html', + 'Accept-Encoding': 'gzip, deflate, br', + } + } +} +function newtasksysUrl(functionId, taskId, stk) { + let url = `${JD_API_HOST}/newtasksys/newtasksys_front/${functionId}?source=dreamfactory&bizCode=dream_factory&sceneval=2&g_login_type=1&_time=${Date.now()}&_=${Date.now()}`; + if (taskId) { + url += `&taskId=${taskId}`; + } + if (stk) { + url += `&_stk=${stk}`; + } + return { + url, + "headers": { + 'Cookie': cookie, + 'Host': 'm.jingxi.com', + 'Accept': '*/*', + 'Connection': 'keep-alive', + 'User-Agent': "jdpingou;iPhone;3.15.2;13.5.1;90bab9217f465a83a99c0b554a946b0b0d5c2f7a;network/wifi;model/iPhone12,1;appBuild/100365;ADID/696F8BD2-0820-405C-AFC0-3C6D028040E5;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/14;pap/JA2015_311210;brand/apple;supportJDSHWK/1;", + 'Accept-Language': 'zh-cn', + 'Referer': 'https://wqsd.jd.com/pingou/dream_factory/index.html', + 'Accept-Encoding': 'gzip, deflate, br', + } + } +} +Date.prototype.Format = function (fmt) { //author: meizz + var o = { + "M+": this.getMonth() + 1, //月份 + "d+": this.getDate(), //日 + "h+": this.getHours(), //小时 + "m+": this.getMinutes(), //分 + "s+": this.getSeconds(), //秒 + "q+": Math.floor((this.getMonth() + 3) / 3), //季度 + "S": this.getMilliseconds() //毫秒 + }; + if (/(y+)/.test(fmt)) + fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); + for (var k in o) + if (new RegExp("(" + k + ")").test(fmt)) + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); + return fmt; +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} +// prettier-ignore +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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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)} diff --git a/jd_friend.js b/jd_friend.js new file mode 100644 index 0000000000..a827019b87 --- /dev/null +++ b/jd_friend.js @@ -0,0 +1,400 @@ +/* +joy总动员 + */ +const $ = new Env('joy总动员'); + +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 +const helpAuthor = true; // 是否帮助作者助力,false打开通知推送,true关闭通知推送 +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '', message; +let friendBody = [ + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22oOO65BY0hrDJVHO9q9jk7Q%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=f170654a0d60d7c235d59f3272169aa4&st=1609421400820&sv=121&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22F0EdP5NfemMuYZOuuPtWeQ%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=fb60d1a854ad02cb1bb0e8c9b860c564&st=1609421782489&sv=110&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22V3IJYdz33tgQjTf2N5sJxL22PE%252B9Cjx0%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=a6859f5db6fe3b2072413aac8ada738c&st=1609421791458&sv=100&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22hfi6vpNOF5a8iQB69A3joQ%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=fa3c5a5ec5cc2c0917956cc1953e1ebf&st=1609421797047&sv=100&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22IfGCI0UJ4HI1trmx1peLdw%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=9f07e2267ee1af2a6b4d74aff5599aa5&st=1609421808336&sv=100&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%227IvQAyhrIQ1IQo%252FeuAQLzw%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=020071221042b99de2b27e439615d8c1&st=1609421818632&sv=110&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22Mu4uKSZhQwuRwAxxcYrXHQ%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=9b3f7261c835f5003249d3bf562e3922&st=1609421827602&sv=110&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22oVyf6jVgchhQLi1meLF8UQ%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=6bbb42ec4d6df4e0cb575446fb503eb1&st=1609421831050&sv=121&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22Ip99PYMqNMkzDpSSlc12yw%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=5ea157ef5abcb86750289f59592a4be0&st=1609421841433&sv=101&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22cmDlh6FLScTjwvzAch1Z2Q%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=8f2b2844ad81a772811054695547d4ba&st=1609421846904&sv=101&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22VGAr8tpbghHN4S8V8zOIyA%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=be1693790dd33ee3ac64430eb05e9c26&st=1609421852909&sv=112&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22f%252Fp06uk5e%252FPzUJZtEpM71pD8Tnq8AdgZ%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=206f8b8f7b044fac89627ffcba7ee4c5&st=1609421858521&sv=122&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%228leqNSLFagedLYJD8aayFVOnm69NNz1f%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=e820cd8465c5cd5943f7b8d0ef698ab4&st=1609421863332&sv=121&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22mcUfJbbTz9gBgfBGLrTm1qYriUrERY7S%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=ca992c239f802f98c08cb0751930c4bb&st=1609421868203&sv=100&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22sXPJrK11bfx15Zd%252B2iWDXA%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=e6d6a23078eb8c4b2919bff3b9279ed6&st=1609421873367&sv=112&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22aD8dKBHjvH1BIfBwPFEPow%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=f293483bc173fde16e1a8ab314d24a13&st=1609421877528&sv=121&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22VGAr8tpbghHN4S8V8zOIyA%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=0b9a2105db9df6ce6c06faf2d76b87af&st=1609421880722&sv=102&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22e%252Fx4pxNB1inPCMg65RTmqG5YP5AOxt8f%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=a5ff7ec8f618874e1c721137b7249a53&st=1609421883744&sv=112&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22i2dQGybge5xZP%252FgmIfMBBA%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=5c6d0a1463dedb42efd59947f357742f&st=1609421891974&sv=110&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22F0EdP5NfemMuYZOuuPtWeQ%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=1242ab5f5f801f5dc913f7bb9232f2de&st=1609421899834&sv=122&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22kFjnMMfPiMlbYUrjLVxfBvHUtLKrXdc0%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=79f227d03e9537f11eb900fc334cf9ad&st=1609421903106&sv=101&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22aD8dKBHjvH1BIfBwPFEPow%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=c12b6e118191587e6574c4a859809a2b&st=1609421907213&sv=100&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22VkNtaNVunxKVNaTsBuL4WQ%253D%253D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=b3df1a185d1321aeb2ee9e11f6232968&st=1609421910983&sv=100&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%226xaWXhG8gOoxIT3QDJBtT9LVwAXlBq2D%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=50281e3582732194b10200977723ed43&st=1609421918909&sv=121&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22transType%22%3A0%2C%22oppositePin%22%3A%22PiIvyKdPOqoaTcz31oXPI2fJ3eg0XNUe%22%2C%22source%22%3A2%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=a1860b1477a347e577b8712db7d0b5a9&st=1609421923443&sv=100&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb' +] +let removeBody = [ + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22aD8dKBHjvH1BIfBwPFEPow%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=0b984c40b50be8c78e0b6a6886c72870&st=1609423456364&sv=112&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22f%5C/p06uk5e%5C/PzUJZtEpM71pD8Tnq8AdgZ%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=c860616a332f67b2f41a7f9734d18670&st=1609423497333&sv=102&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22hfi6vpNOF5a8iQB69A3joQ%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=9704ffe6c77875b82eb8cce42acb62cc&st=1609423503583&sv=101&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22Ip99PYMqNMkzDpSSlc12yw%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=44185d90bb69a44a08c95b3a4c61d271&st=1609423507034&sv=100&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22sXPJrK11bfx15Zd%2B2iWDXA%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=d44075b4dc60831097c438f9b5045a47&st=1609423510983&sv=101&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22cmDlh6FLScTjwvzAch1Z2Q%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=50dfc34b01a1d38c1f5323972f41023f&st=1609423514833&sv=111&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22Mu4uKSZhQwuRwAxxcYrXHQ%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=e86658e5482ec4f1cc58b60b954d176e&st=1609423518118&sv=122&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22kFjnMMfPiMlbYUrjLVxfBvHUtLKrXdc0%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=f16992f054e8cb68cf972dbef734ee74&st=1609423521419&sv=102&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22mcUfJbbTz9gBgfBGLrTm1qYriUrERY7S%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=51c6ecb0dcae185cb3b838c508426088&st=1609423525235&sv=101&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22oVyf6jVgchhQLi1meLF8UQ%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=967a286159530cd60bce61a16748d273&st=1609423529035&sv=122&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%226xaWXhG8gOoxIT3QDJBtT9LVwAXlBq2D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=3ec3e251ece56a721bc5b885ae34e7f7&st=1609423532401&sv=102&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22i2dQGybge5xZP%5C/gmIfMBBA%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=e258a663471cc9d54bcd94c36037701d&st=1609423535685&sv=102&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22V3IJYdz33tgQjTf2N5sJxL22PE%2B9Cjx0%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=cdc8a3a6327fd1b62b857fd1fb78d252&st=1609423538985&sv=102&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22IfGCI0UJ4HI1trmx1peLdw%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=568d98a5952a37a0b64255f3275e2655&st=1609423543570&sv=122&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22VkNtaNVunxKVNaTsBuL4WQ%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=8a5d49e107157e6f69c1339db4a4fd88&st=1609423547936&sv=102&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22VGAr8tpbghHN4S8V8zOIyA%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=9ab365445f456c76b915a971e177b61d&st=1609423551369&sv=122&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22PiIvyKdPOqoaTcz31oXPI2fJ3eg0XNUe%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=dcc2b2e9ededab68cedb2a26770278ce&st=1609423555254&sv=101&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%227IvQAyhrIQ1IQo%5C/euAQLzw%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=3c574761f9b07b9d06c8c14480c2b53f&st=1609423559120&sv=121&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22e%5C/x4pxNB1inPCMg65RTmqG5YP5AOxt8f%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=b853b67fc744c4e503a8f23399dda4e9&st=1609423563854&sv=122&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22F0EdP5NfemMuYZOuuPtWeQ%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=79bb54cee1f3bf43f966456718427514&st=1609423572154&sv=100&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%22oOO65BY0hrDJVHO9q9jk7Q%3D%3D%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=228d1a91d0d8ab778f647b0582a6ea6d&st=1609423575321&sv=122&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb', + 'adid=CC1CDB91-EADC-4790-B669-DE4F85E425B7&area=12_904_908_57903&body=%7B%22oppositePin%22%3A%228leqNSLFagedLYJD8aayFVOnm69NNz1f%22%2C%22source%22%3A2%2C%22transType%22%3A3%7D&build=167490&client=apple&clientVersion=9.3.2&d_brand=apple&d_model=iPhone8%2C1&eid=eidI55930119Nzc3NUIwOTAtNjNBMi00Rg%3D%3Dk9iMPEBPjXpii/VVVYfSpocvZIf3V%2Bm2Go5MZ2y8LiYFi7RMve53r%2BINJc8BGfxbsUniaT69gPh8Zx6o&isBackground=N&joycious=11&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=1a509cff5a1237c1fe453e9bd8372a2e5ce55390&osVersion=13.4.1&partner=apple&rfs=0000&scope=01&screen=750%2A1334&sign=8982374fc5647544806348509757fe0a&st=1609423578954&sv=101&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJj9/1TOUo17mdWrXEKMH6NhjrEufHENCs2xA1vZiU1aqDR6L1%2BA%2ByOpHKZCMbWtCU40pNC2to7d1c5wm7YUH354dMG5K4VJCNv9dsCibhpog3YenA4%2B%2BthY3MWXh87RbVJXGl1pc2FvYtH/%2BFwdanLIBRQEs7YQKahuJjYFAAIr25ZzCIi%2B88QA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=eca3570e9aa3c15b2fad65c40a87f0fb' +] +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { + }; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +const JD_API_HOST = 'https://api.m.jd.com/'; +!(async () => { + $.newShareCodes = [] + // await getAuthorShareCode(); + // await getAuthorShareCode2(); + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + await TotalBean(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + await jdFriend(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +async function jdFriend() { + for (let i = 0; i < friendBody.length; ++i) { + await addFriend(friendBody[i]) + await $.wait(500) + } + $.bean = 0 + $.friends = [] + await getFriendList() + console.log($.friends.length) + for (let i = 0; i < $.friends.length; ++i) { + const friend = $.friends[i] + if (friend['intimacyStatus'] === 0) { + await getFriendDetail(friend['unionPin']) + } + } + await getCardList() + for (let i = 0; i < removeBody.length; ++i) { + await addFriend(removeBody[i]) + await $.wait(500) + } + console.log(`${$.name} 任务运行完成,共计获得 ${$.bean} 京豆`) +} + +function addFriend(body) { + return new Promise(resolve => { + $.post(taskPostUrl('jdf_updateFriendshipStatus', body), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + console.log(data) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function getFriendList() { + return new Promise(resolve => { + $.get(taskGetUrl('getFriendList', {"clientType": "jdApp"}), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.code === '0') { + $.friends = data.data.friends + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function getFriendDetail(unionPin) { + return new Promise(resolve => { + $.get(taskGetUrl('getIntimacyDetail', {"unionPin": unionPin, "clientType": "jdApp"}), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.code === '0') { + console.log(`与好友【${unionPin}】匹配成功,匹配程度:${data.data.intimacy.total}`) + await openBox(unionPin) + await $.wait(500) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function openBox(unionPin, type = 1) { + return new Promise(resolve => { + $.get(taskGetUrl('openBox', {"pin": unionPin, "clientType": "jdApp", "type": type}), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.code === '0') { + console.log(`打开宝箱成功,获得${data.data.bean ? data.data.bean : 0}京豆`) + $.bean += data.data.bean ? data.data.bean : 0 + } else { + console.log(data) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function getCardList() { + return new Promise(resolve => { + $.get(taskGetUrl('getCardList', {"clientType": "jdApp"}), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.code === '0' && data.data.box) { + const boxs = data.data.box + for (let i = 0; i < boxs.length; ++i) { + const box = boxs[i] + if (box['status'] === 1) { + console.log(`去开宝箱【${box['name']}】`) + await openBox(null, box['boxId']) + } + } + + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function showMsg() { + return new Promise(resolve => { + $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); + resolve() + }) +} + + +function taskPostUrl(function_id, body) { + return { + url: `https://api.m.jd.com/client.action?functionId=${function_id}`, + body: body, + headers: { + 'Cookie': cookie, + 'Host': 'api.m.jd.com', + 'Accept': '*/*', + 'Connection': 'keep-alive', + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9', + 'Accept-Encoding': 'gzip, deflate, br', + 'Content-Type': "application/x-www-form-urlencoded" + } + } +} + +function taskGetUrl(function_id, body) { + //console.log(`https://api.m.jd.com/?appid=joy-friend&functionId=${function_id}&body=${escape(JSON.stringify(body))}`) + return { + url: `https://api.m.jd.com/?appid=joy-friend&functionId=${function_id}&body=${escape(JSON.stringify(body))}`, + headers: { + 'Cookie': cookie, + 'Host': 'api.m.jd.com', + 'Accept': '*/*', + 'Connection': 'keep-alive', + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9', + 'Accept-Encoding': 'gzip, deflate, br', + 'Content-Type': "application/x-www-form-urlencoded", + "referer": "https://an.jd.com/babelDiy/Zeus/q1eB6WUB8oC4eH1BsCLWvQakVsX/index.html" + } + } +} + + +function taskUrl(function_id, body) { + body["version"] = "9.0.0.1"; + body["monitor_source"] = "plant_app_plant_index"; + body["monitor_refer"] = ""; + return { + url: JD_API_HOST, + body: `functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld&client=apple&area=5_274_49707_49973&build=167283&clientVersion=9.1.0`, + headers: { + 'Cookie': cookie, + 'Host': 'api.m.jd.com', + 'Accept': '*/*', + 'Connection': 'keep-alive', + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9', + 'Accept-Encoding': 'gzip, deflate, br', + 'Content-Type': "application/x-www-form-urlencoded" + } + } +} + +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} +// prettier-ignore +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,o)=>{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.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 o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=e&&e.timeout?e.timeout:o;const[r,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":r,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),o=JSON.stringify(this.data);s?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(e,o):this.fs.writeFileSync(t,o)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return s;return o}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),o=s?this.getval(s):"";if(o)try{const t=JSON.parse(o);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(e),r=this.getval(i),h=i?"null"===r?null:r||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,o,t),s=this.setval(JSON.stringify(e),i)}catch(e){const r={};this.lodash_set(r,o,t),s=this.setval(JSON.stringify(r),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()?$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)))}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())$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",$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t))}}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="",o){const r=t=>{if(!t||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,r(o)):this.isQuanX()&&$notify(e,s,i,r(o)));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)} diff --git a/jd_fruit.js b/jd_fruit.js new file mode 100644 index 0000000000..99ce136fa5 --- /dev/null +++ b/jd_fruit.js @@ -0,0 +1,1433 @@ +/* +东东水果:脚本更新地址 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js +更新时间:2021-1-9 +东东农场活动链接:https://h5.m.jd.com/babelDiy/Zeus/3KSjXqQabiTuD1cJ28QskrpWoBKT/index.html +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +互助码shareCode请先手动运行脚本查看打印可看到 +一天只能帮助4个人。多出的助力码无效 +==========================Quantumultx========================= +[task_local] +#jd免费水果 +5 6-18/6 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js, tag=东东农场, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdnc.png, enabled=true +=========================Loon============================= +[Script] +cron "5 6-18/6 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js,tag=东东农场 + +=========================Surge============================ +东东农场 = type=cron,cronexp="5 6-18/6 * * *",wake-system=1,timeout=120,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js + +=========================小火箭=========================== +东东农场 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js, cronexpr="5 6-18/6 * * *", timeout=200, enable=true + +jd免费水果 搬的https://github.com/liuxiaoyucc/jd-helper/blob/a6f275d9785748014fc6cca821e58427162e9336/fruit/fruit.js +*/ +const $ = new Env('东东农场'); +let cookiesArr = [], cookie = '', jdFruitShareArr = [], isBox = false, notify, newShareCodes; +//助力好友分享码(最多4个,否则后面的助力失败),原因:京东农场每人每天只有四次助力机会 +//此此内容是IOS用户下载脚本到本地使用,填写互助码的地方,同一京东账号的好友互助码请使用@符号隔开。 +//下面给出两个账号的填写示例(iOS只支持2个京东账号) +let shareCodes = [ // 这个列表填入你要助力的好友的shareCode + //账号一的好友shareCode,不同好友的shareCode中间用@符号隔开 + '0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a@', + //账号二的好友shareCode,不同好友的shareCode中间用@符号隔开 + 'b1638a774d054a05a30a17d3b4d364b8@f92cb56c6a1349f5a35f0372aa041ea0@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3@2673c3777d4443829b2a635059953a28', +] +let message = '', subTitle = '', option = {}, isFruitFinished = false; +const retainWater = 100;//保留水滴大于多少g,默认100g; +let jdNotify = false;//是否关闭通知,false打开通知推送,true关闭通知推送 +let jdFruitBeanCard = false;//农场使用水滴换豆卡(如果出现限时活动时100g水换20豆,此时比浇水划算,推荐换豆),true表示换豆(不浇水),false表示不换豆(继续浇水),脚本默认是浇水 +let randomCount = $.isNode() ? 20 : 5; +const JD_API_HOST = 'https://api.m.jd.com/client.action'; +const urlSchema = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/3KSjXqQabiTuD1cJ28QskrpWoBKT/index.html%22%20%7D`; +!(async () => { + await requireConfig(); + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + await TotalBean(); + console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + message = ''; + subTitle = ''; + option = {}; + await shareCodesFormat(); + await jdFruit(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) +async function jdFruit() { + await initForFarm(); + if ($.farmInfo.farmUserPro) { + // option['media-url'] = $.farmInfo.farmUserPro.goodsImage; + subTitle = `【京东账号${$.index}】${$.nickName}`; + message = `【水果名称】${$.farmInfo.farmUserPro.name}\n`; + console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${$.farmInfo.farmUserPro.shareCode}\n`); + console.log(`\n【已成功兑换水果】${$.farmInfo.farmUserPro.winTimes}次\n`); + message += `【已兑换水果】${$.farmInfo.farmUserPro.winTimes}次\n`; + await masterHelpShare();//助力好友 + if ($.farmInfo.treeState === 2 || $.farmInfo.treeState === 3) { + option['open-url'] = urlSchema; + $.msg($.name, ``, `【京东账号${$.index}】${$.nickName || $.UserName}\n【提醒⏰】${$.farmInfo.farmUserPro.name}已可领取\n请去京东APP或微信小程序查看\n点击弹窗即达`, option); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}水果已可领取`, `【京东账号${$.index}】${$.nickName || $.UserName}\n【提醒⏰】${$.farmInfo.farmUserPro.name}已可领取\n请去京东APP或微信小程序查看`); + } + return + } else if ($.farmInfo.treeState === 1){ + console.log(`\n${$.farmInfo.farmUserPro.name}种植中...\n`) + } else if ($.farmInfo.treeState === 0) { + //已下单购买, 但未开始种植新的水果 + option['open-url'] = urlSchema; + $.msg($.name, ``, `【京东账号${$.index}】 ${$.nickName || $.UserName}\n【提醒⏰】您忘了种植新的水果\n请去京东APP或微信小程序选购并种植新的水果\n点击弹窗即达`, option); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 您忘了种植新的水果`, `京东账号${$.index} ${$.nickName}\n【提醒⏰】您忘了种植新的水果\n请去京东APP或微信小程序选购并种植新的水果`); + } + return + } + await doDailyTask(); + await doTenWater();//浇水十次 + await getFirstWaterAward();//领取首次浇水奖励 + await getTenWaterAward();//领取10浇水奖励 + await getWaterFriendGotAward();//领取为2好友浇水奖励 + await duck(); + await doTenWaterAgain();//再次浇水 + await predictionFruit();//预测水果成熟时间 + } else { + console.log(`初始化农场数据异常, 请登录京东 app查看农场0元水果功能是否正常,农场初始化数据: ${JSON.stringify($.farmInfo)}`); + message = `【京东账号${$.index}】 ${$.nickName || $.UserName}\n【数据异常】请手动登录京东app查看此账号${$.name}是否正常`; + } + await showMsg(); +} +async function doDailyTask() { + await taskInitForFarm(); + console.log(`开始签到`); + if (!$.farmTask.signInit.todaySigned) { + await signForFarm(); //签到 + if ($.signResult.code === "0") { + console.log(`【签到成功】获得${$.signResult.amount}g💧\\n`) + //message += `【签到成功】获得${$.signResult.amount}g💧\n`//连续签到${signResult.signDay}天 + } else { + // message += `签到失败,详询日志\n`; + console.log(`签到结果: ${JSON.stringify($.signResult)}`); + } + } else { + console.log(`今天已签到,连续签到${$.farmTask.signInit.totalSigned},下次签到可得${$.farmTask.signInit.signEnergyEachAmount}g\n`); + } + // 被水滴砸中 + console.log(`被水滴砸中: ${$.farmInfo.todayGotWaterGoalTask.canPop ? '是' : '否'}`); + if ($.farmInfo.todayGotWaterGoalTask.canPop) { + await gotWaterGoalTaskForFarm(); + if ($.goalResult.code === '0') { + console.log(`【被水滴砸中】获得${$.goalResult.addEnergy}g💧\\n`); + // message += `【被水滴砸中】获得${$.goalResult.addEnergy}g💧\n` + } + } + console.log(`签到结束,开始广告浏览任务`); + if (!$.farmTask.gotBrowseTaskAdInit.f) { + let adverts = $.farmTask.gotBrowseTaskAdInit.userBrowseTaskAds + let browseReward = 0 + let browseSuccess = 0 + let browseFail = 0 + for (let advert of adverts) { //开始浏览广告 + if (advert.limit <= advert.hadFinishedTimes) { + // browseReward+=advert.reward + console.log(`${advert.mainTitle}+ ' 已完成`);//,获得${advert.reward}g + continue; + } + console.log('正在进行广告浏览任务: ' + advert.mainTitle); + await browseAdTaskForFarm(advert.advertId, 0); + if ($.browseResult.code === '0') { + console.log(`${advert.mainTitle}浏览任务完成`); + //领取奖励 + await browseAdTaskForFarm(advert.advertId, 1); + if ($.browseRwardResult.code === '0') { + console.log(`领取浏览${advert.mainTitle}广告奖励成功,获得${$.browseRwardResult.amount}g`) + browseReward += $.browseRwardResult.amount + browseSuccess++ + } else { + browseFail++ + console.log(`领取浏览广告奖励结果: ${JSON.stringify($.browseRwardResult)}`) + } + } else { + browseFail++ + console.log(`广告浏览任务结果: ${JSON.stringify($.browseResult)}`); + } + } + if (browseFail > 0) { + console.log(`【广告浏览】完成${browseSuccess}个,失败${browseFail},获得${browseReward}g💧\\n`); + // message += `【广告浏览】完成${browseSuccess}个,失败${browseFail},获得${browseReward}g💧\n`; + } else { + console.log(`【广告浏览】完成${browseSuccess}个,获得${browseReward}g💧\n`); + // message += `【广告浏览】完成${browseSuccess}个,获得${browseReward}g💧\n`; + } + } else { + console.log(`今天已经做过浏览广告任务\n`); + } + //定时领水 + if (!$.farmTask.gotThreeMealInit.f) { + // + await gotThreeMealForFarm(); + if ($.threeMeal.code === "0") { + console.log(`【定时领水】获得${$.threeMeal.amount}g💧\n`); + // message += `【定时领水】获得${$.threeMeal.amount}g💧\n`; + } else { + // message += `【定时领水】失败,详询日志\n`; + console.log(`定时领水成功结果: ${JSON.stringify($.threeMeal)}`); + } + } else { + console.log('当前不在定时领水时间断或者已经领过\n') + } + //给好友浇水 + if (!$.farmTask.waterFriendTaskInit.f) { + if ($.farmTask.waterFriendTaskInit.waterFriendCountKey < $.farmTask.waterFriendTaskInit.waterFriendMax) { + await doFriendsWater(); + } + } else { + console.log(`给${$.farmTask.waterFriendTaskInit.waterFriendMax}个好友浇水任务已完成\n`) + } + // await Promise.all([ + // clockInIn(),//打卡领水 + // executeWaterRains(),//水滴雨 + // masterHelpShare(),//助力好友 + // getExtraAward(),//领取额外水滴奖励 + // turntableFarm()//天天抽奖得好礼 + // ]) + await getAwardInviteFriend(); + await clockInIn();//打卡领水 + await executeWaterRains();//水滴雨 + await getExtraAward();//领取额外水滴奖励 + await turntableFarm()//天天抽奖得好礼 +} +async function predictionFruit() { + console.log('开始预测水果成熟时间\n'); + await initForFarm(); + await taskInitForFarm(); + let waterEveryDayT = $.farmTask.totalWaterTaskInit.totalWaterTaskTimes;//今天到到目前为止,浇了多少次水 + message += `【今日共浇水】${waterEveryDayT}次\n`; + message += `【剩余 水滴】${$.farmInfo.farmUserPro.totalEnergy}g💧\n`; + message += `【水果🍉进度】${(($.farmInfo.farmUserPro.treeEnergy / $.farmInfo.farmUserPro.treeTotalEnergy) * 100).toFixed(2)}%,已浇水${$.farmInfo.farmUserPro.treeEnergy / 10}次,还需${($.farmInfo.farmUserPro.treeTotalEnergy - $.farmInfo.farmUserPro.treeEnergy) / 10}次\n` + if ($.farmInfo.toFlowTimes > ($.farmInfo.farmUserPro.treeEnergy / 10)) { + message += `【开花进度】再浇水${$.farmInfo.toFlowTimes - $.farmInfo.farmUserPro.treeEnergy / 10}次开花\n` + } else if ($.farmInfo.toFruitTimes > ($.farmInfo.farmUserPro.treeEnergy / 10)) { + message += `【结果进度】再浇水${$.farmInfo.toFruitTimes - $.farmInfo.farmUserPro.treeEnergy / 10}次结果\n` + } + // 预测n天后水果课可兑换功能 + let waterTotalT = ($.farmInfo.farmUserPro.treeTotalEnergy - $.farmInfo.farmUserPro.treeEnergy - $.farmInfo.farmUserPro.totalEnergy) / 10;//一共还需浇多少次水 + + let waterD = Math.ceil(waterTotalT / waterEveryDayT); + + message += `【预测】${waterD === 1 ? '明天' : waterD === 2 ? '后天' : waterD + '天之后'}(${timeFormat(24 * 60 * 60 * 1000 * waterD + Date.now())}日)可兑换水果🍉` +} +//浇水十次 +async function doTenWater() { + jdFruitBeanCard = $.getdata('jdFruitBeanCard') ? $.getdata('jdFruitBeanCard') : jdFruitBeanCard; + if ($.isNode() && process.env.FRUIT_BEAN_CARD) { + jdFruitBeanCard = process.env.FRUIT_BEAN_CARD; + } + await myCardInfoForFarm(); + const { fastCard, doubleCard, beanCard, signCard } = $.myCardInfoRes; + if (`${jdFruitBeanCard}` === 'true' && JSON.stringify($.myCardInfoRes).match(`限时翻倍`) && beanCard > 0) { + console.log(`您设置的是使用水滴换豆卡,且背包有水滴换豆卡${beanCard}张, 跳过10次浇水任务`) + return + } + if ($.farmTask.totalWaterTaskInit.totalWaterTaskTimes < $.farmTask.totalWaterTaskInit.totalWaterTaskLimit) { + console.log(`\n准备浇水十次`); + let waterCount = 0; + isFruitFinished = false; + for (; waterCount < $.farmTask.totalWaterTaskInit.totalWaterTaskLimit - $.farmTask.totalWaterTaskInit.totalWaterTaskTimes; waterCount++) { + console.log(`第${waterCount + 1}次浇水`); + await waterGoodForFarm(); + console.log(`本次浇水结果: ${JSON.stringify($.waterResult)}`); + if ($.waterResult.code === '0') { + console.log(`剩余水滴${$.waterResult.totalEnergy}g`); + if ($.waterResult.finished) { + // 已证实,waterResult.finished为true,表示水果可以去领取兑换了 + isFruitFinished = true; + break + } else { + if ($.waterResult.totalEnergy < 10) { + console.log(`水滴不够,结束浇水`) + break + } + await gotStageAward();//领取阶段性水滴奖励 + } + } else { + console.log('浇水出现失败异常,跳出不在继续浇水') + break; + } + } + if (isFruitFinished) { + option['open-url'] = urlSchema; + $.msg($.name, ``, `【京东账号${$.index}】${$.nickName || $.UserName}\n【提醒⏰】${$.farmInfo.farmUserPro.name}已可领取\n请去京东APP或微信小程序查看\n点击弹窗即达`, option); + $.done(); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}水果已可领取`, `京东账号${$.index} ${$.nickName}\n${$.farmInfo.farmUserPro.name}已可领取`); + } + } + } else { + console.log('\n今日已完成10次浇水任务\n'); + } +} +//领取首次浇水奖励 +async function getFirstWaterAward() { + await taskInitForFarm(); + //领取首次浇水奖励 + if (!$.farmTask.firstWaterInit.f && $.farmTask.firstWaterInit.totalWaterTimes > 0) { + await firstWaterTaskForFarm(); + if ($.firstWaterReward.code === '0') { + console.log(`【首次浇水奖励】获得${$.firstWaterReward.amount}g💧\n`); + // message += `【首次浇水奖励】获得${$.firstWaterReward.amount}g💧\n`; + } else { + // message += '【首次浇水奖励】领取奖励失败,详询日志\n'; + console.log(`领取首次浇水奖励结果: ${JSON.stringify($.firstWaterReward)}`); + } + } else { + console.log('首次浇水奖励已领取\n') + } +} +//领取十次浇水奖励 +async function getTenWaterAward() { + //领取10次浇水奖励 + if (!$.farmTask.totalWaterTaskInit.f && $.farmTask.totalWaterTaskInit.totalWaterTaskTimes >= $.farmTask.totalWaterTaskInit.totalWaterTaskLimit) { + await totalWaterTaskForFarm(); + if ($.totalWaterReward.code === '0') { + console.log(`【十次浇水奖励】获得${$.totalWaterReward.totalWaterTaskEnergy}g💧\n`); + // message += `【十次浇水奖励】获得${$.totalWaterReward.totalWaterTaskEnergy}g💧\n`; + } else { + // message += '【十次浇水奖励】领取奖励失败,详询日志\n'; + console.log(`领取10次浇水奖励结果: ${JSON.stringify($.totalWaterReward)}`); + } + } else if ($.farmTask.totalWaterTaskInit.totalWaterTaskTimes < $.farmTask.totalWaterTaskInit.totalWaterTaskLimit) { + // message += `【十次浇水奖励】任务未完成,今日浇水${$.farmTask.totalWaterTaskInit.totalWaterTaskTimes}次\n`; + console.log(`【十次浇水奖励】任务未完成,今日浇水${$.farmTask.totalWaterTaskInit.totalWaterTaskTimes}次\n`); + } + console.log('finished 水果任务完成!'); +} +//再次浇水 +async function doTenWaterAgain() { + console.log('开始检查剩余水滴能否再次浇水再次浇水\n'); + await initForFarm(); + let totalEnergy = $.farmInfo.farmUserPro.totalEnergy; + console.log(`剩余水滴${totalEnergy}g\n`); + await myCardInfoForFarm(); + const { fastCard, doubleCard, beanCard, signCard } = $.myCardInfoRes; + console.log(`背包已有道具:\n快速浇水卡:${fastCard === -1 ? '未解锁': fastCard + '张'}\n水滴翻倍卡:${doubleCard === -1 ? '未解锁': doubleCard + '张'}\n水滴换京豆卡:${beanCard === -1 ? '未解锁' : beanCard + '张'}\n加签卡:${signCard === -1 ? '未解锁' : signCard + '张'}\n`) + if (totalEnergy >= 100 && doubleCard > 0) { + //使用翻倍水滴卡 + for (let i = 0; i < new Array(doubleCard).fill('').length; i++) { + await userMyCardForFarm('doubleCard'); + console.log(`使用翻倍水滴卡结果:${JSON.stringify($.userMyCardRes)}`); + } + await initForFarm(); + totalEnergy = $.farmInfo.farmUserPro.totalEnergy; + } + if (signCard > 0) { + //使用加签卡 + for (let i = 0; i < new Array(signCard).fill('').length; i++) { + await userMyCardForFarm('signCard'); + console.log(`使用加签卡结果:${JSON.stringify($.userMyCardRes)}`); + } + await initForFarm(); + totalEnergy = $.farmInfo.farmUserPro.totalEnergy; + } + jdFruitBeanCard = $.getdata('jdFruitBeanCard') ? $.getdata('jdFruitBeanCard') : jdFruitBeanCard; + if ($.isNode() && process.env.FRUIT_BEAN_CARD) { + jdFruitBeanCard = process.env.FRUIT_BEAN_CARD; + } + if (`${jdFruitBeanCard}` === 'true' && JSON.stringify($.myCardInfoRes).match('限时翻倍')) { + console.log(`\n您设置的是水滴换豆功能,现在为您换豆`); + if (totalEnergy >= 100 && $.myCardInfoRes.beanCard > 0) { + //使用水滴换豆卡 + await userMyCardForFarm('beanCard'); + console.log(`使用水滴换豆卡结果:${JSON.stringify($.userMyCardRes)}`); + if ($.userMyCardRes.code === '0') { + message += `【水滴换豆卡】获得${$.userMyCardRes.beanCount}个京豆\n`; + return + } + } else { + console.log(`您目前水滴:${totalEnergy}g,水滴换豆卡${$.myCardInfoRes.beanCard}张,暂不满足水滴换豆的条件,为您继续浇水`) + } + } + // if (totalEnergy > 100 && $.myCardInfoRes.fastCard > 0) { + // //使用快速浇水卡 + // await userMyCardForFarm('fastCard'); + // console.log(`使用快速浇水卡结果:${JSON.stringify($.userMyCardRes)}`); + // if ($.userMyCardRes.code === '0') { + // console.log(`已使用快速浇水卡浇水${$.userMyCardRes.waterEnergy}g`); + // } + // await initForFarm(); + // totalEnergy = $.farmInfo.farmUserPro.totalEnergy; + // } + // 所有的浇水(10次浇水)任务,获取水滴任务完成后,如果剩余水滴大于等于60g,则继续浇水(保留部分水滴是用于完成第二天的浇水10次的任务) + let overageEnergy = totalEnergy - retainWater; + if (totalEnergy >= ($.farmInfo.farmUserPro.treeTotalEnergy - $.farmInfo.farmUserPro.treeEnergy)) { + //如果现有的水滴,大于水果可兑换所需的对滴(也就是把水滴浇完,水果就能兑换了) + isFruitFinished = false; + for (let i = 0; i < ($.farmInfo.farmUserPro.treeTotalEnergy - $.farmInfo.farmUserPro.treeEnergy) / 10; i++) { + await waterGoodForFarm(); + console.log(`本次浇水结果(水果马上就可兑换了): ${JSON.stringify($.waterResult)}`); + if ($.waterResult.code === '0') { + console.log('\n浇水10g成功\n'); + if ($.waterResult.finished) { + // 已证实,waterResult.finished为true,表示水果可以去领取兑换了 + isFruitFinished = true; + break + } else { + console.log(`目前水滴【${$.waterResult.totalEnergy}】g,继续浇水,水果马上就可以兑换了`) + } + } else { + console.log('浇水出现失败异常,跳出不在继续浇水') + break; + } + } + if (isFruitFinished) { + option['open-url'] = urlSchema; + $.msg($.name, ``, `【京东账号${$.index}】${$.nickName || $.UserName}\n【提醒⏰】${$.farmInfo.farmUserPro.name}已可领取\n请去京东APP或微信小程序查看\n点击弹窗即达`, option); + $.done(); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}水果已可领取`, `京东账号${$.index} ${$.nickName}\n${$.farmInfo.farmUserPro.name}已可领取`); + } + } + } else if (overageEnergy >= 10) { + console.log("目前剩余水滴:【" + totalEnergy + "】g,可继续浇水"); + isFruitFinished = false; + for (let i = 0; i < parseInt(overageEnergy / 10); i++) { + await waterGoodForFarm(); + console.log(`本次浇水结果: ${JSON.stringify($.waterResult)}`); + if ($.waterResult.code === '0') { + console.log(`\n浇水10g成功,剩余${$.waterResult.totalEnergy}\n`) + if ($.waterResult.finished) { + // 已证实,waterResult.finished为true,表示水果可以去领取兑换了 + isFruitFinished = true; + break + } else { + await gotStageAward() + } + } else { + console.log('浇水出现失败异常,跳出不在继续浇水') + break; + } + } + if (isFruitFinished) { + option['open-url'] = urlSchema; + $.msg($.name, ``, `【京东账号${$.index}】${$.nickName || $.UserName}\n【提醒⏰】${$.farmInfo.farmUserPro.name}已可领取\n请去京东APP或微信小程序查看\n点击弹窗即达`, option); + $.done(); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}水果已可领取`, `京东账号${$.index} ${$.nickName}\n${$.farmInfo.farmUserPro.name}已可领取`); + } + } + } else { + console.log("目前剩余水滴:【" + totalEnergy + "】g,不再继续浇水,保留部分水滴用于完成第二天【十次浇水得水滴】任务") + } +} +//领取阶段性水滴奖励 +function gotStageAward() { + return new Promise(async resolve => { + if ($.waterResult.waterStatus === 0 && $.waterResult.treeEnergy === 10) { + console.log('果树发芽了,奖励30g水滴'); + await gotStageAwardForFarm('1'); + console.log(`浇水阶段奖励1领取结果 ${JSON.stringify($.gotStageAwardForFarmRes)}`); + if ($.gotStageAwardForFarmRes.code === '0') { + // message += `【果树发芽了】奖励${$.gotStageAwardForFarmRes.addEnergy}\n`; + console.log(`【果树发芽了】奖励${$.gotStageAwardForFarmRes.addEnergy}\n`); + } + } else if ($.waterResult.waterStatus === 1) { + console.log('果树开花了,奖励40g水滴'); + await gotStageAwardForFarm('2'); + console.log(`浇水阶段奖励2领取结果 ${JSON.stringify($.gotStageAwardForFarmRes)}`); + if ($.gotStageAwardForFarmRes.code === '0') { + // message += `【果树开花了】奖励${$.gotStageAwardForFarmRes.addEnergy}g💧\n`; + console.log(`【果树开花了】奖励${$.gotStageAwardForFarmRes.addEnergy}g💧\n`); + } + } else if ($.waterResult.waterStatus === 2) { + console.log('果树长出小果子啦, 奖励50g水滴'); + await gotStageAwardForFarm('3'); + console.log(`浇水阶段奖励3领取结果 ${JSON.stringify($.gotStageAwardForFarmRes)}`) + if ($.gotStageAwardForFarmRes.code === '0') { + // message += `【果树结果了】奖励${$.gotStageAwardForFarmRes.addEnergy}g💧\n`; + console.log(`【果树结果了】奖励${$.gotStageAwardForFarmRes.addEnergy}g💧\n`); + } + } + resolve() + }) +} +//天天抽奖活动 +async function turntableFarm() { + await initForTurntableFarm(); + if ($.initForTurntableFarmRes.code === '0') { + //领取定时奖励 //4小时一次 + let {timingIntervalHours, timingLastSysTime, sysTime, timingGotStatus, remainLotteryTimes, turntableInfos} = $.initForTurntableFarmRes; + + if (!timingGotStatus) { + console.log(`是否到了领取免费赠送的抽奖机会----${sysTime > (timingLastSysTime + 60*60*timingIntervalHours*1000)}`) + if (sysTime > (timingLastSysTime + 60*60*timingIntervalHours*1000)) { + await timingAwardForTurntableFarm(); + console.log(`领取定时奖励结果${JSON.stringify($.timingAwardRes)}`); + await initForTurntableFarm(); + remainLotteryTimes = $.initForTurntableFarmRes.remainLotteryTimes; + } else { + console.log(`免费赠送的抽奖机会未到时间`) + } + } else { + console.log('4小时候免费赠送的抽奖机会已领取') + } + if ($.initForTurntableFarmRes.turntableBrowserAds && $.initForTurntableFarmRes.turntableBrowserAds.length > 0) { + for (let index = 0; index < $.initForTurntableFarmRes.turntableBrowserAds.length; index++) { + if (!$.initForTurntableFarmRes.turntableBrowserAds[index].status) { + console.log(`开始浏览天天抽奖的第${index + 1}个逛会场任务`) + await browserForTurntableFarm(1, $.initForTurntableFarmRes.turntableBrowserAds[index].adId); + if ($.browserForTurntableFarmRes.code === '0' && $.browserForTurntableFarmRes.status) { + console.log(`第${index + 1}个逛会场任务完成,开始领取水滴奖励\n`) + await browserForTurntableFarm(2, $.initForTurntableFarmRes.turntableBrowserAds[index].adId); + if ($.browserForTurntableFarmRes.code === '0') { + console.log(`第${index + 1}个逛会场任务领取水滴奖励完成\n`) + await initForTurntableFarm(); + remainLotteryTimes = $.initForTurntableFarmRes.remainLotteryTimes; + } + } + } else { + console.log(`浏览天天抽奖的第${index + 1}个逛会场任务已完成`) + } + } + } + //天天抽奖助力 + console.log('开始天天抽奖--好友助力--每人每天只有三次助力机会.') + for (let code of newShareCodes) { + if (code === $.farmInfo.farmUserPro.shareCode) { + console.log('天天抽奖-不能自己给自己助力\n') + continue + } + await lotteryMasterHelp(code); + // console.log('天天抽奖助力结果',lotteryMasterHelpRes.helpResult) + if ($.lotteryMasterHelpRes.helpResult.code === '0') { + console.log(`天天抽奖-助力${$.lotteryMasterHelpRes.helpResult.masterUserInfo.nickName}成功\n`) + } else if ($.lotteryMasterHelpRes.helpResult.code === '11') { + console.log(`天天抽奖-不要重复助力${$.lotteryMasterHelpRes.helpResult.masterUserInfo.nickName}\n`) + } else if ($.lotteryMasterHelpRes.helpResult.code === '13') { + console.log(`天天抽奖-助力${$.lotteryMasterHelpRes.helpResult.masterUserInfo.nickName}失败,助力次数耗尽\n`); + break; + } + } + console.log(`---天天抽奖次数remainLotteryTimes----${remainLotteryTimes}次`) + //抽奖 + if (remainLotteryTimes > 0) { + console.log('开始抽奖') + let lotteryResult = ''; + for (let i = 0; i < new Array(remainLotteryTimes).fill('').length; i++) { + await lotteryForTurntableFarm() + console.log(`第${i + 1}次抽奖结果${JSON.stringify($.lotteryRes)}`); + if ($.lotteryRes.code === '0') { + turntableInfos.map((item) => { + if (item.type === $.lotteryRes.type) { + console.log(`lotteryRes.type${$.lotteryRes.type}`); + if ($.lotteryRes.type.match(/bean/g) && $.lotteryRes.type.match(/bean/g)[0] === 'bean') { + lotteryResult += `${item.name}个,`; + } else if ($.lotteryRes.type.match(/water/g) && $.lotteryRes.type.match(/water/g)[0] === 'water') { + lotteryResult += `${item.name},`; + } else { + lotteryResult += `${item.name},`; + } + } + }) + //没有次数了 + if ($.lotteryRes.remainLotteryTimes === 0) { + break + } + } + } + if (lotteryResult) { + console.log(`【天天抽奖】${lotteryResult.substr(0, lotteryResult.length - 1)}\n`) + // message += `【天天抽奖】${lotteryResult.substr(0, lotteryResult.length - 1)}\n`; + } + } else { + console.log('天天抽奖--抽奖机会为0次') + } + } else { + console.log('初始化天天抽奖得好礼失败') + } +} +//领取额外奖励水滴 +async function getExtraAward() { + await masterHelpTaskInitForFarm(); + if ($.masterHelpResult.code === '0') { + if ($.masterHelpResult.masterHelpPeoples && $.masterHelpResult.masterHelpPeoples.length >= 5) { + // 已有五人助力。领取助力后的奖励 + if (!$.masterHelpResult.masterGotFinal) { + await masterGotFinishedTaskForFarm(); + if ($.masterGotFinished.code === '0') { + console.log(`已成功领取好友助力奖励:【${$.masterGotFinished.amount}】g水`); + message += `【额外奖励】${$.masterGotFinished.amount}g水领取成功\n`; + } + } else { + console.log("已经领取过5好友助力额外奖励"); + message += `【额外奖励】已被领取过\n`; + } + } else { + console.log("助力好友未达到5个"); + message += `【额外奖励】领取失败,原因:给您助力的人未达5个\n`; + } + if ($.masterHelpResult.masterHelpPeoples && $.masterHelpResult.masterHelpPeoples.length > 0) { + let str = ''; + $.masterHelpResult.masterHelpPeoples.map((item, index) => { + if (index === ($.masterHelpResult.masterHelpPeoples.length - 1)) { + str += item.nickName || "匿名用户"; + } else { + str += (item.nickName || "匿名用户") + ','; + } + let date = new Date(item.time); + let time = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getMinutes(); + console.log(`\n京东昵称【${item.nickName || "匿名用户"}】 在 ${time} 给您助过力\n`); + }) + message += `【助力您的好友】${str}\n`; + } + console.log('领取额外奖励水滴结束\n'); + } +} +//助力好友 +async function masterHelpShare() { + console.log('开始助力好友') + let salveHelpAddWater = 0; + let remainTimes = 4;//今日剩余助力次数,默认4次(京东农场每人每天4次助力机会)。 + let helpSuccessPeoples = '';//成功助力好友 + console.log(`格式化后的助力码::${JSON.stringify(newShareCodes)}\n`); + + for (let code of newShareCodes) { + console.log(`开始助力京东账号${$.index} - ${$.nickName}的好友: ${code}`); + if (!code) continue; + if (code === $.farmInfo.farmUserPro.shareCode) { + console.log('不能为自己助力哦,跳过自己的shareCode\n') + continue + } + await masterHelp(code); + if ($.helpResult.code === '0') { + if ($.helpResult.helpResult.code === '0') { + //助力成功 + salveHelpAddWater += $.helpResult.helpResult.salveHelpAddWater; + console.log(`【助力好友结果】: 已成功给【${$.helpResult.helpResult.masterUserInfo.nickName}】助力`); + console.log(`给好友【${$.helpResult.helpResult.masterUserInfo.nickName}】助力获得${$.helpResult.helpResult.salveHelpAddWater}g水滴`) + helpSuccessPeoples += ($.helpResult.helpResult.masterUserInfo.nickName || '匿名用户') + ','; + } else if ($.helpResult.helpResult.code === '8') { + console.log(`【助力好友结果】: 助力【${$.helpResult.helpResult.masterUserInfo.nickName}】失败,您今天助力次数已耗尽`); + } else if ($.helpResult.helpResult.code === '9') { + console.log(`【助力好友结果】: 之前给【${$.helpResult.helpResult.masterUserInfo.nickName}】助力过了`); + } else if ($.helpResult.helpResult.code === '10') { + console.log(`【助力好友结果】: 好友【${$.helpResult.helpResult.masterUserInfo.nickName}】已满五人助力`); + } else { + console.log(`助力其他情况:${JSON.stringify($.helpResult.helpResult)}`); + } + console.log(`【今日助力次数还剩】${$.helpResult.helpResult.remainTimes}次\n`); + remainTimes = $.helpResult.helpResult.remainTimes; + if ($.helpResult.helpResult.remainTimes === 0) { + console.log(`您当前助力次数已耗尽,跳出助力`); + break + } + } else { + console.log(`助力失败::${JSON.stringify($.helpResult)}`); + } + } + if ($.isLoon() || $.isQuanX() || $.isSurge()) { + let helpSuccessPeoplesKey = timeFormat() + $.farmInfo.farmUserPro.shareCode; + if (!$.getdata(helpSuccessPeoplesKey)) { + //把前一天的清除 + $.setdata('', timeFormat(Date.now() - 24 * 60 * 60 * 1000) + $.farmInfo.farmUserPro.shareCode); + $.setdata('', helpSuccessPeoplesKey); + } + if (helpSuccessPeoples) { + if ($.getdata(helpSuccessPeoplesKey)) { + $.setdata($.getdata(helpSuccessPeoplesKey) + ',' + helpSuccessPeoples, helpSuccessPeoplesKey); + } else { + $.setdata(helpSuccessPeoples, helpSuccessPeoplesKey); + } + } + helpSuccessPeoples = $.getdata(helpSuccessPeoplesKey); + } + if (helpSuccessPeoples && helpSuccessPeoples.length > 0) { + message += `【您助力的好友👬】${helpSuccessPeoples.substr(0, helpSuccessPeoples.length - 1)}\n`; + } + if (salveHelpAddWater > 0) { + // message += `【助力好友👬】获得${salveHelpAddWater}g💧\n`; + console.log(`【助力好友👬】获得${salveHelpAddWater}g💧\n`); + } + message += `【今日剩余助力👬】${remainTimes}次\n`; + console.log('助力好友结束,即将开始领取额外水滴奖励\n'); +} +//水滴雨 +async function executeWaterRains() { + let executeWaterRain = !$.farmTask.waterRainInit.f; + if (executeWaterRain) { + console.log(`水滴雨任务,每天两次,最多可得10g水滴`); + console.log(`两次水滴雨任务是否全部完成:${$.farmTask.waterRainInit.f ? '是' : '否'}`); + if ($.farmTask.waterRainInit.lastTime) { + if (Date.now() < ($.farmTask.waterRainInit.lastTime + 3 * 60 * 60 * 1000)) { + executeWaterRain = false; + // message += `【第${$.farmTask.waterRainInit.winTimes + 1}次水滴雨】未到时间,请${new Date($.farmTask.waterRainInit.lastTime + 3 * 60 * 60 * 1000).toLocaleTimeString()}再试\n`; + console.log(`\`【第${$.farmTask.waterRainInit.winTimes + 1}次水滴雨】未到时间,请${new Date($.farmTask.waterRainInit.lastTime + 3 * 60 * 60 * 1000).toLocaleTimeString()}再试\n`); + } + } + if (executeWaterRain) { + console.log(`开始水滴雨任务,这是第${$.farmTask.waterRainInit.winTimes + 1}次,剩余${2 - ($.farmTask.waterRainInit.winTimes + 1)}次`); + await waterRainForFarm(); + console.log('水滴雨waterRain'); + if ($.waterRain.code === '0') { + console.log('水滴雨任务执行成功,获得水滴:' + $.waterRain.addEnergy + 'g'); + console.log(`【第${$.farmTask.waterRainInit.winTimes + 1}次水滴雨】获得${$.waterRain.addEnergy}g水滴\n`); + // message += `【第${$.farmTask.waterRainInit.winTimes + 1}次水滴雨】获得${$.waterRain.addEnergy}g水滴\n`; + } + } + } else { + // message += `【水滴雨】已全部完成,获得20g💧\n`; + } +} +//打卡领水活动 +async function clockInIn() { + console.log('开始打卡领水活动(签到,关注,领券)'); + await clockInInitForFarm(); + if ($.clockInInit.code === '0') { + // 签到得水滴 + if (!$.clockInInit.todaySigned) { + console.log('开始今日签到'); + await clockInForFarm(); + console.log(`打卡结果${JSON.stringify($.clockInForFarmRes)}`); + if ($.clockInForFarmRes.code === '0') { + // message += `【第${$.clockInForFarmRes.signDay}天签到】获得${$.clockInForFarmRes.amount}g💧\n`; + console.log(`【第${$.clockInForFarmRes.signDay}天签到】获得${$.clockInForFarmRes.amount}g💧\n`) + if ($.clockInForFarmRes.signDay === 7) { + //可以领取惊喜礼包 + console.log('开始领取--惊喜礼包38g水滴'); + await gotClockInGift(); + if ($.gotClockInGiftRes.code === '0') { + // message += `【惊喜礼包】获得${$.gotClockInGiftRes.amount}g💧\n`; + console.log(`【惊喜礼包】获得${$.gotClockInGiftRes.amount}g💧\n`); + } + } + } + } + if ($.clockInInit.todaySigned && $.clockInInit.totalSigned === 7) { + console.log('开始领取--惊喜礼包38g水滴'); + await gotClockInGift(); + if ($.gotClockInGiftRes.code === '0') { + // message += `【惊喜礼包】获得${$.gotClockInGiftRes.amount}g💧\n`; + console.log(`【惊喜礼包】获得${$.gotClockInGiftRes.amount}g💧\n`); + } + } + // 限时关注得水滴 + if ($.clockInInit.themes && $.clockInInit.themes.length > 0) { + for (let item of $.clockInInit.themes) { + if (!item.hadGot) { + console.log(`关注ID${item.id}`); + await clockInFollowForFarm(item.id, "theme", "1"); + console.log(`themeStep1--结果${JSON.stringify($.themeStep1)}`); + if ($.themeStep1.code === '0') { + await clockInFollowForFarm(item.id, "theme", "2"); + console.log(`themeStep2--结果${JSON.stringify($.themeStep2)}`); + if ($.themeStep2.code === '0') { + console.log(`关注${item.name},获得水滴${$.themeStep2.amount}g`); + } + } + } + } + } + // 限时领券得水滴 + if ($.clockInInit.venderCoupons && $.clockInInit.venderCoupons.length > 0) { + for (let item of $.clockInInit.venderCoupons) { + if (!item.hadGot) { + console.log(`领券的ID${item.id}`); + await clockInFollowForFarm(item.id, "venderCoupon", "1"); + console.log(`venderCouponStep1--结果${JSON.stringify($.venderCouponStep1)}`); + if ($.venderCouponStep1.code === '0') { + await clockInFollowForFarm(item.id, "venderCoupon", "2"); + if ($.venderCouponStep2.code === '0') { + console.log(`venderCouponStep2--结果${JSON.stringify($.venderCouponStep2)}`); + console.log(`从${item.name}领券,获得水滴${$.venderCouponStep2.amount}g`); + } + } + } + } + } + } + console.log('开始打卡领水活动(签到,关注,领券)结束\n'); +} +// +async function getAwardInviteFriend() { + await friendListInitForFarm();//查询好友列表 + console.log(`查询好友列表数据:${JSON.stringify($.friendList)}\n`) + if ($.friendList) { + console.log(`\n今日已邀请好友${$.friendList.inviteFriendCount}个 / 每日邀请上限${$.friendList.inviteFriendMax}个`); + console.log(`开始删除${$.friendList.friends && $.friendList.friends.length}个好友,可拿每天的邀请奖励`); + if ($.friendList.friends && $.friendList.friends.length > 0) { + for (let friend of $.friendList.friends) { + console.log(`\n开始删除好友 [${friend.shareCode}]`); + const deleteFriendForFarm = await request('deleteFriendForFarm', { "shareCode": `${friend.shareCode}`,"version":8,"channel":1 }); + if (deleteFriendForFarm && deleteFriendForFarm.code === '0') { + console.log(`删除好友 [${friend.shareCode}] 成功\n`); + } + } + } + await receiveFriendInvite();//为他人助力,接受邀请成为别人的好友 + if ($.friendList.inviteFriendCount > 0) { + if ($.friendList.inviteFriendCount > $.friendList.inviteFriendGotAwardCount) { + console.log('开始领取邀请好友的奖励'); + await awardInviteFriendForFarm(); + console.log(`领取邀请好友的奖励结果::${JSON.stringify($.awardInviteFriendRes)}`); + } + } else { + console.log('今日未邀请过好友') + } + } else { + console.log(`查询好友列表失败\n`); + } +} +//给好友浇水 +async function doFriendsWater() { + await friendListInitForFarm(); + console.log('开始给好友浇水...'); + await taskInitForFarm(); + const { waterFriendCountKey, waterFriendMax } = $.farmTask.waterFriendTaskInit; + console.log(`今日已给${waterFriendCountKey}个好友浇水`); + if (waterFriendCountKey < waterFriendMax) { + let needWaterFriends = []; + if ($.friendList.friends && $.friendList.friends.length > 0) { + $.friendList.friends.map((item, index) => { + if (item.friendState === 1) { + if (needWaterFriends.length < (waterFriendMax - waterFriendCountKey)) { + needWaterFriends.push(item.shareCode); + } + } + }); + //TODO ,发现bug,github action运行发现有些账号第一次没有给3个好友浇水 + console.log(`需要浇水的好友列表shareCodes:${JSON.stringify(needWaterFriends)}`); + let waterFriendsCount = 0, cardInfoStr = ''; + for (let index = 0; index < needWaterFriends.length; index ++) { + await waterFriendForFarm(needWaterFriends[index]); + console.log(`为第${index+1}个好友浇水结果:${JSON.stringify($.waterFriendForFarmRes)}\n`) + if ($.waterFriendForFarmRes.code === '0') { + waterFriendsCount ++; + if ($.waterFriendForFarmRes.cardInfo) { + console.log('为好友浇水获得道具了'); + if ($.waterFriendForFarmRes.cardInfo.type === 'beanCard') { + console.log(`获取道具卡:${$.waterFriendForFarmRes.cardInfo.rule}`); + cardInfoStr += `水滴换豆卡,`; + } else if ($.waterFriendForFarmRes.cardInfo.type === 'fastCard') { + console.log(`获取道具卡:${$.waterFriendForFarmRes.cardInfo.rule}`); + cardInfoStr += `快速浇水卡,`; + } else if ($.waterFriendForFarmRes.cardInfo.type === 'doubleCard') { + console.log(`获取道具卡:${$.waterFriendForFarmRes.cardInfo.rule}`); + cardInfoStr += `水滴翻倍卡,`; + } else if ($.waterFriendForFarmRes.cardInfo.type === 'signCard') { + console.log(`获取道具卡:${$.waterFriendForFarmRes.cardInfo.rule}`); + cardInfoStr += `加签卡,`; + } + } + } else if ($.waterFriendForFarmRes.code === '11') { + console.log('水滴不够,跳出浇水') + } + } + // message += `【好友浇水】已给${waterFriendsCount}个好友浇水,消耗${waterFriendsCount * 10}g水\n`; + console.log(`【好友浇水】已给${waterFriendsCount}个好友浇水,消耗${waterFriendsCount * 10}g水\n`); + if (cardInfoStr && cardInfoStr.length > 0) { + // message += `【好友浇水奖励】${cardInfoStr.substr(0, cardInfoStr.length - 1)}\n`; + console.log(`【好友浇水奖励】${cardInfoStr.substr(0, cardInfoStr.length - 1)}\n`); + } + } else { + console.log('您的好友列表暂无好友,快去邀请您的好友吧!') + } + } else { + console.log(`今日已为好友浇水量已达${waterFriendMax}个`) + } +} +//领取给3个好友浇水后的奖励水滴 +async function getWaterFriendGotAward() { + await taskInitForFarm(); + const { waterFriendCountKey, waterFriendMax, waterFriendSendWater, waterFriendGotAward } = $.farmTask.waterFriendTaskInit + if (waterFriendCountKey >= waterFriendMax) { + if (!waterFriendGotAward) { + await waterFriendGotAwardForFarm(); + console.log(`领取给${waterFriendMax}个好友浇水后的奖励水滴::${JSON.stringify($.waterFriendGotAwardRes)}`) + if ($.waterFriendGotAwardRes.code === '0') { + // message += `【给${waterFriendMax}好友浇水】奖励${$.waterFriendGotAwardRes.addWater}g水滴\n`; + console.log(`【给${waterFriendMax}好友浇水】奖励${$.waterFriendGotAwardRes.addWater}g水滴\n`); + } + } else { + console.log(`给好友浇水的${waterFriendSendWater}g水滴奖励已领取\n`); + // message += `【给${waterFriendMax}好友浇水】奖励${waterFriendSendWater}g水滴已领取\n`; + } + } else { + console.log(`暂未给${waterFriendMax}个好友浇水\n`); + } +} +//接收成为对方好友的邀请 +async function receiveFriendInvite() { + for (let code of newShareCodes) { + if (code === $.farmInfo.farmUserPro.shareCode) { + console.log('自己不能邀请自己成为好友噢\n') + continue + } + await inviteFriend(code); + // console.log(`接收邀请成为好友结果:${JSON.stringify($.inviteFriendRes.helpResult)}`) + if ($.inviteFriendRes.helpResult.code === '0') { + console.log(`接收邀请成为好友结果成功,您已成为${$.inviteFriendRes.helpResult.masterUserInfo.nickName}的好友`) + } else if ($.inviteFriendRes.helpResult.code === '17') { + console.log(`接收邀请成为好友结果失败,对方已是您的好友`) + } + } + // console.log(`开始接受6fbd26cc27ac44d6a7fed34092453f77的邀请\n`) + // await inviteFriend('6fbd26cc27ac44d6a7fed34092453f77'); + // console.log(`接收邀请成为好友结果:${JSON.stringify($.inviteFriendRes.helpResult)}`) + // if ($.inviteFriendRes.helpResult.code === '0') { + // console.log(`您已成为${$.inviteFriendRes.helpResult.masterUserInfo.nickName}的好友`) + // } else if ($.inviteFriendRes.helpResult.code === '17') { + // console.log(`对方已是您的好友`) + // } +} +async function duck() { + for (let i = 0; i < 10; i++) { + //这里循环十次 + await getFullCollectionReward(); + if ($.duckRes.code === '0') { + if (!$.duckRes.hasLimit) { + console.log(`小鸭子游戏:${$.duckRes.title}`); + // if ($.duckRes.type !== 3) { + // console.log(`${$.duckRes.title}`); + // if ($.duckRes.type === 1) { + // message += `【小鸭子】为你带回了水滴\n`; + // } else if ($.duckRes.type === 2) { + // message += `【小鸭子】为你带回快速浇水卡\n` + // } + // } + } else { + console.log(`${$.duckRes.title}`) + break; + } + } else if ($.duckRes.code === '10') { + console.log(`小鸭子游戏达到上限`) + break; + } + } +} +// ========================API调用接口======================== +//鸭子,点我有惊喜 +async function getFullCollectionReward() { + return new Promise(resolve => { + const body = {"type": 2, "version": 6, "channel": 2}; + $.post(taskUrl("getFullCollectionReward", body), (err, resp, data) => { + try { + if (err) { + console.log('\n东东农场: API查询请求失败 ‼️‼️'); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + $.duckRes = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +/** + * 领取10次浇水奖励API + */ +async function totalWaterTaskForFarm() { + const functionId = arguments.callee.name.toString(); + $.totalWaterReward = await request(functionId); +} +//领取首次浇水奖励API +async function firstWaterTaskForFarm() { + const functionId = arguments.callee.name.toString(); + $.firstWaterReward = await request(functionId); +} +//领取给3个好友浇水后的奖励水滴API +async function waterFriendGotAwardForFarm() { + const functionId = arguments.callee.name.toString(); + $.waterFriendGotAwardRes = await request(functionId, {"version": 4, "channel": 1}); +} +// 查询背包道具卡API +async function myCardInfoForFarm() { + const functionId = arguments.callee.name.toString(); + $.myCardInfoRes = await request(functionId, {"version": 5, "channel": 1}); +} +//使用道具卡API +async function userMyCardForFarm(cardType) { + const functionId = arguments.callee.name.toString(); + $.userMyCardRes = await request(functionId, {"cardType": cardType}); +} +/** + * 领取浇水过程中的阶段性奖励 + * @param type + * @returns {Promise} + */ +async function gotStageAwardForFarm(type) { + $.gotStageAwardForFarmRes = await request(arguments.callee.name.toString(), {'type': type}); +} +//浇水API +async function waterGoodForFarm() { + await $.wait(1000); + console.log('等待了1秒'); + + const functionId = arguments.callee.name.toString(); + $.waterResult = await request(functionId); +} +// 初始化集卡抽奖活动数据API +async function initForTurntableFarm() { + $.initForTurntableFarmRes = await request(arguments.callee.name.toString(), {version: 4, channel: 1}); +} +async function lotteryForTurntableFarm() { + await $.wait(2000); + console.log('等待了2秒'); + $.lotteryRes = await request(arguments.callee.name.toString(), {type: 1, version: 4, channel: 1}); +} + +async function timingAwardForTurntableFarm() { + $.timingAwardRes = await request(arguments.callee.name.toString(), {version: 4, channel: 1}); +} + +async function browserForTurntableFarm(type, adId) { + if (type === 1) { + console.log('浏览爆品会场'); + } + if (type === 2) { + console.log('天天抽奖浏览任务领取水滴'); + } + const body = {"type": type,"adId": adId,"version":4,"channel":1}; + $.browserForTurntableFarmRes = await request(arguments.callee.name.toString(), body); + // 浏览爆品会场8秒 +} +//天天抽奖浏览任务领取水滴API +async function browserForTurntableFarm2(type) { + const body = {"type":2,"adId": type,"version":4,"channel":1}; + $.browserForTurntableFarm2Res = await request('browserForTurntableFarm', body); +} +/** + * 天天抽奖拿好礼-助力API(每人每天三次助力机会) + */ +async function lotteryMasterHelp() { + $.lotteryMasterHelpRes = await request(`initForFarm`, { + imageUrl: "", + nickName: "", + shareCode: arguments[0] + '-3', + babelChannel: "3", + version: 4, + channel: 1 + }); +} + +//领取5人助力后的额外奖励API +async function masterGotFinishedTaskForFarm() { + const functionId = arguments.callee.name.toString(); + $.masterGotFinished = await request(functionId); +} +//助力好友信息API +async function masterHelpTaskInitForFarm() { + const functionId = arguments.callee.name.toString(); + $.masterHelpResult = await request(functionId); +} +//接受对方邀请,成为对方好友的API +async function inviteFriend() { + $.inviteFriendRes = await request(`initForFarm`, { + imageUrl: "", + nickName: "", + shareCode: arguments[0] + '-inviteFriend', + version: 4, + channel: 2 + }); +} +// 助力好友API +async function masterHelp() { + $.helpResult = await request(`initForFarm`, { + imageUrl: "", + nickName: "", + shareCode: arguments[0], + babelChannel: "3", + version: 2, + channel: 1 + }); +} +/** + * 水滴雨API + */ +async function waterRainForFarm() { + const functionId = arguments.callee.name.toString(); + const body = {"type": 1, "hongBaoTimes": 100, "version": 3}; + $.waterRain = await request(functionId, body); +} +/** + * 打卡领水API + */ +async function clockInInitForFarm() { + const functionId = arguments.callee.name.toString(); + $.clockInInit = await request(functionId); +} + +// 连续签到API +async function clockInForFarm() { + const functionId = arguments.callee.name.toString(); + $.clockInForFarmRes = await request(functionId, {"type": 1}); +} + +//关注,领券等API +async function clockInFollowForFarm(id, type, step) { + const functionId = arguments.callee.name.toString(); + let body = { + id, + type, + step + } + if (type === 'theme') { + if (step === '1') { + $.themeStep1 = await request(functionId, body); + } else if (step === '2') { + $.themeStep2 = await request(functionId, body); + } + } else if (type === 'venderCoupon') { + if (step === '1') { + $.venderCouponStep1 = await request(functionId, body); + } else if (step === '2') { + $.venderCouponStep2 = await request(functionId, body); + } + } +} + +// 领取连续签到7天的惊喜礼包API +async function gotClockInGift() { + $.gotClockInGiftRes = await request('clockInForFarm', {"type": 2}) +} + +//定时领水API +async function gotThreeMealForFarm() { + const functionId = arguments.callee.name.toString(); + $.threeMeal = await request(functionId); +} +/** + * 浏览广告任务API + * type为0时, 完成浏览任务 + * type为1时, 领取浏览任务奖励 + */ +async function browseAdTaskForFarm(advertId, type) { + const functionId = arguments.callee.name.toString(); + if (type === 0) { + $.browseResult = await request(functionId, {advertId, type}); + } else if (type === 1) { + $.browseRwardResult = await request(functionId, {advertId, type}); + } +} +// 被水滴砸中API +async function gotWaterGoalTaskForFarm() { + $.goalResult = await request(arguments.callee.name.toString(), {type: 3}); +} +//签到API +async function signForFarm() { + const functionId = arguments.callee.name.toString(); + $.signResult = await request(functionId); +} +/** + * 初始化农场, 可获取果树及用户信息API + */ +async function initForFarm() { + return new Promise(resolve => { + const option = { + url: `${JD_API_HOST}?functionId=initForFarm`, + body: `body=${escape(JSON.stringify({"version":4}))}&appid=wh5&clientVersion=9.1.0`, + headers: { + "accept": "*/*", + "accept-encoding": "gzip, deflate, br", + "accept-language": "zh-CN,zh;q=0.9", + "cache-control": "no-cache", + "cookie": cookie, + "origin": "https://home.m.jd.com", + "pragma": "no-cache", + "referer": "https://home.m.jd.com/myJd/newhome.action", + "sec-fetch-dest": "empty", + "sec-fetch-mode": "cors", + "sec-fetch-site": "same-site", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + "Content-Type": "application/x-www-form-urlencoded" + }, + timeout: 10000, + }; + $.post(option, (err, resp, data) => { + try { + if (err) { + console.log('\n东东农场: API查询请求失败 ‼️‼️'); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + $.farmInfo = JSON.parse(data) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +// 初始化任务列表API +async function taskInitForFarm() { + console.log('\n初始化任务列表') + const functionId = arguments.callee.name.toString(); + $.farmTask = await request(functionId); +} +//获取好友列表API +async function friendListInitForFarm() { + $.friendList = await request('friendListInitForFarm', {"version": 4, "channel": 1}); + // console.log('aa', aa); +} +// 领取邀请好友的奖励API +async function awardInviteFriendForFarm() { + $.awardInviteFriendRes = await request('awardInviteFriendForFarm'); +} +//为好友浇水API +async function waterFriendForFarm(shareCode) { + const body = {"shareCode": shareCode, "version": 6, "channel": 1} + $.waterFriendForFarmRes = await request('waterFriendForFarm', body); +} +async function showMsg() { + let ctrTemp; + if ($.isNode() && process.env.FRUIT_NOTIFY_CONTROL) { + ctrTemp = `${process.env.FRUIT_NOTIFY_CONTROL}` === 'false'; + } else if ($.getdata('jdFruitNotify')) { + ctrTemp = $.getdata('jdFruitNotify') === 'false'; + } else { + ctrTemp = `${jdNotify}` === 'false'; + } + if (ctrTemp) { + $.msg($.name, subTitle, message, option); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `${subTitle}\n${message}`); + } + } else { + $.log(`\n${message}\n`); + } +} + +function timeFormat(time) { + let date; + if (time) { + date = new Date(time) + } else { + date = new Date(); + } + return date.getFullYear() + '-' + ((date.getMonth() + 1) >= 10 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)) + '-' + (date.getDate() >= 10 ? date.getDate() : '0' + date.getDate()); +} +function readShareCode() { + return new Promise(async resolve => { + $.get({url: `http://api.turinglabs.net/api/v1/jd/farm/read/${randomCount}/`, timeout: 10000,}, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) + data = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + await $.wait(10000); + resolve() + }) +} +function shareCodesFormat() { + return new Promise(async resolve => { + // console.log(`第${$.index}个京东账号的助力码:::${jdFruitShareArr[$.index - 1]}`) + newShareCodes = []; + if (jdFruitShareArr[$.index - 1]) { + newShareCodes = jdFruitShareArr[$.index - 1].split('@'); + } else { + console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) + const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1); + newShareCodes = shareCodes[tempIndex].split('@'); + } + const readShareCodeRes = await readShareCode(); + if (readShareCodeRes && readShareCodeRes.code === 200) { + // newShareCodes = newShareCodes.concat(readShareCodeRes.data || []); + newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])]; + } + console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify(newShareCodes)}`) + resolve(); + }) +} +function requireConfig() { + return new Promise(resolve => { + console.log('开始获取配置文件\n') + notify = $.isNode() ? require('./sendNotify') : ''; + //Node.js用户请在jdCookie.js处填写京东ck; + const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; + const jdFruitShareCodes = $.isNode() ? require('./jdFruitShareCodes.js') : ''; + //IOS等用户直接用NobyDa的jd cookie + if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + if (jdCookieNode[item]) { + cookiesArr.push(jdCookieNode[item]) + } + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; + } else { + cookiesArr.push(...[$.getdata('CookieJD'), $.getdata('CookieJD2')]); + } + console.log(`共${cookiesArr.length}个京东账号\n`) + if ($.isNode()) { + Object.keys(jdFruitShareCodes).forEach((item) => { + if (jdFruitShareCodes[item]) { + jdFruitShareArr.push(jdFruitShareCodes[item]) + } + }) + } else { + const boxShareCodeArr = ['jd_fruit1', 'jd_fruit2', 'jd_fruit3', 'jd_fruit4']; + const boxShareCodeArr2 = ['jd2_fruit1', 'jd2_fruit2', 'jd2_fruit3', 'jd2_fruit4']; + const isBox1 = boxShareCodeArr.some((item) => { + const boxShareCode = $.getdata(item); + return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); + }); + const isBox2 = boxShareCodeArr2.some((item) => { + const boxShareCode = $.getdata(item); + return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); + }); + isBox = isBox1 ? isBox1 : isBox2; + if (isBox1) { + let temp = []; + for (const item of boxShareCodeArr) { + if ($.getdata(item)) { + temp.push($.getdata(item)) + } + } + jdFruitShareArr.push(temp.join('@')); + } + if (isBox2) { + let temp = []; + for (const item of boxShareCodeArr2) { + if ($.getdata(item)) { + temp.push($.getdata(item)) + } + } + jdFruitShareArr.push(temp.join('@')); + } + } + // console.log(`jdFruitShareArr::${JSON.stringify(jdFruitShareArr)}`) + // console.log(`jdFruitShareArr账号长度::${jdFruitShareArr.length}`) + console.log(`您提供了${jdFruitShareArr.length}个账号的农场助力码\n`); + resolve() + }) +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + }, + "timeout": 10000, + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function request(function_id, body = {}, timeout = 1000){ + return new Promise(resolve => { + setTimeout(() => { + $.get(taskUrl(function_id, body), (err, resp, data) => { + try { + if (err) { + console.log('\n东东农场: API查询请求失败 ‼️‼️') + console.log(JSON.stringify(err)); + console.log(`function_id:${function_id}`) + $.logErr(err); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }, timeout) + }) +} +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} +function taskUrl(function_id, body = {}) { + return { + url: `${JD_API_HOST}?functionId=${function_id}&appid=wh5&body=${escape(JSON.stringify(body))}`, + headers: { + Cookie: cookie, + UserAgent: $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + }, + timeout: 10000, + } +} +// prettier-ignore +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,o)=>{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.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 o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=e&&e.timeout?e.timeout:o;const[r,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":r,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),o=JSON.stringify(this.data);s?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(e,o):this.fs.writeFileSync(t,o)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return s;return o}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),o=s?this.getval(s):"";if(o)try{const t=JSON.parse(o);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(e),r=this.getval(i),h=i?"null"===r?null:r||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,o,t),s=this.setval(JSON.stringify(e),i)}catch(e){const r={};this.lodash_set(r,o,t),s=this.setval(JSON.stringify(r),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()?$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)))}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())$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",$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t))}}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="",o){const r=t=>{if(!t||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,r(o)):this.isQuanX()&&$notify(e,s,i,r(o)));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)} diff --git a/jd_joy_feedPets.js b/jd_joy_feedPets.js new file mode 100644 index 0000000000..7a107bd0f2 --- /dev/null +++ b/jd_joy_feedPets.js @@ -0,0 +1,240 @@ +/***** +宠汪汪喂食(如果喂食80g失败,降级一个档次喂食(40g),依次类推),三餐,建议一小时运行一次 +更新时间:2020-11-03 +支持京东多个账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +****/ +// quantumultx +// [task_local] +// #京东宠汪汪喂食 +// 15 */1 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_feedPets.js, tag=京东宠汪汪喂食, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdcww.png, enabled=true +// Loon +// [Script] +// cron "15 */1 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_feedPets.js,tag=京东宠汪汪喂食 +// Surge +// 京东宠汪汪喂食 = type=cron,cronexp="15 */1 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_feedPets.js + +const $ = new Env('宠汪汪🐕喂食'); +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; + +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +let jdNotify = true;//是否开启静默运行。默认true开启 +let message = '', subTitle = ''; +const JD_API_HOST = 'https://jdjoy.jd.com' +let FEED_NUM = ($.getdata('joyFeedCount') * 1) || 10; //喂食数量默认10g,可选 10,20,40,80 , 其他数字不可. + +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + await TotalBean(); + console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + message = ''; + subTitle = ''; + if ($.isNode()) { + if (process.env.JOY_FEED_COUNT) { + if ([10, 20, 40, 80].indexOf(process.env.JOY_FEED_COUNT * 1) > -1) { + FEED_NUM = process.env.JOY_FEED_COUNT ? process.env.JOY_FEED_COUNT * 1 : FEED_NUM; + } else { + console.log(`您输入的 JOY_FEED_COUNT 为非法数字,请重新输入`); + } + } + } + await feedPets(FEED_NUM);//喂食 + await ThreeMeals();//三餐 + await showMsg(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) +function showMsg() { + $.log(`\n${message}\n`); + jdNotify = $.getdata('jdJoyNotify') ? $.getdata('jdJoyNotify') : jdNotify; + if (!jdNotify || jdNotify === 'false') { + $.msg($.name, subTitle, `【京东账号${$.index}】${$.UserName}\n` + message); + } +} +function feedPets(feedNum) { + return new Promise(resolve => { + console.log(`您设置的喂食数量::${FEED_NUM}g\n`); + console.log(`实际的喂食数量::${feedNum}g\n`); + const options = { + url: `${JD_API_HOST}/pet/feed?feedCount=${feedNum}`, + headers: { + 'Cookie': cookie, + 'reqSource': 'h5', + 'Host': 'jdjoy.jd.com', + 'Connection': 'keep-alive', + 'Content-Type': 'application/json', + 'Referer': 'https://jdjoy.jd.com/pet/index', + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-cn', + 'Accept-Encoding': 'gzip, deflate, br', + } + } + $.get(options, async (err, resp, data) => { + try { + $.data = JSON.parse(data); + if ($.data.success) { + if ($.data.errorCode === 'feed_ok') { + console.log('喂食成功') + message += `【喂食成功】${feedNum}g\n`; + } else if ($.data.errorCode === 'time_error') { + console.log('喂食失败:正在食用') + message += `【喂食失败】您的汪汪正在食用\n`; + } else if ($.data.errorCode === 'food_insufficient') { + console.log(`当前喂食${feedNum}g狗粮不够, 现为您降低一档次喂食\n`) + if ((feedNum) === 80) { + feedNum = 40; + } else if ((feedNum) === 40) { + feedNum = 20; + } else if ((feedNum) === 20) { + feedNum = 10; + } else if ((feedNum) === 10) { + feedNum = 0; + } + // 如果喂食设置的数量失败, 就降低一个档次喂食. + if ((feedNum) !== 0) { + await feedPets(feedNum); + } else { + console.log('您的狗粮已不足10g') + message += `【喂食失败】您的狗粮已不足10g\n`; + } + } else { + console.log(`其他状态${$.data.errorCode}`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve($.data); + } + }) + }) +} + +//三餐 +function ThreeMeals() { + return new Promise(resolve => { + const options = { + url: `${JD_API_HOST}/pet/getFood?taskType=ThreeMeals`, + headers: { + 'Cookie': cookie, + 'reqSource': 'h5', + 'Host': 'jdjoy.jd.com', + 'Connection': 'keep-alive', + 'Content-Type': 'application/json', + 'Referer': 'https://jdjoy.jd.com/pet/index', + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-cn', + 'Accept-Encoding': 'gzip, deflate, br', + } + } + $.get(options, async (err, resp, data) => { + try { + data = JSON.parse(data); + if (data.success) { + if (data.errorCode === 'received') { + console.log(`三餐结果领取成功`) + message += `【三餐】领取成功,获得${data.data}g狗粮\n`; + } + } + } catch (e) { + $.logErr(resp, e); + } finally { + resolve(data); + } + }) + }) +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +// prettier-ignore +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,o)=>{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.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 o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=e&&e.timeout?e.timeout:o;const[r,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":r,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),o=JSON.stringify(this.data);s?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(e,o):this.fs.writeFileSync(t,o)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return s;return o}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),o=s?this.getval(s):"";if(o)try{const t=JSON.parse(o);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(e),r=this.getval(i),h=i?"null"===r?null:r||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,o,t),s=this.setval(JSON.stringify(e),i)}catch(e){const r={};this.lodash_set(r,o,t),s=this.setval(JSON.stringify(r),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()?$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)))}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())$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",$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t))}}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="",o){const r=t=>{if(!t||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,r(o)):this.isQuanX()&&$notify(e,s,i,r(o)));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)} diff --git a/jd_joy_steal.js b/jd_joy_steal.js new file mode 100644 index 0000000000..4007a86855 --- /dev/null +++ b/jd_joy_steal.js @@ -0,0 +1,552 @@ +/* +jd宠汪汪偷好友积分与狗粮,及给好友喂食 +偷好友积分上限是20个好友(即获得100积分),帮好友喂食上限是20个好友(即获得200积分),偷好友狗粮上限也是20个好友(最多获得120g狗粮) +IOS用户支持京东双账号,NodeJs用户支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +更新时间:2020-11-03 +如果开启了给好友喂食功能,建议先凌晨0点运行jd_joy.js脚本获取狗粮后,再运行此脚本(jd_joy_steal.js)可偷好友积分,6点运行可偷好友狗粮 +注:如果使用Node.js, 需自行安装'crypto-js,got,http-server,tough-cookie'模块. 例: npm install crypto-js http-server tough-cookie got --save +*/ +// quantumultx +// [task_local] +// #宠汪汪偷好友积分与狗粮 +// 0 0,6 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_steal.js, tag=宠汪汪偷好友积分与狗粮, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdcww.png, enabled=true +// Loon +// [Script] +// cron "0 0,6 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_steal.js,tag=宠汪汪偷好友积分与狗粮 +// Surge +// 宠汪汪偷好友积分与狗粮 = type=cron,cronexp="0 0,6 * * *",wake-system=1,timeout=320,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_steal.js +const $ = new Env('宠汪汪偷好友积分与狗粮'); +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; + +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +let message = '', subTitle = ''; + +let jdNotify = false;//是否开启静默运行,false关闭静默运行(即通知),true打开静默运行(即不通知) +let jdJoyHelpFeed = false;//是否给好友喂食,false为不给喂食,true为给好友喂食,默认不给好友喂食 +let jdJoyStealCoin = true;//是否偷好友积分与狗粮,false为否,true为是,默认是偷 +const weAppUrl = 'https://draw.jdfcloud.com//pet'; +const JD_API_HOST = 'https://jdjoy.jd.com/pet' +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + await TotalBean(); + console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + message = ''; + subTitle = ''; + await jdJoySteal(); + await showMsg(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) +async function jdJoySteal() { + await getFriends(); + if ($.getFriendsData && $.getFriendsData.success) { + message += `【京东账号${$.index}】${$.nickName}\n`; + await getCoinChanges(); + if ($.getFriendsData && $.getFriendsData.datas && $.getFriendsData.datas.length > 0) { + const { lastPage } = $.getFriendsData.page; + console.log('lastPage', lastPage) + $.allFriends = []; + for (let i = 1; i <= new Array(lastPage).fill('').length; i++) { + console.log(`开始查询第${i}页好友\n`); + await getFriends(i); + $.allFriends = $.allFriends.concat($.getFriendsData.datas); + } + for (let index = 0; index < $.allFriends.length; index ++) { + //剔除自己 + if (!$.allFriends[index].stealStatus) { + $.allFriends.splice(index, 1); + } + } + console.log(`共${$.allFriends.length}个好友`); + $.helpFood = 0; + $.stealFriendCoin = 0; + $.stealFood = 0; + await Promise.all([ + stealFriendCoinFun(),//偷积分 + stealFriendsFood(),//偷好友狗粮 + helpFriendsFeed()//给好友喂食 + ]) + } + } else { + message += `${$.getFriendsData && $.getFriendsData.errorMessage}\n`; + } +} +async function stealFriendsFood() { + let jdJoyStealCoinTemp; + if ($.isNode() && process.env.jdJoyStealCoin) { + jdJoyStealCoinTemp = `${process.env.jdJoyStealCoin}` === 'true'; + } else if ($.getdata('jdJoyStealCoin')) { + jdJoyStealCoinTemp = $.getdata('jdJoyStealCoin') === 'true'; + } else { + jdJoyStealCoinTemp = `${jdJoyStealCoin}` === 'true'; + } + if (jdJoyStealCoinTemp) { + console.log(`开始偷好友狗粮`); + for (let friends of $.allFriends) { + const { friendPin, status, stealStatus } = friends; + console.log(`stealFriendsFood---好友【${friendPin}】--偷食状态:${stealStatus}\n`); + // console.log(`stealFriendsFood---好友【${friendPin}】--喂食状态:${status}\n`); + if (stealStatus === 'can_steal') { + //可偷狗粮 + //偷好友狗粮 + console.log(`发现好友【${friendPin}】可偷狗粮\n`) + await enterFriendRoom(friendPin); + await doubleRandomFood(friendPin); + const getRandomFoodRes = await getRandomFood(friendPin); + console.log(`偷好友狗粮结果:${JSON.stringify(getRandomFoodRes)}`) + if (getRandomFoodRes && getRandomFoodRes.success) { + if (getRandomFoodRes.errorCode === 'steal_ok') { + $.stealFood += getRandomFoodRes.data; + } else if (getRandomFoodRes.errorCode === 'chance_full') { + console.log('偷好友狗粮已达上限,跳出循环'); + break; + } + } + } else if (stealStatus === 'chance_full') { + console.log('偷好友狗粮已达上限,跳出循环'); + break; + } + } + } +} +//偷好友积分 +async function stealFriendCoinFun() { + let jdJoyStealCoinTemp; + if ($.isNode() && process.env.jdJoyStealCoin) { + jdJoyStealCoinTemp = `${process.env.jdJoyStealCoin}` === 'true'; + } else if ($.getdata('jdJoyStealCoin')) { + jdJoyStealCoinTemp = $.getdata('jdJoyStealCoin') === 'true'; + } else { + jdJoyStealCoinTemp = `${jdJoyStealCoin}` === 'true'; + } + if (jdJoyStealCoinTemp) { + if ($.visit_friend !== 100) { + console.log('开始偷好友积分') + for (let friends of $.allFriends) { + const { friendPin } = friends; + await stealFriendCoin(friendPin);//领好友积分 + if ($.stealFriendCoin * 1 === 100) { + console.log(`偷好友积分已达上限${$.stealFriendCoin}个,现跳出循环`) + break + } + } + } else { + console.log('偷好友积分已达上限(已获得100积分)') + $.stealFriendCoin = `已达上限(已获得100积分)` + } + } +} +//给好友喂食 +async function helpFriendsFeed() { + if ($.help_feed !== 200) { + //可给好友喂食 + let ctrTemp; + if ($.isNode() && process.env.JOY_HELP_FEED) { + ctrTemp = `${process.env.JOY_HELP_FEED}` === 'true'; + } else if ($.getdata('jdJoyHelpFeed')) { + ctrTemp = $.getdata('jdJoyHelpFeed') === 'true'; + } else { + ctrTemp = `${jdJoyHelpFeed}` === 'true'; + } + if (ctrTemp) { + console.log(`\n开始给好友喂食`); + for (let friends of $.allFriends) { + const { friendPin, status, stealStatus } = friends; + // console.log(`\nhelpFriendsFeed---好友【${friendPin}】--偷食状态:${stealStatus}`); + console.log(`\nhelpFriendsFeed---好友【${friendPin}】--喂食状态:${status}`); + if (status === 'not_feed') { + const helpFeedRes = await helpFeed(friendPin); + // console.log(`帮忙喂食结果--${JSON.stringify(helpFeedRes)}`) + if (helpFeedRes && helpFeedRes.errorCode === 'help_ok' && helpFeedRes.success) { + console.log(`帮好友[${friendPin}]喂食10g狗粮成功,你获得10积分\n`); + $.helpFood += 10; + } else if (helpFeedRes && helpFeedRes.errorCode === 'chance_full') { + console.log('喂食已达上限,不再喂食\n') + break + } else if (helpFeedRes && helpFeedRes.errorCode === 'food_insufficient') { + console.log('帮好友喂食失败,您的狗粮不足10g\n') + break + } else { + console.log(JSON.stringify(helpFeedRes)) + } + } else if (status === 'time_error') { + console.log(`帮好友喂食失败,好友[${friendPin}]的汪汪正在食用\n`) + } + } + } else { + console.log('您已设置不为好友喂食,现在跳过喂食,如需为好友喂食请在BoxJs打开喂食开关或者更改脚本 jdJoyHelpFeed 处') + } + } else { + console.log('帮好友喂食已达上限(已帮喂20个好友获得200积分)') + $.helpFood = '已达上限(已帮喂20个好友获得200积分)' + } +} +function getFriends(currentPage = '1') { + return new Promise(resolve => { + const options = { + url: `${JD_API_HOST}/getFriends?itemsPerPage=20¤tPage=${currentPage}`, + headers: { + 'Cookie': cookie, + 'reqSource': 'h5', + 'Host': 'jdjoy.jd.com', + 'Connection': 'keep-alive', + 'Content-Type': 'application/json', + 'Referer': 'https://jdjoy.jd.com/pet/index', + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-cn', + 'Accept-Encoding': 'gzip, deflate, br', + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️') + throw new Error(err); + } else { + // console.log('JSON.parse(data)', JSON.parse(data)) + if (data) { + $.getFriendsData = JSON.parse(data); + } else { + console.log(`京豆api返回数据为空,请检查自身原因`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }) + }) +} + +async function stealFriendCoin(friendPin) { + // console.log(`进入好友 ${friendPin}的房间`) + const enterFriendRoomRes = await enterFriendRoom(friendPin); + if (enterFriendRoomRes) { + const { friendHomeCoin } = enterFriendRoomRes.data; + if (friendHomeCoin > 0) { + //领取好友积分 + console.log(`好友 ${friendPin}的房间可领取积分${friendHomeCoin}个\n`) + const getFriendCoinRes = await getFriendCoin(friendPin); + console.log(`偷好友积分结果:${JSON.stringify(getFriendCoinRes)}\n`) + if (getFriendCoinRes && getFriendCoinRes.errorCode === 'coin_took_ok') { + $.stealFriendCoin += getFriendCoinRes.data; + } + } else { + console.log(`好友 ${friendPin}的房间暂无可领取积分\n`) + } + } +} +//进入好友房间 +function enterFriendRoom(friendPin) { + console.log(`\nfriendPin:: ${friendPin}\n`); + return new Promise(async resolve => { + $.get(taskUrl('enterFriendRoom', (friendPin)), (err, resp, data) => { + try { + if (err) { + console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️') + console.log(`\n${JSON.stringify(err)}`) + console.log(`\n${err}\n`) + throw new Error(err); + } else { + // console.log('进入好友房间', JSON.parse(data)) + if (data) { + data = JSON.parse(data); + console.log(`可偷狗粮:${data.data.stealFood}`) + console.log(`可偷积分:${data.data.friendHomeCoin}`) + } else { + console.log(`京豆api返回数据为空,请检查自身原因`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} +//收集好友金币 +function getFriendCoin(friendPin) { + return new Promise(resolve => { + $.get(taskUrl('getFriendCoin', friendPin), (err, resp, data) => { + try { + if (err) { + console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️') + throw new Error(err); + } else { + if (data) { + data = JSON.parse(data); + } else { + console.log(`京豆api返回数据为空,请检查自身原因`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} +//帮好友喂食 +function helpFeed(friendPin) { + return new Promise(resolve => { + $.get(taskUrl('helpFeed', friendPin), (err, resp, data) => { + try { + if (err) { + console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️') + throw new Error(err); + } else { + if (data) { + data = JSON.parse(data); + } else { + console.log(`京豆api返回数据为空,请检查自身原因`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} +//收集好友狗粮,已实现分享可得双倍狗粮功能 +//①分享 +function doubleRandomFood(friendPin) { + return new Promise(resolve => { + $.get(taskUrl('doubleRandomFood', friendPin), (err, resp, data) => { + try { + if (err) { + console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️') + throw new Error(err); + } else { + // console.log('分享', JSON.parse(data)) + // $.appGetPetTaskConfigRes = JSON.parse(data); + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }) + }) +} +//②领取双倍狗粮 +function getRandomFood(friendPin) { + return new Promise(resolve => { + $.get(taskUrl('getRandomFood', friendPin), (err, resp, data) => { + try { + if (err) { + console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️') + throw new Error(err); + } else { + if (data) { + console.log(`领取双倍狗粮结果--${data}`) + data = JSON.parse(data); + } else { + console.log(`京豆api返回数据为空,请检查自身原因`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} +function getCoinChanges() { + return new Promise(resolve => { + const options = { + url: `${JD_API_HOST}/getCoinChanges?changeDate=${Date.now()}`, + headers: { + 'Cookie': cookie, + 'reqSource': 'h5', + 'Host': 'jdjoy.jd.com', + 'Connection': 'keep-alive', + 'Content-Type': 'application/json', + 'Referer': 'https://jdjoy.jd.com/pet/index', + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-cn', + 'Accept-Encoding': 'gzip, deflate, br', + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️') + throw new Error(err); + } else { + // console.log('getCoinChanges', JSON.parse(data)) + if (data) { + data = JSON.parse(data); + if (data.datas && data.datas.length > 0) { + $.help_feed = 0; + $.visit_friend = 0; + for (let item of data.datas) { + if ($.time('yyyy-MM-dd') === timeFormat(item.createdDate) && item.changeEvent === 'help_feed'){ + $.help_feed = item.changeCoin; + } + if ($.time('yyyy-MM-dd') === timeFormat(item.createdDate) && item.changeEvent === 'visit_friend') { + $.visit_friend = item.changeCoin; + } + } + console.log(`$.help_feed给好友喂食获得积分:${$.help_feed}`); + console.log(`$.visit_friend领取好友积分:${$.visit_friend}`); + } + } else { + console.log(`京豆api返回数据为空,请检查自身原因`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }) + }) +} +function showMsg() { + return new Promise(resolve => { + $.stealFood = $.stealFood >= 0 ? `【偷好友狗粮】获取${$.stealFood}g狗粮\n` : `【偷好友狗粮】${$.stealFood}\n`; + $.stealFriendCoin = $.stealFriendCoin >= 0 ? `【领取好友积分】获得${$.stealFriendCoin}个\n` : `【领取好友积分】${$.stealFriendCoin}\n`; + $.helpFood = $.helpFood >= 0 ? `【给好友喂食】消耗${$.helpFood}g狗粮,获得积分${$.helpFood}个\n` : `【给好友喂食】${$.helpFood}\n`; + message += $.stealFriendCoin; + message += $.stealFood; + message += $.helpFood; + let ctrTemp; + if ($.getdata('jdJoyStealNotify')) { + ctrTemp = `${$.getdata('jdJoyStealNotify')}` === 'false'; + } else { + ctrTemp = `${jdNotify}` === 'false'; + } + if (ctrTemp) { + $.msg($.name, '', message); + } else { + $.log(`\n${message}\n`); + } + resolve() + }) +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function taskUrl(functionId, friendPin) { + return { + url: `${JD_API_HOST}/${functionId}?friendPin=${encodeURI(friendPin)}`, + headers: { + 'Cookie': cookie, + 'reqSource': 'h5', + 'Host': 'jdjoy.jd.com', + 'Connection': 'keep-alive', + 'Content-Type': 'application/json', + 'Referer': 'https://jdjoy.jd.com/pet/index', + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-cn', + 'Accept-Encoding': 'gzip, deflate, br', + } + } +} +function timeFormat(time) { + let date; + if (time) { + date = new Date(time) + } else { + date = new Date(); + } + return date.getFullYear() + '-' + ((date.getMonth() + 1) >= 10 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)) + '-' + (date.getDate() >= 10 ? date.getDate() : '0' + date.getDate()); +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} +// prettier-ignore +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,o)=>{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.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 o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=e&&e.timeout?e.timeout:o;const[r,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":r,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),o=JSON.stringify(this.data);s?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(e,o):this.fs.writeFileSync(t,o)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return s;return o}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),o=s?this.getval(s):"";if(o)try{const t=JSON.parse(o);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(e),r=this.getval(i),h=i?"null"===r?null:r||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,o,t),s=this.setval(JSON.stringify(e),i)}catch(e){const r={};this.lodash_set(r,o,t),s=this.setval(JSON.stringify(r),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()?$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)))}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())$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",$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t))}}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="",o){const r=t=>{if(!t||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,r(o)):this.isQuanX()&&$notify(e,s,i,r(o)));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)} diff --git a/jd_mh.js b/jd_mh.js new file mode 100644 index 0000000000..bb8a858e5c --- /dev/null +++ b/jd_mh.js @@ -0,0 +1,301 @@ +/* + * @Author: shylocks https://github.com/shylocks + * @Date: 2021-01-11 16:25:41 + * @Last Modified by: shylocks + * @Last Modified time: 2021-01-11 18:25:41 + */ +/* +盲盒抽京豆 +活动入口:https://anmp.jd.com/babelDiy/Zeus/xKACpgVjVJM7zPKbd5AGCij5yV9/index.html?wxAppName=jd +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +============Quantumultx=============== +[task_local] +#盲盒抽京豆 +1 7 * * * https://raw.githubusercontent.com/shylocks/Loon/main/jd_mh.js, tag=盲盒抽京豆, enabled=true + +================Loon============== +[Script] +cron "1 7 * * *" script-path=https://raw.githubusercontent.com/shylocks/Loon/main/jd_mh.js,tag=盲盒抽京豆 + +===============Surge================= +盲盒抽京豆 = type=cron,cronexp="1 7 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/shylocks/Loon/main/jd_mh.js + +============小火箭========= +盲盒抽京豆 = type=cron,script-path=https://raw.githubusercontent.com/shylocks/Loon/main/jd_mh.js, cronexpr="1 8,12,18* * *", timeout=200, enable=true + */ +const $ = new Env('盲盒抽京豆'); +const notify = $.isNode() ? require('./sendNotify') : ''; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '', message; + +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { + }; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} + +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + $.beans = 0 + message = ''; + await TotalBean(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}); + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } else { + $.setdata('', `CookieJD${i ? i + 1 : ""}`);//cookie失效,故清空cookie。$.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 + } + continue + } + await jdMh() + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +async function jdMh() { + await getInfo() + await getUserInfo() + while ($.userInfo.bless >= $.userInfo.cost_bless_one_time) { + await draw() + await getUserInfo() + await $.wait(500) + } + await showMsg(); +} + +function showMsg() { + return new Promise(resolve => { + message += `本次运行获得${$.beans}京豆` + $.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}`); + resolve() + }) +} + +function getInfo() { + return new Promise(resolve => { + $.get({ + url: 'https://anmp.jd.com/babelDiy/Zeus/xKACpgVjVJM7zPKbd5AGCij5yV9/index.html?wxAppName=jd', + headers: { + Cookie: cookie + } + }, (err, resp, data) => { + try { + $.info = JSON.parse(data.match(/var snsConfig = (.*)/)[1]) + $.prize = JSON.parse($.info.prize) + resolve() + } catch (e) { + console.log(e) + } + }) + }) +} + +function getUserInfo() { + return new Promise(resolve => { + $.get(taskUrl('query'), async (err, resp, data) => { + try { + if (err) { + console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + $.userInfo = JSON.parse(data.match(/query\((.*)\n/)[1]).data + // console.log(`您的好友助力码为${$.userInfo.shareid}`) + console.log(`当前幸运值:${$.userInfo.bless}`) + for (let task of $.info.config.tasks) { + if (!$.userInfo.complete_task_list.includes(task['_id'])) { + console.log(`去做任务${task['_id']}`) + await doTask(task['_id']) + await $.wait(500) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} + +function doTask(taskId) { + let body = `task_bless=10&taskid=${taskId}` + return new Promise(resolve => { + $.get(taskUrl('completeTask', body), async (err, resp, data) => { + try { + if (err) { + console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data.match(/query\((.*)\n/)[1]) + if (data.data.complete_task_list.includes(taskId)) { + console.log(`任务完成成功,当前幸运值${data.data.curbless}`) + $.userInfo.bless = data.data.curbless + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} + +function draw() { + return new Promise(resolve => { + $.get(taskUrl('draw'), async (err, resp, data) => { + try { + if (err) { + console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data.match(/query\((.*)\n/)[1]) + if (data.data.drawflag) { + if ($.prize.filter(vo => vo.prizeLevel === data.data.level).length > 0) { + console.log(`获得${$.prize.filter(vo => vo.prizeLevel === data.data.level)[0].prizename}`) + $.beans += $.prize.filter(vo => vo.prizeLevel === data.data.level)[0].beansPerNum + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} + +function taskUrl(function_id, body = '') { + body = `activeid=${$.info.activeId}&token=${$.info.actToken}&sceneval=2&shareid=&_=${new Date().getTime()}&callback=query&${body}` + return { + url: `https://wq.jd.com/activet2/piggybank/${function_id}?${body}`, + headers: { + 'Host': 'wq.jd.com', + 'Accept': 'application/json', + 'Accept-Language': 'zh-cn', + 'Content-Type': 'application/json;charset=utf-8', + 'Origin': 'wq.jd.com', + 'User-Agent': 'JD4iPhone/167490 (iPhone; iOS 14.2; Scale/3.00)', + 'Referer': `https://anmp.jd.com/babelDiy/Zeus/xKACpgVjVJM7zPKbd5AGCij5yV9/index.html?wxAppName=jd`, + 'Cookie': cookie + } + } +} + +function taskPostUrl(function_id, body) { + return { + url: `https://lzdz-isv.isvjcloud.com/${function_id}`, + body: body, + headers: { + 'Host': 'lzdz-isv.isvjcloud.com', + 'Accept': 'application/json', + 'Accept-Language': 'zh-cn', + 'Content-Type': 'application/x-www-form-urlencoded', + 'Origin': 'https://lzdz-isv.isvjcloud.com', + 'User-Agent': 'JD4iPhone/167490 (iPhone; iOS 14.2; Scale/3.00)', + 'Referer': `https://lzdz-isv.isvjcloud.com/dingzhi/book/develop/activity?activityId=${ACT_ID}`, + 'Cookie': `${cookie} isvToken=${$.isvToken};` + } + } +} + +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + return []; + } + } +} + +// prettier-ignore +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)} diff --git a/jd_nian.js b/jd_nian.js new file mode 100644 index 0000000000..340798106a --- /dev/null +++ b/jd_nian.js @@ -0,0 +1,949 @@ +/* +京东炸年兽🧨 +活动时间:2021-1-18至2021-2-11 +暂不加入品牌会员 +活动入口:https://wbbny.m.jd.com/babelDiy/Zeus/2cKMj86srRdhgWcKonfExzK4ZMBy/index.html +活动地址:京东app左侧浮动窗口 +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +============Quantumultx=============== +[task_local] +#京东炸年兽🧨 +0 8 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian.js, tag=京东炸年兽🧨, enabled=true + +================Loon============== +[Script] +cron "0 8 * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian.js,tag=京东炸年兽🧨 + +===============Surge================= +京东炸年兽🧨 = type=cron,cronexp="0 8 * * *",wake-system=1,timeout=200,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian.js + +============小火箭========= +京东炸年兽🧨 = type=cron,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nian.js, cronexpr="0 8 * * *", timeout=200, enable=true + */ +const $ = new Env('京东炸年兽🧨'); + +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 +const randomCount = $.isNode() ? 20 : 5; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '', message; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +const JD_API_HOST = 'https://api.m.jd.com/client.action'; +const inviteCodes = [ + `cgxZaDXWZPCmiUa2akPVmFMI27K6antJzucULQPYNim_BPEW1Dwd@cgxZdTXtIrPYuAqfDgSpusxr97nagU6hwFa3TXxnqM95u3ib-xt4nWqZdz8@cgxZdTXtIO-O6QmYDVf67KCEJ19JcybuMB2_hYu8NSNQg0oS2Z_FpMce45g@cgxZdTXtILiLvg7OAASp61meehou4OeZvqbjghsZlc3rI5SBk7b3InUqSQ0@cgxZ9_MZ8gByP7FZ368dN8oTZBwGieaH5HvtnvXuK1Epn_KK8yol8OYGw7h3M2j_PxSZvYA`, + `cgxZaDXWZPCmiUa2akPVmFMI27K6antJzucULQPYNim_BPEW1Dwd@cgxZdTXtIrPYuAqfDgSpusxr97nagU6hwFa3TXxnqM95u3ib-xt4nWqZdz8@cgxZdTXtIO-O6QmYDVf67KCEJ19JcybuMB2_hYu8NSNQg0oS2Z_FpMce45g@cgxZdTXtILiLvg7OAASp61meehou4OeZvqbjghsZlc3rI5SBk7b3InUqSQ0@cgxZdTXtIumO4w2cDgSqvYcqHwjaAzLxu0S371Dh_fctFJtN0tXYzdR7JaY` +]; +!(async () => { + await requireConfig(); + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + await TotalBean(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + await shareCodesFormat(); + await jdNian() + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) +async function jdNian() { + await getHomeData() + if(!$.secretp) return + await map() + await queryMaterials() + await getTaskList() + await $.wait(1000) + await doTask() + await helpFriends() + await getHomeData(true) + await showMsg() +} +function encode(data, aa, extraData) { + const temp = { + "extraData": JSON.stringify(extraData), + "businessData": JSON.stringify(data), + "secretp": aa, + } + return { "ss": (JSON.stringify(temp)) }; +} +function getRnd() { + return Math.floor(1e6 * Math.random()).toString(); +} +function showMsg() { + return new Promise(resolve => { + console.log('任务已做完!\n如有未完成的任务,请多执行几次。注:目前入会任务不会做') + if (!jdNotify) { + $.msg($.name, '', `${message}`); + } else { + $.log(`京东账号${$.index}${$.nickName}\n${message}`); + } + if (new Date().getHours() === 23) { + $.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}`); + } + resolve() + }) +} +async function helpFriends() { + for (let code of $.newShareCodes) { + if (!code) continue + await getFriendData(code) + await $.wait(1000) + } +} +async function doTask() { + for (let item of $.taskVos) { + if (item.taskType === 14) { + //好友助力任务 + //console.log(`您的好友助力码为${item.assistTaskDetailVo.taskToken}`) + } + if(item.taskType===2){ + if (item.status === 1) { + console.log(`准备做此任务:${item.taskName}`) + await getFeedDetail({"taskId":item.taskId},item.taskId) + } else if(item.status===2){ + console.log(`${item.taskName}已做完`) + } + } + else if (item.taskType === 3 || item.taskType === 26) { + if(item.shoppingActivityVos) { + if (item.status === 1) { + console.log(`准备做此任务:${item.taskName}`) + for (let task of item.shoppingActivityVos) { + if (task.status === 1) { + await collectScore(item.taskId, task.itemId); + } + } + } else if (item.status === 2) { + console.log(`${item.taskName}已做完`) + } + } + } + else if (item.taskType === 9) { + if (item.status === 1) { + console.log(`准备做此任务:${item.taskName}`) + for (let task of item.shoppingActivityVos) { + if (task.status === 1) { + await collectScore(item.taskId, task.itemId, 1); + } + } + } else if(item.status===2){ + console.log(`${item.taskName}已做完`) + } + } + else if (item.taskType === 7) { + if (item.status === 1) { + console.log(`准备做此任务:${item.taskName}`) + for (let task of item.browseShopVo) { + if (task.status === 1) { + await collectScore(item.taskId, task.itemId, 1); + } + } + } else if(item.status===2){ + console.log(`${item.taskName}已做完`) + } + } + } +} + +function getFeedDetail(body={}) { + return new Promise(resolve => { + $.post(taskPostUrl("nian_getFeedDetail", body, "nian_getFeedDetail"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data.bizCode === 0) { + if(data.data.result.addProductVos){ + for(let vo of data.data.result.addProductVos){ + if(vo['status']===1){ + for(let i=0;i { + $.post(taskPostUrl('nian_getHomeData'), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + if (data && data.data['bizCode'] === 0) { + $.userInfo = data.data.result.homeMainInfo + $.secretp = $.userInfo.secretp; + if(!$.secretp){ + console.log(`账号被风控`) + message += `账号被风控,无法参与活动\n` + $.secretp = null + return + } + console.log(`当前爆竹${$.userInfo.raiseInfo.remainScore}🧨,下一关需要${$.userInfo.raiseInfo.nextLevelScore}🧨`) + + if(info) { + message += `当前爆竹${$.userInfo.raiseInfo.remainScore}🧨\n` + return + } + if($.userInfo.raiseInfo.produceScore > 0){ + console.log(`可收取的爆竹大于0,去收取爆竹`) + await collectProduceScore() + } + if(parseInt($.userInfo.raiseInfo.remainScore) >= parseInt($.userInfo.raiseInfo.curLevelStartScore)){ + console.log(`去升级`) + await $.wait(2000) + await raise() + } + } + else{ + $.secretp = null + console.log(`账号被风控,无法参与活动`) + message += `账号被风控,无法参与活动\n` + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }) + }) +} +function collectProduceScore(taskId= "collectProducedCoin") { + let temp = { + "taskId": taskId, + "rnd": getRnd(), + "inviteId": "-1", + "stealId": "-1" + } + const extraData = { + "jj": 6, + "buttonid": "jmdd-react-smash_0", + "sceneid": "homePageh5", + "appid": '50073' + } + const body = encode(temp, $.secretp, extraData); + return new Promise(resolve => { + $.post(taskPostUrl("nian_collectProduceScore", body, "nian_collectProduceScore"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data.bizCode === 0) { + console.log(`收取成功,获得${data.data.result.produceScore}爆竹🧨`) + // $.userInfo = data.data.result.userInfo; + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function collectScore(taskId,itemId,actionType=null,inviteId=null,shopSign=null) { + let temp = { + "taskId": taskId, + "rnd": getRnd(), + "inviteId": "-1", + "stealId": "-1" + } + if(itemId) temp['itemId'] = itemId + if(actionType) temp['actionType'] = actionType + if(inviteId) temp['inviteId'] = inviteId + if(shopSign) temp['shopSign'] = shopSign + const extraData = { + "jj": 6, + "buttonid": "jmdd-react-smash_0", + "sceneid": "homePageh5", + "appid": '50073' + } + let body = { + ...encode(temp, $.secretp, extraData), + taskId:taskId, + itemId:itemId + } + if(actionType) body['actionType'] = actionType + if(inviteId) body['inviteId'] = inviteId + if(shopSign) body['shopSign'] = shopSign + return new Promise(resolve => { + $.post(taskPostUrl("nian_collectScore", body, "nian_collectScore"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data.bizCode === 0) { + if(data.data.result.score) + console.log(`任务完成,获得${data.data.result.score}爆竹🧨`) + else if(data.data.result.maxAssistTimes) { + console.log(`助力好友成功`) + } else{ + console.log(`任务上报成功`) + await $.wait(10*1000) + if(data.data.result.taskToken){ + await doTask2(data.data.result.taskToken) + } + } + // $.userInfo = data.data.result.userInfo; + } + else{ + console.log(data.data.bizMsg) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function doTask2(taskToken) { + let body = { + "dataSource":"newshortAward", + "method":"getTaskAward", + "reqParams":`{\"taskToken\":\"${taskToken}\"}` + } + return new Promise(resolve => { + $.post(taskPostUrl("qryViewkitCallbackResult", body, ), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + // console.log(data) + if (data.code === "0") { + console.log(data.toast.subTitle + '🧨') + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function raise(taskId= "nian_raise") { + let temp = { + "taskId": taskId, + "rnd": getRnd(), + "inviteId": "-1", + "stealId": "-1" + } + const extraData = { + "jj": 6, + "buttonid": "jmdd-react-smash_0", + "sceneid": "homePageh5", + "appid": '50073' + } + const body = encode(temp, $.secretp, extraData); + return new Promise(resolve => { + $.post(taskPostUrl("nian_raise", body, "nian_raise"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data.bizCode === 0) { + console.log(`升级成功`) + // $.userInfo = data.data.result.userInfo; + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function getTaskList(body={}) { + return new Promise(resolve => { + $.post(taskPostUrl("nian_getTaskDetail", body, "nian_getTaskDetail"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data.bizCode === 0) { + if(JSON.stringify(body)==="{}") { + $.taskVos = data.data.result.taskVos;//任务列表 + console.log(`您的好友助力码为${data.data.result.inviteId}`) + } + // $.userInfo = data.data.result.userInfo; + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function getFriendData(inviteId) { + return new Promise((resolve) => { + $.post(taskPostUrl('nian_getHomeData',{"inviteId":inviteId}), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + if (data && data.data['bizCode'] === 0) { + $.itemId = data.data.result.homeMainInfo.guestInfo.itemId + await collectScore('2',$.itemId,null,inviteId) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }) + }) +} +function map() { + return new Promise(resolve => { + $.post(taskPostUrl("nian_myMap", {}, "nian_myMap"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data.bizCode === 0) { + let msg = '当前已开启的地图:' + for(let vo of data.data.result.monsterInfoList){ + if(vo.curLevel) msg+= vo.name +' ' + } + console.log(msg) + // $.userInfo = data.data.result.userInfo; + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function queryMaterials() { + let body = {"qryParam":"[{\"type\":\"advertGroup\",\"mapTo\":\"viewLogo\",\"id\":\"05149412\"},{\"type\":\"advertGroup\",\"mapTo\":\"bottomLogo\",\"id\":\"05149413\"}]","activityId":"2cKMj86srRdhgWcKonfExzK4ZMBy","pageId":"","reqSrc":"","applyKey":"21beast"} + return new Promise(resolve => { + $.post(taskPostUrl("qryCompositeMaterials", body, "qryCompositeMaterials"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if(data.code==='0') { + for(let vo of data.data.viewLogo.list){ + console.log(`去做${vo.name}店铺任务`) + await shopLotteryInfo(vo.desc) + await $.wait(2000) + } + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function shopLotteryInfo(shopSign) { + let body = {"shopSign":shopSign} + return new Promise(resolve => { + $.post(taskPostUrl("nian_shopLotteryInfo", body, "nian_shopLotteryInfo"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if(data.code===0) { + for(let vo of data.data.result.taskVos){ + if(vo.status===1){ + if(vo.taskType===12){ + console.log(`去做${vo.taskName}任务`) + await $.wait(2000) + await collectScore(vo.taskId,vo.simpleRecordInfoVo.itemId,null,null,shopSign) + } + else if (vo.taskType === 3 || vo.taskType === 26) { + if(vo.shoppingActivityVos) { + if (vo.status === 1) { + console.log(`准备做此任务:${vo.taskName}`) + for (let task of vo.shoppingActivityVos) { + if (task.status === 1) { + await $.wait(2000) + await collectScore(vo.taskId, task.advId,null,null,shopSign); + } + } + } else if (vo.status === 2) { + console.log(`${vo.taskName}已做完`) + } + } + } + } + } + for(let i=0;i { + $.post(taskPostUrl("nian_doShopLottery", body, "nian_doShopLottery"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if(data.code===0 && data.data && data.data.result) { + let result = data.data.result + if(result.awardType===4) + console.log(`抽奖成功,获得${result.score}爆竹🧨`) + else if(result.awardType===2 || result.awardType===3) + console.log(`抽奖成功,获得优惠卷`) + else + console.log(`抽奖成功,获得${JSON.stringify(result)}`) + }else{ + console.log(`抽奖失败`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function signInRead(shopSign) { + let body = {"shopSign":shopSign} + return new Promise(resolve => { + $.post(taskPostUrl("nian_shopSignInRead", body, "nian_shopSignInRead"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if(data.code===0 && data.data && data.data.result && data.data.result.signInTag) { + await signInWrite(shopSign) + } else{ + console.log(`店铺已签到过`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function signInWrite(shopSign) { + let temp = { + "shopSign": shopSign, + } + const extraData = { + "jj": 6, + "buttonid": "jmdd-react-smash_0", + "sceneid": "homePageh5", + "appid": '50073' + } + let body = { + ...encode(temp, $.secretp, extraData), + shopSign:shopSign + } + return new Promise(resolve => { + $.post(taskPostUrl("nian_shopSignInWrite", body, "nian_shopSignInWrite"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data.bizCode === 0) { + if(data.data.result.score) + console.log(`签到成功,获得${data.data.result.score}爆竹🧨`) + } + else{ + console.log(data.data.bizMsg) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function pkInfo() { + return new Promise(resolve => { + $.post(taskPostUrl("nian_pk_getHomeData", {}, "nian_pk_getHomeData"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + console.log(data) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function pkCollectScore() { + return new Promise(resolve => { + $.post(taskPostUrl("nian_pk_collectScore", {}, "nian_pk_collectScore"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + console.log(data) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function pkTaskDetail() { + return new Promise(resolve => { + $.post(taskPostUrl("nian_pk_getTaskDetail", {}, "nian_pk_getTaskDetail"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + console.log(data) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function pkAssignGroup(inviteId) { + let temp = { + "confirmFlag": 1, + "inviteId": inviteId, + } + const extraData = { + "jj": 6, + "buttonid": "jmdd-react-smash_0", + "sceneid": "homePageh5", + "appid": '50073' + } + let body = { + ...encode(temp, $.secretp, extraData), + inviteId:inviteId + } + return new Promise(resolve => { + $.post(taskPostUrl("nian_pk_assistGroup", body, "nian_pk_assistGroup"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + console.log(data) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function readShareCode() { + console.log(`开始`) + return new Promise(async resolve => { + $.get({url: `https://code.chiang.fun/api/v1/jd/jdnian/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) + data = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + await $.wait(2000); + resolve() + }) +} +//格式化助力码 +function shareCodesFormat() { + return new Promise(async resolve => { + // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`) + $.newShareCodes = []; + if ($.shareCodesArr[$.index - 1]) { + $.newShareCodes = $.shareCodesArr[$.index - 1].split('@'); + } else { + console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) + const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1); + $.newShareCodes = inviteCodes[tempIndex].split('@'); + } + const readShareCodeRes = await readShareCode(); + if (readShareCodeRes && readShareCodeRes.code === 200) { + $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])]; + } + console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`) + resolve(); + }) +} +function requireConfig() { + return new Promise(resolve => { + console.log(`开始获取${$.name}配置文件\n`); + //Node.js用户请在jdCookie.js处填写京东ck; + let shareCodes = [] + console.log(`共${cookiesArr.length}个京东账号\n`); + if ($.isNode() && process.env.JDNIAN_SHARECODES) { + if (process.env.JDNIAN_SHARECODES.indexOf('\n') > -1) { + shareCodes = process.env.JDNIAN_SHARECODES.split('\n'); + } else { + shareCodes = process.env.JDNIAN_SHARECODES.split('&'); + } + } + $.shareCodesArr = []; + if ($.isNode()) { + Object.keys(shareCodes).forEach((item) => { + if (shareCodes[item]) { + $.shareCodesArr.push(shareCodes[item]) + } + }) + } + console.log(`您提供了${$.shareCodesArr.length}个账号的${$.name}助力码\n`); + resolve() + }) +} + +function taskPostUrl(function_id, body = {}, function_id2) { + let url = `${JD_API_HOST}`; + if (function_id2) { + url += `?functionId=${function_id2}`; + } + return { + url, + body: `functionId=${function_id}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0`, + headers: { + "Cookie": cookie, + "origin": "https://h5.m.jd.com", + "referer": "https://h5.m.jd.com/", + 'Content-Type': 'application/x-www-form-urlencoded', + "User-Agent": "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0", + } + } +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} +// prettier-ignore +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)} diff --git a/jd_nianCollect.js b/jd_nianCollect.js new file mode 100644 index 0000000000..da35d1de90 --- /dev/null +++ b/jd_nianCollect.js @@ -0,0 +1,154 @@ +/* +京东炸年兽领爆竹🧨 +仅仅是收集一下京东炸年兽领爆竹活动每秒产生的爆竹🧨 + +每小时的第20分运行一次 +20 * * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_nianCollect.js + */ +const $ = new Env('京东炸年兽领爆竹🧨'); +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = ''; + +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { + }; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +let UserName = ''; +const JD_API_HOST = `https://api.m.jd.com/client.action`; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + return; + } + console.log(`\n小功能::仅仅是收集一下京东炸年兽领金币每秒产生的爆竹🧨,建议一个小时跑一次脚本\n`) + for (let i = 0; i < cookiesArr.length; i++) { + cookie = cookiesArr[i]; + if (cookie) { + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + await collectProduceScore() + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) + +async function collectProduceScore() { + await getHomeData(); + if ($.secretp) { + const temp = { + "taskId": "collectProducedCoin", + "rnd": getRnd(), + "inviteId": "-1", + "stealId": "-1" + } + const extraData = { + "jj": 6, + "buttonid": "jmdd-react-smash_0", + "sceneid": "homePageh5", + "appid": '50073' + } + const body = encode(temp, $.secretp, extraData); + await stall_collectProduceScore(body); + } +} +function stall_collectProduceScore(body) { + return new Promise((resolve) => { + $.post(taskPostUrl('nian_collectProduceScore', body), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data && data.data.bizCode === 0) { + console.log(`京东账号${$.index} ${$.UserName}成功收集爆竹🧨:${data.data.result.produceScore}个`) + } else { + console.log(`京东账号${$.index} ${$.UserName}成功收集爆竹🧨失败:${data.data.bizMsg}`) + } + } else { + console.log(`请检查自身设备原因`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }) + }) +} +function getHomeData() { + return new Promise((resolve) => { + $.post(taskPostUrl('nian_getHomeData'), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + if (data && data.data['bizCode'] === 0) { + $.secretp = data.data.result.homeMainInfo.secretp; + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }) + }) +} +function encode(data, aa, extraData) { + const temp = { + "extraData": JSON.stringify(extraData), + "businessData": JSON.stringify(data), + "secretp": aa, + } + return { "ss": (JSON.stringify(temp)) }; +} +function getRnd() { + return Math.floor(1e6 * Math.random()).toString(); +} +function taskPostUrl(functionId, body = {}) { + return { + url: `${JD_API_HOST}?functionId=${functionId}`, + body: `functionId=${functionId}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0`, + headers: { + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Content-Type': 'application/x-www-form-urlencoded', + 'Host': 'api.m.jd.com', + 'Cookie': cookie, + 'Origin': 'https://wbbny.m.jd.com', + 'Referer': 'https://wbbny.m.jd.com/babelDiy/Zeus/4SJUHwGdUQYgg94PFzjZZbGZRjDd/index.html', + } + } +} + +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} + +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; 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) } diff --git a/jd_pet.js b/jd_pet.js new file mode 100644 index 0000000000..22880358f1 --- /dev/null +++ b/jd_pet.js @@ -0,0 +1,631 @@ +/* +东东萌宠 更新地址: https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js +更新时间:2021-01-10 +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js + +互助码shareCode请先手动运行脚本查看打印可看到 +一天只能帮助5个人。多出的助力码无效 + +=================================Quantumultx========================= +[task_local] +#东东萌宠 +15 6-18/6 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js, tag=东东萌宠, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdmc.png, enabled=true + +=================================Loon=================================== +[Script] +cron "15 6-18/6 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js,tag=东东萌宠 + +===================================Surge================================ +东东萌宠 = type=cron,cronexp="15 6-18/6 * * *",wake-system=1,timeout=120,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js + +====================================小火箭============================= +东东萌宠 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js, cronexpr="15 6-18/6 * * *", timeout=200, enable=true + +*/ +const $ = new Env('东东萌宠'); +let cookiesArr = [], cookie = '', jdPetShareArr = [], isBox = false, notify, newShareCodes; +//助力好友分享码(最多5个,否则后面的助力失败),原因:京东农场每人每天只有四次助力机会 +//此此内容是IOS用户下载脚本到本地使用,填写互助码的地方,同一京东账号的好友互助码请使用@符号隔开。 +//下面给出两个账号的填写示例(iOS只支持2个京东账号) +let shareCodes = [ // IOS本地脚本用户这个列表填入你要助力的好友的shareCode + //账号一的好友shareCode,不同好友的shareCode中间用@符号隔开 + 'MTAxODc2NTEzNTAwMDAwMDAwMjg3MDg2MA==@MTAxODc2NTEzMzAwMDAwMDAyNzUwMDA4MQ==@MTAxODc2NTEzMjAwMDAwMDAzMDI3MTMyOQ==@MTAxODc2NTEzNDAwMDAwMDAzMDI2MDI4MQ==@MTAxODcxOTI2NTAwMDAwMDAxOTQ3MjkzMw==', + //账号二的好友shareCode,不同好友的shareCode中间用@符号隔开 + 'MTAxODc2NTEzMjAwMDAwMDAzMDI3MTMyOQ==@MTAxODcxOTI2NTAwMDAwMDAyNjA4ODQyMQ==@MTAxODc2NTEzOTAwMDAwMDAyNzE2MDY2NQ==@MTE1NDUyMjEwMDAwMDAwNDI0MDM2MDc=', +] +let message = '', subTitle = '', option = {}; +let jdNotify = false;//是否关闭通知,false打开通知推送,true关闭通知推送 +const JD_API_HOST = 'https://api.m.jd.com/client.action'; +let goodsUrl = '', taskInfoKey = []; +let randomCount = $.isNode() ? 20 : 5; +!(async () => { + await requireConfig(); + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + await TotalBean(); + console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + message = ''; + subTitle = ''; + goodsUrl = ''; + taskInfoKey = []; + option = {}; + await shareCodesFormat(); + await jdPet(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) +async function jdPet() { + //查询jd宠物信息 + const initPetTownRes = await request('initPetTown'); + message = `【京东账号${$.index}】${$.nickName}\n`; + if (initPetTownRes.code === '0' && initPetTownRes.resultCode === '0' && initPetTownRes.message === 'success') { + $.petInfo = initPetTownRes.result; + if ($.petInfo.userStatus === 0) { + $.msg($.name, '', `【提示】京东账号${$.index}${$.nickName}\n萌宠活动未开启\n请手动去京东APP开启活动\n入口:我的->游戏与互动->查看更多开启`, { "open-url": "openapp.jdmoble://" }); + return + } + if (!$.petInfo.goodsInfo) { + $.msg($.name, '', `【提示】京东账号${$.index}${$.nickName}\n暂未选购新的商品`, { "open-url": "openapp.jdmoble://" }); + if ($.isNode()) await notify.sendNotify(`${$.name} - ${$.index} - ${$.nickName}`, `【提示】京东账号${$.index}${$.nickName}\n暂未选购新的商品`); + return + } + goodsUrl = $.petInfo.goodsInfo && $.petInfo.goodsInfo.goodsUrl; + // option['media-url'] = goodsUrl; + // console.log(`初始化萌宠信息完成: ${JSON.stringify(petInfo)}`); + if ($.petInfo.petStatus === 5) { + await slaveHelp();//可以兑换而没有去兑换,也能继续助力好友 + option['open-url'] = "openApp.jdMobile://"; + $.msg($.name, `【提醒⏰】${$.petInfo.goodsInfo.goodsName}已可领取`, '请去京东APP或微信小程序查看', option); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}奖品已可领取`, `京东账号${$.index} ${$.nickName}\n${$.petInfo.goodsInfo.goodsName}已可领取`); + } + return + } else if ($.petInfo.petStatus === 6) { + await slaveHelp();//已领取红包,但未领养新的,也能继续助力好友 + option['open-url'] = "openApp.jdMobile://"; + $.msg($.name, `【提醒⏰】已领取红包,但未继续领养新的物品`, '请去京东APP或微信小程序继续领养', option); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}奖品已可领取`, `京东账号${$.index} ${$.nickName}\n已领取红包,但未继续领养新的物品`); + } + return + } + console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${$.petInfo.shareCode}\n`); + await taskInit(); + if ($.taskInit.resultCode === '9999' || !$.taskInit.result) { + console.log('初始化任务异常, 请稍后再试'); + return + } + $.taskInfo = $.taskInit.result; + + await petSport();//遛弯 + await slaveHelp();//助力好友 + await masterHelpInit();//获取助力的信息 + await doTask();//做日常任务 + await feedPetsAgain();//再次投食 + await energyCollect();//收集好感度 + await showMsg(); + console.log('全部任务完成, 如果帮助到您可以点下🌟STAR鼓励我一下, 明天见~'); + } else if (initPetTownRes.code === '0'){ + console.log(`初始化萌宠失败: ${initPetTownRes.message}`); + } +} +// 收取所有好感度 +async function energyCollect() { + console.log('开始收取任务奖励好感度'); + let function_id = arguments.callee.name.toString(); + const response = await request(function_id); + // console.log(`收取任务奖励好感度完成:${JSON.stringify(response)}`); + if (response.resultCode === '0') { + message += `【第${response.result.medalNum + 1}块勋章完成进度】${response.result.medalPercent}%,还需收集${response.result.needCollectEnergy}好感\n`; + message += `【已获得勋章】${response.result.medalNum}块,还需收集${response.result.needCollectMedalNum}块即可兑换奖品“${$.petInfo.goodsInfo.goodsName}”\n`; + } +} +//再次投食 +async function feedPetsAgain() { + const response = await request('initPetTown');//再次初始化萌宠 + if (response.code === '0' && response.resultCode === '0' && response.message === 'success') { + $.petInfo = response.result; + let foodAmount = $.petInfo.foodAmount; //剩余狗粮 + if (foodAmount - 100 >= 10) { + for (let i = 0; i < parseInt((foodAmount - 100) / 10); i++) { + const feedPetRes = await request('feedPets'); + console.log(`投食feedPetRes`); + if (feedPetRes.resultCode == 0 && feedPetRes.code == 0) { + console.log('投食成功') + } + } + const response2 = await request('initPetTown'); + $.petInfo = response2.result; + subTitle = $.petInfo.goodsInfo.goodsName; + // message += `【与爱宠相识】${$.petInfo.meetDays}天\n`; + // message += `【剩余狗粮】${$.petInfo.foodAmount}g\n`; + } else { + console.log("目前剩余狗粮:【" + foodAmount + "】g,不再继续投食,保留部分狗粮用于完成第二天任务"); + subTitle = $.petInfo.goodsInfo && $.petInfo.goodsInfo.goodsName; + // message += `【与爱宠相识】${$.petInfo.meetDays}天\n`; + // message += `【剩余狗粮】${$.petInfo.foodAmount}g\n`; + } + } else { + console.log(`初始化萌宠失败: ${JSON.stringify($.petInfo)}`); + } +} + + +async function doTask() { + const { signInit, threeMealInit, firstFeedInit, feedReachInit, inviteFriendsInit, browseShopsInit, taskList } = $.taskInfo; + for (let item of taskList) { + if ($.taskInfo[item].finished) { + console.log(`任务 ${item} 已完成`) + } + } + //每日签到 + if (signInit && !signInit.finished) { + await signInitFun(); + } + // 首次喂食 + if (firstFeedInit && !firstFeedInit.finished) { + await firstFeedInitFun(); + } + // 三餐 + if (threeMealInit && !threeMealInit.finished) { + if (threeMealInit.timeRange === -1) { + console.log(`未到三餐时间`); + } else { + await threeMealInitFun(); + } + } + if (browseShopsInit && !browseShopsInit.finished) { + await browseShopsInitFun(); + } + let browseSingleShopInitList = []; + taskList.map((item) => { + if (item.indexOf('browseSingleShopInit') > -1) { + browseSingleShopInitList.push(item); + } + }); + // 去逛逛好货会场 + for (let item of browseSingleShopInitList) { + const browseSingleShopInitTask = $.taskInfo[item]; + if (browseSingleShopInitTask && !browseSingleShopInitTask.finished) { + await browseSingleShopInit(browseSingleShopInitTask); + } + } + if (inviteFriendsInit && !inviteFriendsInit.finished) { + await inviteFriendsInitFun(); + } + // 投食10次 + if (feedReachInit && !feedReachInit.finished) { + await feedReachInitFun(); + } +} +// 好友助力信息 +async function masterHelpInit() { + let res = await request(arguments.callee.name.toString()); + // console.log(`助力信息: ${JSON.stringify(res)}`); + if (res.code === '0' && res.resultCode === '0') { + if (res.result.masterHelpPeoples && res.result.masterHelpPeoples.length >= 5) { + if(!res.result.addedBonusFlag) { + console.log("开始领取额外奖励"); + let getHelpAddedBonusResult = await request('getHelpAddedBonus'); + if (getHelpAddedBonusResult.resultCode === '0') { + message += `【额外奖励${getHelpAddedBonusResult.result.reward}领取】${getHelpAddedBonusResult.message}\n`; + } + console.log(`领取30g额外奖励结果:【${getHelpAddedBonusResult.message}】`); + } else { + console.log("已经领取过5好友助力额外奖励"); + message += `【额外奖励】已领取\n`; + } + } else { + console.log("助力好友未达到5个") + message += `【额外奖励】领取失败,原因:给您助力的人未达5个\n`; + } + if (res.result.masterHelpPeoples && res.result.masterHelpPeoples.length > 0) { + console.log('帮您助力的好友的名单开始') + let str = ''; + res.result.masterHelpPeoples.map((item, index) => { + if (index === (res.result.masterHelpPeoples.length - 1)) { + str += item.nickName || "匿名用户"; + } else { + str += (item.nickName || "匿名用户") + ','; + } + }) + message += `【助力您的好友】${str}\n`; + } + } +} +/** + * 助力好友, 暂时支持一个好友, 需要拿到shareCode + * shareCode为你要助力的好友的 + * 运行脚本时你自己的shareCode会在控制台输出, 可以将其分享给他人 + */ +async function slaveHelp() { + //$.log(`\n因1.6日好友助力功能下线。故暂时屏蔽\n`) + //return + let helpPeoples = ''; + for (let code of newShareCodes) { + console.log(`开始助力京东账号${$.index} - ${$.nickName}的好友: ${code}`); + if (!code) continue; + let response = await request(arguments.callee.name.toString(), {'shareCode': code}); + if (response.code === '0' && response.resultCode === '0') { + if (response.result.helpStatus === 0) { + console.log('已给好友: 【' + response.result.masterNickName + '】助力成功'); + helpPeoples += response.result.masterNickName + ','; + } else if (response.result.helpStatus === 1) { + // 您今日已无助力机会 + console.log(`助力好友${response.result.masterNickName}失败,您今日已无助力机会`); + break; + } else if (response.result.helpStatus === 2) { + //该好友已满5人助力,无需您再次助力 + console.log(`该好友${response.result.masterNickName}已满5人助力,无需您再次助力`); + } else { + console.log(`助力其他情况:${JSON.stringify(response)}`); + } + } else { + console.log(`助力好友结果: ${response.message}`); + } + } + if (helpPeoples && helpPeoples.length > 0) { + message += `【您助力的好友】${helpPeoples.substr(0, helpPeoples.length - 1)}\n`; + } +} +// 遛狗, 每天次数上限10次, 随机给狗粮, 每次遛狗结束需调用getSportReward领取奖励, 才能进行下一次遛狗 +async function petSport() { + console.log('开始遛弯'); + let times = 1 + const code = 0 + let resultCode = 0 + do { + let response = await request(arguments.callee.name.toString()) + console.log(`第${times}次遛狗完成: ${JSON.stringify(response)}`); + resultCode = response.resultCode; + if (resultCode == 0) { + let sportRevardResult = await request('getSportReward'); + console.log(`领取遛狗奖励完成: ${JSON.stringify(sportRevardResult)}`); + } + times++; + } while (resultCode == 0 && code == 0) + if (times > 1) { + // message += '【十次遛狗】已完成\n'; + } +} +// 初始化任务, 可查询任务完成情况 +async function taskInit() { + console.log('开始任务初始化'); + $.taskInit = await request(arguments.callee.name.toString(), {"version":1}); +} +// 每日签到, 每天一次 +async function signInitFun() { + console.log('准备每日签到'); + const response = await request("getSignReward"); + console.log(`每日签到结果: ${JSON.stringify(response)}`); + if (response.code === '0' && response.resultCode === '0') { + console.log(`【每日签到成功】奖励${response.result.signReward}g狗粮\n`); + // message += `【每日签到成功】奖励${response.result.signReward}g狗粮\n`; + } else { + console.log(`【每日签到】${response.message}\n`); + // message += `【每日签到】${response.message}\n`; + } +} + +// 三餐签到, 每天三段签到时间 +async function threeMealInitFun() { + console.log('准备三餐签到'); + const response = await request("getThreeMealReward"); + console.log(`三餐签到结果: ${JSON.stringify(response)}`); + if (response.code === '0' && response.resultCode === '0') { + console.log(`【定时领狗粮】获得${response.result.threeMealReward}g\n`); + // message += `【定时领狗粮】获得${response.result.threeMealReward}g\n`; + } else { + console.log(`【定时领狗粮】${response.message}\n`); + // message += `【定时领狗粮】${response.message}\n`; + } +} + +// 浏览指定店铺 任务 +async function browseSingleShopInit(item) { + console.log(`开始做 ${item.title} 任务, ${item.desc}`); + const body = {"index": item['index'], "version":1, "type":1}; + const body2 = {"index": item['index'], "version":1, "type":2}; + const response = await request("getSingleShopReward", body); + // console.log(`点击进去response::${JSON.stringify(response)}`); + if (response.code === '0' && response.resultCode === '0') { + const response2 = await request("getSingleShopReward", body2); + // console.log(`浏览完毕领取奖励:response2::${JSON.stringify(response2)}`); + if (response2.code === '0' && response2.resultCode === '0') { + console.log(`【浏览指定店铺】获取${response2.result.reward}g\n`); + // message += `【浏览指定店铺】获取${response2.result.reward}g\n`; + } + } +} + +// 浏览店铺任务, 任务可能为多个? 目前只有一个 +async function browseShopsInitFun() { + console.log('开始浏览店铺任务'); + let times = 0; + let resultCode = 0; + let code = 0; + do { + let response = await request("getBrowseShopsReward"); + console.log(`第${times}次浏览店铺结果: ${JSON.stringify(response)}`); + code = response.code; + resultCode = response.resultCode; + times++; + } while (resultCode == 0 && code == 0 && times < 5) + console.log('浏览店铺任务结束'); +} +// 首次投食 任务 +function firstFeedInitFun() { + console.log('首次投食任务合并到10次喂食任务中\n'); +} + +// 邀请新用户 +async function inviteFriendsInitFun() { + console.log('邀请新用户功能未实现'); + if ($.taskInfo.inviteFriendsInit.status == 1 && $.taskInfo.inviteFriendsInit.inviteFriendsNum > 0) { + // 如果有邀请过新用户,自动领取60gg奖励 + const res = await request('getInviteFriendsReward'); + if (res.code == 0 && res.resultCode == 0) { + console.log(`领取邀请新用户奖励成功,获得狗粮现有狗粮${$.taskInfo.inviteFriendsInit.reward}g,${res.result.foodAmount}g`); + message += `【邀请新用户】获取狗粮${$.taskInfo.inviteFriendsInit.reward}g\n`; + } + } +} + +/** + * 投食10次 任务 + */ +async function feedReachInitFun() { + console.log('投食任务开始...'); + let finishedTimes = $.taskInfo.feedReachInit.hadFeedAmount / 10; //已经喂养了几次 + let needFeedTimes = 10 - finishedTimes; //还需要几次 + let tryTimes = 20; //尝试次数 + do { + console.log(`还需要投食${needFeedTimes}次`); + const response = await request('feedPets'); + console.log(`本次投食结果: ${JSON.stringify(response)}`); + if (response.resultCode == 0 && response.code == 0) { + needFeedTimes--; + } + if (response.resultCode == 3003 && response.code == 0) { + console.log('剩余狗粮不足, 投食结束'); + needFeedTimes = 0; + } + tryTimes--; + } while (needFeedTimes > 0 && tryTimes > 0) + console.log('投食任务结束...\n'); +} +async function showMsg() { + let ctrTemp; + if ($.isNode() && process.env.PET_NOTIFY_CONTROL) { + ctrTemp = `${process.env.PET_NOTIFY_CONTROL}` === 'false'; + } else if ($.getdata('jdPetNotify')) { + ctrTemp = $.getdata('jdPetNotify') === 'false'; + } else { + ctrTemp = `${jdNotify}` === 'false'; + } + // jdNotify = `${notify.petNotifyControl}` === 'false' && `${jdNotify}` === 'false' && $.getdata('jdPetNotify') === 'false'; + if (ctrTemp) { + $.msg($.name, subTitle, message, option); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `${subTitle}\n${message}`); + } + } else { + $.log(`\n${message}\n`); + } +} +function readShareCode() { + return new Promise(async resolve => { + $.get({url: `http://api.turinglabs.net/api/v1/jd/pet/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) + data = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + await $.wait(10000); + resolve() + }) +} +function shareCodesFormat() { + return new Promise(async resolve => { + // console.log(`第${$.index}个京东账号的助力码:::${jdPetShareArr[$.index - 1]}`) + newShareCodes = []; + if (jdPetShareArr[$.index - 1]) { + newShareCodes = jdPetShareArr[$.index - 1].split('@'); + } else { + console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) + const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1); + newShareCodes = shareCodes[tempIndex].split('@'); + } + //因好友助力功能下线。故暂时屏蔽 + const readShareCodeRes = await readShareCode(); + //const readShareCodeRes = null; + if (readShareCodeRes && readShareCodeRes.code === 200) { + newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])]; + } + console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify(newShareCodes)}`) + resolve(); + }) +} +function requireConfig() { + return new Promise(resolve => { + console.log('开始获取东东萌宠配置文件\n') + notify = $.isNode() ? require('./sendNotify') : ''; + //Node.js用户请在jdCookie.js处填写京东ck; + const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; + const jdPetShareCodes = $.isNode() ? require('./jdPetShareCodes.js') : ''; + //IOS等用户直接用NobyDa的jd cookie + if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + if (jdCookieNode[item]) { + cookiesArr.push(jdCookieNode[item]) + } + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; + } else { + cookiesArr.push(...[$.getdata('CookieJD'), $.getdata('CookieJD2')]); + } + console.log(`共${cookiesArr.length}个京东账号\n`) + if ($.isNode()) { + Object.keys(jdPetShareCodes).forEach((item) => { + if (jdPetShareCodes[item]) { + jdPetShareArr.push(jdPetShareCodes[item]) + } + }) + } else { + const boxShareCodeArr = ['jd_pet1', 'jd_pet2', 'jd_pet3', 'jd_pet4', 'jd_pet5']; + const boxShareCodeArr2 = ['jd2_pet1', 'jd2_pet2', 'jd2_pet3', 'jd2_pet4', 'jd2_pet5']; + const isBox1 = boxShareCodeArr.some((item) => { + const boxShareCode = $.getdata(item); + return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); + }); + const isBox2 = boxShareCodeArr2.some((item) => { + const boxShareCode = $.getdata(item); + return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); + }); + isBox = isBox1 ? isBox1 : isBox2; + if (isBox1) { + let temp = []; + for (const item of boxShareCodeArr) { + if ($.getdata(item)) { + temp.push($.getdata(item)) + } + } + jdPetShareArr.push(temp.join('@')); + } + if (isBox2) { + let temp = []; + for (const item of boxShareCodeArr2) { + if ($.getdata(item)) { + temp.push($.getdata(item)) + } + } + jdPetShareArr.push(temp.join('@')); + } + } + // console.log(`jdPetShareArr::${JSON.stringify(jdPetShareArr)}`) + // console.log(`jdPetShareArr账号长度::${jdPetShareArr.length}`) + console.log(`您提供了${jdPetShareArr.length}个账号的东东萌宠助力码\n`); + resolve() + }) +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +// 请求 +async function request(function_id, body = {}) { + await $.wait(3000); //歇口气儿, 不然会报操作频繁 + return new Promise((resolve, reject) => { + $.post(taskUrl(function_id, body), (err, resp, data) => { + try { + if (err) { + console.log('\n东东萌宠: API查询请求失败 ‼️‼️'); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + data = JSON.parse(data); + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data) + } + }) + }) +} +// function taskUrl(function_id, body = {}) { +// return { +// url: `${JD_API_HOST}?functionId=${function_id}&appid=wh5&loginWQBiz=pet-town&body=${escape(JSON.stringify(body))}`, +// headers: { +// Cookie: cookie, +// UserAgent: $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), +// } +// }; +// } +function taskUrl(function_id, body = {}) { + body["version"] = 2; + body["channel"] = 'app'; + return { + url: `${JD_API_HOST}?functionId=${function_id}`, + body: `body=${escape(JSON.stringify(body))}&appid=wh5&loginWQBiz=pet-town&clientVersion=9.0.4`, + headers: { + 'Cookie': cookie, + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Host': 'api.m.jd.com', + 'Content-Type': 'application/x-www-form-urlencoded', + } + }; +} +// prettier-ignore +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,o)=>{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.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 o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=e&&e.timeout?e.timeout:o;const[r,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":r,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),o=JSON.stringify(this.data);s?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(e,o):this.fs.writeFileSync(t,o)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return s;return o}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),o=s?this.getval(s):"";if(o)try{const t=JSON.parse(o);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(e),r=this.getval(i),h=i?"null"===r?null:r||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,o,t),s=this.setval(JSON.stringify(e),i)}catch(e){const r={};this.lodash_set(r,o,t),s=this.setval(JSON.stringify(r),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()?$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)))}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())$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",$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t))}}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="",o){const r=t=>{if(!t||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,r(o)):this.isQuanX()&&$notify(e,s,i,r(o)));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)} diff --git a/jd_plantBean.js b/jd_plantBean.js new file mode 100644 index 0000000000..874a0b762e --- /dev/null +++ b/jd_plantBean.js @@ -0,0 +1,749 @@ +/* +种豆得豆 脚本更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js +更新时间:2021-1-16 +已支持IOS京东双账号,云端N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +注:会自动关注任务中的店铺跟商品,介意者勿使用。 +互助码shareCode请先手动运行脚本查看打印可看到 +每个京东账号每天只能帮助3个人。多出的助力码将会助力失败。 +=====================================Quantumult X================================= +[task_local] +1 7-21/2 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js, tag=种豆得豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzd.png, enabled=true + +=====================================Loon================================ +[Script] +cron "1 7-21/2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js,tag=京东种豆得豆 + +======================================Surge========================== +京东种豆得豆 = type=cron,cronexp="1 7-21/2 * * *",wake-system=1,timeout=120,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js + +====================================小火箭============================= +京东种豆得豆 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js, cronexpr="1 7-21/2 * * *", timeout=200, enable=true + +搬的https://github.com/uniqueque/QuantumultX/blob/4c1572d93d4d4f883f483f907120a75d925a693e/Script/jd_plantBean.js +*/ +const $ = new Env('京东种豆得豆'); +//Node.js用户请在jdCookie.js处填写京东ck; +//ios等软件用户直接用NobyDa的jd cookie +let jdNotify = true;//是否开启静默运行。默认true开启 +let cookiesArr = [], cookie = '', jdPlantBeanShareArr = [], isBox = false, notify, newShareCodes, option, message,subTitle; +//京东接口地址 +const JD_API_HOST = 'https://api.m.jd.com/client.action'; +//助力好友分享码(最多3个,否则后面的助力失败) +//此此内容是IOS用户下载脚本到本地使用,填写互助码的地方,同一京东账号的好友互助码请使用@符号隔开。 +//下面给出两个账号的填写示例(iOS只支持2个京东账号) +let shareCodes = [ // IOS本地脚本用户这个列表填入你要助力的好友的shareCode + //账号一的好友shareCode,不同好友的shareCode中间用@符号隔开 + '66j4yt3ebl5ierjljoszp7e4izzbzaqhi5k2unz2afwlyqsgnasq@olmijoxgmjutyrsovl2xalt2tbtfmg6sqldcb3q@e7lhibzb3zek27amgsvywffxx7hxgtzstrk2lba@e7lhibzb3zek32e72n4xesxmgc2m76eju62zk3y', + //账号二的好友shareCode,不同好友的shareCode中间用@符号隔开 + 'olmijoxgmjutyx55upqaqxrblt7f3h26dgj2riy@4npkonnsy7xi3p6pjfxg6ct5gll42gmvnz7zgoy@6dygkptofggtp6ffhbowku3xgu@mlrdw3aw26j3wgzjipsxgonaoyr2evrdsifsziy', +] +let currentRoundId = null;//本期活动id +let lastRoundId = null;//上期id +let roundList = []; +let awardState = '';//上期活动的京豆是否收取 +let randomCount = $.isNode() ? 20 : 5; +!(async () => { + await requireConfig(); + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + await TotalBean(); + console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + message = ''; + subTitle = ''; + option = {}; + await shareCodesFormat(); + await jdPlantBean(); + await showMsg(); + } + } +})().catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') +}).finally(() => { + $.done(); +}) + +async function jdPlantBean() { + try { + console.log(`获取任务及基本信息`) + await plantBeanIndex(); + // console.log(plantBeanIndexResult.data.taskList); + if ($.plantBeanIndexResult.code === '0') { + const shareUrl = $.plantBeanIndexResult.data.jwordShareInfo.shareUrl + $.myPlantUuid = getParam(shareUrl, 'plantUuid') + console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${$.myPlantUuid}\n`); + roundList = $.plantBeanIndexResult.data.roundList; + currentRoundId = roundList[1].roundId;//本期的roundId + lastRoundId = roundList[0].roundId;//上期的roundId + awardState = roundList[0].awardState; + $.taskList = $.plantBeanIndexResult.data.taskList; + subTitle = `【京东昵称】${$.plantBeanIndexResult.data.plantUserInfo.plantNickName}`; + message += `【上期时间】${roundList[0].dateDesc.replace('上期 ', '')}\n`; + message += `【上期成长值】${roundList[0].growth}\n`; + await receiveNutrients();//定时领取营养液 + await doHelp();//助力 + await doTask();//做日常任务 + await doEgg(); + await stealFriendWater(); + await doCultureBean(); + await doGetReward(); + await showTaskProcess(); + await plantShareSupportList(); + } else { + console.log(`种豆得豆-初始失败: ${JSON.stringify($.plantBeanIndexResult)}`); + } + } catch (e) { + $.logErr(e); + } +} +async function doGetReward() { + console.log(`【上轮京豆】${awardState === '4' ? '采摘中' : awardState === '5' ? '可收获了' : '已领取'}`); + if (awardState === '4') { + //京豆采摘中... + message += `【上期状态】${roundList[0].tipBeanEndTitle}\n`; + } else if (awardState === '5') { + //收获 + await getReward(); + console.log('开始领取京豆'); + if ($.getReward.code === '0') { + console.log('京豆领取成功'); + message += `【上期兑换京豆】${$.getReward.data.awardBean}个\n`; + $.msg($.name, subTitle, message); + if ($.isNode()) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}`, `京东账号${$.index} ${$.nickName}\n${message}`); + } + } + } else if (awardState === '6') { + //京豆已领取 + message += `【上期兑换京豆】${roundList[0].awardBeans}个\n`; + } + if (roundList[1].dateDesc.indexOf('本期 ') > -1) { + roundList[1].dateDesc = roundList[1].dateDesc.substr(roundList[1].dateDesc.indexOf('本期 ') + 3, roundList[1].dateDesc.length); + } + message += `【本期时间】${roundList[1].dateDesc}\n`; + message += `【本期成长值】${roundList[1].growth}\n`; +} +async function doCultureBean() { + await plantBeanIndex(); + if ($.plantBeanIndexResult.code === '0') { + const plantBeanRound = $.plantBeanIndexResult.data.roundList[1] + if (plantBeanRound.roundState === '2') { + //收取营养液 + console.log(`开始收取营养液`) + for (let bubbleInfo of plantBeanRound.bubbleInfos) { + console.log(`收取-${bubbleInfo.name}-的营养液`) + await cultureBean(plantBeanRound.roundId, bubbleInfo.nutrientsType) + console.log(`收取营养液结果:${JSON.stringify($.cultureBeanRes)}`) + } + } + } else { + console.log(`plantBeanIndexResult:${JSON.stringify($.plantBeanIndexResult)}`) + } +} +async function stealFriendWater() { + await stealFriendList(); + if ($.stealFriendList.code === '0') { + if ($.stealFriendList.data.tips) { + console.log('偷取好友营养液今日已达上限'); + return + } + if ($.stealFriendList.data && $.stealFriendList.data.friendInfoList && $.stealFriendList.data.friendInfoList.length > 0) { + let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); + for (let item of $.stealFriendList.data.friendInfoList) { + if (new Date(nowTimes).getHours() === 20) { + if (item.nutrCount >= 2) { + // console.log(`可以偷的好友的信息::${JSON.stringify(item)}`); + console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`); + await collectUserNutr(item.paradiseUuid); + console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`) + if ($.stealFriendRes.code === '0') { + console.log(`偷取好友营养液成功`) + } + } + } else { + if (item.nutrCount >= 3) { + // console.log(`可以偷的好友的信息::${JSON.stringify(item)}`); + console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`); + await collectUserNutr(item.paradiseUuid); + console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`) + if ($.stealFriendRes.code === '0') { + console.log(`偷取好友营养液成功`) + } + } + } + } + } + } +} +async function doEgg() { + await egg(); + if ($.plantEggLotteryRes.code === '0') { + if ($.plantEggLotteryRes.data.restLotteryNum > 0) { + const eggL = new Array($.plantEggLotteryRes.data.restLotteryNum).fill(''); + console.log(`目前共有${eggL.length}次扭蛋的机会`) + for (let i = 0; i < eggL.length; i++) { + console.log(`开始第${i + 1}次扭蛋`); + await plantEggDoLottery(); + console.log(`天天扭蛋成功:${JSON.stringify($.plantEggDoLotteryResult)}`); + } + } else { + console.log('暂无扭蛋机会') + } + } else { + console.log('查询天天扭蛋的机会失败') + } +} +async function doTask() { + if ($.taskList && $.taskList.length > 0) { + for (let item of $.taskList) { + if (item.isFinished === 1) { + console.log(`${item.taskName} 任务已完成\n`); + continue; + } else { + if (item.taskType === 8) { + console.log(`\n【${item.taskName}】任务未完成,需自行手动去京东APP完成,${item.desc}营养液\n`) + } else { + console.log(`\n【${item.taskName}】任务未完成,${item.desc}营养液\n`) + } + } + if (item.dailyTimes === 1 && item.taskType !== 8) { + console.log(`\n开始做 ${item.taskName}任务`); + // $.receiveNutrientsTaskRes = await receiveNutrientsTask(item.taskType); + await receiveNutrientsTask(item.taskType); + console.log(`做 ${item.taskName}任务结果:${JSON.stringify($.receiveNutrientsTaskRes)}\n`); + } + if (item.taskType === 3) { + //浏览店铺 + console.log(`开始做 ${item.taskName}任务`); + let unFinishedShopNum = item.totalNum - item.gainedNum; + if (unFinishedShopNum === 0) { + continue + } + await shopTaskList(); + const { data } = $.shopTaskListRes; + let goodShopListARR = [], moreShopListARR = [], shopList = []; + const { goodShopList, moreShopList } = data; + for (let i of goodShopList) { + if (i.taskState === '2') { + goodShopListARR.push(i); + } + } + for (let j of moreShopList) { + if (j.taskState === '2') { + moreShopListARR.push(j); + } + } + shopList = goodShopListARR.concat(moreShopListARR); + for (let shop of shopList) { + const { shopId, shopTaskId } = shop; + const body = { + "monitor_refer": "plant_shopNutrientsTask", + "shopId": shopId, + "shopTaskId": shopTaskId + } + const shopRes = await requestGet('shopNutrientsTask', body); + console.log(`shopRes结果:${JSON.stringify(shopRes)}`); + if (shopRes.code === '0') { + if (shopRes.data && shopRes.data.nutrState && shopRes.data.nutrState === '1') { + unFinishedShopNum --; + } + } + if (unFinishedShopNum <= 0) { + console.log(`${item.taskName}任务已做完\n`) + break; + } + } + } + if (item.taskType === 5) { + //挑选商品 + console.log(`开始做 ${item.taskName}任务`); + let unFinishedProductNum = item.totalNum - item.gainedNum; + if (unFinishedProductNum === 0) { + continue + } + await productTaskList(); + // console.log('productTaskList', $.productTaskList); + const { data } = $.productTaskList; + let productListARR = [], productList = []; + const { productInfoList } = data; + for (let i = 0; i < productInfoList.length; i++) { + for (let j = 0; j < productInfoList[i].length; j++){ + productListARR.push(productInfoList[i][j]); + } + } + for (let i of productListARR) { + if (i.taskState === '2') { + productList.push(i); + } + } + for (let product of productList) { + const { skuId, productTaskId } = product; + const body = { + "monitor_refer": "plant_productNutrientsTask", + "productTaskId": productTaskId, + "skuId": skuId + } + const productRes = await requestGet('productNutrientsTask', body); + if (productRes.code === '0') { + // console.log('nutrState', productRes) + //这里添加多重判断,有时候会出现活动太火爆的问题,导致nutrState没有 + if (productRes.data && productRes.data.nutrState && productRes.data.nutrState === '1') { + unFinishedProductNum --; + } + } + if (unFinishedProductNum <= 0) { + console.log(`${item.taskName}任务已做完\n`) + break; + } + } + } + if (item.taskType === 10) { + //关注频道 + console.log(`开始做 ${item.taskName}任务`); + let unFinishedChannelNum = item.totalNum - item.gainedNum; + if (unFinishedChannelNum === 0) { + continue + } + await plantChannelTaskList(); + const { data } = $.plantChannelTaskList; + // console.log('goodShopList', data.goodShopList); + // console.log('moreShopList', data.moreShopList); + let goodChannelListARR = [], normalChannelListARR = [], channelList = []; + const { goodChannelList, normalChannelList } = data; + for (let i of goodChannelList) { + if (i.taskState === '2') { + goodChannelListARR.push(i); + } + } + for (let j of normalChannelList) { + if (j.taskState === '2') { + normalChannelListARR.push(j); + } + } + channelList = goodChannelListARR.concat(normalChannelListARR); + for (let channelItem of channelList) { + const { channelId, channelTaskId } = channelItem; + const body = { + "channelId": channelId, + "channelTaskId": channelTaskId + } + const channelRes = await requestGet('plantChannelNutrientsTask', body); + console.log(`channelRes结果:${JSON.stringify(channelRes)}`); + if (channelRes.code === '0') { + if (channelRes.data && channelRes.data.nutrState && channelRes.data.nutrState === '1') { + unFinishedChannelNum --; + } + } + if (unFinishedChannelNum <= 0) { + console.log(`${item.taskName}任务已做完\n`) + break; + } + } + } + } + } +} +function showTaskProcess() { + return new Promise(async resolve => { + await plantBeanIndex(); + $.taskList = $.plantBeanIndexResult.data.taskList; + if ($.taskList && $.taskList.length > 0) { + console.log(" 任务 进度"); + for (let item of $.taskList) { + console.log(`[${item["taskName"]}] ${item["gainedNum"]}/${item["totalNum"]} ${item["isFinished"]}`); + } + } + resolve() + }) +} +//助力好友 +async function doHelp() { + for (let plantUuid of newShareCodes) { + console.log(`开始助力京东账号${$.index} - ${$.nickName}的好友: ${plantUuid}`); + if (!plantUuid) continue; + if (plantUuid === $.myPlantUuid) { + console.log(`\n跳过自己的plantUuid\n`) + continue + } + await helpShare(plantUuid); + if ($.helpResult.code === '0') { + // console.log(`助力好友结果: ${JSON.stringify($.helpResult.data.helpShareRes)}`); + if ($.helpResult.data.helpShareRes) { + if ($.helpResult.data.helpShareRes.state === '1') { + console.log(`助力好友${plantUuid}成功`) + console.log(`${$.helpResult.data.helpShareRes.promptText}\n`); + } else if ($.helpResult.data.helpShareRes.state === '2') { + console.log('您今日助力的机会已耗尽,已不能再帮助好友助力了\n'); + break; + } else if ($.helpResult.data.helpShareRes.state === '3') { + console.log('该好友今日已满9人助力/20瓶营养液,明天再来为Ta助力吧\n') + } else if ($.helpResult.data.helpShareRes.state === '4') { + console.log(`${$.helpResult.data.helpShareRes.promptText}\n`) + } else { + console.log(`助力其他情况:${JSON.stringify($.helpResult.data.helpShareRes)}`); + } + } + } else { + console.log(`助力好友失败: ${JSON.stringify($.helpResult)}`); + } + } +} +function showMsg() { + $.log(`\n${message}\n`); + jdNotify = $.getdata('jdPlantBeanNotify') ? $.getdata('jdPlantBeanNotify') : jdNotify; + if (!jdNotify || jdNotify === 'false') { + $.msg($.name, subTitle, message); + } +} +// ================================================此处是API================================= +//每轮种豆活动获取结束后,自动收取京豆 +async function getReward() { + const body = { + "roundId": lastRoundId + } + $.getReward = await request('receivedBean', body); +} +//收取营养液 +async function cultureBean(currentRoundId, nutrientsType) { + let functionId = arguments.callee.name.toString(); + let body = { + "roundId": currentRoundId, + "nutrientsType": nutrientsType, + } + $.cultureBeanRes = await request(functionId, body); +} +//偷营养液大于等于3瓶的好友 +//①查询好友列表 +async function stealFriendList() { + const body = { + pageNum: '1' + } + $.stealFriendList = await request('plantFriendList', body); +} + +//②执行偷好友营养液的动作 +async function collectUserNutr(paradiseUuid) { + console.log('开始偷好友'); + // console.log(paradiseUuid); + let functionId = arguments.callee.name.toString(); + const body = { + "paradiseUuid": paradiseUuid, + "roundId": currentRoundId + } + $.stealFriendRes = await request(functionId, body); +} +async function receiveNutrients() { + $.receiveNutrientsRes = await request('receiveNutrients', {"roundId": currentRoundId, "monitor_refer": "plant_receiveNutrients"}) + // console.log(`定时领取营养液结果:${JSON.stringify($.receiveNutrientsRes)}`) +} +async function plantEggDoLottery() { + $.plantEggDoLotteryResult = await requestGet('plantEggDoLottery'); +} +//查询天天扭蛋的机会 +async function egg() { + $.plantEggLotteryRes = await requestGet('plantEggLotteryIndex'); +} +async function productTaskList() { + let functionId = arguments.callee.name.toString(); + $.productTaskList = await requestGet(functionId, {"monitor_refer": "plant_productTaskList"}); +} +async function plantChannelTaskList() { + let functionId = arguments.callee.name.toString(); + $.plantChannelTaskList = await requestGet(functionId); + // console.log('$.plantChannelTaskList', $.plantChannelTaskList) +} +async function shopTaskList() { + let functionId = arguments.callee.name.toString(); + $.shopTaskListRes = await requestGet(functionId, {"monitor_refer": "plant_receiveNutrients"}); + // console.log('$.shopTaskListRes', $.shopTaskListRes) +} +async function receiveNutrientsTask(awardType) { + const functionId = arguments.callee.name.toString(); + const body = { + "monitor_refer": "receiveNutrientsTask", + "awardType": `${awardType}`, + } + $.receiveNutrientsTaskRes = await requestGet(functionId, body); +} +async function plantShareSupportList() { + $.shareSupportList = await requestGet('plantShareSupportList', {"roundId": ""}); + if ($.shareSupportList && $.shareSupportList.code === '0') { + const { data } = $.shareSupportList; + //当日北京时间0点时间戳 + const UTC8_Zero_Time = parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000; + //次日北京时间0点时间戳 + const UTC8_End_Time = parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000 + (24 * 60 * 60 * 1000); + let friendList = []; + data.map(item => { + if (UTC8_Zero_Time <= item['createTime'] && item['createTime'] < UTC8_End_Time) { + friendList.push(item); + } + }) + message += `【助力您的好友】共${friendList.length}人`; + } else { + console.log(`异常情况:${JSON.stringify($.shareSupportList)}`) + } +} +//助力好友的api +async function helpShare(plantUuid) { + console.log(`\n开始助力好友: ${plantUuid}`); + const body = { + "plantUuid": plantUuid, + "wxHeadImgUrl": "", + "shareUuid": "", + "followType": "1", + } + $.helpResult = await request(`plantBeanIndex`, body); + console.log(`助力结果的code:${$.helpResult && $.helpResult.code}`); +} +async function plantBeanIndex() { + $.plantBeanIndexResult = await request('plantBeanIndex');//plantBeanIndexBody +} +function readShareCode() { + return new Promise(async resolve => { + $.get({url: `http://api.turinglabs.net/api/v1/jd/bean/read/${randomCount}/`, timeout: 10000}, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) + data = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + await $.wait(15000); + resolve() + }) +} +//格式化助力码 +function shareCodesFormat() { + return new Promise(async resolve => { + // console.log(`第${$.index}个京东账号的助力码:::${jdPlantBeanShareArr[$.index - 1]}`) + newShareCodes = []; + if (jdPlantBeanShareArr[$.index - 1]) { + newShareCodes = jdPlantBeanShareArr[$.index - 1].split('@'); + } else { + console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) + const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1); + newShareCodes = shareCodes[tempIndex].split('@'); + } + const readShareCodeRes = await readShareCode(); + if (readShareCodeRes && readShareCodeRes.code === 200) { + newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])]; + } + console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify(newShareCodes)}`) + resolve(); + }) +} +function requireConfig() { + return new Promise(resolve => { + console.log('开始获取种豆得豆配置文件\n') + notify = $.isNode() ? require('./sendNotify') : ''; + //Node.js用户请在jdCookie.js处填写京东ck; + const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; + const jdPlantBeanShareCodes = $.isNode() ? require('./jdPlantBeanShareCodes.js') : ''; + //IOS等用户直接用NobyDa的jd cookie + if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + if (jdCookieNode[item]) { + cookiesArr.push(jdCookieNode[item]) + } + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; + } else { + cookiesArr.push(...[$.getdata('CookieJD'), $.getdata('CookieJD2')]); + } + console.log(`共${cookiesArr.length}个京东账号\n`) + if ($.isNode()) { + Object.keys(jdPlantBeanShareCodes).forEach((item) => { + if (jdPlantBeanShareCodes[item]) { + jdPlantBeanShareArr.push(jdPlantBeanShareCodes[item]) + } + }) + } else { + const boxShareCodeArr = ['jd_plantBean1', 'jd_plantBean2', 'jd_plantBean3']; + const boxShareCodeArr2 = ['jd2_plantBean1', 'jd2_plantBean2', 'jd2_plantBean3']; + const isBox1 = boxShareCodeArr.some((item) => { + const boxShareCode = $.getdata(item); + return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); + }); + const isBox2 = boxShareCodeArr2.some((item) => { + const boxShareCode = $.getdata(item); + return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); + }); + isBox = isBox1 ? isBox1 : isBox2; + if (isBox1) { + let temp = []; + for (const item of boxShareCodeArr) { + if ($.getdata(item)) { + temp.push($.getdata(item)) + } + } + jdPlantBeanShareArr.push(temp.join('@')); + } + if (isBox2) { + let temp = []; + for (const item of boxShareCodeArr2) { + if ($.getdata(item)) { + temp.push($.getdata(item)) + } + } + jdPlantBeanShareArr.push(temp.join('@')); + } + } + // console.log(`\n种豆得豆助力码::${JSON.stringify(jdPlantBeanShareArr)}`); + console.log(`您提供了${jdPlantBeanShareArr.length}个账号的种豆得豆助力码\n`); + resolve() + }) +} +function requestGet(function_id, body = {}) { + if (!body.version) { + body["version"] = "9.0.0.1"; + } + body["monitor_source"] = "plant_app_plant_index"; + body["monitor_refer"] = ""; + return new Promise(async resolve => { + await $.wait(2000); + const option = { + url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld`, + headers: { + 'Cookie': cookie, + 'Host': 'api.m.jd.com', + 'Accept': '*/*', + 'Connection': 'keep-alive', + 'User-Agent': 'JD4iPhone/167283 (iPhone;iOS 13.6.1;Scale/3.00)', + 'Accept-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9', + 'Accept-Encoding': 'gzip, deflate, br', + 'Content-Type': "application/x-www-form-urlencoded" + }, + timeout: 10000, + }; + $.get(option, (err, resp, data) => { + try { + if (err) { + console.log('\n种豆得豆: API查询请求失败 ‼️‼️') + $.logErr(err); + } else { + data = JSON.parse(data); + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + }, + "timeout": 10000, + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function request(function_id, body = {}){ + return new Promise(async resolve => { + await $.wait(2000); + $.post(taskUrl(function_id, body), (err, resp, data) => { + try { + if (err) { + console.log('\n种豆得豆: API查询请求失败 ‼️‼️') + console.log(`function_id:${function_id}`) + $.logErr(err); + } else { + data = JSON.parse(data); + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} +function taskUrl(function_id, body) { + body["version"] = "9.2.4.0"; + body["monitor_source"] = "plant_app_plant_index"; + body["monitor_refer"] = ""; + return { + url: JD_API_HOST, + body: `functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld&client=apple&area=19_1601_50258_51885&build=167490&clientVersion=9.3.2`, + headers: { + "Cookie": cookie, + "Host": "api.m.jd.com", + "Accept": "*/*", + "Connection": "keep-alive", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + "Accept-Language": "zh-Hans-CN;q=1,en-CN;q=0.9", + "Accept-Encoding": "gzip, deflate, br", + "Content-Type": "application/x-www-form-urlencoded" + }, + timeout: 10000, + } +} +function getParam(url, name) { + const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i") + const r = url.match(reg) + if (r != null) return unescape(r[2]); + return null; +} +// prettier-ignore +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,o)=>{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.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 o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=e&&e.timeout?e.timeout:o;const[r,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":r,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),o=JSON.stringify(this.data);s?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(e,o):this.fs.writeFileSync(t,o)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return s;return o}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),o=s?this.getval(s):"";if(o)try{const t=JSON.parse(o);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(e),r=this.getval(i),h=i?"null"===r?null:r||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,o,t),s=this.setval(JSON.stringify(e),i)}catch(e){const r={};this.lodash_set(r,o,t),s=this.setval(JSON.stringify(r),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()?$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)))}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())$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",$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t))}}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="",o){const r=t=>{if(!t||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,r(o)):this.isQuanX()&&$notify(e,s,i,r(o)));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)} diff --git a/jd_shareCode_auto.js b/jd_shareCode_auto.js new file mode 100644 index 0000000000..31804108cd --- /dev/null +++ b/jd_shareCode_auto.js @@ -0,0 +1,546 @@ +const $ = new Env("京东分享码"); +const notify = $.isNode() ? require("./sendNotify") : ""; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require("./jdCookie.js") : ""; +const JD_API_HOST = "https://api.m.jd.com/client.action"; +let cookiesArr = [], + cookie = ""; + +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]); + }); + if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {}; +} else { + let cookiesData = $.getdata("CookiesJD") || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map((item) => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata("CookieJD2"), $.getdata("CookieJD")]); + cookiesArr.reverse(); +} + +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, "【提示】请先获取cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/", { + "open-url": "https://bean.m.jd.com/", + }); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + cookie = cookiesArr[i]; + if (cookie) { + $.result = []; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]); + $.index = i + 1; + $.shareCode = { + jdfactory: { + //日志中直接搜索下面内容即可快速找到互助码信息 + //您的东东工厂好友助力邀请码: + name: "京东工厂", + base: "http://api.turinglabs.net/api/v1/jd/ddfactory/create/", + code: "", + err: "", + }, + jxfactory: { + //日志中直接搜索下面内容即可快速找到互助码信息 + //分享码: + name: "京喜工厂", + base: "http://api.turinglabs.net/api/v1/jd/jxfactory/create/", + code: "", + err: "", + }, + pet: { + //日志中直接搜索下面内容即可快速找到互助码信息 + //【您的东东萌宠互助码shareCode】 + name: "京东萌宠", + base: "http://api.turinglabs.net/api/v1/jd/pet/create/", + code: "", + }, + bean: { + //日志中直接搜索下面内容即可快速找到互助码信息 + //【您的京东种豆得豆互助码】 + name: "种豆得豆", + base: "http://api.turinglabs.net/api/v1/jd/bean/create/", + code: "", //此处放入互助码,支持数组或字符串类型 + err: "", + }, + farm: { + //日志中直接搜索下面内容即可快速找到互助码信息 + //【您的东东农场互助码shareCode】 + name: "京东农场", + base: "http://api.turinglabs.net/api/v1/jd/farm/create/", + code: "", + err: "", + }, + crazyjoy: { + name: "疯狂的JOY", + base: "https://code.chiang.fun/api/v1/jd/jdcrazyjoy/create/", + code: "", + err: "", + }, + jdzz: { + name: "京东赚赚", + base: "https://code.chiang.fun/api/v1/jd/jdzz/create/", + code: "", + err: "", + }, + }; + await getShareCode(cookie); + if (true) { + await autoInject(); + } + await msgShow(); + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()); + +//#region 获取分享码 +/** + * 获取分享码 + * @param {String} cookie 京东cookie字符串 + */ +async function getShareCode() { + await shareCode_jdfactory(); + await shareCode_jxfactory(); + await shareCode_pet(); + await shareCode_bean(); + await shareCode_farm(); + await shareCode_crazyjoy(); + await shareCode_jdZZ(); +} +async function shareCode_jdfactory() { + var request = { + url: `${JD_API_HOST}?functionId=jdfactory_getTaskDetail`, + body: `functionId=jdfactory_getTaskDetail&body=${escape(JSON.stringify({}))}&client=wh5&clientVersion=9.1.0`, + headers: { + Cookie: cookie, + origin: "https://h5.m.jd.com", + referer: "https://h5.m.jd.com/", + "Content-Type": "application/x-www-form-urlencoded", + "User-Agent": $.isNode() + ? process.env.JD_USER_AGENT + ? process.env.JD_USER_AGENT + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0" + : $.getdata("JDUA") + ? $.getdata("JDUA") + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0", + }, + }; + return new Promise((resolve) => { + $.post(request, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`$东东工厂 API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data.bizCode === 0) { + $.taskVos = data.data.result.taskVos; //任务列表 + $.taskVos.map((item) => { + if (item.taskType === 14) { + $.shareCode.jdfactory.code = item.assistTaskDetailVo.taskToken; + } + }); + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +async function shareCode_jxfactory() { + var request = { + url: `https://m.jingxi.com/dreamfactory/userinfo/GetUserInfo?zone=dream_factory&pin=&sharePin=&shareType=&materialTuanPin=&materialTuanId=&sceneval=2&g_login_type=1&_time=${Date.now()}&_=${Date.now()}`, + headers: { + Cookie: cookie, + Host: "m.jingxi.com", + Accept: "*/*", + Connection: "keep-alive", + "User-Agent": + "jdpingou;iPhone;3.14.4;14.0;ae75259f6ca8378672006fc41079cd8c90c53be8;network/wifi;model/iPhone10,2;appBuild/100351;ADID/00000000-0000-0000-0000-000000000000;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/62;pap/JA2015_311210;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148", + "Accept-Language": "zh-cn", + Referer: "https://wqsd.jd.com/pingou/dream_factory/index.html", + "Accept-Encoding": "gzip, deflate, br", + }, + }; + return new Promise((resolve) => { + $.get(request, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`京喜工厂 API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data["ret"] === 0) { + data = data["data"]; + $.unActive = true; //标记是否开启了京喜活动或者选购了商品进行生产 + $.encryptPin = ""; + $.shelvesList = []; + if (data.factoryList && data.productionList) { + $.shareCode.jxfactory.code = data.user.encryptPin; + } else { + if (!data.factoryList) { + $.shareCode.jxfactory.err = "活动未开启"; + } else if (data.factoryList && !data.productionList) { + $.shareCode.jxfactory.err = "未选购商品"; + } + } + } else { + console.log(`jxfactory_GetUserInfo异常:${JSON.stringify(data)}`); + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +async function shareCode_pet() { + var request = { + url: `${JD_API_HOST}?functionId=initPetTown`, + body: `body=${escape( + JSON.stringify({ version: 2, channel: "app" }) + )}&appid=wh5&loginWQBiz=pet-town&clientVersion=9.0.4`, + headers: { + Cookie: cookie, + "User-Agent": $.isNode() + ? process.env.JD_USER_AGENT + ? process.env.JD_USER_AGENT + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0" + : $.getdata("JDUA") + ? $.getdata("JDUA") + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0", + Host: "api.m.jd.com", + "Content-Type": "application/x-www-form-urlencoded", + }, + }; + return new Promise((resolve) => { + $.post(request, async (err, resp, data) => { + try { + if (err) { + console.log("\n东东萌宠: API查询请求失败 ‼️‼️"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + data = JSON.parse(data); + + const initPetTownRes = data; + + message = `【京东账号${$.index}】${$.UserName}\n`; + if ( + initPetTownRes.code === "0" && + initPetTownRes.resultCode === "0" && + initPetTownRes.message === "success" + ) { + $.shareCode.pet.code = initPetTownRes.result.shareCode; + } else if (initPetTownRes.code === "0") { + console.log(`初始化萌宠失败: ${initPetTownRes.message}`); + } else { + console.log("shit-pet"); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +async function shareCode_bean() { + var request = { + url: `${JD_API_HOST}`, + body: `functionId=plantBeanIndex&body=${escape( + JSON.stringify({ version: "9.0.0.1", monitor_source: "plant_app_plant_index", monitor_refer: "" }) + )}&appid=ld&client=apple&area=5_274_49707_49973&build=167283&clientVersion=9.1.0`, + headers: { + Cookie: cookie, + Host: "api.m.jd.com", + Accept: "*/*", + Connection: "keep-alive", + "User-Agent": $.isNode() + ? process.env.JD_USER_AGENT + ? process.env.JD_USER_AGENT + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0" + : $.getdata("JDUA") + ? $.getdata("JDUA") + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0", + "Accept-Language": "zh-Hans-CN;q=1,en-CN;q=0.9", + "Accept-Encoding": "gzip, deflate, br", + "Content-Type": "application/x-www-form-urlencoded", + }, + }; + return new Promise(async (resolve) => { + $.post(request, (err, resp, data) => { + try { + if (err) { + console.log("\n种豆得豆: API查询请求失败 ‼️‼️"); + console.log(`function_id:${function_id}`); + $.logErr(err); + } else { + data = JSON.parse(data); + if (data.code === "0") { + const shareUrl = data.data.jwordShareInfo.shareUrl; + $.shareCode.bean.code = getParam(shareUrl, "plantUuid"); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }); + }); + function getParam(url, name) { + const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); + const r = url.match(reg); + if (r != null) return unescape(r[2]); + return null; + } +} +async function shareCode_farm() { + var request = { + url: `${JD_API_HOST}?functionId=initForFarm`, + body: `body=${escape(JSON.stringify({ version: 4 }))}&appid=wh5&clientVersion=9.1.0`, + headers: { + accept: "*/*", + "accept-encoding": "gzip, deflate, br", + "accept-language": "zh-CN,zh;q=0.9", + "cache-control": "no-cache", + cookie: cookie, + origin: "https://home.m.jd.com", + pragma: "no-cache", + referer: "https://home.m.jd.com/myJd/newhome.action", + "sec-fetch-dest": "empty", + "sec-fetch-mode": "cors", + "sec-fetch-site": "same-site", + "User-Agent": $.isNode() + ? process.env.JD_USER_AGENT + ? process.env.JD_USER_AGENT + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0" + : $.getdata("JDUA") + ? $.getdata("JDUA") + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0", + "Content-Type": "application/x-www-form-urlencoded", + }, + }; + return new Promise((resolve) => { + $.post(request, (err, resp, data) => { + try { + if (err) { + console.log("\n东东农场: API查询请求失败 ‼️‼️"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + var jsonData = JSON.parse(data); + if (jsonData && jsonData.farmUserPro) { + $.shareCode.farm.code = jsonData.farmUserPro.shareCode; + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +async function shareCode_crazyjoy() { + let t = Date.now().toString().substr(0, 10); + let e = $.md5("aDvScBv$gGQvrXfva8dG!ZC@DA70Y%lX" + t) + Number(t).toString(16); + var request = { + url: `https://api.m.jd.com/?uts=${e}&appid=crazy_joy&functionId=crazyJoy_user_gameState&body=${escape({ + paramData: "", + })}&t=${t}`, + headers: { + Cookie: cookie, + Host: "api.m.jd.com", + Accept: "*/*", + Connection: "keep-alive", + "User-Agent": $.isNode() + ? process.env.JD_USER_AGENT + ? process.env.JD_USER_AGENT + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0" + : $.getdata("JDUA") + ? $.getdata("JDUA") + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0", + "Accept-Language": "zh-cn", + Referer: "https://crazy-joy.jd.com/", + origin: "https://crazy-joy.jd.com", + "Accept-Encoding": "gzip, deflate, br", + }, + }; + return new Promise((resolve) => { + $.get(request, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.success && data.data && data.data.userInviteCode) { + $.shareCode.crazyjoy.code = data.data.userInviteCode; + } else console.log(`用户信息获取失败`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +async function shareCode_jdZZ() { + var request = { + url: `${JD_API_HOST}?functionId=interactIndex&body=${escape( + JSON.stringify({}) + )}&client=wh5&clientVersion=9.1.0`, + headers: { + Cookie: cookie, + Host: "api.m.jd.com", + Connection: "keep-alive", + "Content-Type": "application/json", + Referer: "http://wq.jd.com/wxapp/pages/hd-interaction/index/index", + "User-Agent": $.isNode() + ? process.env.JD_USER_AGENT + ? process.env.JD_USER_AGENT + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0" + : $.getdata("JDUA") + ? $.getdata("JDUA") + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0", + "Accept-Language": "zh-cn", + "Accept-Encoding": "gzip, deflate, br", + }, + }; + return new Promise((resolve) => { + $.get(request, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data.shareTaskRes) { + $.shareCode.jdzz.code = data.data.shareTaskRes.itemId; + } else { + $.shareCode.jdzz.err = `已满5人助力,暂时看不到您的京东赚赚好友助力码`; + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +//#endregion + +//#region 自动注入互助码 +async function autoInject() { + var keys = Object.keys($.shareCode); + for (var index in keys) { + var request = $.shareCode[keys[index]]; + if (request.base && request.code) { + await httpRequest(request); + } else { + $.result.push( + `【${request.name}】⛔️\n${ + request.code ? request.code : request.err ? request.err : "未配置提交链接或未获取到互助码" + }` + ); + } + } +} +function httpRequest(info) { + return new Promise((resolve) => { + $.get({ url: `${info.base}${info.code.trim()}/` }, (err, resp, data) => { + try { + const obj = JSON.parse(data); + if (obj.code == 200) { + $.result.push(`【${info.name}】✅\n${info.code}`); + } else if (obj.code == 400) { + $.result.push(`【${info.name}】✔️\n${info.code}`); + } else { + $.result.push(`【${info.name}】❌\n${info.code}`); + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +//#endregion + +/** 检测是否可以成功转换成json对象 */ +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +/** 最终的通知消息 */ +function msgShow() { + return new Promise(async (resolve) => { + var shareCodeMsg = "\n"; + if ($.result.length > 0) { + for (var index in $.result) { + shareCodeMsg += `\n${$.result[index]}`; + } + } else { + shareCodeMsg += `\n【京东工厂】\n${ + $.shareCode.jdfactory.code ? $.shareCode.jdfactory.code : $.shareCode.jdfactory.err + }`; + shareCodeMsg += `\n【京喜工厂】\n${ + $.shareCode.jxfactory.code ? $.shareCode.jxfactory.code : $.shareCode.jxfactory.err + }`; + shareCodeMsg += `\n【京东萌宠】\n${$.shareCode.pet.code ? $.shareCode.pet.code : $.shareCode.pet.err}`; + shareCodeMsg += `\n【种豆得豆】\n${$.shareCode.bean.code ? $.shareCode.bean.code : $.shareCode.bean.err}`; + shareCodeMsg += `\n【京东农场】\n${$.shareCode.farm.code ? $.shareCode.farm.code : $.shareCode.farm.err}`; + shareCodeMsg += `\n【疯狂JOY】\n${ + $.shareCode.crazyjoy.code ? $.shareCode.crazyjoy.code : $.shareCode.crazyjoy.err + }`; + shareCodeMsg += `\n【京东赚赚】\n${$.shareCode.jdzz.code ? $.shareCode.jdzz.code : $.shareCode.jdzz.err}`; + } + + $.msg($.name, ``, `【京东账号${$.index}】${$.UserName}${shareCodeMsg}`); + if ($.isNode()) { + await notify.sendNotify( + `${$.name} - 账号${$.index} - ${$.UserName}`, + `【京东账号${$.index}】${$.UserName}${shareCodeMsg}` + ); + } + resolve(); + }); +} + +// prettier-ignore +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)} +// prettier-ignore +!function(n){function t(n,t){var r=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(r>>16)<<16|65535&r}function r(n,t){return n<>>32-t}function e(n,e,o,u,c,f){return t(r(t(t(e,n),t(u,f)),c),o)}function o(n,t,r,o,u,c,f){return e(t&r|~t&o,n,t,u,c,f)}function u(n,t,r,o,u,c,f){return e(t&o|r&~o,n,t,u,c,f)}function c(n,t,r,o,u,c,f){return e(t^r^o,n,t,u,c,f)}function f(n,t,r,o,u,c,f){return e(r^(t|~o),n,t,u,c,f)}function i(n,r){n[r>>5]|=128<>>9<<4)]=r;var e,i,a,d,h,l=1732584193,g=-271733879,v=-1732584194,m=271733878;for(e=0;e>5]>>>t%32&255)}return r}function d(n){var t,r=[];for(r[(n.length>>2)-1]=void 0,t=0;t>5]|=(255&n.charCodeAt(t/8))<16&&(o=i(o,8*n.length)),r=0;r<16;r+=1){u[r]=909522486^o[r],c[r]=1549556828^o[r]}return e=i(u.concat(d(t)),512+8*t.length),a(i(c.concat(e),640))}function g(n){var t,r,e="";for(r=0;r>>4&15)+"0123456789abcdef".charAt(15&t)}return e}function v(n){return unescape(encodeURIComponent(n))}function m(n){return h(v(n))}function p(n){return g(m(n))}function s(n,t){return l(v(n),v(t))}function C(n,t){return g(s(n,t))}function A(n,t,r){return t?r?s(t,n):C(t,n):r?m(n):p(n)}$.md5=A}(this); diff --git a/jd_xtg_help.js b/jd_xtg_help.js new file mode 100644 index 0000000000..d8b3c15804 --- /dev/null +++ b/jd_xtg_help.js @@ -0,0 +1,519 @@ +/* + * @Author: LXK9301 + * @Date: 2020-10-21 17:04:04 + * @Last Modified by: LXK9301 + * @Last Modified time: 2021-05-27 19:15:04 + */ +/* +家电星推官好友互助脚本 +家电星推官活动地址:https://3.cn/-1eD1VOa?_ts=1622072397979&utm_source=iosapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=CopyURL&ad_od=share&gx=RnFtxGZZPTONndRP--twDLBLeC4DoX3_2wf2 +活动时间:2021年5月27日 00:00:00-2021年6月18日 23:59:59 +京豆先到先得!!!!!!!!!!! +出现任务做完没领取的情况,就再运行一次脚本 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +============Quantumultx=============== +[task_local] +#家电星推官好友互助 +0 0 0 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_xtg_help.js, tag=家电星推官好友互助, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true + +================Loon============== +[Script] +cron "0 0 0 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_xtg_help.js,tag=家电星推官好友互助 + +===============Surge================= +家电星推官好友互助 = type=cron,cronexp="0 0 0 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_xtg_help.js + +============小火箭========= +家电星推官好友互助 = type=cron,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_xtg_help.js, cronexpr="0 0 0 * * *", timeout=3600, enable=true + */ +const $ = new Env("家电星推官好友互助"); +const activeEndTime = "2021/06/18 23:59:59+08:00"; //活动结束时间 +const notify = $.isNode() ? require("./sendNotify") : ""; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require("./jdCookie.js") : ""; +!function(n){"use strict";function r(n,r){var t=(65535&n)+(65535&r);return(n>>16)+(r>>16)+(t>>16)<<16|65535&t}function t(n,r){return n<>>32-r}function u(n,u,e,o,c,f){return r(t(r(r(u,n),r(o,f)),c),e)}function e(n,r,t,e,o,c,f){return u(r&t|~r&e,n,r,o,c,f)}function o(n,r,t,e,o,c,f){return u(r&e|t&~e,n,r,o,c,f)}function c(n,r,t,e,o,c,f){return u(r^t^e,n,r,o,c,f)}function f(n,r,t,e,o,c,f){return u(t^(r|~e),n,r,o,c,f)}function i(n,t){n[t>>5]|=128<>>9<<4)]=t;var u,i,a,h,g,l=1732584193,d=-271733879,v=-1732584194,C=271733878;for(u=0;u>5]>>>r%32&255);return t}function h(n){var r,t=[];for(t[(n.length>>2)-1]=void 0,r=0;r>5]|=(255&n.charCodeAt(r/8))<16&&(e=i(e,8*n.length)),t=0;t<16;t+=1)o[t]=909522486^e[t],c[t]=1549556828^e[t];return u=i(o.concat(h(r)),512+8*r.length),a(i(c.concat(u),640))}function d(n){var r,t,u="";for(t=0;t>>4&15)+"0123456789abcdef".charAt(15&r);return u}function v(n){return unescape(encodeURIComponent(n))}function C(n){return g(v(n))}function A(n){return d(C(n))}function m(n,r){return l(v(n),v(r))}function s(n,r){return d(m(n,r))}function b(n,r,t){return r?t?m(r,n):s(r,n):t?C(n):A(n)}$.md5=b}(); +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = "", allMsg = ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]); + }); + if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {}; +} else { + cookiesArr = [ + $.getdata("CookieJD"), + $.getdata("CookieJD2"), + ...jsonParse($.getdata("CookiesJD") || "[]").map((item) => item.cookie), + ].filter((item) => !!item); +} +let starID = [ + { + "starId": "flp-songqian", + }, + { + "starId": "ykd-liutao", + } +]; +$.allShareId = {}; +const JD_API_HOST = "https://guardianstarjd.m.jd.com/star"; +!(async () => { + if (!cookiesArr[0]) { + $.msg( + $.name, + "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", + "https://bean.m.jd.com/bean/signIndex.action", + { "open-url": "https://bean.m.jd.com/bean/signIndex.action" } + ); + return; + } + cookie = cookiesArr[0]; + await starRanking(); + + //助力功能 + for (let index = 0; index < starID.length; index++) { + $.invites = []; + $.activeId = starID[index]['starId']; + $.appIndex = index + 1; + console.log(`\n获取星推官【${$.activeId}】下的邀请码\n`) + for (let v = 0; v < cookiesArr.length; v++) { + cookie = cookiesArr[v]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]); + $.index = v + 1; + await initSuportInfo(); + } + if ($.invites.length > 0) { + $.allShareId[starID[index]['starId']] = $.invites; + } + } + if (!cookiesArr || cookiesArr.length < 2) return + console.log(`开始自己账号内部互助\n\n`); + for (let v = 0; v < cookiesArr.length; v++) { + cookie = cookiesArr[v]; + $.index = v + 1; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]); + + for (let oneAppId in $.allShareId) { + let oneAcHelpList = $.allShareId[oneAppId]; + for (let j = 0; j < oneAcHelpList.length; j++) { + $.item = oneAcHelpList[j]; + if ($.UserName === $.item['userName']) continue; + if (!$.item['inviteId'] || $.item['max']) continue + console.log(`账号${$.index} ${$.UserName} 去助力账号 ${$.item['userName']}的第${$.item['index']}个星推官活动【${$.item['starId']}】,邀请码 【${$.item['inviteId']}】`) + $.canHelp = true; + $.activeId = $.item['starId']; + await doSupport($.item['inviteId']); + if (!$.canHelp) { + console.log(`助力机会已耗尽,跳出`); + break;//此处如果break,则遇到第一个活动就无助力机会时,不会继续助力第二个活动了 + } + } + } + } +})() + .catch((e) => { + $.log("", `❌ ${$.name}, 失败! 原因: ${e}!`, ""); + }) + .finally(() => { + $.done(); + }); +async function showMsg() { + let nowTime = new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000; + if (nowTime > new Date(activeEndTime).getTime()) { + $.msg($.name, 'xtg', `请删除或禁用此脚本\n咱江湖再见`); + if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `请删除此脚本\n咱江湖再见`) + } else { + if ($.beanCount) { + $.msg($.name, ``, `京东账号${$.index} ${$.nickName || $.UserName}\n星推官活动获得:${$.beanCount}京豆`); + allMsg += `京东账号${$.index} ${$.nickName || $.UserName}\n星推官活动获得:${$.beanCount}京豆\n`; + } + } +} +async function JD_XTG(flag = false) { + var skuCount = 15, meetingCount = 15; + await getHomePage(); + if ($.homeData && $.homeData.code === 200) { + let { dayTask, supportTask } = $.homeData.data; + if (flag) { + // console.log(`\n===========活动${$.j + 1}-[${starID[$.j]['starId']}] 助力码==========\n${shareId}\n`); + // $.shareID.push(shareId); + } + dayTask = dayTask.filter(vo => (vo['type'] === 'sku' || vo['type'] === 'meeting' || vo['type'] === 'followShop') && vo['finishCount'] !== vo['count']); + for (let item of dayTask) { + if (item['type'] === 'memberShop') { + console.log(`开通【${item['name']}】会员,跳过\n`); + continue + } + if (item['type'] === 'sku') { + meetingCount = item['count']; + console.log(`浏览【${item['name']}】(${item['finishCount']}/${item['count']}),需等待6秒`); + const res = await doTask(item['type'], item["id"]); + const t = Date.now(); + if (res && res.code === 200) { + await $.wait(6 * 1000) + // const b = `browse_task_${$.activeId}_${item["id"]}_${$.time('yyyyMMdd')}_${item['type']}_${t + 7 * 1000}`; + await getBrowsePrize(res.data); + // await getBrowsePrize(b); + } + } + if (item['type'] === 'meeting') { + skuCount = item['count']; + console.log(`浏览会场【${item['name']}】(${item['finishCount']}/${item['count']}),需等待6秒`); + const res = await doTask(item['type'], item["id"]); + const t = Date.now(); + if (res && res.code === 200) { + await $.wait(6 * 1000) + await getBrowsePrize(res.data); + } + } + if (item['type'] === 'followShop') { + console.log(`关注店铺【${item['name']}】(${item['finishCount']}/${item['count']})`); + await doTask(item['type'], item["id"], `followShop`); + } + } + dayTask = dayTask.filter(vo => (vo['type'] === 'sku' || vo['type'] === 'meeting' || vo['type'] === 'followShop') && vo['finishCount'] !== vo['count']); + if (dayTask && dayTask.length) { + $.times += 1; + console.log(`第 ${$.times + 1}次循环执行JD_XTG`) + // await JD_XTG(); + if ($.times <= Math.max(skuCount, meetingCount)) { + // console.log(`第 ${$.times + 1}次循环执行JD_XTG`) + await JD_XTG(); + } else { + console.log(`估计已死循环,不再执行JD_XTG\n`) + } + } else { + console.log(`${$.activeId}星推官任务已做完\n`) + } + } else { + console.log(`京东服务器返回无数据!`); + } +} +//获取邀请码 +function initSuportInfo() { + return new Promise(async (resolve) => { + const options = taskPostUrl('task/initSuportInfo', 'initSuportInfo',`starId=${$.activeId}`); + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + // console.log(`\n助力结果:${data}`); + data = JSON.parse(data); + if (data['code'] === 200) { + console.log(`账号${$.index} ${$.UserName} ${$.activeId}星推官邀请码:${data.data}`); + $.invites.push({ + inviteId: data.data, + userName: $.UserName, + starId: $.activeId, + index: $.appIndex, + max: false + }) + } else { + console.log(`邀请码获取失败:`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +function starRanking() { + return new Promise(async (resolve) => { + const options = taskPostUrl('task/starRanking', 'starRanking', 'starId=bl-gongjun') + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + // console.log(`\n助力结果:${data}`); + data = JSON.parse(data); + if (data['code'] === 200) { + starID = data.data + } else { + console.log(`frontConfig失败:`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +function getHomePage() { + return new Promise((resolve) => { + const options = taskPostUrl('task/getList', 'getList', `starId=${$.activeId}`); + $.post(options, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (data) { + data = JSON.parse(data); + if (data['code'] === 200) { + $.homeData = data; + } else { + console.log(`getList异常`) + } + } else { + console.log(`京东服务器返回空数据`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +function doTask(type, id, functionID = 'doBrowse') { + return new Promise(async (resolve) => { + const options = taskPostUrl(`task/${functionID}`, functionID, `starId=${$.activeId}&id=${id}&type=${type}`) + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + console.log(`doBrowse做任务结果:${data}`); + data = JSON.parse(data); + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }); + }); +} +function getBrowsePrize(browseId) { + return new Promise(async (resolve) => { + const options = taskPostUrl('task/getBrowsePrize', 'getBrowsePrize', `starId=${$.activeId}&browseId=${browseId}`) + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + console.log(`getBrowsePrize做任务结果:${data}`); + data = JSON.parse(data); + if (data && data.code === 200) { + $.beanCount += data.data['jingBean']; + console.log(`获得京豆:${data.data['jingBean']}\n`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +function doSupport(shareId) { + return new Promise(async (resolve) => { + const options = taskPostUrl('task/doSupport', 'doSupport', `starId=${$.activeId}&shareId=${shareId}`) + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + data = JSON.parse(data); + if (data && data.code === 200) { + if (data['data']['status'] === 6) { + console.log('助力成功') + } + if (data['data']['status'] === 5) $.canHelp = false; + if (data['data']['status'] === 4) $.item['max'] = true; + } + console.log(`助力结果:${JSON.stringify(data)}\n`); + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +function TotalBean() { + return new Promise(async (resolve) => { + const options = { + url: `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + headers: { + Accept: "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + Connection: "keep-alive", + Cookie: cookie, + Referer: "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": "jdapp;android;9.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36", + }, + }; + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (data) { + data = JSON.parse(data); + if (data["retcode"] === 13) { + $.isLogin = false; //cookie过期 + return; + } + if (data["retcode"] === 0) { + $.nickName = (data["base"] && data["base"].nickname) || $.UserName; + } else { + $.nickName = $.UserName; + } + } else { + console.log(`京东服务器返回空数据`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }); + }); +} +// function getDayPrizeStatus(prizeType, prizeId, status) { +// let r = Date.now().toString(); +// let hi = "07035cabb557f096"; +// let o = hi + r; +// let t = "getDayPrizeStatus"; +// let a = `starId=${$.activeId}&status=${status}&prizeType=${prizeType}&prizeId=${prizeId}`; +// return new Promise(async (resolve) => { +// const options = { +// url: `${JD_API_HOST}/getDayPrizeStatus`, +// body: `starId=${$.activeId}&status=${status}&prizeType=${prizeType}&prizeId=${prizeId}`, +// headers: { +// Accept: "application/json,text/plain, */*", +// "Content-Type": "application/x-www-form-urlencoded", +// "Accept-Encoding": "gzip, deflate, br", +// "Accept-Language": "zh-cn", +// Connection: "keep-alive", +// Cookie: cookie, +// Host: "urvsaggpt.m.jd.com", +// Referer: "https://urvsaggpt.m.jd.com/static/index.html", +// sign: za(a, o, t).toString(), +// timestamp: r, +// "User-Agent": "jdapp;android;9.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36", +// }, +// }; +// $.post(options, (err, resp, data) => { +// try { +// if (err) { +// console.log(`${JSON.stringify(err)}`); +// console.log(`${$.name} API请求失败,请检查网路重试`); +// } else { +// console.log(`抽奖结果:${data}`); +// // data = JSON.parse(data); +// } +// } catch (e) { +// $.logErr(e, resp); +// } finally { +// resolve(); +// } +// }); +// }); +// } +function taskPostUrl(functionId, t, a) { + let o = '', r = ''; + const time = Date.now(); + // if (t === 'getBrowsePrize') { + // o = "07035cabb557f096" + (time + 6 * 1000); + // r = (time + 6 * 1000).toString() + // } else { + // o = "07035cabb557f096" + time; + // r = time.toString(); + // } + o = "07035cabb557f096" + time; + r = time.toString(); + // let t = "/khc/task/doQuestion"; + // let a = "brandId=555555&questionId=2&result=1" + return { + url: `${JD_API_HOST}/${functionId}`, + body: a, + headers: { + Accept: "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + Connection: "keep-alive", + Cookie: cookie, + Host: "guardianstarjd.m.jd.com", + Referer: "https://guardianstarjd.m.jd.com/", + sign: za(a, o, t).toString(), + timestamp: r, + "User-Agent": "jdapp;android;9.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36", + } + } +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie"); + return []; + } + } +} +function taskUrl(function_id) { + let r = Date.now().toString(); + let hi = "07035cabb557f096"; + let o = hi + r; + let t = function_id; + let a = `t=${r}&starId=${$.activeId}`; + return { + url: `${JD_API_HOST}/${function_id}?t=${r}&starId=${$.activeId}`, + headers: { + Accept: "application/json,text/plain, */*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + Connection: "keep-alive", + Cookie: cookie, + Host: "urvsaggpt.m.jd.com", + Referer: "https://guardianstarjd.m.jd.com/", + sign: za(a, o, t).toString(), + timestamp: r, + "User-Agent": "jdapp;android;9.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36", + }, + }; +} + +// prettier-ignore +function za(t, e, a) { + var n = "", + i = a.split("?")[1] || ""; + if (t) { + if ("string" == typeof t) n = t + i; + else if ("object" == ka(t)) { + var s = []; + for (var r in t) s.push(r + "=" + t[r]); + n = s.length ? s.join("&") + i : i; + } + } else n = i; + if (n) { + var o = n.split("&").sort().join(""); + return $.md5(o + e); + } + return $.md5(e); +} + +// prettier-ignore +function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);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("",`🔔${this.name}, 开始!`)}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("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(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();s&&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,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/jkd.js b/jkd.js new file mode 100644 index 0000000000..ea6b0d17cb --- /dev/null +++ b/jkd.js @@ -0,0 +1,89 @@ +const exec = require('child_process').execSync +const fs = require('fs') +const download = require('download') + +const $ = new Env('聚看点'); +const notify = $.isNode() ? require('./sendNotify') : ''; +// 公共变量 +const JKD_COOKIE = process.env.JKD_COOKIE +//只用于判断,推送是sendnodify +let SEND_KEY = ''; +if(process.env.PUSH_KEY){ + SEND_KEY = process.env.PUSH_KEY +} +if(process.env.BARK_PUSH){ + SEND_KEY = process.env.BARK_PUSH +} +if(process.env.TG_BOT_TOKEN){ + SEND_KEY = process.env.TG_BOT_TOKEN +} +if(process.env.DD_BOT_TOKEN){ + SEND_KEY = process.env.DD_BOT_TOKEN +} +if(process.env.IGOT_PUSH_KEY){ + SEND_KEY = process.env.IGOT_PUSH_KEY +} + +async function downFile () { + const url = 'https://raw.githubusercontent.com/shylocks/Loon/main/jkd.js' + await download(url, './') +} + +async function changeFiele () { + let content = await fs.readFileSync('./jkd.js', 'utf8') + //content = content.replace(/let CASH = ""/, "let CASH = 10") + await fs.writeFileSync( './jkd.js', content, 'utf8') +} + +async function deleteFile(path) { + // 查看文件result.txt是 否存在,如果存在,先删除 + const fileExists = await fs.existsSync(path); + // console.log('fileExists', fileExists); + if (fileExists) { + const unlinkRes = await fs.unlinkSync(path); + // console.log('unlinkRes', unlinkRes) + } +} + +async function start() { + if (!JKD_COOKIE) { + console.log('请填写 secret 后在继续') + return + } + // 下载最新代码 + await downFile(); + console.log('下载代码完毕') + // 替换变量 + await changeFiele(); + console.log('替换变量完毕') + // 执行 + await exec("node jkd.js >> result.txt"); + console.log('执行完毕') + const path = "./result.txt"; + let content = ""; + if (fs.existsSync(path)) { + content = fs.readFileSync(path, "utf8"); + } + var Time = new Date(new Date().getTime() + 8 * 60 * 60 * 1000); + if(SEND_KEY) { + if (content.includes("Cookie") && Time.getHours()==9 && Time.getMinutes()<=40) { + await notify.sendNotify("聚看点-" + new Date().toLocaleDateString(), content); + console.log("聚看点-" + content) + }else{ + console.log("聚看点-" + content) + } + }else{ + await notify.sendNotify("聚看点-" + new Date().toLocaleDateString(), content); + console.log("聚看点-" + content) + } + + //运行完成后,删除下载的文件 + console.log('运行完成后,删除下载的文件\n') + await deleteFile(path); + +} + +start() + +// prettier-ignore +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();s&&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}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}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)} diff --git a/joy.js b/joy.js new file mode 100644 index 0000000000..2f3fe6569b --- /dev/null +++ b/joy.js @@ -0,0 +1,759 @@ +/** + * 疯狂的joy + * + * - 签到 + * - 挂机 + * - 购买、合并joy + */ + +const $ = new Env('疯狂的joy'); +let cookiesArr = [], isBox = false, notify; +let message = '', subTitle = '', option = {}; +let jdNotify = false;//是否关闭通知,false打开通知推送,true关闭通知推送 +const JD_API_HOST = 'https://api.m.jd.com'; +let randomCount = $.isNode() ? 20 : 5; +const BUY_JOY_LEVEL = 1 // 默认购买的joy等级 +const MERGE_WAIT = process.env.MERGE_WAIT ? process.env.MERGE_WAIT : 1000 * 60 // 默认1分钟一次购买合并 +const PRODUCE_WAIT = process.env.PRODUCE_WAIT ? process.env.PRODUCE_WAIT : 1000 // 默认1秒一次模拟挂机 + +!(async () => { + await requireConfig(); + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + let cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + await TotalBean(cookie); + console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } else { + $.setdata('', `CookieJD${i ? i + 1 : ""}`);//cookie失效,故清空cookie。$.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。 + } + continue + } + await new CrazyJoy(i, cookie, $.nickName).start() + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +class CrazyJoy { + _shop = [] + ctx = {} + + constructor(index, cookie, nickName) { + this._index = index + this._cookie = cookie + this._nickName = nickName + } + + async start() { + await this.gameState() + await this.doSign() + setInterval(__ => this.produce(), PRODUCE_WAIT) // 模拟挂机1s一次 + setInterval(__ => this.checkAndMerge(), MERGE_WAIT) // 购买合并升级1分钟一次 + setInterval(__ => this.obtainAward(), 1000 * 60 * 30) //领取金币,固定30分钟一次 + // await this.produce() + // await this.checkAndMerge() + } + + async checkAndMerge() { + // 购买 + await this.joyList() + // 刷新商店 + await this.shop() + console.log(`joy列表 ${this.ctx.joyIds}`) + for (let i = 0; i < this.ctx.joyIds.length; i++) { + let joy = this.ctx.joyIds[i] + if (joy === 0) { + await this.trade(BUY_JOY_LEVEL) + await $.wait(1000) + } + } + await this.joyList() + // 开始合并 + let maybe = calc(this.ctx.joyIds) + for (const it of Object.keys(maybe)) { + let v = maybe[it] + if (it > 0 && it < 34) { + if (v.length > 1 && v.length > 2) { + // 只合并一次,因为合并后joy索引会变化 + await this.moveOrMerge(v[0], v[1]) + await $.wait(1000 * 3) + } + } + } + } + + /** + * 获取用户信息 + */ + gameState() { + return new Promise((resolve) => { + const body = { + paramData: { + inviter: 'DBwF_65db1jIoHqBDEMk8at9zd5YaBeE' + } + } + $.get(this.taskUrl('crazyJoy_user_gameState', body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + // console.log('ddd----ddd', data) + if (data.success) { + this.ctx = data.data + console.log(`邀请码 ${this.ctx.userInviteCode}`) + console.log(`当前joy币 ${this.ctx.totalCoinAmount}`) + console.log(`离线收益 ${this.ctx.offlineCoinAmount}`) + console.log(`最高级别的joy ${this.ctx.userTopLevelJoyId}级`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) + } + +// 获取joy列表 + joyList() { + const body = { + paramData: { + inviter: 'DBwF_65db1jIoHqBDEMk8at9zd5YaBeE' + } + } + return new Promise((resolve) => { + $.get(this.taskUrl('crazyJoy_user_gameState', body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + // console.log('ddd----ddd', data) + if (data.success && data.data.joyIds) { + this.ctx = data.data + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) + } + +// 领取金币 + obtainAward() { + return new Promise((resolve) => { + const body = { + eventType: "HOUR_BENEFIT", + } + $.get(this.taskUrl('crazyJoy_event_obtainAward', body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + if (data.success) { + console.log(`领取金币奖励 --> ${data.data.coins}`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) + } + +// 签到 + doSign() { + return new Promise((resolve) => { + $.get(this.taskUrl('crazyJoy_task_doSign'), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + console.log(data.message) + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) + } + +// 每日任务 + getTaskState() { + const body = {"paramData": {"taskType": "DAY_TASK"}} + return new Promise((resolve) => { + $.get(this.taskUrl('crazyJoy_task_getTaskState', body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + // console.log('ddd----ddd', data) + if (data.success) { + console.log(data.message) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) + } + +// 模拟挂机获得金币 + produce() { + return new Promise((resolve) => { + $.get(this.taskUrl('crazyJoy_joy_produce'), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + if (data.success && data.data.coins) { + console.log(`账号${this._index + 1} ${this._nickName} 模拟挂机中 获得${data.data.coins}个币,当前拥有${data.data.totalCoinAmount}`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) + } + +// 购买joy + trade(joyLevel) { + // 默认只能购买最高等级-1 级的joy + const allowMaxLevel = this._shop[this._shop.length - 2] + let cost = 0 + if (allowMaxLevel.joyId < joyLevel) { + joyLevel = allowMaxLevel.joyId + cost = allowMaxLevel.coins + } else { + for (let i = 0; i < this._shop; i++) { + let it = this._shop[i] + if (it.joyId == joyLevel) { + cost = it.coins + break + } + } + } + if (this.ctx.totalCoinAmount < cost) { + console.log(`买不起等级为${joyLevel}的joy,需要${cost},当前${this.ctx.totalCoinAmount},跳过`) + return + } + console.log(`购买${joyLevel} ${this._max_level} ${this._max_level < joyLevel}`) + const body = {"action": "BUY", "joyId": joyLevel, "boxId": ""} + return new Promise((resolve) => { + $.get(this.taskUrl('crazyJoy_joy_trade', body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + console.log(data) + if (data.success) { + console.log(`购买${joyLevel}级joy成功, 花费${data.data.coins},下次购买费用 --> ${data.data.nextBuyPrice}, 剩余joy币 --> ${data.data.totalCoins}`) + //更新当前剩余金币数量 + this.ctx.totalCoinAmount = data.data.totalCoins + } else { + console.log(data.message) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) + } + +// 卖出 + trade1(joyId, boxId) { + const body = {"action": "SELL", "joyId": joyId, "boxId": boxId} + return new Promise((resolve) => { + $.get(this.taskUrl('crazyJoy_joy_trade', body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + if (data.success && data.data.coins) { + console.log(`模拟挂机中 获得${data.data.coins}个币,当前拥有${data.data.totalCoinAmount}`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) + } + + // 合并joy + moveOrMerge(from, to) { + // 等待5s再合并,不然会操作过于频繁 + const body = { + "operateType": "MERGE", + "fromBoxIndex": from, + "targetBoxIndex": to + } + return new Promise((resolve) => { + $.get(this.taskUrl('crazyJoy_joy_moveOrMerge', body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + console.log(data) + if (data.success) { + console.log(`合并成功 下标${from} --> ${to} = ${data.data.newJoyId}`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) + } + + // 查看商店 + shop() { + const body = {"paramData": {"entry": "SHOP"}} + return new Promise((resolve) => { + $.get(this.taskUrl('crazyJoy_joy_allowBoughtList', body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data); + if (data.success) { + this._shop = data.data.shop + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) + } + + taskUrl(functionId, body = '{}') { + return { + url: `${JD_API_HOST}/?body=${encodeURIComponent(JSON.stringify(body))}&appid=crazy_joy&functionId=${functionId}&t=${Date.now()}&uts=b8bf8319bc0e120e166849cb7e957d335fe01979`, + headers: { + 'Cookie': this._cookie, + 'Accept': '*/*', + 'Connection': 'keep-alive', + 'User-Agent': 'jdpingou;iPhone;3.15.2;14.2;ae75259f6ca8378672006fc41079cd8c90c53be8;network/wifi;model/iPhone10,2;appBuild/100365;ADID/00000000-0000-0000-0000-000000000000;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/0;hasOCPay/0;supportBestPay/0;session/158;pap/JA2015_311210;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', + 'Accept-Language': 'zh-cn', + 'Referer': 'https://crazy-joy.jd.com/', + 'Accept-Encoding': 'gzip, deflate, br', + } + } + } + +} + +function TotalBean(cookie) { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function requireConfig() { + return new Promise(resolve => { + console.log('开始获取配置文件\n') + notify = $.isNode() ? require('./sendNotify') : ''; + //Node.js用户请在jdCookie.js处填写京东ck; + const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; + if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + if (jdCookieNode[item]) { + cookiesArr.push(jdCookieNode[item]) + } + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { + }; + } else { + cookiesArr.push(...[$.getdata('CookieJD'), $.getdata('CookieJD2')]); + } + console.log(`共${cookiesArr.length}个京东账号\n`) + resolve() + }) +} + +function calc(arr) { + let obj = {}; + for (let i = 0; i < arr.length; i++) { + let it = arr[i] + if (Object.keys(obj).includes(`${it}`)) { + obj[it].push(i) + } else { + obj[it] = [i] + } + } + return obj; +} + +// prettier-ignore +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, o) => { + 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.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 o = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); + o = o ? 1 * o : 20, o = e && e.timeout ? e.timeout : o; + const [r, h] = i.split("@"), a = { + url: `http://${h}/v1/scripting/evaluate`, + body: {script_text: t, mock_type: "cron", timeout: o}, + headers: {"X-Key": r, 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), + o = JSON.stringify(this.data); + s ? this.fs.writeFileSync(t, o) : i ? this.fs.writeFileSync(e, o) : this.fs.writeFileSync(t, o) + } + } + + lodash_get(t, e, s) { + const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); + let o = t; + for (const t of i) if (o = Object(o)[t], void 0 === o) return s; + return o + } + + 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), o = s ? this.getval(s) : ""; + if (o) try { + const t = JSON.parse(o); + e = t ? this.lodash_get(t, i, "") : e + } catch (t) { + e = "" + } + } + return e + } + + setdata(t, e) { + let s = !1; + if (/^@/.test(e)) { + const [, i, o] = /^@(.*?)\.(.*?)$/.exec(e), r = this.getval(i), + h = i ? "null" === r ? null : r || "{}" : "{}"; + try { + const e = JSON.parse(h); + this.lodash_set(e, o, t), s = this.setval(JSON.stringify(e), i) + } catch (e) { + const r = {}; + this.lodash_set(r, o, t), s = this.setval(JSON.stringify(r), 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() ? $httpClient.get(t, (t, s, i) => { + !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) + }) : this.isQuanX() ? $task.fetch(t).then(t => { + const {statusCode: s, statusCode: i, headers: o, body: r} = t; + e(null, {status: s, statusCode: i, headers: o, body: r}, r) + }, t => e(t)) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { + try { + 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: o, body: r} = t; + e(null, {status: s, statusCode: i, headers: o, body: r}, r) + }, t => e(t))) + } + + 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()) $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", $task.fetch(t).then(t => { + const {statusCode: s, statusCode: i, headers: o, body: r} = t; + e(null, {status: s, statusCode: i, headers: o, body: r}, r) + }, 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: o, body: r} = t; + e(null, {status: s, statusCode: i, headers: o, body: r}, r) + }, t => e(t)) + } + } + + 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 = "", o) { + const r = t => { + if (!t || !this.isLoon() && this.isSurge()) return t; + if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? {"open-url": t} : void 0; + if ("object" == typeof t) { + if (this.isLoon()) { + let e = t.openUrl || t["open-url"], + s = t.mediaUrl || t["media-url"]; + return {openUrl: e, mediaUrl: s} + } + if (this.isQuanX()) { + let e = t["open-url"] || t.openUrl, + s = t["media-url"] || t.mediaUrl; + return {"open-url": e, "media-url": s} + } + } + }; + this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, r(o)) : this.isQuanX() && $notify(e, s, i, r(o))); + 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) +} diff --git a/package.json b/package.json index e8a427d084..e764e0f9d5 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,10 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/Sunert/Scripts.git" + "url": "https://github.com/Sunert/Scripts.git" }, - "keywords": [], - "author": "", + "keywords": ["中青看点,腾讯新闻等等"], + "author": "Sunert", "license": "ISC", "bugs": { "url": "https://github.com/Sunert/Scripts/issues" @@ -19,12 +19,9 @@ "homepage": "https://github.com/Sunert/Scripts#readme", "dependencies": { "crypto-js": "^4.0.0", - "got": "^11.5.1", + "got": "^11.7.0", "http-server": "^0.12.3", - "node-schedule": "^1.3.2", "tough-cookie": "^4.0.0", - "download": "^8.0.0", - "request": "^2.88.2", - "request-promise": "^4.2.5" + "download": "^8.0.0" } } diff --git a/sendNotify.js b/sendNotify.js new file mode 100644 index 0000000000..b4478d69be --- /dev/null +++ b/sendNotify.js @@ -0,0 +1,326 @@ +const querystring = require("querystring"); +const $ = new Env(); +// =======================================微信server酱通知设置区域=========================================== +//此处填你申请的SCKEY. +//注:此处设置github action用户填写到Settings-Secrets里面(Name输入PUSH_KEY) +let SCKEY = ''; + +// =======================================Bark App通知设置区域=========================================== +//此处填你BarkAPP的信息(IP/设备码,例如:https://api.day.app/XXXXXXXX) +//注:此处设置github action用户填写到Settings-Secrets里面(Name输入BARK_PUSH) +let BARK_PUSH = ''; +//BARK app推送铃声,铃声列表去APP查看复制填写 +//注:此处设置github action用户填写到Settings-Secrets里面(Name输入BARK_SOUND , Value输入app提供的铃声名称,例如:birdsong) +let BARK_SOUND = ''; + + +// =======================================telegram机器人通知设置区域=========================================== +//此处填你telegram bot 的Token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw +//注:此处设置github action用户填写到Settings-Secrets里面(Name输入TG_BOT_TOKEN) +let TG_BOT_TOKEN = ''; +//此处填你接收通知消息的telegram用户的id,例如:129xxx206 +//注:此处设置github action用户填写到Settings-Secrets里面(Name输入TG_USER_ID) +let TG_USER_ID = ''; + +// =======================================钉钉机器人通知设置区域=========================================== +//此处填你钉钉 bot 的webhook,例如:5a544165465465645d0f31dca676e7bd07415asdasd +//注:此处设置github action用户填写到Settings-Secrets里面(Name输入DD_BOT_TOKEN) +let DD_BOT_TOKEN = ''; +//密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 +let DD_BOT_SECRET = ''; + +// =======================================iGot聚合推送通知设置区域=========================================== +//此处填您iGot的信息(推送key,例如:https://push.hellyw.com/XXXXXXXX) +//注:此处设置github action用户填写到Settings-Secrets里面(Name输入IGOT_PUSH_KEY) +let IGOT_PUSH_KEY = ''; + +if (process.env.PUSH_KEY) { + SCKEY = process.env.PUSH_KEY; +} +if (process.env.BARK_PUSH) { + if(process.env.BARK_PUSH.indexOf('https') > -1 || process.env.BARK_PUSH.indexOf('http') > -1) { + //兼容BARK自建用户 + BARK_PUSH = process.env.BARK_PUSH + } else { + BARK_PUSH = `https://api.day.app/${process.env.BARK_PUSH}` + } + if (process.env.BARK_SOUND) { + BARK_SOUND = process.env.BARK_SOUND + } +} else { + if(BARK_PUSH && BARK_PUSH.indexOf('https') === -1 && BARK_PUSH.indexOf('http') === -1) { + //兼容BARK本地用户只填写设备码的情况 + BARK_PUSH = `https://api.day.app/${BARK_PUSH}` + } +} +if (process.env.TG_BOT_TOKEN) { + TG_BOT_TOKEN = process.env.TG_BOT_TOKEN; +} +if (process.env.TG_USER_ID) { + TG_USER_ID = process.env.TG_USER_ID; +} + +if (process.env.DD_BOT_TOKEN) { + DD_BOT_TOKEN = process.env.DD_BOT_TOKEN; + if (process.env.DD_BOT_SECRET) { + DD_BOT_SECRET = process.env.DD_BOT_SECRET; + } +} + +if (process.env.IGOT_PUSH_KEY) { + IGOT_PUSH_KEY = process.env.IGOT_PUSH_KEY +} + +async function sendNotify(text, desp, params = {}) { + //提供五种通知 + await serverNotify(text, desp); + text = text.match(/.*?(?=\s?-)/g) ? text.match(/.*?(?=\s?-)/g)[0] : text; + await BarkNotify(text, desp, params); + await tgBotNotify(text, desp); + await ddBotNotify(text, desp); + await iGotNotify(text, desp, params); +} + +function serverNotify(text, desp) { + return new Promise(resolve => { + if (SCKEY) { + //微信server酱推送通知一个\n不会换行,需要两个\n才能换行,故做此替换 + desp = desp.replace(/[\n\r]/g, '\n\n'); + const options = { + url: `https://sc.ftqq.com/${SCKEY}.send`, + body: `text=${text}&desp=${desp}`, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('\n发送通知调用API失败!!\n') + console.log(err); + } else { + data = JSON.parse(data); + if (data.errno === 0) { + console.log('\nserver酱发送通知消息成功\n') + } else if (data.errno === 1024) { + console.log('\nPUSH_KEY 错误\n') + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + } else { + console.log('\n您未提供server酱的SCKEY,取消微信推送消息通知\n'); + resolve() + } + }) +} + +function BarkNotify(text, desp, params={}) { + return new Promise(resolve => { + if (BARK_PUSH) { + const options = { + url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}&${querystring.stringify(params)}`, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log('\nBark APP发送通知调用API失败!!\n') + console.log(err); + } else { + data = JSON.parse(data); + if (data.code === 200) { + console.log('\nBark APP发送通知消息成功\n') + } else { + console.log(`\n${data.message}\n`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }) + } else { + console.log('\n您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知\n'); + resolve() + } + }) +} + +function tgBotNotify(text, desp) { + return new Promise(resolve => { + if (TG_BOT_TOKEN && TG_USER_ID) { + const options = { + url: `https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage`, + body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}&disable_web_page_preview=true`, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + } + if (process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) { + const tunnel = require("tunnel"); + const agent = { + https: tunnel.httpsOverHttp({ + proxy: { + host: process.env.TG_PROXY_HOST, + port: process.env.TG_PROXY_PORT * 1 + } + }) + } + Object.assign(options, { agent }) + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('\ntelegram发送通知消息失败!!\n') + console.log(err); + } else { + data = JSON.parse(data); + if (data.ok) { + console.log('\nTelegram发送通知消息完成。\n') + } else if (data.error_code === 400) { + console.log('\n请主动给bot发送一条消息并检查接收用户ID是否正确。\n') + } else if (data.error_code === 401){ + console.log('\nTelegram bot token 填写错误。\n') + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + } else { + console.log('\n您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知\n'); + resolve() + } + }) +} +function ddBotNotify(text, desp) { + return new Promise(resolve => { + const options = { + url: `https://oapi.dingtalk.com/robot/send?access_token=${DD_BOT_TOKEN}`, + json: { + "msgtype": "text", + "text": { + "content": ` ${text}\n\n${desp}` + } + }, + headers: { + 'Content-Type': 'application/json' + } + } + if (DD_BOT_TOKEN && DD_BOT_SECRET) { + const crypto = require('crypto'); + const dateNow = Date.now(); + const hmac = crypto.createHmac('sha256', DD_BOT_SECRET); + hmac.update(`${dateNow}\n${DD_BOT_SECRET}`); + const result = encodeURIComponent(hmac.digest('base64')); + options.url = `${options.url}×tamp=${dateNow}&sign=${result}`; + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('\n钉钉发送通知消息失败!!\n') + console.log(err); + } else { + data = JSON.parse(data); + if (data.errcode === 0) { + console.log('\n钉钉发送通知消息完成。\n') + } else { + console.log(`\n${data.errmsg}\n`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + } else if (DD_BOT_TOKEN) { + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('\n钉钉发送通知消息失败!!\n') + console.log(err); + } else { + data = JSON.parse(data); + if (data.errcode === 0) { + console.log('\n钉钉发送通知消息完成。\n') + } else { + console.log(`\n${data.errmsg}\n`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + } else { + console.log('\n您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n'); + resolve() + } + }) +} + +function iGotNotify(text, desp, params={}){ + return new Promise(resolve => { + if (IGOT_PUSH_KEY) { + // 校验传入的IGOT_PUSH_KEY是否有效 + const IGOT_PUSH_KEY_REGX = new RegExp("^[a-zA-Z0-9]{24}$") + if(!IGOT_PUSH_KEY_REGX.test(IGOT_PUSH_KEY)) { + console.log('\n您所提供的IGOT_PUSH_KEY无效\n') + resolve() + return + } + const options = { + url: `https://push.hellyw.com/${IGOT_PUSH_KEY.toLowerCase()}`, + body: `title=${text}&content=${desp}&${querystring.stringify(params)}`, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('\n发送通知调用API失败!!\n') + console.log(err); + } else { + if(typeof data === 'string') data = JSON.parse(data); + if (data.ret === 0) { + console.log('\niGot发送通知消息成功\n') + } else { + console.log(`\niGot发送通知消息失败:${data.errMsg}\n`) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + } else { + console.log('\n您未提供iGot的推送IGOT_PUSH_KEY,取消iGot推送消息通知\n'); + resolve() + } + }) +} + +module.exports = { + sendNotify, + SCKEY, + BARK_PUSH, + TG_BOT_TOKEN, + TG_USER_ID, + DD_BOT_TOKEN, + IGOT_PUSH_KEY +}//这里导出SCKEY,BARK_PUSH等通知参数是jd_bean_sign.js处需要 +// prettier-ignore +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)} diff --git a/sqxs.js b/sqxs.js new file mode 100644 index 0000000000..ab6a881221 --- /dev/null +++ b/sqxs.js @@ -0,0 +1,785 @@ +/* + +脚本名称:"书旗小说多账户号稳定版"; +适用版本:verson 4.3.2 ; 适用版本:verson 4.3.2 ; 适用版本:verson 4.3.2 ;(重要事情说三遍) +作者:caixukun; + + +【注意事项】: +0.所有js脚本均为本地脚本,非远程目录。 + +1.有时候会出现获取不到ck的情况,请关闭代理重复该步骤多试几次; + +2.看视频金币ck获取可能会出现视频加载失败,可以先关闭qx,待视频能看再打开qx; + +3.运行次数大概一天,一到两次,日收益5毛左右; + +4.阅读任务可能会出现中断,读者可自行更改间隔时间; + +5.所有ck获取完成,可以打开boxjs看看书否所有的参数都有值,不要出现账号1的ack和账号2的bck混合在一起; + + +【nodejs教程】: +打开boxjs,复制会话,新建文件,粘贴,改文件名为 sqxsck.json,与本脚本放同一目录下,用nodejs即可运行本脚本; + + +【QX教程】: +hostname:ocean.shuqireader.com + +[rewrite_local] +https://ocean.shuqireader.com/api/ad/v1/api/prize/lottery url script-request-body sqxsgetck.js +https://ocean.shuqireader.com/api/activity/activity/v1/lottery/draw url script-request-body sqxsgetck.js +https://ocean.shuqireader.com/api/activity/xapi/gold/record url script-request-body sqxsgetck.js +https://ocean.shuqireader.com/api/prizecenter/xapi/prize/manual/receive url script-request-body sqxsgetck.js +https://ocean.shuqireader.com/api/ad/v1/api/prize/readpage/pendant/lottery url script-request-body sqxsgetck.js + +[task_local] +0 12 * * * sqxs.js, tag=书旗小说, enabled=true + +boxjs:https://raw.githubusercontent.com/xiaokxiansheng/js/master/Task/cxk10.boxjs.json + +共6个ck,打开书旗小说 +1.点击 我的-去赚钱-去看书,随便阅读一本书,金币转一圈获得 阅读ck; + +2.点击 我的-去赚钱-一键收取,获得 收集金币ck; + +3.点击 我的-去赚钱-看视频赚2500金币,看一个视频广告获得 视频金币奖励ck; + +4.点击 我的-去赚钱-福利转转转-看视频抽奖,获得 视频抽奖奖励ck 和 抽奖ck; + +5 点击 我的-去赚钱-记录,获得 用户信息url; + + + + */ + +const jobname = '书旗小说' + const $ = Env(jobname) + + let ReadTimes = 0; +let vediogold = 0; +let drawgold = 0; +let sqname; +let notify = require('./sendNotify'); +!(async() => { + await all(); +})() +.catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') +}) +.finally(() => { + $.done(); +}) + +async function all() { + //nodejs运行 + if ($.isNode()) { + let sqxsck = require('./sqxsck.json'); + let CountNumber = sqxsck.settings[1].val; + $.log(`============ 共 ${CountNumber} 个${jobname}账号=============`); + for (let i = 0; i < CountNumber; i++) { + if (sqxsck.datas[0 + 6 * i].val) { + readckArr = sqxsck.datas[0 + 6 * i].val.split('&&'); + receivecoinckArr = sqxsck.datas[1 + 6 * i].val.split('&&'); + vediogoldprizeckArr = sqxsck.datas[2 + 6 * i].val.split('&&'); + vediodrawprizeckArr = sqxsck.datas[3 + 6 * i].val.split('&&'); + drawckArr = sqxsck.datas[4 + 6 * i].val.split('&&'); + userinfock = sqxsck.datas[5 + 6 * i].val; + if ( i == 0) + sqname = '草莓酸奶酱'; + if ( i == 1) + sqname = '1783990'; + if ( i == 2) + sqname = '柚旅时光机'; + if ( i == 3) + sqname = '忘忧浮云'; + if ( i == 4) + sqname = '有心'; + $.log(`\n============ 【书旗小说${i+1}】=============`); + ReadTimes = 0; + vediogold = 0; + drawgold = 0; + + //阅读 + await readbook(); + + //收集阅读金币 + //if(ReadTimes>0) + await receivecoin(); + + //看视频奖励金币 + await vediogoldprize(0); + + //看视频奖励抽奖次数 + await vediodrawprize(0); + + //个人信息 + await userinfo(); + } + } + + } + //QX运行 + else { + + let CountNumber = $.getval('CountNumber'); + if (typeof CountNumber === 'undefined') + CountNumber = 1; + $.log(`============ 共 ${CountNumber} 个${jobname}账号=============`); + + for (let i = 1; i <= CountNumber; i++) { + if ($.getdata(`readck${i}`)) { + readckArr = $.getdata(`readck${i}`).split('&&'); + receivecoinckArr = $.getdata(`receivecoinck${i}`).split('&&'); + vediogoldprizeckArr = $.getdata(`vediogoldprizeck${i}`).split('&&'); + vediodrawprizeckArr = $.getdata(`vediodrawprizeck${i}`).split('&&'); + drawckArr = $.getdata(`drawck${i}`).split('&&'); + userinfock = $.getdata(`userinfock${i}`); + $.log('\n============ 【书旗小说' + i + '】============='); + ReadTimes = 0; + vediogold = 0; + drawgold = 0; + //阅读 + await readbook(); + + //收集阅读金币 + //if(ReadTimes>0) + await receivecoin(); + + //看视频奖励金币 + await vediogoldprize(0); + + //看视频奖励抽奖次数 + await vediodrawprize(0); + + //个人信息 + await userinfo(); + } + } + + } +} + +function readbook() { + return new Promise((resolve, reject) => { + const url = "https://ocean.shuqireader.com/api/ad/v1/api/prize/readpage/pendant/lottery"; + + const request = { + url: url, + headers: JSON.parse(readckArr[1]), + body: readckArr[0] + }; + $.post(request, async(error, request, data) => { + try { + if (error) { + $.log("阅读请求失败,再次尝试阅读"); + await $.wait(5000); + await readbook(); + } else { + const result = JSON.parse(data) + //$.log(data); + if (result.status == 200) { + ReadTimes++; + $.log("【阅读任务】第" + ReadTimes + "次阅读成功,获得3金币"); + await $.wait(5000); + await readbook(); + } else { + + if (result.message != '领取达到每日上限,请明天再来') { + $.log("【阅读任务】阅读失败," + result.message + ",再次尝试阅读"); + await $.wait(5000); + await readbook(); + } else + $.log("【阅读任务】阅读失败," + result.message); + + //$.log(data); + } + } + } catch (e) { + $.log(e) + } + resolve(); + }); + }); +} + +function receivecoin() { + return new Promise((resolve, reject) => { + const url = "https://ocean.shuqireader.com/api/prizecenter/xapi/prize/manual/receive"; + + const request = { + url: url, + headers: JSON.parse(receivecoinckArr[1]), + body: receivecoinckArr[0] + }; + $.post(request, async(error, request, data) => { + try { + if (error) { + $.log("收集阅读金币请求失败,再次尝试收集阅读金币"); + await $.wait(5000); + await receivecoin(); + } else { + //$.log(data); + const result = JSON.parse(data); + if (result.status == 200) { + + $.log("【收集金币】收集阅读金币成功,共获得" + ReadTimes * 3 + "金币"); + + } else { + $.log("【收集金币】收集阅读金币失败," + result.message); + //$.log(data); + } + } + + } catch (e) { + $.log(e) + } + resolve(); + }); + }); +} + +function vediogoldprize(j) { + return new Promise((resolve, reject) => { + const url = "https://ocean.shuqireader.com/api/ad/v1/api/prize/lottery"; + const request = { + url: url, + headers: JSON.parse(vediogoldprizeckArr[1]), + body: vediogoldprizeckArr[0] + }; + $.post(request, async(error, request, data) => { + try { + if (error) { + $.log("视频金币请求失败,再次尝试视频金币"); + await $.wait(5000); + await vediogoldprize(); + } else { + const result = JSON.parse(data) + //$.log(data); + if (result.status == 200) { + j++; + $.log("【视频金币】观看第" + j + "个视频成功,获得250金币,等待30s观看下一个视频"); + vediogold += 250; + await $.wait(30000); + await vediogoldprize(j); + } else { + if (result.message != '领取达到每日上限,请明天再来') { + $.log("【视频金币】观看失败," + result.message + ",再次尝试视频金币"); + await $.wait(30000); + await vediogoldprize(j); + } else + $.log("【视频金币】观看失败," + result.message); + //$.log(data); + + } + } + } catch (e) { + $.log(e) + } + resolve(); + }); + }); +} + +function vediodrawprize(k) { + return new Promise((resolve, reject) => { + const url = "https://ocean.shuqireader.com/api/ad/v1/api/prize/lottery"; + + const request = { + url: url, + headers: JSON.parse(vediodrawprizeckArr[1]), + body: vediodrawprizeckArr[0] + }; + $.post(request, async(error, request, data) => { + try { + if (error) { + $.log("视频抽奖请求失败,再次尝试视频抽奖"); + await $.wait(5000); + await vediogoldprize(); + } else { + const result = JSON.parse(data) + //$.log(data); + if (result.status == 200) { + k++; + $.log("【视频抽奖】观看第" + k + "个视频成功,获得一次抽奖机会"); + await $.wait(5000); + await draw(k); + } else { + if (result.message != '领取达到每日上限,请明天再来') { + $.log("【视频抽奖】观看失败," + result.message + ",再次尝试视频抽奖"); + await $.wait(5000); + await vediodrawprize(k); + } else + $.log("【视频抽奖】观看失败," + result.message); + //$.log(data); + } + } + } catch (e) { + $.log(e) + } + resolve(); + }); + }); +} + +function draw(k) { + return new Promise((resolve, reject) => { + const url = "https://ocean.shuqireader.com/api/activity/activity/v1/lottery/draw?asac=2A20C07RJ9F51AOEFSNHDR"; + + const request = { + url: url, + headers: JSON.parse(drawckArr[1]), + body: drawckArr[0] + }; + $.post(request, async(error, request, data) => { + try { + if (error) { + $.log("抽奖任务请求失败,再次尝试视频抽奖"); + await $.wait(5000); + await draw(); + } else { + const result = JSON.parse(data) + //$.log(data); + if (result.status == 200) { + $.log("【抽奖任务】抽奖成功,获得" + result.data.prizeList[0].prizeName); + drawgold += parseInt(result.data.prizeList[0].prizeName); + await $.wait(5000); + await vediodrawprize(k); + } else { + $.log("【抽奖任务】抽奖失败," + result.message); + //$.log(data); + } + } + } catch (e) { + $.log(e) + } + resolve(); + }); + }); +} + +function userinfo() { + return new Promise((resolve, reject) => { + const request = { + url: userinfock, + headers: {}, + body: "" + }; + + $.post(request, async(error, request, data) => { + try { + if (error) { + $.log("用户信息请求失败,再次尝试用户信息请求"); + await $.wait(5000); + await userinfo(); + } else { + //$.log(data); + const result = JSON.parse(data); + if (result.status == 200) { + $.log("【阅读任务】本次共获得" + ReadTimes * 3 + "金币"); + $.log("【视频任务】本次共获得" + vediogold + "金币"); + $.log("【抽奖任务】本次共获得" + drawgold + "金币"); + $.log("【金币总数】" + result.data.gold); + $.log("【总计收益】" + result.data.income + "元"); + + await notify.sendNotify(`书旗小说`, `书旗账号 ${sqname} \n【阅读任务】本次共获得 ${ReadTimes*3} 金币\n【视频任务】本次共获得${vediogold}金币\n【抽奖任务】本次共获得${drawgold}金币\n【金币总数】${result.data.gold}\n【总计收益】 ${result.data.income}元`); + } else { + $.log("【金币总数】数据异常," + result.message); + //$.log(data); + } + } + } catch (e) { + $.log(e) + } + resolve(); + }); + }); +} + +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(`\n${this.name}\u811a\u672c,\u5f00\u59cb\u6267\u884c:`) + } + 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("", `${this.name}\u811a\u672c, \u6267\u884c\u7ed3\u675f! \u7528\u65f6${s}\u79d2`), + this.log(), + (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) + } + } + (t, e) +} diff --git a/sqxsck.json b/sqxsck.json new file mode 100644 index 0000000000..bae48b0817 --- /dev/null +++ b/sqxsck.json @@ -0,0 +1 @@ +{"id":"sqxh","name":"书旗小说","keys":["readck1","receivecoinck1","vediogoldprizeck1","vediodrawprizeck1","drawck1","userinfock1","readck2","receivecoinck2","vediogoldprizeck2","vediodrawprizeck2","drawck2","userinfock2","readck3","receivecoinck3","vediogoldprizeck3","vediodrawprizeck3","drawck3","userinfock3","readck4","receivecoinck4","vediogoldprizeck4","vediodrawprizeck4","drawck4","userinfock4","readck5","receivecoinck5","vediogoldprizeck5","vediodrawprizeck5","drawck5","userinfock5","readck6","receivecoinck6","vediogoldprizeck6","vediodrawprizeck6","drawck6","userinfock6","readck7","receivecoinck7","vediogoldprizeck7","vediodrawprizeck7","drawck7","userinfock7","readck8","receivecoinck8","vediogoldprizeck8","vediodrawprizeck8","drawck8","userinfock8","readck9","receivecoinck9","vediogoldprizeck9","vediodrawprizeck9","drawck9","userinfock9","readck10","receivecoinck10","vediogoldprizeck10","vediodrawprizeck10","drawck10","userinfock10"],"author":"@caixukun1","settings":[{"id":"sqxs","name":"当前账号","val":"5","type":"number","desc":"当前抓取ck记录的账号序号,如:1、2、4、"},{"id":"CountNumber","name":"账号个数","val":"5","type":"number","desc":"指定任务最多跑几个账号,根据抓取的账号数据个数来设值"}],"repo":"https://raw.githubusercontent.com/","icons":["https://s3.ax1x.com/2021/02/06/yYzYWR.png","https://s3.ax1x.com/2021/02/06/yYzYWR.png"],"script":"https://raw.githubusercontent.com/","icon":"https://s3.ax1x.com/2021/02/06/yYzYWR.png","favIcon":"mdi-star-outline","favIconColor":"grey","datas":[{"key":"readck1","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2010297604%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEwMjk3NjA0IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMzUwNSwidXNlcklkIjoiMjAxMDI5NzYwNCIsImlhdCI6MTYxNTIwNTEwNSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.sVXyY-0MLL5phAc5EuQ2bLRtUZQF23oOX0qBZQHeVft1vThzRsxCFkOArKBXi6etb9BdZlh76dL3gVsm33E7Tg%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=707&key=sq_app_ad&miniWua=HHnB_BiNP3DE/TflaXykWlXC7coGg0cKKshCxT1KNnsom4RQ%3D&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=678&sign=3464DAF89F6513CA3853DA2A49BD8E72×tamp=1615205172&userId=2010297604&wua=HIVW_3snaPITzcuBNEqfzppNhEPhE1oTfuMIODc2qa8s7znAV/k3HgfLv/KF%2BrO46sdit5eTUeP9qkjfVbTg/D1FpFy3co4j2abihwJ494dq1FEk3D50GRdjq32fpRKrB7UN1et0HD2fBt/y3/sxSgcS1qLUdsWL68JNUZgzcttX3V7C2odGx%2BQZ94QnaX/jgrF7H90430x/KPGYmT3y8aa7EZMzXuri0REq9x0JI56DwJEA%3D&&{\"Cookie\":\"isg=BAcHajrYK9g2Aa9U25lycPvonL3RDNvuxUxy7Nn0Ixa9SCcK4dxrPkUY7I4Wu7Nm; cna=uwDNGKxvSSYCAXcsPUw/NwpI\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1549\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"receivecoinck1","val":"platform=1&src=×tamp=1615205227&userId=2010297604&sqSv=1.0&appVer=4.3.2.0&placeId=&sign=b14caf602f2d0728ebe2973f99ebc675&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26stopPullRefresh%3D1%26from%3DShuqiTab%26upf%3D20368%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2010297604%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEwMjk3NjA0IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMzUwNSwidXNlcklkIjoiMjAxMDI5NzYwNCIsImlhdCI6MTYxNTIwNTEwNSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.sVXyY-0MLL5phAc5EuQ2bLRtUZQF23oOX0qBZQHeVft1vThzRsxCFkOArKBXi6etb9BdZlh76dL3gVsm33E7Tg%26skinColor%3D23B383%26platform%3D1%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/18D52 AliApp(shuqi/4.3.2.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.2.0) 1536x2048 Winding(WV_3) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/welfare_page_v2/?serviceWorkerOn=1&stopPullRefresh=1&from=ShuqiTab&upf=20368&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2010297604&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.2.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEwMjk3NjA0IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMzUwNSwidXNlcklkIjoiMjAxMDI5NzYwNCIsImlhdCI6MTYxNTIwNTEwNSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.sVXyY-0MLL5phAc5EuQ2bLRtUZQF23oOX0qBZQHeVft1vThzRsxCFkOArKBXi6etb9BdZlh76dL3gVsm33E7Tg&skinColor=23B383&platform=iOS&ver=210122&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1261\",\"Accept-Language\":\"zh-cn\"}"},{"key":"vediogoldprizeck1","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2010297604%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.3.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEwMjk3NjA0IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMzk0NSwidXNlcklkIjoiMjAxMDI5NzYwNCIsImlhdCI6MTYxNTIwNTU0NSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0._u1UlhG4kM-MYWP3V7lHB73VF1AvC6PlFa8dZA5Wdb52Kn8ZwPqutZRb0HrWX9pUXLQxELTTs2QAKDILNl-uSg%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210203%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=525&key=sq_app_ad&miniWua=HHnB_biqaOxhkcch8AglnNyDbSBviqS3FpRo8zLimu1nqYXbldpBu0Qh3hdRfyeLxqVRLgDa11eDjLMHt9Vh94vzKMWx7C04lKFedFktqN0gxIirVm1QUBGHIqetcHuQgykqs&platform=iOS&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=626&sign=5C78B3341739472C9C82C946AC637201×tamp=1615205590&userId=2010297604&user_id=2010297604&wua=HIVW_3Xfmbmrymp/JJFbcjcE5BZkbfsJDKyOO%2BsBoUqnqQOU1rmURVf9lou3Z%2BtViwppGG8gwfpH8RnEgOIXUxiZHmFmtSA7u2zwN5bgwUa4Ywjxz/ZDNtrPbLg%2BjneoS0m6bBQEXbeIOdeCqPmev78cZZ93/Dcv03ipPFkDmYUfgDfF28MVOtNjuY%2BQKVwvzT%2BkVmJzUbRpV7l7Gm7mTJ5dPQcRsDVE5cK9IHDm4tgeFjm8KBgajWoCIURmH9Eh3WUSArrotgcuunNFEQTByD4EAsdcqJ1SktJIWAk6NvHKgHEZ9mu5BdGh%2BQ6p20W1jizRpUBMmUMcUHhP4tcCy/Ib8YpXJVqP4AaEItrno2BwCMRPnYEyook%2BQwOasEdxNJv3a&&{\"Cookie\":\"isg=BP39iOGTQVq_0uW2O4Dv0f1ZBl_3mjHsN3NN0L9COdSD9h0oh-pBvMu0pqyw7Umk; cna=XwLNGGIunEACAXcsPUxOnP2o\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.3 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1819\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"vediodrawprizeck1","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2010297604%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEwMjk3NjA0IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMzUwNSwidXNlcklkIjoiMjAxMDI5NzYwNCIsImlhdCI6MTYxNTIwNTEwNSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.sVXyY-0MLL5phAc5EuQ2bLRtUZQF23oOX0qBZQHeVft1vThzRsxCFkOArKBXi6etb9BdZlh76dL3gVsm33E7Tg%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=711&key=sq_app_ad&miniWua=HHnB_lZovFG3pv2/OQkD8sm/K/Ns/KXKlfEdtcUzmVVaXkAc%3D&platform=iOS&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=703&sign=FC4201DB779E24AA1E149CCF2E9DFA84×tamp=1615205346&userId=2010297604&user_id=2010297604&wua=HIVW_tKMue4cSSYnh191UWvSkcGv08mjrSMlvwQwA105v6wzAcw7E0FGaLPJtvQhPdx7C2SZCwV8lVVFDUU7b647Q6byBV/0PeHyRNgggvIsIfAogmWz0jOQLgqy151yVAeerfl7//csEgGfYch0qpqndGnFNYbW2NubprchK5hlsnmKQfcS0Is2KjhvSgy7fKVxf8Ee/i70Whnj250Yx8sQw6c14X2kcJCaNk4uyUEiM95k%3D&&{\"Cookie\":\"isg=BM_PEm7d84C-mff8w7E6WGNwVGXZ9CMWTeQKhOHcRD5FsOWy6cZ8Z2GwtGYO0_uO; cna=uwDNGKxvSSYCAXcsPUw/NwpI\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1577\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"drawck1","val":"wua=HIVW_lUiChXVl%2BOSTVrshdkfjZbTL7xpjLWP6CZtOnsaFCwbJWISpfOVCtYNtS7wQ169Qv3Zm51Zu%2FAicUcOkqYhTrXj1y09Co%2FgnDdLZkcOiwYBip7Ap2d0BtQXZIJePfhxBQzn0H6O4ACdu1BioNuH7aZz8k50miHyq9AMOG%2BXPZZsef%2BD947JBlTaQKv8of8qjlRAsRvysjJ0u%2FV9BTQhbll9T13FM%2FGpxmOMHIHnqiv1rOIhqGsKDYZINpf%2FKzT4CYFb0CX3kSKUaWzyRCaMxqp9fyGFLG0dDS0TZiokCKqbPJKz2dtBBzxQcEnnu4sem8NBA1EV8YHJ9%2BMFW7jWzHxjPjqYNsVd7fT008o9da8%2FRJB5s9OHfSjGUqTbNFcld&ua=&userId=2010297604&umidtoken=CwpLFuhLOgQquzV4EW6r1Ibov3gcOLip&secureDeviceType=ios&secureAppName=wenxue-activity-proxy&asac=2A20C07RJ9F51AOEFSNHDR×tamp=1615205766&activityId=311&lotteryNum=1&sessionId=1&useGoldcoinType=0&sqSv=1.0&sign=7bf3272423b638614b42b0d911d8be4c&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26asac%3D2A20C07RJ9F51AOEFSNHDR%26spm%3Da2oun.page_render_sq_welfare_welfare_page_v2.%25E6%258B%259B%25E8%25B4%25A2%25E7%258C%25AB.turntable_in_0%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2010297604%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3DCwpLFuhLOgQquzV4EW6r1Ibov3gcOLip%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.3.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEwMjk3NjA0IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNDAwNSwidXNlcklkIjoiMjAxMDI5NzYwNCIsImlhdCI6MTYxNTIwNTYwNSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.lAO6KnexuXM6myl1z7d2RyBnAGcldpG_Lhr2g0n1E_4EXVP7366xoiThtKSMkser5WVZ2WTwk7Ye2eax9oWBhg%26skinColor%3D23B383%26platform%3D1%26ver%3D210203%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 AliApp(shuqi/4.3.3.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.3.0) 1536x2048 Winding(WV_3) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/lottery_page/?serviceWorkerOn=1&asac=2A20C07RJ9F51AOEFSNHDR&spm=a2oun.page_render_sq_welfare_welfare_page_v2.%E6%8B%9B%E8%B4%A2%E7%8C%AB.turntable_in_0&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2010297604&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=CwpLFuhLOgQquzV4EW6r1Ibov3gcOLip&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.3.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEwMjk3NjA0IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNDAwNSwidXNlcklkIjoiMjAxMDI5NzYwNCIsImlhdCI6MTYxNTIwNTYwNSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.lAO6KnexuXM6myl1z7d2RyBnAGcldpG_Lhr2g0n1E_4EXVP7366xoiThtKSMkser5WVZ2WTwk7Ye2eax9oWBhg&skinColor=23B383&platform=iOS&ver=210203&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1925\",\"Accept-Language\":\"zh-cn\"}"},{"key":"userinfock1","val":"https://ocean.shuqireader.com/api/activity/xapi/gold/record?userId=2010297604&page=1&pageSize=10&sqSv=1.0&sign=e13c63f6bea18ec560f99d1ce49db4b5&key=sq_h5_gateway&_public=fe-env%253Duae-prod%2526sdk%253D14.4%2526utdid%253DYDXtGFuwhAIDAGcg21DfxrSH%2526ustatus%253D1%2526first_placeid%253D111111%2526net_env%253Dwifi%2526placeid%253D111111%2526user_id%253D2010297604%2526sn%253DC8632262E5EC058F2691BD667236A56F746082BE%2526umidtoken%253DYDXtGFuwhAIDAGcg21DfxrSH%2526msv%253D8.0.0%2526brand%253DApple%2526imei%253DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%2526skinVersionPrefix%253D1%2526appVer%253D4.3.2.0%2526skinActiveColor%253D0F9970%2526manufacturer%253DApple%2526session%253DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEwMjk3NjA0IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMzUwNSwidXNlcklkIjoiMjAxMDI5NzYwNCIsImlhdCI6MTYxNTIwNTEwNSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.sVXyY-0MLL5phAc5EuQ2bLRtUZQF23oOX0qBZQHeVft1vThzRsxCFkOArKBXi6etb9BdZlh76dL3gVsm33E7Tg%2526skinColor%253D23B383%2526platform%253D1%2526ver%253D210122%2526mod%253DUnknowniPad%2526statusBarHeight%253D20.000000%2526skinVersion%253D1%2526wh%253D1536x2048%2526soft_id%253D21%2526utype%253Dvip%2526skinId%253D999%2526idfa%253DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4"},{"key":"readck2","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2009598099%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5NTk4MDk5IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMjE1MywidXNlcklkIjoiMjAwOTU5ODA5OSIsImlhdCI6MTYxNTIwMzc1Mywib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.eOuJnNgwzSj3Eo9L4LZwpCJd3covdcfZtoFNEyyA0DO3WENlkXImgM9Abvc10FiOR345-xWS8fX26bDBhqfJvw%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=707&key=sq_app_ad&miniWua=HHnB_496oEWZSfZdK01qtCs8mvPWI%2BQJ3o/3APTgq/X3gpUg%3D&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=678&sign=1ECB2022064ABCBC142409AF5B676364×tamp=1615203796&userId=2009598099&wua=HIVW_cMjh8Na4JNkzor8wvkPtXc9C3ntnZ0PQGv5xPMMgE0zCYrvWDlR73r3GDn4ExPwYFQ0j5cjoac03KLaPRnPTpyPRaAPr3x7d6z5YdB/LbKEzY939WUYx6ETC/oF71LzhR7k80zVNDvc6/GCzZWIgb153fU9PUtR4fgSnvEtAwlatB4J8N%2B%2BZQK6bbcRYkOh7GahmUVHBjFD6fFSHhnF0jBkk7wqBa5uzUA23GSWSkk4%3D&&{\"Cookie\":\"isg=BM7OlaXaIn_ZMZZbJb346K97FaKQT5JJw0NyR_gXOlGMW261YN_iWXQLlQE32Iph; cna=OvvMGP+BHlMCAXcsPUzFAIWr\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1551\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"receivecoinck2","val":"platform=1&src=×tamp=1615203815&userId=2009598099&sqSv=1.0&appVer=4.3.2.0&placeId=&sign=b77af743fec3404e92ff6f66fdfda460&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26stopPullRefresh%3D1%26from%3DShuqiTab%26upf%3D20368%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2009598099%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5NTk4MDk5IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMjE1MywidXNlcklkIjoiMjAwOTU5ODA5OSIsImlhdCI6MTYxNTIwMzc1Mywib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.eOuJnNgwzSj3Eo9L4LZwpCJd3covdcfZtoFNEyyA0DO3WENlkXImgM9Abvc10FiOR345-xWS8fX26bDBhqfJvw%26skinColor%3D23B383%26platform%3D1%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 AliApp(shuqi/4.3.2.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.2.0) 1536x2048 Winding(WV_3) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/welfare_page_v2/?serviceWorkerOn=1&stopPullRefresh=1&from=ShuqiTab&upf=20368&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2009598099&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.2.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5NTk4MDk5IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMjE1MywidXNlcklkIjoiMjAwOTU5ODA5OSIsImlhdCI6MTYxNTIwMzc1Mywib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.eOuJnNgwzSj3Eo9L4LZwpCJd3covdcfZtoFNEyyA0DO3WENlkXImgM9Abvc10FiOR345-xWS8fX26bDBhqfJvw&skinColor=23B383&platform=iOS&ver=210122&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1261\",\"Accept-Language\":\"zh-cn\"}"},{"key":"vediogoldprizeck2","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2009598099%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5NTk4MDk5IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMjIwOCwidXNlcklkIjoiMjAwOTU5ODA5OSIsImlhdCI6MTYxNTIwMzgwOCwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Gz_KtVchr9Byu2AP9qDM3fGjryYadk_7DxhPyRBx_XEaMZ1ZznJghVwz2OYE3ZU3JrRovlJcw4aRmlE6peIL7w%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=525&key=sq_app_ad&miniWua=HHnB_za7JjTTbywK0l069eXhM8MOBgScaFKp5JInj1nA2ccs%3D&platform=iOS&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=626&sign=035B9680B04A5D53401F97B152BAA5A6×tamp=1615203859&userId=2009598099&user_id=2009598099&wua=HIVW_lpvYlSHfPvMEm4ydlVVMy0gxbi0e%2Bekc3mLS6mjYA8NHodMFcCi1iXjOwJyNrBn7vLkcDqt8wIBhuhzyzgyOMe/T4BdY9dKo6w%2BnphNg/iowu3J6A%2B25ld27cjnDHAHYVx1txf7GE0s6wnHjZ1NxYtpn%2BnDWvrcxhGz30YNzM/5X/gLoQYn43xL3POovMbT9I5bP69sYACK13E%2B4XWcRSw%3D%3D&&{\"Cookie\":\"isg=BGVlUM-6aSLe_43-2sAD5Qiefiefohk0BAbJ4mdKNRyrfobwL_OjBWoODmQI5THs; cna=OvvMGP+BHlMCAXcsPUzFAIWr\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1569\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"vediodrawprizeck2","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2009598099%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5NTk4MDk5IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMjI3NiwidXNlcklkIjoiMjAwOTU5ODA5OSIsImlhdCI6MTYxNTIwMzg3Niwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.qIn9z3_Xm1HqRM94dVWg9y_1zG7KGt17zJloUvOJ6p4mfYtKVM0E5un1YV1v30JeCrb7RrKgeJkHNeLoqL7pvw%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=711&key=sq_app_ad&miniWua=HHnB_SCNQPTFFyLJ%2Bt68TOYpdwtZdAESfvB5FnE5udPAWKSs%3D&platform=iOS&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=703&sign=2E70F3A269CAC756267DD53966F7AFF5×tamp=1615204165&userId=2009598099&user_id=2009598099&wua=HIVW_Dw/VFQA7rhedNyTDZrgZ4%2B4L7gh%2Bji4qz98ry%2BE/eSI2azOqlRU1pmBctOXijNmkyXI%2BYvEIvqfZZl/nZAzVvlj/RiDCBX3AO6G0PUV8LEUFjNXMDFQh/ohL9DDcddxBDAVYs6J39140aEvZ2A6s/9v2joYhgPIsGtAlL7kYq3t%2BGZnH44f0uuKCcCTfz0Hdxes99rh/lEi1B75U6Ux47iRzT42yRH6DkqY8J0cJQeY%3D&&{\"Cookie\":\"isg=BHR0o95VqOGFXjyts_8ixiHZTzTmTZg3vSEYEQ7VAf-CeRbDNlwVx8wp_zehmtCP; cna=OvvMGP+BHlMCAXcsPUzFAIWr\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1589\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"drawck2","val":"wua=HIVW_o6uAn9RKPlXwEpB4Jf8J5U0EsmQgUN3DfF5JQZbyXE3ldFd3XWxb2KUWcBJWd4Vp6buJ71O7nrYU7hG3uZoJFy%2FTKnBt3asGMvodTQSJv71seKKbCIBZOuLsbbQ29wx%2BdyhlDyn%2FXwXd2jNhqtsqUsLUy0SqPgLGCYhcV2OMBoAEK4NNgU%2B8hfzevI07fcgNesLohqXeiUarHl7KkZSJs06izoL%2BRt36zJbkWthUhEWZeM%2FkKvZ6FVDWNYKbhfQ0jR3x5g13pCCMfb9MImtC9R3STZ36u6941033aTqWEoEvaDzzhJ%2BHCd1nQBfYStJc7zRsnQv75OxYqp3%2Fg3%2FDm7o%2FGa5UVy5HyqXvUU5I3PktvYsZ%2BhSphYKr8fup6C%2Ff&ua=&userId=2009598099&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&secureDeviceType=ios&secureAppName=wenxue-activity-proxy&asac=2A20C07RJ9F51AOEFSNHDR×tamp=1615204430&activityId=311&lotteryNum=1&sessionId=1&useGoldcoinType=0&sqSv=1.0&sign=313bd248d39d5f104b08264e27e4de66&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26asac%3D2A20C07RJ9F51AOEFSNHDR%26spm%3Da2oun.page_render_sq_welfare_welfare_page_v2.%25E6%258B%259B%25E8%25B4%25A2%25E7%258C%25AB.turntable_in_0%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2009598099%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.3.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5NTk4MDk5IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMjc2OCwidXNlcklkIjoiMjAwOTU5ODA5OSIsImlhdCI6MTYxNTIwNDM2OCwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.nddrTW_an0MDCZ3-m9q1NUgNkG-LOPVMW8bPB48NXwwi0RqFBSohNmVj5FVsF-4DbX9FEeUFjaCf70AkgGJa-w%26skinColor%3D23B383%26platform%3D1%26ver%3D210203%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/18D52 AliApp(shuqi/4.3.3.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.3.0) 1536x2048 Winding(WV_4) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/lottery_page/?serviceWorkerOn=1&asac=2A20C07RJ9F51AOEFSNHDR&spm=a2oun.page_render_sq_welfare_welfare_page_v2.%E6%8B%9B%E8%B4%A2%E7%8C%AB.turntable_in_0&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2009598099&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.3.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5NTk4MDk5IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMjc2OCwidXNlcklkIjoiMjAwOTU5ODA5OSIsImlhdCI6MTYxNTIwNDM2OCwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.nddrTW_an0MDCZ3-m9q1NUgNkG-LOPVMW8bPB48NXwwi0RqFBSohNmVj5FVsF-4DbX9FEeUFjaCf70AkgGJa-w&skinColor=23B383&platform=iOS&ver=210203&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1913\",\"Accept-Language\":\"zh-cn\"}"},{"key":"userinfock2","val":"https://ocean.shuqireader.com/api/activity/xapi/gold/record?userId=2009598099&page=1&pageSize=10&sqSv=1.0&sign=82871895e20da1331f9b6bef4dbfee1f&key=sq_h5_gateway&_public=fe-env%253Duae-prod%2526sdk%253D14.4%2526utdid%253DYDXtGFuwhAIDAGcg21DfxrSH%2526ustatus%253D1%2526first_placeid%253D111111%2526net_env%253Dwifi%2526placeid%253D111111%2526user_id%253D2009598099%2526sn%253DC8632262E5EC058F2691BD667236A56F746082BE%2526umidtoken%253DYDXtGFuwhAIDAGcg21DfxrSH%2526msv%253D8.0.0%2526brand%253DApple%2526imei%253DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%2526skinVersionPrefix%253D1%2526appVer%253D4.3.2.0%2526skinActiveColor%253D0F9970%2526manufacturer%253DApple%2526session%253DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5NTk4MDk5IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyMjI3NiwidXNlcklkIjoiMjAwOTU5ODA5OSIsImlhdCI6MTYxNTIwMzg3Niwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.qIn9z3_Xm1HqRM94dVWg9y_1zG7KGt17zJloUvOJ6p4mfYtKVM0E5un1YV1v30JeCrb7RrKgeJkHNeLoqL7pvw%2526skinColor%253D23B383%2526platform%253D1%2526ver%253D210122%2526mod%253DUnknowniPad%2526statusBarHeight%253D20.000000%2526skinVersion%253D1%2526wh%253D1536x2048%2526soft_id%253D21%2526utype%253Dvip%2526skinId%253D999%2526idfa%253DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4"},{"key":"readck3","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2009348883%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNTk3NiwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNTIwNzU3Niwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.WUp0wNdK835BMRX15Im8G04ET4tijKxyj5TM8MkTYPBQvyuB-j91A75auA9KbJtbA_L4puJeROVtDZ6HLXyoAQ%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=707&key=sq_app_ad&miniWua=HHnB_70yRWsW61lJG5OX6%2BMUudHZFYg9hcLkj%2BxvMbPDdRFY%3D&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=678&sign=E3F5854A2FBF611A70013E2F847FB225×tamp=1615207648&userId=2009348883&wua=HIVW_n3MnHspEDG36Jmnsw59uS8YNv40Leh7jXmOE6wiUFHZUXJg2Zd1Y6WpBbWdoUTsjKChFo8DMX4EQnO/BajP2/USH2Lp6oTvxsJW1KgUozoqZde6AWGTQwOLGrgIxO6lexEZt8FDtfGtCPgqu5r93zBvARWCeSUvYD7IsZSch1SAQo8y4WRdmkkeDnHePOnUlKKlHcC8U0sIp15A962NQjRcm0dL2gCbtUDzYqTRycNI%3D&&{\"Cookie\":\"isg=BNracSsMbpMcQuI_D56EwkRyIYb8C17lt83OYORThm04V3qRzJuu9aC3IaVLnNZ9; cna=fwjNGOvF2lMCAXcsPUzA/6EY\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1549\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"receivecoinck3","val":"platform=1&src=×tamp=1615207659&userId=2009348883&sqSv=1.0&appVer=4.3.2.0&placeId=&sign=ef5bf86291bad7c264519426df0c09fe&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26stopPullRefresh%3D1%26from%3DShuqiTab%26upf%3D20665%257CTag%2540Bucket%254029%2540290066149%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2009348883%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNTk3NiwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNTIwNzU3Niwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.WUp0wNdK835BMRX15Im8G04ET4tijKxyj5TM8MkTYPBQvyuB-j91A75auA9KbJtbA_L4puJeROVtDZ6HLXyoAQ%26skinColor%3D23B383%26platform%3D1%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 AliApp(shuqi/4.3.2.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.2.0) 1536x2048 Winding(WV_2) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/welfare_page_v2/?serviceWorkerOn=1&stopPullRefresh=1&from=ShuqiTab&upf=20665%7CTag@Bucket@29@290066149&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2009348883&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.2.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNTk3NiwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNTIwNzU3Niwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.WUp0wNdK835BMRX15Im8G04ET4tijKxyj5TM8MkTYPBQvyuB-j91A75auA9KbJtbA_L4puJeROVtDZ6HLXyoAQ&skinColor=23B383&platform=iOS&ver=210122&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1301\",\"Accept-Language\":\"zh-cn\"}"},{"key":"vediogoldprizeck3","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2009348883%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNTk3NiwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNTIwNzU3Niwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.WUp0wNdK835BMRX15Im8G04ET4tijKxyj5TM8MkTYPBQvyuB-j91A75auA9KbJtbA_L4puJeROVtDZ6HLXyoAQ%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=525&key=sq_app_ad&miniWua=HHnB_4fe3MT69Ikam%2BBahAOJiSvY3tvkY2qz9BkbfjI%2BVqDI%3D&platform=iOS&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=626&sign=6ECE5DE34066EFACA134CA61D5B0C72E×tamp=1615207707&userId=2009348883&user_id=2009348883&wua=HIVW_hx%2BszqG6CA8nYILkLmHOVOUyr7eCxcKZTte%2BDFlKLAHpI29NxuPl2jF9tOMn63gjS5MSbKA9ZoWp91t%2B4Nr4o8xVa8nKWzj2fkdv5/7COwb9O/grhiXCY3HkvSJpxfDGI%2B7Bd3yRL6tMyhlJ4l8h6ijhvZsaxp0RqdTbgg2RvZonaiXPAC7/XdBCbMR5yVo6F8PvzXFRRyp3zR5NK4U5ea6bu7UGcELRyxcJs5lUkfM%3D&&{\"Cookie\":\"isg=BFZW-48QKmcAQB7D63JAtihGrQpY95oxi3nSfMC_QznUg_QdKIaIQBUxH5lvMJJJ; cna=fwjNGOvF2lMCAXcsPUzA/6EY\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1589\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"vediodrawprizeck3","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2009348883%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNTk3NiwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNTIwNzU3Niwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.WUp0wNdK835BMRX15Im8G04ET4tijKxyj5TM8MkTYPBQvyuB-j91A75auA9KbJtbA_L4puJeROVtDZ6HLXyoAQ%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=711&key=sq_app_ad&miniWua=HHnB_9Vy0p3xuHnVFY6Ru4GYS6yyTLlDt7FiulzKIt7BeCMA%3D&platform=iOS&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=703&sign=9A1A4CCDC4F024DB2AE17DD3617C436A×tamp=1615207810&userId=2009348883&user_id=2009348883&wua=HIVW_K6SGcOTRalzh7y9Udhq1I0G4a0TnWw68OUs3hI1l%2BNmz7J0b8RLeM%2BSYnnjQBGHoQubxhWGrIgC%2BQejGmiFwdUxHkCC3teWBJUnRhROZrS4A8taylB2kZOURNIvvbSNgcvxgFNju7fLmtTfIJYZOKYfl9uSbIBNV/BveCNg6BXWN38DfVQ2wNjTVhAvGNFoO%2Bp//3q4ldbJfPoMG96mNZu7oXMHNkV8Ka0YsiihmYcg%3D&&{\"Cookie\":\"isg=BE1NmG76EWpmM7VG5N_Li--DVm_HKoH8bACuO4_SjeRThmU4V3grzkkE9pzgXZm0; cna=fwjNGOvF2lMCAXcsPUzA/6EY\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1585\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"drawck3","val":"wua=HIVW_f9UBW3aZT4bGw1XXDekoUKLHKqu4ado3zen6QCqGzHpqYhIyU3ucTDvLDjG8lay7%2BkIGr3DuMc6msBzIfYVUap8%2BLYXr9eFHyqZMIzbULzck0HIokN%2FKuR2at0gkTz0GQEZwxltG8BNhLnu2GreDN5S8CG%2Bj9O%2FnLi4cM79x7F7V1gblLrzV49C3EuhZ6f%2FjqRWQqwGm7xzOJknPPbMsF20632nV2%2FFS2tqphrbBR2w%3D&ua=&userId=2009348883&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&secureDeviceType=ios&secureAppName=wenxue-activity-proxy&asac=2A20C07RJ9F51AOEFSNHDR×tamp=1615207822&activityId=311&lotteryNum=1&sessionId=1&useGoldcoinType=0&sqSv=1.0&sign=3b310a3a3f9228eb2405d62a6871d23b&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26asac%3D2A20C07RJ9F51AOEFSNHDR%26spm%3Da2oun.page_render_sq_welfare_welfare_page_v2.%25E6%258B%259B%25E8%25B4%25A2%25E7%258C%25AB.turntable_in_0%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2009348883%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNTk3NiwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNTIwNzU3Niwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.WUp0wNdK835BMRX15Im8G04ET4tijKxyj5TM8MkTYPBQvyuB-j91A75auA9KbJtbA_L4puJeROVtDZ6HLXyoAQ%26skinColor%3D23B383%26platform%3D1%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 AliApp(shuqi/4.3.2.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.2.0) 1536x2048 Winding(WV_4) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/lottery_page/?serviceWorkerOn=1&asac=2A20C07RJ9F51AOEFSNHDR&spm=a2oun.page_render_sq_welfare_welfare_page_v2.%E6%8B%9B%E8%B4%A2%E7%8C%AB.turntable_in_0&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2009348883&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.2.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNTk3NiwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNTIwNzU3Niwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.WUp0wNdK835BMRX15Im8G04ET4tijKxyj5TM8MkTYPBQvyuB-j91A75auA9KbJtbA_L4puJeROVtDZ6HLXyoAQ&skinColor=23B383&platform=iOS&ver=210122&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1757\",\"Accept-Language\":\"zh-cn\"}"},{"key":"userinfock3","val":"https://ocean.shuqireader.com/api/activity/xapi/gold/record?userId=2009348883&page=1&pageSize=10&sqSv=1.0&sign=cf69eae8eed04474afb6e25aa51caa01&key=sq_h5_gateway&_public=fe-env%253Duae-prod%2526sdk%253D14.4%2526utdid%253DYDXtGFuwhAIDAGcg21DfxrSH%2526ustatus%253D1%2526first_placeid%253D111111%2526net_env%253Dwifi%2526placeid%253D111111%2526user_id%253D2009348883%2526sn%253DC8632262E5EC058F2691BD667236A56F746082BE%2526umidtoken%253DYDXtGFuwhAIDAGcg21DfxrSH%2526msv%253D8.0.0%2526brand%253DApple%2526imei%253DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%2526skinVersionPrefix%253D1%2526appVer%253D4.3.2.0%2526skinActiveColor%253D0F9970%2526manufacturer%253DApple%2526session%253DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNTk3NiwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNTIwNzU3Niwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.WUp0wNdK835BMRX15Im8G04ET4tijKxyj5TM8MkTYPBQvyuB-j91A75auA9KbJtbA_L4puJeROVtDZ6HLXyoAQ%2526skinColor%253D23B383%2526platform%253D1%2526ver%253D210122%2526mod%253DUnknowniPad%2526statusBarHeight%253D20.000000%2526skinVersion%253D1%2526wh%253D1536x2048%2526soft_id%253D21%2526utype%253Dvip%2526skinId%253D999%2526idfa%253DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4"},{"key":"readck4","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2012222182%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEyMjIyMTgyIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjQzOSwidXNlcklkIjoiMjAxMjIyMjE4MiIsImlhdCI6MTYxNTIwODAzOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Ch2c_o56glaCdHAhBY_TNS5BIUiYpC8yBtCy3DK1pvMKkSA3g70X2_WHrlDKPVvPy4KMt2Q1vtG7T2LBNc8JGg%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=707&key=sq_app_ad&miniWua=HHnB_qVK5MzJHU%2BjV1HsGe2LHL4dK0pJykaEqJ45nBibdglk%3D&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=678&sign=0B2F4A07F99E90B5AE026D2110479C02×tamp=1615208149&userId=2012222182&wua=HIVW_ATBT6H%2BUatupu8tJBt7J4ZfjDrAL1/cigO7c6V9ZmnXWiZUJdwwaYIoBccgUw3VhS8DUyQQG8Bwq0ZXDpT8m1fYlvd69Nsdgyf0Sjcw3vPpyORkbFvQhWTrCp0Snm/vPWyt/VBGV4cVB/1qqaTTUoHUI0qWOUQ7Bq5DuHByW844rdguyPoS2E4Gppw%2B0quVOOQ8XYBX5kJmDIj47Ky5IHQ%3D%3D&&{\"Cookie\":\"isg=BGhox09cnE1AmrDJzMmaClxrM1B6kcybXlmNkSKZtOPWfQjnyqGcK_6tc5ON1oRz; cna=PwzNGGG7QQUCAXcsPUyjlftm\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1533\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"receivecoinck4","val":"platform=1&src=×tamp=1615208159&userId=2012222182&sqSv=1.0&appVer=4.3.2.0&placeId=&sign=f38e955db07dc5f353de595bcdf1ea63&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26stopPullRefresh%3D1%26from%3DShuqiTab%26upf%3D20368%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2012222182%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEyMjIyMTgyIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjQzOSwidXNlcklkIjoiMjAxMjIyMjE4MiIsImlhdCI6MTYxNTIwODAzOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Ch2c_o56glaCdHAhBY_TNS5BIUiYpC8yBtCy3DK1pvMKkSA3g70X2_WHrlDKPVvPy4KMt2Q1vtG7T2LBNc8JGg%26skinColor%3D23B383%26platform%3D1%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/18D52 AliApp(shuqi/4.3.2.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.2.0) 1536x2048 Winding(WV_3) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/welfare_page_v2/?serviceWorkerOn=1&stopPullRefresh=1&from=ShuqiTab&upf=20368&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2012222182&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.2.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEyMjIyMTgyIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjQzOSwidXNlcklkIjoiMjAxMjIyMjE4MiIsImlhdCI6MTYxNTIwODAzOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Ch2c_o56glaCdHAhBY_TNS5BIUiYpC8yBtCy3DK1pvMKkSA3g70X2_WHrlDKPVvPy4KMt2Q1vtG7T2LBNc8JGg&skinColor=23B383&platform=iOS&ver=210122&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1261\",\"Accept-Language\":\"zh-cn\"}"},{"key":"vediogoldprizeck4","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2012222182%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEyMjIyMTgyIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjQzOSwidXNlcklkIjoiMjAxMjIyMjE4MiIsImlhdCI6MTYxNTIwODAzOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Ch2c_o56glaCdHAhBY_TNS5BIUiYpC8yBtCy3DK1pvMKkSA3g70X2_WHrlDKPVvPy4KMt2Q1vtG7T2LBNc8JGg%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=525&key=sq_app_ad&miniWua=HHnB_zmwxMtw46SCk77sjRN4gA/JGoVeoIyWoJ6MJhowesPw%3D&platform=iOS&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=626&sign=ABB9618B547F1BCCCA1BE768942C77B5×tamp=1615208195&userId=2012222182&user_id=2012222182&wua=HIVW_M1Uf2x6VhRhZP4ljTmjhR8vXND8DPRkHj8Amdfbdg4a7/zgbpdLj3sAU4J24SropDX7tCPYsWkIoE68v8NYJTfjOJXxISzrM1qfyBA1sEapk0dFKpQf1EbdvC%2BybFDpQ4lTGdHerOtct7%2BkP29mC2euqKsvQ11ofu2y%2BA2IAE9x6xMNaaWtDEiws98bvtaszIF7ItpHdh%2B9d7oRxQnz0UbejmOIi%2B3RpI79/8eEqajQ%3D&&{\"Cookie\":\"isg=BAoK57m2XgOuD9Kv2vMYlMKxUfas-45VcNMvd5RDt93oR6gBfIpEZM71UzWbrAbt; cna=PwzNGGG7QQUCAXcsPUyjlftm\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1587\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"vediodrawprizeck4","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2012222182%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEyMjIyMTgyIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjQzOSwidXNlcklkIjoiMjAxMjIyMjE4MiIsImlhdCI6MTYxNTIwODAzOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Ch2c_o56glaCdHAhBY_TNS5BIUiYpC8yBtCy3DK1pvMKkSA3g70X2_WHrlDKPVvPy4KMt2Q1vtG7T2LBNc8JGg%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=711&key=sq_app_ad&miniWua=HHnB_0QgRj9bf1vAiajDbfUEZnFwsXbLo%2BHn8J0IS0zSyy9s%3D&platform=iOS&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=703&sign=CD79E0031C40BD49719057E564D383BD×tamp=1615208324&userId=2012222182&user_id=2012222182&wua=HIVW_kKKs3kRGuHgZihJ/hKOzyFWbq2S1iOGIojJsmXsnRtbZaKOZ2%2BpKgrY8KuSHnvkCbB7csUz6EOhpT5idOy8zaprQqI6jByONoIYIWQDGUUEPqPpGAO9OJVeZKnxYdhhQ/km18wy7KQ2HPyqYGY5n96NyaS8XE90S/Z7dIDRWg/8JRKaJT310D6MiW2i/oxqGwRqGEVP7UBey6mztHYjDRzM4ITEJPYHFgYN8yxw/Cek%3D&&{\"Cookie\":\"isg=BP__gwuNo3BCGadsn7x1Bz_WhNWJ5FOGnfAL6pHMmq71oB0imbVj1pby5vZe4yv-; cna=PwzNGGG7QQUCAXcsPUyjlftm\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1581\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"drawck4","val":"wua=HIVW_UHb5zJgOQvTBlNx2VpHo%2B%2FgQww3UjQDTOA4Xzhuu7xsXkqelIa2mDGGxHe6rG1mhi4%2F9qpW9unI%2BRbSn5iykQ9wVMnIfTEOa65%2BhOtWWqq2mLUQHvVhUBHK66Z1r%2BbIpnBV10B3g3i51OK9qbFuBvr9bcg1wr3LlI4OO3DgrLlm52e5ykeDstl9IitJ%2Fk2dndZt28txVtocXjBXBKwJExw3vRzbB4f1qkggZ44lpaqE%3D&ua=&userId=2012222182&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&secureDeviceType=ios&secureAppName=wenxue-activity-proxy&asac=2A20C07RJ9F51AOEFSNHDR×tamp=1615208328&activityId=311&lotteryNum=1&sessionId=1&useGoldcoinType=0&sqSv=1.0&sign=20cf2f4f0342cc98c2cc8743c88053a3&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26asac%3D2A20C07RJ9F51AOEFSNHDR%26spm%3Da2oun.page_render_sq_welfare_welfare_page_v2.%25E6%258B%259B%25E8%25B4%25A2%25E7%258C%25AB.turntable_in_0%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2012222182%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEyMjIyMTgyIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjQzOSwidXNlcklkIjoiMjAxMjIyMjE4MiIsImlhdCI6MTYxNTIwODAzOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Ch2c_o56glaCdHAhBY_TNS5BIUiYpC8yBtCy3DK1pvMKkSA3g70X2_WHrlDKPVvPy4KMt2Q1vtG7T2LBNc8JGg%26skinColor%3D23B383%26platform%3D1%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/18D52 AliApp(shuqi/4.3.2.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.2.0) 1536x2048 Winding(WV_5) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/lottery_page/?serviceWorkerOn=1&asac=2A20C07RJ9F51AOEFSNHDR&spm=a2oun.page_render_sq_welfare_welfare_page_v2.%E6%8B%9B%E8%B4%A2%E7%8C%AB.turntable_in_0&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2012222182&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.2.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEyMjIyMTgyIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjQzOSwidXNlcklkIjoiMjAxMjIyMjE4MiIsImlhdCI6MTYxNTIwODAzOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Ch2c_o56glaCdHAhBY_TNS5BIUiYpC8yBtCy3DK1pvMKkSA3g70X2_WHrlDKPVvPy4KMt2Q1vtG7T2LBNc8JGg&skinColor=23B383&platform=iOS&ver=210122&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1757\",\"Accept-Language\":\"zh-cn\"}"},{"key":"userinfock4","val":"https://ocean.shuqireader.com/api/activity/xapi/gold/record?userId=2012222182&page=1&pageSize=10&sqSv=1.0&sign=4e97e1d0cc3167913699e1b79b347ede&key=sq_h5_gateway&_public=fe-env%253Duae-prod%2526sdk%253D14.4%2526utdid%253DYDXtGFuwhAIDAGcg21DfxrSH%2526ustatus%253D1%2526first_placeid%253D111111%2526net_env%253Dwifi%2526placeid%253D111111%2526user_id%253D2012222182%2526sn%253DC8632262E5EC058F2691BD667236A56F746082BE%2526umidtoken%253DYDXtGFuwhAIDAGcg21DfxrSH%2526msv%253D8.0.0%2526brand%253DApple%2526imei%253DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%2526skinVersionPrefix%253D1%2526appVer%253D4.3.2.0%2526skinActiveColor%253D0F9970%2526manufacturer%253DApple%2526session%253DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDEyMjIyMTgyIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjQzOSwidXNlcklkIjoiMjAxMjIyMjE4MiIsImlhdCI6MTYxNTIwODAzOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Ch2c_o56glaCdHAhBY_TNS5BIUiYpC8yBtCy3DK1pvMKkSA3g70X2_WHrlDKPVvPy4KMt2Q1vtG7T2LBNc8JGg%2526skinColor%253D23B383%2526platform%253D1%2526ver%253D210122%2526mod%253DUnknowniPad%2526statusBarHeight%253D20.000000%2526skinVersion%253D1%2526wh%253D1536x2048%2526soft_id%253D21%2526utype%253Dvip%2526skinId%253D999%2526idfa%253DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4"},{"key":"readck5","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2022437835%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDIyNDM3ODM1IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjg3NSwidXNlcklkIjoiMjAyMjQzNzgzNSIsImlhdCI6MTYxNTIwODQ3NSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.BPY3vgzuv9yWgsBFhcCreM5vOho9yzn0aR1dTDv1G16W2-RTb_rEw6aWH-Hg7LTtTy3BgjQkLP6ZnBZeH-9GnA%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=707&key=sq_app_ad&miniWua=HHnB_6qhiX3a8f4yzTB2V8HHmG8300DVHhfipogFMfkCGv94%3D&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=678&sign=96EC7557B1183F33667930708BB8AFD4×tamp=1615208598&userId=2022437835&wua=HIVW_MWCZ3JUJPCZR4ENOVFBakEldKjnEV8lCzIr0OwSEwRE0BKxIeQ3Ng7bUi9ebhxVr6qptmCRDBTRcgXfgXmdiRSF4XYprZiOj3sM5xknGb9OGdAk5UdrVPlIntDqhR27ZIhvhj360JZtJF/nw%2BJ%2BVyNdmlwA5rjD3MLzWDQA/OPpu1YITioF79m2keQEkMJd4QoOYss4TIYKaTq7fobonO7j3e7NW81gYui2gm8UzHq4%3D&&{\"Cookie\":\"isg=BO3tuIencQo7eBVmv6E5mILg9o9nSiEcW9Kofi_yKQTzpg1Y95ox7DtmlvxAPTnU; cna=Ag7NGICy3GsCAXcsPUxY0unM\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1549\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"receivecoinck5","val":"platform=1&src=×tamp=1615208610&userId=2022437835&sqSv=1.0&appVer=4.3.2.0&placeId=&sign=6d7964812543cc20e35b6b4cf71c460f&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26stopPullRefresh%3D1%26upf%3D20559%26from%3DShuqiTab%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2022437835%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDIyNDM3ODM1IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjg3NSwidXNlcklkIjoiMjAyMjQzNzgzNSIsImlhdCI6MTYxNTIwODQ3NSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.BPY3vgzuv9yWgsBFhcCreM5vOho9yzn0aR1dTDv1G16W2-RTb_rEw6aWH-Hg7LTtTy3BgjQkLP6ZnBZeH-9GnA%26skinColor%3D23B383%26platform%3D1%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/18D52 AliApp(shuqi/4.3.2.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.2.0) 1536x2048 Winding(WV_3) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/welfare_page_v2/?serviceWorkerOn=1&stopPullRefresh=1&upf=20559&from=ShuqiTab&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2022437835&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.2.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDIyNDM3ODM1IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjg3NSwidXNlcklkIjoiMjAyMjQzNzgzNSIsImlhdCI6MTYxNTIwODQ3NSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.BPY3vgzuv9yWgsBFhcCreM5vOho9yzn0aR1dTDv1G16W2-RTb_rEw6aWH-Hg7LTtTy3BgjQkLP6ZnBZeH-9GnA&skinColor=23B383&platform=iOS&ver=210122&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1261\",\"Accept-Language\":\"zh-cn\"}"},{"key":"vediogoldprizeck5","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2022437835%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDIyNDM3ODM1IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjg3NSwidXNlcklkIjoiMjAyMjQzNzgzNSIsImlhdCI6MTYxNTIwODQ3NSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.BPY3vgzuv9yWgsBFhcCreM5vOho9yzn0aR1dTDv1G16W2-RTb_rEw6aWH-Hg7LTtTy3BgjQkLP6ZnBZeH-9GnA%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=525&key=sq_app_ad&miniWua=HHnB_PToyNUNtQzcNmlVPrLCBZf%2Bmpz8gWaqU9PFua8T1uSU%3D&platform=iOS&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=626&sign=427B301EA14B8E4B719A197E50114636×tamp=1615208651&userId=2022437835&user_id=2022437835&wua=HIVW_dvIbYedeJzhwgGNWHossiEsYSXOn2zzX1/HhS0eQst1jx73t65IqPwf2L1vm6WIZhaVCyEX1o0uGNTe0UbGLK%2BUPtkhFYKMEpQjjs/YJ/uQlXwCw0bSmTonjZMGAXfWDmsB2k7kzYas0TjfRfkFb5Gy77ge%2BXIL7ufzFwN25gYJwfTCaGr2/36Tqv0A9GmQPm%2BXk/h/hc5jf%2BYsn5paZClii9TNKTGV4vuE9MBKZIBw%3D&&{\"Cookie\":\"isg=BJ-frUlpAxDdKgcMAR-L0mRGJPUpBPOm_fTaFDHsOc6VwLtCOdX797zShta-w8se; cna=Ag7NGICy3GsCAXcsPUxY0unM\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1587\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"vediodrawprizeck5","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26user_id%3D2022437835%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDIyNDM3ODM1IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNzk2MSwidXNlcklkIjoiMjAyMjQzNzgzNSIsImlhdCI6MTYxNTIwOTU2MSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.w5t-HUmBNlH49fMheViZuSzPCVvd81hWP1mGfOHStHsijLUpPFXTvbnIb2SfGHnQWPMJBxAxz9JT5V47ly4RRQ%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=711&key=sq_app_ad&miniWua=HHnB_%2BUbWNt0HadZwY1k5bggeCK8tdx2XsAeqzG8CDY8fdLs%3D&platform=iOS&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=703&sign=690C41BCBB2D2649B830168B76868CDD×tamp=1615210666&userId=2022437835&user_id=2022437835&wua=HIVW_BVlFpDsYiWZdU9TE0FXe4ydkqN%2BqODyaMMq5UR5L7THM/yuN1n9KiTKwwE/YPH%2BEzFxSH6TWwZHfIC/CZj1ni/wQ8QuQxkkYPiSscY/rYM8UKF8EwB/Tlaf9x4uI3hZsF5fKdRPV29kKHtH33c8lJ7TqbYBTCMwgwgTe5yPRl4thNxR/GfpGqTLdcWPylL0w5I8lZeUP73I2ct6ml%2BfoloQpcQEw4YOJFiaWXJWeOYM%3D&&{\"Cookie\":\"isg=BMPDNUCrp2ypdGsYxdOvfmhSWIFtOFd6YSgQPPWgHSKZtOfWfQmfykRmKsL6D69y; cna=Ag7NGICy3GsCAXcsPUxY0unM\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.2 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1585\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"drawck5","val":"wua=HIVW_PoCCbc8hymz%2FH2vijnQ8%2BwvJUydG%2BnkuEpfMzrF%2FVdRf0vvhodD%2F%2BsyMepu5%2BXLORg1rcYho2grkrzGce3LqI7wTV22NFFKZOT9M1yBGi2tvGd45AqZnwyQx7hJpTJvuvFz9AvfO4ypjWJYt9pxbwKOM3X5xqsuwnCI%2FaTmc%2Bn8J0D0GcLXhxtnsrpHjvBnl%2FROlGkuQV2kDqDjWAYilN82qKxL4xGnb0IvW%2Bj8gqgo%3D&ua=&userId=2022437835&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&secureDeviceType=ios&secureAppName=wenxue-activity-proxy&asac=2A20C07RJ9F51AOEFSNHDR×tamp=1615208830&activityId=311&lotteryNum=1&sessionId=1&useGoldcoinType=0&sqSv=1.0&sign=c5ca4d99741575b950bf641b408b37f0&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26asac%3D2A20C07RJ9F51AOEFSNHDR%26spm%3Da2oun.page_render_sq_welfare_welfare_page_v2.%25E6%258B%259B%25E8%25B4%25A2%25E7%258C%25AB.turntable_in_0%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2022437835%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3DYDXtGFuwhAIDAGcg21DfxrSH%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.2.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDIyNDM3ODM1IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjg3NSwidXNlcklkIjoiMjAyMjQzNzgzNSIsImlhdCI6MTYxNTIwODQ3NSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.BPY3vgzuv9yWgsBFhcCreM5vOho9yzn0aR1dTDv1G16W2-RTb_rEw6aWH-Hg7LTtTy3BgjQkLP6ZnBZeH-9GnA%26skinColor%3D23B383%26platform%3D1%26ver%3D210122%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/18D52 AliApp(shuqi/4.3.2.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.2.0) 1536x2048 Winding(WV_4) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/lottery_page/?serviceWorkerOn=1&asac=2A20C07RJ9F51AOEFSNHDR&spm=a2oun.page_render_sq_welfare_welfare_page_v2.%E6%8B%9B%E8%B4%A2%E7%8C%AB.turntable_in_0&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2022437835&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=YDXtGFuwhAIDAGcg21DfxrSH&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.2.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDIyNDM3ODM1IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjg3NSwidXNlcklkIjoiMjAyMjQzNzgzNSIsImlhdCI6MTYxNTIwODQ3NSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.BPY3vgzuv9yWgsBFhcCreM5vOho9yzn0aR1dTDv1G16W2-RTb_rEw6aWH-Hg7LTtTy3BgjQkLP6ZnBZeH-9GnA&skinColor=23B383&platform=iOS&ver=210122&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1765\",\"Accept-Language\":\"zh-cn\"}"},{"key":"userinfock5","val":"https://ocean.shuqireader.com/api/activity/xapi/gold/record?userId=2022437835&page=1&pageSize=10&sqSv=1.0&sign=d1086d68d2a71fa07906f04b4b9c70ac&key=sq_h5_gateway&_public=fe-env%253Duae-prod%2526sdk%253D14.4%2526utdid%253DYDXtGFuwhAIDAGcg21DfxrSH%2526ustatus%253D1%2526first_placeid%253D111111%2526net_env%253Dwifi%2526placeid%253D111111%2526user_id%253D2022437835%2526sn%253DC8632262E5EC058F2691BD667236A56F746082BE%2526umidtoken%253DYDXtGFuwhAIDAGcg21DfxrSH%2526msv%253D8.0.0%2526brand%253DApple%2526imei%253DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%2526skinVersionPrefix%253D1%2526appVer%253D4.3.2.0%2526skinActiveColor%253D0F9970%2526manufacturer%253DApple%2526session%253DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDIyNDM3ODM1IiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNTcyNjg3NSwidXNlcklkIjoiMjAyMjQzNzgzNSIsImlhdCI6MTYxNTIwODQ3NSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.BPY3vgzuv9yWgsBFhcCreM5vOho9yzn0aR1dTDv1G16W2-RTb_rEw6aWH-Hg7LTtTy3BgjQkLP6ZnBZeH-9GnA%2526skinColor%253D23B383%2526platform%253D1%2526ver%253D210122%2526mod%253DUnknowniPad%2526statusBarHeight%253D20.000000%2526skinVersion%253D1%2526wh%253D1536x2048%2526soft_id%253D21%2526utype%253Dvip%2526skinId%253D999%2526idfa%253DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4"},{"key":"readck6","val":""},{"key":"receivecoinck6","val":""},{"key":"vediogoldprizeck6","val":""},{"key":"vediodrawprizeck6","val":""},{"key":"drawck6","val":""},{"key":"userinfock6","val":""},{"key":"readck7","val":""},{"key":"receivecoinck7","val":""},{"key":"vediogoldprizeck7","val":""},{"key":"vediodrawprizeck7","val":""},{"key":"drawck7","val":""},{"key":"userinfock7","val":""},{"key":"readck8","val":""},{"key":"receivecoinck8","val":""},{"key":"vediogoldprizeck8","val":""},{"key":"vediodrawprizeck8","val":""},{"key":"drawck8","val":""},{"key":"userinfock8","val":""},{"key":"readck9","val":""},{"key":"receivecoinck9","val":""},{"key":"vediogoldprizeck9","val":""},{"key":"vediodrawprizeck9","val":""},{"key":"drawck9","val":""},{"key":"userinfock9","val":""},{"key":"readck10","val":""},{"key":"receivecoinck10","val":""},{"key":"vediogoldprizeck10","val":""},{"key":"vediodrawprizeck10","val":""},{"key":"drawck10","val":""},{"key":"userinfock10","val":""}],"sessions":[{"id":"95592a22-c1ba-463a-84f3-c08f0c241378","name":"会话 2","appId":"sqxh","appName":"书旗小说","enable":true,"createTime":"2021-02-24T12:27:18.219Z","datas":[{"key":"readck1","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3D90tLeFNLOsIr/DV30zY/RC3e7yMfccP5%26user_id%3D2009348883%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.3.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNDY4NjkyOSwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNDE2ODUyOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Z3ume3xoTkVKrUdFkhAollD9ArAYit2-ScE-Hi1V1k2aFhfnGImvVOnJ-1lSJk6d3IfUPLQGxQJXVskNY5mPcw%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210203%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=707&key=sq_app_ad&miniWua=HHnB_6M9oxivTm6pYAO0E/shhl0jJY0TN8fpesJhXkAuG34u/fZGp9pNXztLYQNkmKOIy/6%2B%2BdsPP0gy8U6Kh4IdmPzRSgLUVipT067g%2BCTtNHHXEUJyR102uV39pqb6DdjAj&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=678&sign=A94927F654AF9BF76732021FD0D39E5B×tamp=1614168870&userId=2009348883&wua=HIVW_rwCxT7U20wkwqnT7i2cq%2B1ZF67%2B/b4btC2MJOwRLk3bRHL0hGkhX4c43rFtOAf8xLvn/TMDxAXym38KOpb1BnP7x60OTe7FixgF5N4v91ybkF/VheIfhNaD38QFiBy2WdyGppmraTlpqqqq09x0fHXRwCfgLy/ulMCQtRYXkqqa%2Bj8FGpydbcBLCpnrTFymkWe%2B%2BnCCLDiZT7zVfS1PqsdO15WB8alsd/jzPVAy2Ii7exvnTqLlo3syz4Ry8EieRqdjO2X0NNMgXwfepJg5Oo%2B1/ysUb9WI/zemjLKvtzrdEOz3FlMly8xuO%2BHztGDiBmoR4k0zEoLkC0dOM%2BX0UzEAs%2BXiaUFbNph2GnAWnsnsk%2Bt59WBvDvMJj3WL2L4qj&&{\"Cookie\":\"isg=BNvb7p3GP1Sa90MgnwxIFsHIYDlFsO-yaoEcjM0YtlrxrPmOVYKvA2U8QIoil0eq; cna=RBC9GK9vZRQCAXcsPW6XxNXq\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.3 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1807\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"receivecoinck1","val":"platform=1&src=×tamp=1614168885&userId=2009348883&sqSv=1.0&appVer=4.3.3.0&placeId=&sign=a2cef0401745d1fce3c3725034036f93&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26stopPullRefresh%3D1%26from%3DShuqiTab%26upf%3D20368%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2009348883%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3D90tLeFNLOsIr%252FDV30zY%252FRC3e7yMfccP5%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.3.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNDY4NjkyOSwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNDE2ODUyOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Z3ume3xoTkVKrUdFkhAollD9ArAYit2-ScE-Hi1V1k2aFhfnGImvVOnJ-1lSJk6d3IfUPLQGxQJXVskNY5mPcw%26skinColor%3D23B383%26platform%3D1%26ver%3D210203%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 AliApp(shuqi/4.3.3.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.3.0) 1536x2048 Winding(WV_2) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/welfare_page_v2/?serviceWorkerOn=1&stopPullRefresh=1&from=ShuqiTab&upf=20368&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2009348883&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=90tLeFNLOsIr%2FDV30zY%2FRC3e7yMfccP5&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.3.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNDY4NjkyOSwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNDE2ODUyOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Z3ume3xoTkVKrUdFkhAollD9ArAYit2-ScE-Hi1V1k2aFhfnGImvVOnJ-1lSJk6d3IfUPLQGxQJXVskNY5mPcw&skinColor=23B383&platform=iOS&ver=210203&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1277\",\"Accept-Language\":\"zh-cn\"}"},{"key":"vediogoldprizeck1","val":"_public=skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26umidtoken%3Dvy5LDJ9LOstk3zV306xqwLR8ddXgcDob%26user_id%3D2009348883%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26placeid%3D111111%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.3.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNDY4NDY1MCwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNDE2NjI1MCwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.gxoggxh3_z7g455n2tiX8rbBnwL_OXdlF57YhB7IY77VGqgliwi6XqoAxIy4ELEk9qKGHhJu5JaPYAIs4CQwSQ%26skinColor%3D23B383%26platform%3DiOS%26ver%3D210203%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26utype%3Dvip%26sdk%3D14.4&deliveryId=525&key=sq_app_ad&miniWua=HHnB_6PqtQKjP70qZ2krBVo1RSEJk7/kRAUTHcSOSj8bQcYW4v1nG6xnrwmBOfT8VnwV6YTgZglHVY3PT44z%2BKY1lqkxFpkf8XFIFOnMLrbAhM9aY4MHpo9noPaiGHCo3Or50&platform=iOS&reqEncryptParam=%3A&reqEncryptType=-1&requestSrc=shuqi&resEncryptType=-1&resourceId=626&sign=CE7873C767B892B6DCC11CC92619C704×tamp=1614166298&userId=2009348883&user_id=2009348883&wua=HIVW_ivKXNZm4bdnU41JBlpAhEA20ej2ouD7RQE8YvNzbHa0auyIbvt0YephXFpB59fjAep/eKl6mRhSDV%2Bkl/G0wL4F6FDV02aqhoWBqGDWznEfI5A89GbhfDXGd0Ojfq7y0XR/Za3z35S13FjzzUFBIV5v6JFfZNDtdMLyK7pD93hhgMFkiSl726Ke5ly5Z8%2BoQCmexRrZtvTJb038WyJ2wc/mD60uQ9XWHpOD8zPXbHXbZANZn3I/NP8ALTbcOp9Zrl7vT7mjmWxpj5Kd1XLBIdqTY21b/J%2BA1/MeYFnhEunOChH22XFFIB4DuBYhwRKdsJFEl%2Bkx79otRqFbi9kaWycqKAGMS9S%2BXUZVG15f24RwQ49bl37aHPDUvcrD9z%2Br4&&{\"Cookie\":\"isg=BKenjDm9i4j9xA8ESwBc-m2MPN1xLHsOVlM46XkUwjZdaMUqgf2cX0Uqju52m1OG; cna=RBC9GK9vZRQCAXcsPW6XxNXq\",\"Accept\":\"*/*\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"shuqireader/4.3.3 (iPad; iOS 14.4; Scale/2.00)\",\"Content-Length\":\"1827\",\"Accept-Language\":\"zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8\"}"},{"key":"vediodrawprizeck1","val":""},{"key":"drawck1","val":"wua=HIVW_Cn47CvPtfgNVR3emu6TBSK1HWLAMDygt6BycVi1j93hX%2FL8ctEW0tDm%2B2WhE2%2B1z5Hz2VEXvFelizZMOcXb%2F%2Fm2PgBnCV9LiwgRpN8ia7EiomZoF94wY1RvAki0C2t5wwytYuR8rUW3vcf1WSZhTBt0lnAs4SAYqjpFJiDvzfOgqWyrkQXu1iQ%2BjjV5I0jrV31mp%2BsVbMKUaih9rum5gXyPEtQjP9uhlt3oec8UWrWf3eFcsDUEfFQKqZFR3YoqH0fj8S0qCZEkcY2tfo3IUjm12JwBub19znmI7062s9hlS1VCCuFe7%2Bt00KjLjifi4Bi0OE308K8mvY4xLmkGphyBg7JqbjkRdxypBGcZGT3169tNe3gb93M3Mc75B2onY&ua=&userId=2009348883&umidtoken=90tLeFNLOsIr%2FDV30zY%2FRC3e7yMfccP5&secureDeviceType=ios&secureAppName=wenxue-activity-proxy&asac=2A20C07RJ9F51AOEFSNHDR×tamp=1614168931&activityId=311&lotteryNum=1&sessionId=1&useGoldcoinType=0&sqSv=1.0&sign=398639a44b67daf59decc8b725b3b446&key=sq_h5_gateway&_public=serviceWorkerOn%3D1%26asac%3D2A20C07RJ9F51AOEFSNHDR%26spm%3Da2oun.page_render_sq_welfare_welfare_page_v2.%25E6%258B%259B%25E8%25B4%25A2%25E7%258C%25AB.turntable_in_0%26sdk%3D14.4%26utdid%3DYDXtGFuwhAIDAGcg21DfxrSH%26ustatus%3D1%26first_placeid%3D111111%26net_env%3Dwifi%26placeid%3D111111%26user_id%3D2009348883%26sn%3DC8632262E5EC058F2691BD667236A56F746082BE%26umidtoken%3D90tLeFNLOsIr%252FDV30zY%252FRC3e7yMfccP5%26msv%3D8.0.0%26brand%3DApple%26imei%3DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%26skinVersionPrefix%3D1%26appVer%3D4.3.3.0%26skinActiveColor%3D0F9970%26manufacturer%3DApple%26session%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNDY4NjkyOSwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNDE2ODUyOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Z3ume3xoTkVKrUdFkhAollD9ArAYit2-ScE-Hi1V1k2aFhfnGImvVOnJ-1lSJk6d3IfUPLQGxQJXVskNY5mPcw%26skinColor%3D23B383%26platform%3D1%26ver%3D210203%26mod%3DUnknowniPad%26statusBarHeight%3D20.000000%26skinVersion%3D1%26wh%3D1536x2048%26soft_id%3D21%26utype%3Dvip%26skinId%3D999%26idfa%3DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4&&{\"Origin\":\"https://render-web.shuqireader.com\",\"Accept-Encoding\":\"gzip, deflate, br\",\"Connection\":\"keep-alive\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"Accept\":\"application/json, text/plain, */*\",\"Host\":\"ocean.shuqireader.com\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 AliApp(shuqi/4.3.3.0) WindVane/8.6.1 Shuqi (iPad7,5__shuqi__v4.3.3.0) 1536x2048 Winding(WV_3) WK\",\"Referer\":\"https://render-web.shuqireader.com/render/sq-welfare/page/lottery_page/?serviceWorkerOn=1&asac=2A20C07RJ9F51AOEFSNHDR&spm=a2oun.page_render_sq_welfare_welfare_page_v2.%E6%8B%9B%E8%B4%A2%E7%8C%AB.turntable_in_0&sdk=14.4&utdid=YDXtGFuwhAIDAGcg21DfxrSH&ustatus=1&first_placeid=111111&net_env=wifi&placeid=111111&user_id=2009348883&sn=C8632262E5EC058F2691BD667236A56F746082BE&umidtoken=90tLeFNLOsIr%2FDV30zY%2FRC3e7yMfccP5&msv=8.0.0&brand=Apple&imei=C7C1660FD2551C1EFD5B9E847AB6FA360A359C5E&skinVersionPrefix=1&appVer=4.3.3.0&skinActiveColor=0F9970&manufacturer=Apple&session=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNDY4NjkyOSwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNDE2ODUyOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Z3ume3xoTkVKrUdFkhAollD9ArAYit2-ScE-Hi1V1k2aFhfnGImvVOnJ-1lSJk6d3IfUPLQGxQJXVskNY5mPcw&skinColor=23B383&platform=iOS&ver=210203&mod=UnknowniPad&statusBarHeight=20.000000&skinVersion=1&wh=1536x2048&soft_id=21&utype=vip&skinId=999&idfa=BEE23FE0-7B3A-407F-B922-18CC6ED9F2F4\",\"Content-Length\":\"1933\",\"Accept-Language\":\"zh-cn\"}"},{"key":"userinfock1","val":"https://ocean.shuqireader.com/api/activity/xapi/gold/record?userId=2009348883&page=1&pageSize=10&sqSv=1.0&sign=cf69eae8eed04474afb6e25aa51caa01&key=sq_h5_gateway&_public=fe-env%253Duae-prod%2526sdk%253D14.4%2526utdid%253DYDXtGFuwhAIDAGcg21DfxrSH%2526ustatus%253D1%2526first_placeid%253D111111%2526net_env%253Dwifi%2526placeid%253D111111%2526user_id%253D2009348883%2526sn%253DC8632262E5EC058F2691BD667236A56F746082BE%2526umidtoken%253D90tLeFNLOsIr%2525252FDV30zY%2525252FRC3e7yMfccP5%2526msv%253D8.0.0%2526brand%253DApple%2526imei%253DC7C1660FD2551C1EFD5B9E847AB6FA360A359C5E%2526skinVersionPrefix%253D1%2526appVer%253D4.3.3.0%2526skinActiveColor%253D0F9970%2526manufacturer%253DApple%2526session%253DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDA5MzQ4ODgzIiwidXRkaWQiOiIiLCJpbWVpIjoiQzdDMTY2MEZEMjU1MUMxRUZENUI5RTg0N0FCNkZBMzYwQTM1OUM1RSIsInNuIjoiQzg2MzIyNjJFNUVDMDU4RjI2OTFCRDY2NzIzNkE1NkY3NDYwODJCRSIsImV4cCI6MTYxNDY4NjkyOSwidXNlcklkIjoiMjAwOTM0ODg4MyIsImlhdCI6MTYxNDE2ODUyOSwib2FpZCI6IiIsInBsYXRmb3JtIjoiaU9TIn0.Z3ume3xoTkVKrUdFkhAollD9ArAYit2-ScE-Hi1V1k2aFhfnGImvVOnJ-1lSJk6d3IfUPLQGxQJXVskNY5mPcw%2526skinColor%253D23B383%2526platform%253D1%2526ver%253D210203%2526mod%253DUnknowniPad%2526statusBarHeight%253D20.000000%2526skinVersion%253D1%2526wh%253D1536x2048%2526soft_id%253D21%2526utype%253Dvip%2526skinId%253D999%2526idfa%253DBEE23FE0-7B3A-407F-B922-18CC6ED9F2F4"},{"key":"readck2","val":""},{"key":"receivecoinck2","val":""},{"key":"vediogoldprizeck2","val":""},{"key":"vediodrawprizeck2","val":""},{"key":"drawck2","val":""},{"key":"userinfock2","val":""},{"key":"readck3","val":""},{"key":"receivecoinck3","val":""},{"key":"vediogoldprizeck3","val":""},{"key":"vediodrawprizeck3","val":""},{"key":"drawck3","val":""},{"key":"userinfock3","val":""},{"key":"readck4","val":""},{"key":"receivecoinck4","val":""},{"key":"vediogoldprizeck4","val":""},{"key":"vediodrawprizeck4","val":""},{"key":"drawck4","val":""},{"key":"userinfock4","val":""},{"key":"readck5","val":""},{"key":"receivecoinck5","val":""},{"key":"vediogoldprizeck5","val":""},{"key":"vediodrawprizeck5","val":""},{"key":"drawck5","val":""},{"key":"userinfock5","val":""},{"key":"readck6","val":""},{"key":"receivecoinck6","val":""},{"key":"vediogoldprizeck6","val":""},{"key":"vediodrawprizeck6","val":""},{"key":"drawck6","val":""},{"key":"userinfock6","val":""},{"key":"readck7","val":""},{"key":"receivecoinck7","val":""},{"key":"vediogoldprizeck7","val":""},{"key":"vediodrawprizeck7","val":""},{"key":"drawck7","val":""},{"key":"userinfock7","val":""},{"key":"readck8","val":""},{"key":"receivecoinck8","val":""},{"key":"vediogoldprizeck8","val":""},{"key":"vediodrawprizeck8","val":""},{"key":"drawck8","val":""},{"key":"userinfock8","val":""},{"key":"readck9","val":""},{"key":"receivecoinck9","val":""},{"key":"vediogoldprizeck9","val":""},{"key":"vediodrawprizeck9","val":""},{"key":"drawck9","val":""},{"key":"userinfock9","val":""},{"key":"readck10","val":""},{"key":"receivecoinck10","val":""},{"key":"vediogoldprizeck10","val":""},{"key":"vediodrawprizeck10","val":""},{"key":"drawck10","val":""},{"key":"userinfock10","val":""}]}],"isLoaded":true} diff --git a/wkzh.json b/wkzh.json new file mode 100644 index 0000000000..dc1185cb38 --- /dev/null +++ b/wkzh.json @@ -0,0 +1 @@ +[ { "id": 638731, "url": "http://wx.tiantianaiyuedu.site/read/article", "hd": "{\"X-Requested-With\":\"XMLHttpRequest\",\"Connection\":\"keep-alive\",\"Accept-Encoding\":\"gzip, deflate\",\"Content-Type\":\"application/json;charset=utf-8\",\"Origin\":\"http://wx.tiantianaiyuedu.site\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.2(0x18000239) NetType/WIFI Language/zh_CN\",\"X-CSRF-TOKEN\":\"2ms0eeFRcAYXKYF0mpwHsTa0JRNKQBEH9seX9VUe\",\"Cookie\":\"XSRF-TOKEN=eyJpdiI6InlMZTh2M0ZkM1NDT1k1ZjdZdFZVdlE9PSIsInZhbHVlIjoiT3dNTEVZUUIrUmFZSEtXT3J5ek85OXpZNHNNWmZMbHpcL0JLcWdcLzd1Q25KZUw0TG5xOTZqenRBQXR5RTNUc25xXC9BazVkbysxWlhHWllmaVdZczY4TFE9PSIsIm1hYyI6ImNmZDE3ZDcxZmM1YmU1MmZmNjAzOTZjMGYyZWYwZGM0NDA5YjgwNjlkM2NmZWJhZGNhMTczM2JjMWE0ZmFiZGMifQ%3D%3D; laravel_session=eyJpdiI6Ik9ibXJKbTVid3V3empKVzNEdllkN3c9PSIsInZhbHVlIjoibWhpQzJMZm9HSUVERFo2V01kdlR3aEUzcHNXNEd4Mlk3UWZocXZcL3FIdnByTmlUWWczNXJrVGtyUVhZa3ZCOG9BVXZqV3VPNmU5ZUZzdUp4NHpsTkFnPT0iLCJtYWMiOiI2YTg2MzAwZmRjMWMxMTNiNDEyZWRhYmYyY2I1YmM4MmZjNTAxYjMxMTE4MGFhNTY3OGEwNDRhZDJjY2MzYzE5In0%3D\",\"Host\":\"wx.tiantianaiyuedu.site\",\"Accept-Language\":\"zh-cn\",\"Accept\":\"application/json, text/plain, */*\",\"Content-Length\":\"107\"}" }, { "id": 638735, "url": "http://wx.tiantianaiyuedu.site/read/article", "hd": "{\"X-Requested-With\":\"XMLHttpRequest\",\"Connection\":\"keep-alive\",\"Accept-Encoding\":\"gzip, deflate\",\"Content-Type\":\"application/json;charset=utf-8\",\"Origin\":\"http://wx.tiantianaiyuedu.site\",\"User-Agent\":\"Mozilla/5.0 (iPad; CPU OS 14_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.2(0x18000239) NetType/WIFI Language/zh_CN\",\"X-CSRF-TOKEN\":\"icBARUklJJsIZj8EhKNx4SjzuoiUJjRxbkCPKbXq\",\"Cookie\":\"XSRF-TOKEN=eyJpdiI6Ijd6RndMbFwvNUY5SW1tcTFrRnFhblwvdz09IiwidmFsdWUiOiJzRGEyRFNBNlwvejVPWDVVaDNtcGdSRFpwNGZ0cXlnUFVGWVFpRldlT3N3bFwvNm5QUmZ4ZXNvR2dtYW83TDNpbm53QXBwNm9ZaTNjZFpQZHI0K1VGcnh3PT0iLCJtYWMiOiI5Yjc2Y2VmZDFhOTdkMGY4OTZlNDZjNDI2YmUyNTQ0MjcwZDYyODBiNjk5ZWU0Y2FhZmY5M2Q1ZTY4NDkxYTQzIn0%3D; laravel_session=eyJpdiI6IjkwbTBkVnFPS2lsYWgyY2g3VGdOK3c9PSIsInZhbHVlIjoiY3o5QzVpcWdNN2J6YzhZZXQxbWZnTGJnN2JUaWpJelp5b1RnVTRiUGtYQVhEOVFDRGF6TXkxVEJWXC8yVFRIZ1VJa1paRDc3Z3cxT1dPUjkzYVdScVhBPT0iLCJtYWMiOiI3ODkzNzkyZmIyMjQ4N2NjYzkyOGU0NTY5YWQ0ZGYwNzhiNzEzYTc0YjQxODU0N2IyYjdlYzUzODBlNDg5NTZmIn0%3D\",\"Host\":\"wx.tiantianaiyuedu.site\",\"Accept-Language\":\"zh-cn\",\"Accept\":\"application/json, text/plain, */*\",\"Content-Length\":\"107\"}" }] diff --git a/wkzz.js b/wkzz.js new file mode 100644 index 0000000000..669f0e7178 --- /dev/null +++ b/wkzz.js @@ -0,0 +1,351 @@ +/* +软件名称:微客众智 微信扫描二维码打开 +更新时间:2021-03-16 @肥皂 +脚本说明:微客众智自动阅读 +脚本为自动完成微客众智的阅读任务 +每日收益0.6元左右,可多号撸。 +类似番茄看看和云扫码,貌似没有任务冲突(划重点) +哈哈哈啊哈哈哈哈 + +复制链接到微信打开 http://i.hylks.xyz/i/632723?sharefrom=hall&_target=hall + +或者扫码打开 https://raw.githubusercontent.com/age174/-/main/507A2E9A-BE08-44D8-8BDC-B4F624763406.jpeg +微信扫描打开 + + + +本脚本以学习为主! +使用方法:扫码进去,点击任务大厅的阅读文章 +点击开始阅读,等待六秒返回获取数据 + +TG电报群: https://t.me/hahaha8028 + +3.16更新,加入自动提现,可提现余额大于等于两元自动提现 + +boxjs地址 : + +https://raw.githubusercontent.com/age174/-/main/feizao.box.json + + +微客众智 +圈X配置如下,其他软件自行测试,定时可以多设置几次,没任务会停止运行的 +[task_local] +#微客众智 +5,35 9-22 * * * https://raw.githubusercontent.com/age174/-/main/wkzz.js, tag=微客众智, img-url=https://ae01.alicdn.com/kf/Uff0a0bb9e66a479591c9b02c176fd276A.jpg, enabled=true + + +[rewrite_local] +#微客众智 +^http://wx.tiantianaiyuedu.site/ url script-request-body https://raw.githubusercontent.com/age174/-/main/wkzz.js + + + +#loon +http://wx.tiantianaiyuedu.site/ script-path=https://raw.githubusercontent.com/age174/-/main/wkzz.js, requires-body=true, timeout=10, tag=微客众智 + + + +#surge + +微客众智 = type=http-request,pattern=http://wx.tiantianaiyuedu.site/,requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/age174/-/main/wkzz.js,script-update-interval=0 + + + + +[MITM] +hostname = wx.tiantianaiyuedu.site + + +*/ + + +const $ = new Env('微客众智自动阅读'); +const wkzz = require('./wkzh.json'); +let times = Math.round(Date.now() / 1000) +let wkzzurl = '', wkzzhd = '',id = '',uid='',tid='',name='' +!(async () => { + if (typeof $request !== "undefined") { + await wkzzck() + } else { + let acList = wkzz.filter(o => o.id && o.hd).map((o, i) => ({no: i + 1, id: o.id, url: o.url, hd: o.hd})) + $.log(`------------- 共${acList.length}个账号-------------\n`) + for (let i = 0; i < acList.length; i++) { + wkzzurl = acList[i].url + wkzzhd = acList[i].hd + $.log(`\n开始【微客众智${i + 1}】`) + let userInfo = await getUserInfo(wkzzhd) + id = userInfo.wxuser_id + if (id) { + $.log('\n微客众智获取用户信息成功\n当前用户名:' + userInfo.nickname + ' 用户ID:' + id + '\n开始查询任务信息') + await wkzzlb(); + await wkzzxj(); + } else if (userInfo) { + $.log(userInfo) + } + } + } +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()) +//微客众智数据获取 + + +async function wkzzck() { + if ($request.url.indexOf("wx.tiantianaiyuedu.site/read/article") > -1) { + const hd = JSON.stringify($request.headers); + let userInfo = await getUserInfo(hd) + if(userInfo.wxuser_id){ + let status = 1 + let no = wkzz.length + for (let i = 0, len = no; i < len; i++) { + let ac = wkzz[i] || {} + if (ac.id) { + if (ac.id == userInfo.wxuser_id) { + no = i + status = 0 + break + } + } else if (no == len) { + no = i + } + } + wkzz[no] = {id: userInfo.wxuser_id, url: $request.url, hd: hd} + $.log(JSON.stringify(wkzz[no], null, 2)) + $.setdata(JSON.stringify(wkzz, null, 2), 'wkzz') + $.msg($.name, "", `微客众智[账号${no+1}] ${status?'新增':'更新'}数据成功!`) + } + } +} + +// 获取用户信息 +function getUserInfo(hd, timeout = 0) { + return new Promise((resolve) => { + let url = { + url: "http://wx.tiantianaiyuedu.site/me", + headers: JSON.parse(hd) + } + $.get(url, async (err, resp, data) => { + if (resp.statusCode == 301) { + $.log('\n微客众智访问失败,可能是Cookie过期或网络问题') + $.msg('微客众智Cookie过期', '', '请重新抓包获取数据,建议保持微客众智的重写在开启状态') + } + let userInfo = '' + try { + if (err) { + $.logErr(`❌ API请求失败,请检查网络后重试\n url: ${url.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + if (resp.statusCode != 301) { + let result = $.toObj(data) + if (result.errors == false) { + userInfo = result.data + } else { + userInfo = '微客众智获取用户信息失败 已停止当前账号运行!' + } + } + } + } catch (e) { + //$.logErr(e, resp); + } finally { + resolve(userInfo) + } + }) + }) +} + + +//微客众智任务列表 +function wkzzlb(timeout = 0) { + return new Promise((resolve) => { + +let url = { + url : "http://wx.tiantianaiyuedu.site/read/tasks?times=0.350527818069823", + headers : JSON.parse(wkzzhd), + +} + $.get(url, async (err, resp, data) => { + + try { + const result = JSON.parse(data) + + if(result.data.code== 1){ +uid=data.match(/"id":(.*?),/)[1] +tid =data.match(/"a_id":(.*?),/)[1] +name =data.match(/"content_url":"(.*?)",/)[1] + + console.log('\n微客众智获取任务ID成功\n当前任务ID: '+uid+' '+tid+'\n开始循环阅读:') + await $.wait(1000); + await wkzzyd(); +} else { + console.log('\n微客众智获取任务ID失败 '+result.data.message) +await wkzzwz(); +} + + } catch (e) { + //$.logErr(e, resp); + } finally { + resolve() + } + },timeout) + }) +} + +//微客众智 +function wkzzwz(timeout = 0) { + return new Promise((resolve) => { + +let url = { + url : "http://wx.tiantianaiyuedu.site/account/income_info?times=0.7346913820791053", + headers : JSON.parse(wkzzhd), + +} + $.get(url, async (err, resp, data) => { + try { + + const result = JSON.parse(data) + if(result.errors == false){ + + console.log('\n微客众智获取用户信息成功\n今日阅读次数: '+result.data.read_task_count+' '+'\n今日阅读奖励'+result.data.read_money) + +} else { + console.log('\n微客众智获取用户信息失败 '+result.msg) +} + + } catch (e) { + //$.logErr(e, resp); + } finally { + resolve() + } + },timeout) + }) +} +//微客众智提交 +function wkzzyd(timeout = 0) { + return new Promise((resolve) => { +let url = { + url : "http://wx.tiantianaiyuedu.site/read/article", + headers : JSON.parse(wkzzhd), + body : `{"data":{"wxuser_id":${id},"receive_article_id":${tid} ,"article_created_at":${times},"task_id": ${uid}}}`, +} + $.post(url, async (err, resp, data) => { + try { + + const result = JSON.parse(data) + if(result.errors == false){ + console.log('\n微客众智任务提交成功:'+result.message) +await wkzzxx(); + +} else { + console.log('\n微客众智任务提交失败 '+data) + +} + + } catch (e) { + //$.logErr(e, resp); + } finally { + resolve() + } + },timeout) + }) +} + + +//微客众智信息 +function wkzzxx(timeout = 0) { + return new Promise((resolve) => { + +let url = { + url : "http://wx.tiantianaiyuedu.site/account/income_info?times=0.7346913820791053", + headers : JSON.parse(wkzzhd), + +} + $.get(url, async (err, resp, data) => { + try { + + const result = JSON.parse(data) + if(result.errors == false){ + + console.log('\n微客众智获取用户信息成功\n今日阅读次数: '+result.data.read_task_count+' '+'\n今日获得奖励'+result.data.read_money+'开始获取任务') + await $.wait(8000); + await wkzzlb(); +} else { + console.log('\n微客众智获取用户信息失败 '+result.msg) +} + + } catch (e) { + //$.logErr(e, resp); + } finally { + resolve() + } + },timeout) + }) +} + +//微客众智可提现金额 +function wkzzxj(timeout = 0) { + return new Promise((resolve) => { + +let url = { + url : "http://wx.tiantianaiyuedu.site/account/account_info?times=0.005304894211631606", + headers : JSON.parse(wkzzhd), + +} + $.get(url, async (err, resp, data) => { + try { + + const result = JSON.parse(data) + if(result.errors == false){ + + console.log('\n微客众智当前可提现额度为'+result.data.balance) +if(result.data.balance >= 2){ +console.log('\n微客众智当前金额可提现,前去执行提现任务') +await wkzztx(); +}else{ +console.log('\n微客众智当前金额不满足提现,跳过提现') +} + + +} else { + console.log('\n微客众智获取用户信息失败 '+result.msg) +} + + } catch (e) { + //$.logErr(e, resp); + } finally { + resolve() + } + },timeout) + }) +} +//提现 +function wkzztx(timeout = 0) { + return new Promise((resolve) => { +const ck = JSON.parse(wkzzhd) +const head = {"X-Requested-With":"XMLHttpRequest","Connection":"keep-alive","Accept-Encoding":"gzip, deflate","Content-Type":"application/json;charset=utf-8","Origin":"http://tx.ac48.top","User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.2(0x18000235) NetType/4G Language/zh_CN","X-CSRF-TOKEN":wkzzhd.match(/"X-CSRF-TOKEN":"(.*?)",/)[1],"Cookie":ck.Cookie,"Host":"tx.ac48.top","Accept-Language":"zh-cn","Accept":"application/json, text/plain, */*","Content-Length":"106"} +; +let url = { + url : "http://tx.ac48.top/withdraw/withdraw", + headers : head, + body : `{"money":2,"account_type":2}`, +} + $.post(url, async (err, resp, data) => { + try { + const result = JSON.parse(data) + if(result.errors == false){ + + $.msg('微客众智','','\n微客众智提现2元已成功') + +} else { + console.log('\n微客众智提现失败: '+result.message) +} + + } catch (e) { + //$.logErr(e, resp); + } finally { + resolve() + } + },timeout) + }) +} + + +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)} diff --git a/ysm.js b/ysm.js new file mode 100644 index 0000000000..151a004c7e --- /dev/null +++ b/ysm.js @@ -0,0 +1,567 @@ +/* +软件名称:云扫码 微信扫描二维码打开 +更新时间:2021-03-31 @肥皂 +脚本说明:云扫码自动阅读 +脚本为自动完成云扫码的阅读任务 +每日收益1元左右,可多号撸。提现秒到 +可以多个阅读平台同时跑脚本,如番茄看看和微客众智 + +任务打开二维码地址 https://raw.githubusercontent.com/age174/-/main/3B7C4F94-B961-4690-8DF7-B27998789124.png +微信扫描打开,保存临时码,再去扫码获取数据 + + + +本脚本以学习为主! +首次运行脚本,会提示获取数据 +去云扫码,点击开始阅读,获得阅读数据 +七八秒后返回,获得提交任务数据 +跑脚本到3000金币,手动提现一次,获得自动提现数据 +总共需要三个数据。。 + +TG电报群: https://t.me/hahaha8028 + +3.1更新增加是否有阅读任务的判断 +加入自动兑换和自动提现,当前金币大于等于3000会自动提现,请自行去获取提现数据,方法,进入云扫码,成功提现一次获取数据成功 +解决多账号问题,可以多账号撸了 +3.2更新,新增判断,如果提示当前任务已结束脚本会尝试继续执行不会终止循环,key提交提示失败也会尝试重新执行,增加了提现成功的通知 +3.8更新,修复因官方更新无法提交key和领取任务奖励的问题 +3.9更新 修复云扫码官方更新无法自动阅读的问题 + +3.18更新,新增判断云扫码每日首次运行脚本是否手动阅读过两篇文章,如果阅读过两篇文章脚本继续执行任务,否则结束 + +3.26更新,云扫码多账号更新优化,加入多账号并发执行,获取ck方式改为和番茄看看一样的方式,不用手动选择抓包账号几,加入通知开关和首次阅读开关限制,自定义提现金额,比例为1:10000,最低提现金额为0.3元,即填写提现金额最少填写3000,注意需要重新更改重写的链接,请在下方获取替换以前的重写,该版本为@ztxtop大佬提交的pr。感谢大佬 + +3.31更新,修复官方域名更换无法正常跑脚本的问题,请更换一下重写重新抓包 +PS: +一般两篇文章过后还能阅读那么当天一般都能跑满任务的,需要手动阅读两篇的原因是和番茄看看一样,前两篇文章是调用微信接口鉴权的(这个没有办法解决),鉴权通过可以继续阅读,不通过则限制阅读(如果你不手动阅读鉴权,直接跑脚本很大几率直接就限制了),云扫码和番茄看看鉴权通过的话是不会有任务冲突的,一般情况下这两个平台手动阅读了两篇文章都能跑满全部任务。阅读三兄弟的微客众智则不需要手动阅读可以直接跑脚本(可惜ck过期太快,但是不会限制,我的ck最长坚持了四天,有些人就只能坚持一天,建议微客众智的重写保持开启状态。) + +boxjs地址 : + +https://raw.githubusercontent.com/age174/-/main/feizao.box.json + + +云扫码 +圈X配置如下,其他软件自行测试,定时可以多设置几次,没任务会停止运行的 +[task_local] +#云扫码 +15 12,14,16,20,22 * * * https://raw.githubusercontent.com/age174/-/main/ysm.js, tag=云扫码, img-url=https://raw.githubusercontent.com/erdongchanyo/icon/main/taskicon/Yunsaoma.png, enabled=true + + +[rewrite_local] +#云扫码 +^http://.+?[^/]/yunonline/v\d+/redirect/(?!undefined) url script-request-header https://raw.githubusercontent.com/age174/-/main/ysm.js + + + +#loon +^http://.+?[^/]/yunonline/v\d+/redirect/(?!undefined) script-path=https://raw.githubusercontent.com/age174/-/main/ysm.js, requires-body=true, timeout=10, tag=云扫码 + + + +#surge + +云扫码 = type=http-request,pattern=^http://.+?[^/]/yunonline/v\d+/redirect/(?!undefined),requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/age174/-/main/ysm.js,script-update-interval=0 + + +*/ + +const $ = new Env('云扫码') +let ysm = require('./ysmzh.json'); +let needNotice = 'true' +let ysmBanfirstTask = 'true' // 禁止脚本执行首个任务,避免每日脚本跑首次任务导致微信限制 +let ysmBanhalfTask = 'true' // 脚本执行完第50个任务时退出任务,再手动阅读2篇避免出现微信限制 +let ysmtxAmt = '10000' // 此处修改提现金额,0.3元等于3000币,默认不提现 +ysmtxAmt = ysmtxAmt > 3000 ? (parseInt(ysmtxAmt / 1000) * 1000) : ysmtxAmt > 0 ? 3000 : 0 +let concurrency = '2' // 并发执行任务的账号数,默单账号循环执行 +concurrency = concurrency < 1 ? 1 : concurrency + +const execNo = [] // 允许执行的账号,为空时不限制,指定时,按照指定的来判断处理,例如:[1,3] + +const moveData = 0 + +const baseHeaders = { + "Accept": "application/json, text/javascript, */*; q=0.01", + "Accept-Encoding": "gzip, deflate", + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", + "Connection": "keep-alive", + "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", + "X-Requested-With": "XMLHttpRequest" +} + +!(async () => { + if (typeof $request !== "undefined") { + await ysmck() + } else if (moveData) { + await ysmckMove() + } else { + // 获取分组执行账号数据 + let execAcList = getExecAcList() + let msgInfo = [] + for (let arr of execAcList) { + let allAc = arr.map(ac => ac.no).join(', ') + $.log(`\n=======================================\n开始【${$.name}账号:${allAc}】`) + let rtList = await Promise.all(arr.map((ac, i) => execTask(ac, i))) + msgInfo.push(rtList.map(ac => `【账号${ac.no}】\n当前余额:${ac.last_gold}币\n今日奖励:${ac.day_gold}\n已阅读数:${ac.day_read}\n待阅读数:${ac.remain_read}${ac.extMsg?'\n\t'+ac.extMsg:''}`).join('\n\n')) + } + if (msgInfo.length <= 0) { + msgInfo.push(`暂无账号数据,请重新扫码进入云扫码首页抓取数据`) + } + if (needNotice) { + $.msg($.name, '', msgInfo.join('\n\n')) + } else { + $.log('\n======== [脚本运行完毕,打印日志结果] ========\n' + msgInfo.join('\n\n')) + } + } +})() +.catch((e) => $.logErr(e)) + .finally(() => $.done()) + +function execTask(ac, i) { + return new Promise(async resolve => { + try { + await $.wait(i * 50) + await ysm4(ac) + if ((!execNo || (execNo.length == 0 || execNo.includes(ac.no))) && ac.remain_read && !(ac.day_read < 2 && ysmBanfirstTask) && !(ysmBanhalfTask && ac.day_read == 50)) { + $.log(`😄账号${ac.no}今日已读${ac.day_read}次,今日待读${ac.remain_read}次,即将阅读`) + await $.wait((i + 1) * 600) + let flag = 0 + let count = 1 + let allowErrorCount = 3 + do { + flag = await ysm1(ac, count++) + if (flag < 0) { + allowErrorCount += flag - 0 + } + } while (flag && allowErrorCount > 0) + } else { + $.log(`😓账号${ac.no}今日已读${ac.day_read}次,今日待读${ac.remain_read}次,跳过阅读`) + } + if (ac.txbody && ysmtxAmt >= 3000 && ac.last_gold >= ysmtxAmt) { + ac.extMsg = await ysmdh(ac, ysmtxAmt) + } + await ysmSignInfo(ac) + } catch (e) { + $.logErr(`账号${ac.no} 循环执行任务出现异常: ${e}`) + } finally { + resolve(ac) + } + }) +} + +function getExecAcList() { + let acList = ysm.filter(o => o.openid).map((o, i) => { + let data = o.domain.match(/^(https?:\/\/(.+?))\//) + let acHeader = { + "Origin": data[1], + "Host": data[2], + "User-Agent": o.ua, + "Referer": `${o.domain}redirect/${o.secret}?openid=${o.openid}&redirect_flag=read` + } + return { + no: i + 1, + last_gold: 0, + day_gold: 0, + remain_read: 0, + day_read: 0, + openid: o.openid, + domain: o.domain, + headers: { + ...baseHeaders, + ...acHeader + }, + body: `secret=${o.secret}&type=read`, + txbody: o.txbody + } + }) + let execAcList = [] + let len = acList.length + // 计算分组后每组账号个数 + let slot = len % concurrency == 0 ? len / concurrency : parseInt(len / concurrency) + 1 + slot = Math.ceil(len / (slot || 1)) + let idx = -1 + acList.forEach((o, i) => { + if (i % slot == 0) { + idx++ + } + if (execAcList[idx]) { + execAcList[idx].push(o) + } else { + execAcList[idx] = [o] + } + }) + $.log(`云扫码当前设置的提现金额为: ${ysmtxAmt / 10000} 元`, `----------- 共${len}个账号分${execAcList.length}组去执行 -----------`) + return execAcList +} + +//云扫码数据获取 +async function ysmck() { + const url = $request.url + let newAc = '' + if (url.match(/https?:\/\/.+?[^/]\/yunonline\/v\d+\/redirect\/(?!undefined)/) || url.match(/https?:\/\/.+?[^/]\/yunonline\/v\d+\/exchange\?/)) { + let hd = {...$request.headers} + let data = (hd['Referer'] || hd['referer'] || '').match(/^https?:\/\/.+?[^/]\/yunonline\/v\d+\/redirect\/(?!undefined).+$/) + let no = ysm.length + newAc = await updateAndGetCk(no + 1, data && data[0] || url, hd) + if (newAc) { + let status = 1 + for (let i = 0, len = no; i < len; i++) { + let ac = ysm[i] || {} + if (ac.openid) { + if (ac.openid == newAc.openid) { + no = i + status = 0 + break + } + } else if (no == len) { + no = i + } + } + ysm[no] = newAc + $.setdata(JSON.stringify(ysm, null, 2), 'ysm') + $.msg($.name, "", `云扫码[账号${no+1}] ${status?'新增':'更新'}数据成功!`) + } + } + if (!newAc) { + $.log($.name, `无法从请求中获取到用户账号数据,跳过处理`) + } +} + +function updateAndGetCk(no, url, headers) { + return new Promise(resolve => { + let opts = {url} + $.get(opts, async (err, resp, html) => { + let rtAc = '' + try { + if (err) { + $.logErr(`❌ 账号${no} API请求失败,请检查网络后重试\n url: ${opts.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + let openid = (html.match(/openid="(.+?)"/) || ['', ''])[1] + let domain = (html.match(/domain="(https?:\/\/.+?)"/) || ['', ''])[1] + let secret = (html.match(/secret="(.+)";/) || ['', ''])[1] + let txbody = (html.match(/https?:.+?\/exchange\?(openid=.+?&request_id=.+?)(&|")/) || ['', ''])[1] + let ua = headers['User-Agent'] || headers['user-agent'] + if (txbody) { + var Android = String(ua.match(/android/i)).toLowerCase() == "android" + var iOS = String(ua.match(/iphone/i)).toLowerCase() == "iphone" || String(ua.match(/ipad/i)).toLowerCase() == "ipad" + txbody += `&ua=${iOS ? 1 : Android ? 2 : 0}` + } + if (domain && ua && secret) { + rtAc = {openid, domain, ua, secret, txbody} + } + } + } catch (e) { + $.logErr(`======== 账号 ${no} ========\nurl: ${opts.url}\nerror:${e}\ndata: ${resp && resp.body}`) + } finally { + resolve(rtAc) + } + }) + }) +} + +async function ysmckMove() { + let ysmArr = [] + let ysmcount = ($.getval('ysmcount') || '1') - 0 + for (let i = 1; i <= ysmcount; i++) { + let hd = $.getjson(`ysmhd${i>1?i:''}`) + if (hd) { + let data = (hd['Referer'] || hd['referer'] || '').match(/^https?:\/\/.+?[^/]\/yunonline\/v\d+\/redirect\/(?!undefined).+$/) + if (data) { + let newAc = await updateAndGetCk(i, data[0], hd) + if (newAc) { + ysmArr.push(newAc) + } + } + } + } + if (ysmArr.length > 0) { + let existsId = ysm.map(o => o.openid) + for (let ac of ysmArr) { + if (!existsId.includes(ac.openid)) { + ysm.push(ac) + existsId.push(ac.openid) + } + } + $.setdata(JSON.stringify(ysm, null, 2), 'ysm') + $.msg($.name, "", `迁移账号数:${ysmArr.length}\n合计账号数:${ysm.length}!`) + } else { + $.log('无待迁移的旧数据') + } +} + +// 金币信息查询 +function ysm4(ac) { + return new Promise((resolve) => { + let opts = { + url: `${ac.domain}gold?openid=${ac.openid}&time=${Date.parse(new Date())}`, + headers: ac.headers + } + $.get(opts, (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${opts.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if (result.errcode == 0 && result.data) { + ac.last_gold = (result.data.last_gold || 0) - 0 + ac.day_read = (result.data.day_read || 0) - 0 + ac.day_gold = (result.data.day_gold || 0) - 0 + ac.remain_read = (result.data.remain_read || 0) - 0 + } + } + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\nerror:${e}\ndata: ${resp && resp.body}`) + } finally { + resolve() + } + }) + }) +} + +//云扫码领取 +function ysm3(ac, time) { + return new Promise((resolve) => { + let opts = { + url: `${ac.domain}add_gold`, + headers: ac.headers, + body: `openid=${ac.openid||''}&time=${time}` + } + $.post(opts, (err, resp, data) => { + let f = -1 + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${opts.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if (result.errcode == 0 && result.data) { + ac.last_gold = (result.data.last_gold || 0) - 0 + ac.day_read = (result.data.day_read || 0) - 0 + ac.day_gold = (result.data.day_gold || 0) - 0 + ac.remain_read = (result.data.remain_read || 0) - 0 + if (ac.remain_read <= 0) { + f = 0 + $.msg(`${$.name}: 账号${ac.no}`, '', `今日阅读已达上限,请明日继续`) + } else if (ysmBanhalfTask && ac.day_read == 50) { + f = 0 + $.msg(`${$.name}: 账号${ac.no}`, '', `今日已阅读50篇,请手动阅读2篇再跑脚本`) + } else { + f = 1 + } + $.log(`🌝账号${ac.no}:本次奖励:${result.data.gold}, 当前余额: ${ac.last_gold}`, `今日阅读次数: ${ac.day_read}, 今日阅读奖励: ${ac.day_gold}`, `今日剩余阅读次数:${ac.remain_read}`) + } else { + $.logErr(`🚫账号${ac.no}:${result.msg},跳过本次循环\n${data}`) + if (result.errcode == 405 || result.msg == '来晚了,当前任务已结束') { + f = 1 + } + } + } + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\nerror:${e}\ndata: ${resp && resp.body}`) + } finally { + resolve(f) + } + }) + }) +} + +//云扫码提交 +function ysm2(ac, jumpLink, flag = 0) { + return new Promise((resolve) => { + let opts = {url: jumpLink} + if (flag) { + opts['headers'] = ac.headers + } + $.get(opts, async (err, resp, data) => { + let rtObj = '' + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${opts.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + rtObj = $.toObj(data, {}) + } + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\nerror:${e}\ndata: ${resp && resp.body}`) + } finally { + resolve(rtObj) + } + }) + }) +} + +//云扫码key +function ysm1(ac, count) { + return new Promise((resolve) => { + let opts = { + url: `${ac.domain}task`, + headers: ac.headers, + body: ac.body + } + $.post(opts, async (err, resp, data) => { + let f = -1 + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${opts.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else if (count > 55) { + f = -3 + $.msg($.name, `账号${ac.no}`, `本阶段阅读循环次数过多,可能接口返回异常数据导致脚本死循环了,终止脚本运行`) + } else { + const result = JSON.parse(data) + if (result.errcode == 0 && result.data && result.data.link) { + $.log(`\n🌝账号${ac.no}获取key回执成功,第${count}次跳转观看💦`) + let jumpLink = (result.data.link.match(/redirect_uri=(.*?)(&|#wechat_redirect|$)/) || ['', result.data.link])[1] + let jumpObj = await ysm2(ac, unescape(jumpLink) + '?/', 1) + if (jumpObj) { + let time = parseInt(Math.random() * (11 - 9 + 1) + 9, 10) + $.log(`🌝账号${ac.no}等待${time}秒后提交本次观看任务`) + await $.wait(time * 1000) + f = await ysm3(ac, time) + } else { + $.log(`🌝账号${ac.no}jump接口请求失败,重新执行阅读任务`) + await $.wait(1500) + } + } else if (data == '{"errcode":0,"msg":"success"}') { + $.logErr(`🚫账号${ac.no}:🧼来自肥皂的提示:当前没有任务啊,手动进云扫码看看是不是一直显示更新中,别问肥皂什么原因啦~`) + f = -3 + } else { + $.logErr(`🚫账号${ac.no}:获取key回执失败:${(result.data && result.data.msg) || result.msg}`) + if (((result.data && result.data.msg) || result.msg) == '请一个小时后再来') { + f = -3 + } else { + f = -2 + await $.wait(1500) + } + } + } + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\nerror:${e}\ndata: ${resp && resp.body}`) + } finally { + resolve(f) + } + }) + }) +} + + +//云扫码兑换 +function ysmdh(ac, gold) { + return new Promise((resolve) => { + let opts = { + url: `${ac.domain}user_gold`, + headers: ac.headers, + body: `${ac.txbody.match(/(openid=.*?)ua/)[1]}gold=${gold}` + } + $.post(opts, async (err, resp, data) => { + let msg = '' + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${opts.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if (result.errcode == 0) { + $.log(`🌝云扫码账号${ac.no} 提现兑换成功:兑换金额${result.data.money}元,前去微信提现'`) + await $.wait(1000) + msg = await ysmwx(ac, result.data.money) + } else { + msg = `🚫微信提现兑换失败:${result.msg}` + } + } + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\nerror:${e}\ndata: ${resp && resp.body}`) + } finally { + resolve(msg) + } + }) + }) +} + + +//云扫码提现 +function ysmwx(ac, money) { + return new Promise((resolve) => { + let opts = { + url: `${ac.domain}withdraw`, + headers: ac.headers, + body: ac.txbody + } + $.post(opts, async (err, resp, data) => { + let msg = '' + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${opts.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if (result.errcode == 0) { + $.log(`🌝云扫码账号${ac.no} 微信提现成功:${result.msg}`) + msg = `已成功提现至微信${money}元` + } else { + msg = `🚫微信提现回执失败:${result.msg}` + } + } + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\nerror:${e}\ndata: ${resp && resp.body}`) + } finally { + resolve(msg) + } + }) + }) +} + +function ysmSignInfo(ac) { + return new Promise((resolve) => { + let opts = { + url: `${ac.domain}sign_info?time=${Math.floor(new Date().getTime()/1000)}000&openid=${ac.openid||''}`, + headers: ac.headers + } + $.get(opts, async (err, resp, data) => { + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${opts.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + let rtObj = $.toObj(data, {}) + if (rtObj.errcode == 0 && rtObj.data && rtObj.data.signIn == false) { + // 未签到,执行签到获取奖励 + let msg = await ysmSign(ac) + if (msg) { + ac.extMsg = ac.extMsg ? ac.extMsg + '\n\t' + msg : msg + } + } + } + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\nerror:${e}\ndata: ${resp && resp.body}`) + } finally { + resolve() + } + }) + }) +} + +function ysmSign(ac) { + return new Promise((resolve) => { + let opts = { + url: `${ac.domain}sign_in`, + headers: ac.headers, + body: `openid=${ac.openid||''}` + } + $.post(opts, async (err, resp, data) => { + let msg = '' + try { + if (err) { + $.logErr(`❌ 账号${ac.no} API请求失败,请检查网络后重试\n url: ${opts.url} \n data: ${JSON.stringify(err, null, 2)}`) + } else { + const result = JSON.parse(data) + if (result.errcode == 0) { + $.log(`🌝云扫码账号${ac.no} 签到成功`) + msg = `签到成功:奖励${result.data.gold}币` + } else { + msg = `签到失败:${result.msg}` + } + } + } catch (e) { + $.logErr(`======== 账号 ${ac.no} ========\nurl: ${opts.url}\nerror:${e}\ndata: ${resp && resp.body}`) + } finally { + resolve(msg) + } + }) + }) +} + +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)}