├── .github
├── ISSUE_TEMPLATE
│ ├── 1-bug.yml
│ └── 2-feature-request.yml
└── workflows
│ ├── botany.yml
│ ├── laoban.yml
│ ├── tieba.yml
│ └── v2ex.yml
├── .gitignore
├── LICENSE
├── README.md
├── docker
├── Dockerfile
├── crontab_list.sh
├── default_task.sh
├── docker-compose.yml
└── docker_entrypoint.sh
├── package.json
└── src
├── client
├── sudojia_bananaVideo.js
├── sudojia_jhcard.js
├── sudojia_jiangshan.js
├── sudojia_kuro.js
├── sudojia_moto.js
├── sudojia_opposhop.js
├── sudojia_shmedia.js
├── sudojia_tieba_taskSign.js
├── sudojia_tuchong.js
├── sudojia_xhn.js
├── sudojia_xiangwan.js
└── sudojia_xniu.js
├── other
└── sudojia_authCheck.js
├── public
└── sudojia_shuifei.js
├── utils
├── common.js
├── env.js
├── envCheck.js
├── initScript.js
└── sendNotify.js
├── web
├── sudojia_33agilestudio.js
├── sudojia_aliyundrive.js
├── sudojia_fnnas.js
├── sudojia_jlc.js
├── sudojia_jlc_yj.js
├── sudojia_juejin.js
├── sudojia_sspanel.js
├── sudojia_tieba.js
├── sudojia_v2ex.js
└── sudojia_znds.js
└── wx_mini
├── sudojia_allGirls.js
├── sudojia_amx.js
├── sudojia_beiyinmei.js
├── sudojia_botanyStar.js
├── sudojia_bwtea.js
├── sudojia_colorful_mall.js
├── sudojia_flyant.js
├── sudojia_hgf.js
├── sudojia_hlzj_game.js
├── sudojia_hzhfp.js
├── sudojia_instax.js
├── sudojia_jindian.js
├── sudojia_kozbs.js
├── sudojia_ktgzs.js
├── sudojia_kukahome.js
├── sudojia_laoban.js
├── sudojia_longfor.js
├── sudojia_mallcoo.js
├── sudojia_mawuwang.js
├── sudojia_midea.js
├── sudojia_mxbc.js
├── sudojia_naixue.js
├── sudojia_nestle.js
├── sudojia_nfhk.js
├── sudojia_pangGe.js
├── sudojia_paotea.js
├── sudojia_starMom.js
├── sudojia_tastientech.js
├── sudojia_tebu.js
├── sudojia_tilta.js
├── sudojia_wnna.js
├── sudojia_xiaomi_community.js
├── sudojia_xinxi.js
├── sudojia_xpfarm.js
└── sudojia_zxice.js
/.github/ISSUE_TEMPLATE/1-bug.yml:
--------------------------------------------------------------------------------
1 | name: '🐞Bug 提交'
2 | description: '使用此模板来提交一个 Bug🐞'
3 | title: '请输入标题'
4 | labels: [ '🐞Bug' ]
5 | body:
6 | - type: textarea
7 | attributes:
8 | label: '📜 脚本名称'
9 | description: 请输入运行出错的脚本名称
10 | validations:
11 | required: true
12 |
13 | - type: textarea
14 | attributes:
15 | label: '🤔 问题描述'
16 | description: 请输入清晰且简洁的问题描述
17 | validations:
18 | required: true
19 |
20 | - type: textarea
21 | attributes:
22 | label: '🔄 重现过程'
23 | description: 请提供你的重现过程步骤
24 | validations:
25 | required: true
26 |
27 | - type: dropdown
28 | attributes:
29 | label: '🌐 网络自检'
30 | description: 服务器是否能正常 Ping 通脚本对应的网站
31 | options:
32 | - 否
33 | - 是
34 | validations:
35 | required: true
36 |
37 | - type: textarea
38 | attributes:
39 | label: '🔗 附加信息'
40 | description: 请提供你的错误截图及错误日志输出信息或者任何有助于的其他信息
41 | validations:
42 | required: true
43 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/2-feature-request.yml:
--------------------------------------------------------------------------------
1 | name: '🚀功能请求'
2 | description: '使用此模板来提交一个功能请求🚀'
3 | title: '请输入标题'
4 | labels: [ '🚀功能请求' ]
5 | body:
6 | - type: dropdown
7 | attributes:
8 | label: '📲 服务平台'
9 | options:
10 | - 微信小程序
11 | - 微信公众号
12 | - 客户端
13 | - Web 网页
14 | - 其它
15 | validations:
16 | required: true
17 |
18 | - type: textarea
19 | attributes:
20 | label: '🧸 应用官网'
21 | description: 网页就输入网址,小程序、客户端等直接输入名称即可
22 | validations:
23 | required: true
24 |
25 | - type: textarea
26 | attributes:
27 | label: '🤔 活动入口'
28 | description: 请输入要请求的功能入口位置,如:我的 -> 右上角 -> 每日签到
29 | validations:
30 | required: true
31 |
32 | - type: textarea
33 | attributes:
34 | label: '🎁 奖励说明'
35 | description: 请清晰描述该功能所带来的奖励
36 | validations:
37 | required: true
38 |
39 | - type: textarea
40 | attributes:
41 | label: '🔗 附加信息'
42 | description: 请提供该功能的详细截图及奖励、功能位置等任何有助于的其他信息
43 | validations:
44 | required: true
45 |
--------------------------------------------------------------------------------
/.github/workflows/botany.yml:
--------------------------------------------------------------------------------
1 | name: botany
2 |
3 | on:
4 | workflow_dispatch:
5 | schedule:
6 | - cron: "15 5 * * *"
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v4
13 | - name: Use Node.js 14
14 | uses: actions/setup-node@v4
15 | with:
16 | node-version: '14.x'
17 |
18 | - name: Cache node_modules
19 | uses: actions/cache@v3
20 | id: cache-node-modules
21 | with:
22 | path: node_modules
23 | key: ${{ runner.os }}-${{ matrix.node-version }}-nodeModules-${{ hashFiles('package-lock.json') }}-${{ hashFiles('package.json') }}
24 | restore-keys: |
25 | ${{ runner.os }}-${{ matrix.node-version }}-nodeModules-
26 |
27 | - name: Install dependency packages
28 | if: steps.cache-node-modules.outputs.cache-hit != 'true'
29 | run: |
30 | npm install
31 |
32 | - name: Start running the script
33 | run: |
34 | node src/wx_mini/sudojia_botanyStar.js
35 | env:
36 | BOTANY_ACCOUNT: ${{ secrets.BOTANY_ACCOUNT }}
37 | TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
38 | TG_USER_ID: ${{ secrets.TG_USER_ID }}
39 | PUSH_KEY: ${{ secrets.PUSH_KEY }}
40 | BARK_PUSH: ${{ secrets.BARK_PUSH }}
41 | BARK_SOUND: ${{ secrets.BARK_SOUND }}
42 | DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }}
43 | DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }}
44 | QYWX_KEY: ${{ secrets.QYWX_KEY }}
45 | IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY }}
46 | PUSH_PLUS_TOKEN: ${{ secrets.PUSH_PLUS_TOKEN }}
47 | PUSH_PLUS_USER: ${{ secrets.PUSH_PLUS_USER }}
48 |
49 | - name: Delete Workflow Runs
50 | uses: Mattraks/delete-workflow-runs@main
51 | with:
52 | retain_days: 1
53 | keep_minimum_runs: 1
54 |
--------------------------------------------------------------------------------
/.github/workflows/laoban.yml:
--------------------------------------------------------------------------------
1 | name: laoban
2 |
3 | on:
4 | workflow_dispatch:
5 | schedule:
6 | - cron: "36 1 * * *"
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v4
13 | - name: Use Node.js 14
14 | uses: actions/setup-node@v4
15 | with:
16 | node-version: '14.x'
17 |
18 | - name: Cache node_modules
19 | uses: actions/cache@v3
20 | id: cache-node-modules
21 | with:
22 | path: node_modules
23 | key: ${{ runner.os }}-${{ matrix.node-version }}-nodeModules-${{ hashFiles('package-lock.json') }}-${{ hashFiles('package.json') }}
24 | restore-keys: |
25 | ${{ runner.os }}-${{ matrix.node-version }}-nodeModules-
26 |
27 | - name: Install dependency packages
28 | if: steps.cache-node-modules.outputs.cache-hit != 'true'
29 | run: |
30 | npm install
31 |
32 | - name: Start running the script
33 | run: |
34 | node src/wx_mini/sudojia_laoban.js
35 | env:
36 | LAOBAN_OPENID: ${{ secrets.LAOBAN_OPENID }}
37 | TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
38 | TG_USER_ID: ${{ secrets.TG_USER_ID }}
39 | PUSH_KEY: ${{ secrets.PUSH_KEY }}
40 | BARK_PUSH: ${{ secrets.BARK_PUSH }}
41 | BARK_SOUND: ${{ secrets.BARK_SOUND }}
42 | DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }}
43 | DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }}
44 | QYWX_KEY: ${{ secrets.QYWX_KEY }}
45 | IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY }}
46 | PUSH_PLUS_TOKEN: ${{ secrets.PUSH_PLUS_TOKEN }}
47 | PUSH_PLUS_USER: ${{ secrets.PUSH_PLUS_USER }}
48 |
49 | - name: Delete Workflow Runs
50 | uses: Mattraks/delete-workflow-runs@main
51 | with:
52 | retain_days: 1
53 | keep_minimum_runs: 1
54 |
--------------------------------------------------------------------------------
/.github/workflows/tieba.yml:
--------------------------------------------------------------------------------
1 | name: tieba
2 |
3 | on:
4 | workflow_dispatch:
5 | schedule:
6 | - cron: "50 5 * * *"
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v4
13 | - name: Use Node.js 14
14 | uses: actions/setup-node@v4
15 | with:
16 | node-version: '14.x'
17 |
18 | - name: Cache node_modules
19 | uses: actions/cache@v3
20 | id: cache-node-modules
21 | with:
22 | path: node_modules
23 | key: ${{ runner.os }}-${{ matrix.node-version }}-nodeModules-${{ hashFiles('package-lock.json') }}-${{ hashFiles('package.json') }}
24 | restore-keys: |
25 | ${{ runner.os }}-${{ matrix.node-version }}-nodeModules-
26 |
27 | - name: Install dependency packages
28 | if: steps.cache-node-modules.outputs.cache-hit != 'true'
29 | run: |
30 | npm install
31 |
32 | - name: Start running the script
33 | run: |
34 | node src/web/sudojia_tieba.js
35 | env:
36 | TIE_BA_COOKIE: ${{ secrets.TIE_BA_COOKIE }}
37 | TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
38 | TG_USER_ID: ${{ secrets.TG_USER_ID }}
39 | PUSH_KEY: ${{ secrets.PUSH_KEY }}
40 | BARK_PUSH: ${{ secrets.BARK_PUSH }}
41 | BARK_SOUND: ${{ secrets.BARK_SOUND }}
42 | DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }}
43 | DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }}
44 | QYWX_KEY: ${{ secrets.QYWX_KEY }}
45 | IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY }}
46 | PUSH_PLUS_TOKEN: ${{ secrets.PUSH_PLUS_TOKEN }}
47 | PUSH_PLUS_USER: ${{ secrets.PUSH_PLUS_USER }}
48 |
49 | - name: Delete Workflow Runs
50 | uses: Mattraks/delete-workflow-runs@main
51 | with:
52 | retain_days: 1
53 | keep_minimum_runs: 1
54 |
--------------------------------------------------------------------------------
/.github/workflows/v2ex.yml:
--------------------------------------------------------------------------------
1 | name: v2ex
2 |
3 | on:
4 | workflow_dispatch:
5 | schedule:
6 | - cron: "35 0 * * *"
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v4
13 | - name: Use Node.js 14
14 | uses: actions/setup-node@v4
15 | with:
16 | node-version: '14.x'
17 |
18 | - name: Cache node_modules
19 | uses: actions/cache@v3
20 | id: cache-node-modules
21 | with:
22 | path: node_modules
23 | key: ${{ runner.os }}-${{ matrix.node-version }}-nodeModules-${{ hashFiles('package-lock.json') }}-${{ hashFiles('package.json') }}
24 | restore-keys: |
25 | ${{ runner.os }}-${{ matrix.node-version }}-nodeModules-
26 |
27 | - name: Install dependency packages
28 | if: steps.cache-node-modules.outputs.cache-hit != 'true'
29 | run: |
30 | npm install
31 |
32 | - name: Start running the script
33 | run: |
34 | node src/web/sudojia_v2ex.js
35 | env:
36 | V2EX_COOKIE: ${{ secrets.V2EX_COOKIE }}
37 | TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
38 | TG_USER_ID: ${{ secrets.TG_USER_ID }}
39 | PUSH_KEY: ${{ secrets.PUSH_KEY }}
40 | BARK_PUSH: ${{ secrets.BARK_PUSH }}
41 | BARK_SOUND: ${{ secrets.BARK_SOUND }}
42 | DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }}
43 | DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }}
44 | QYWX_KEY: ${{ secrets.QYWX_KEY }}
45 | IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY }}
46 | PUSH_PLUS_TOKEN: ${{ secrets.PUSH_PLUS_TOKEN }}
47 | PUSH_PLUS_USER: ${{ secrets.PUSH_PLUS_USER }}
48 |
49 | - name: Delete Workflow Runs
50 | uses: Mattraks/delete-workflow-runs@main
51 | with:
52 | retain_days: 1
53 | keep_minimum_runs: 1
54 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | dist/
4 | .cargo-ok
5 | .idea/
6 | backup
7 | test
8 | target
9 | source
10 | docs
11 | package-lock.json
12 | utils/ipCache.json
13 | img
14 | reverts.sh
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
AutoTaskScript
3 |
4 |
5 | 一些脚本,每天定时自动签到
6 |
7 |
8 | 🐛上报 Bug、🤔问题反馈、📄需求提报!
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | ## 💡食用指南
22 |
23 | [点我前往查看脚本食用指南](https://rh-docs.netlify.app/)
24 |
25 | ## 💬讨论交流
26 |
27 | - [💬Telegram Group](https://t.me/v_script)
28 | - [🔔Telegram Channel](https://t.me/IiiiOOiiiiOO)
29 |
30 | ## 👍服务器推荐
31 |
32 | 1. [【阿里云】2核2G3M,99/年,续费同价](https://www.aliyun.com/daily-act/ecs/activity_selection?userCode=ga5zx65v)
33 | 2. [【腾讯云】2核2G4M云服务器新老同享99元/年,续费同价](https://curl.qcloud.com/3wQPyTQE)
34 | 3. [【华为云】普惠上云专区限时秒杀:2核2G2M,最低38/年](https://activity.huaweicloud.com/discount_area_v5/index.html)
35 |
36 | ## 🗃项目架构
37 |
38 | ```markdown
39 | /AutoTaskScript
40 | ├── src
41 | │ ├── client
42 | │ │ └── 存放客户端类
43 | │ ├── public
44 | │ │ └── 存放公众号类
45 | │ ├── web
46 | │ │ └── 存放网页类
47 | │ ├── wx_mini
48 | │ │ └── 存放小程序类
49 | │ ├── other
50 | │ │ └── 存放辅助类,例如检测账号失效等
51 | │ └── utils
52 | │ └── 存放通用工具类
53 | └── README.md
54 | ```
55 |
56 | ## ⚠️免责声明
57 |
58 | - 本仓库发布的 AutoTaskScript 项目中涉及的解锁解密分析脚本仅用于测试、学习和研究,禁止用于商业目的。 其合法性、准确性、完整性和有效性无法得到保证。 请根据实际情况作出自己的判断。
59 | - 禁止任何官方账号或自媒体以任何形式复制或发布本项目中的所有资源文件。
60 | - 本仓库不负责任何脚本问题,包括但不限于任何脚本错误导致的任何损失或损坏。
61 | - 任何间接使用该脚本的用户,包括但不限于建立 VPS 或在某些行为违反国家/地区法律或相关法规时传播该脚本,本仓库不承担由此造成的任何隐私泄露或其他后果。
62 | - 请勿将本脚本项目的任何内容用于商业或非法目的,否则所造成的后果由您自行承担。
63 | - 任何单位或个人认为项目脚本可能侵犯其权利时,应及时通知并提供身份证明和所有权证明。 我们会在收到认证文件后删除相应的脚本。
64 | - 任何以任何方式或直接或间接使用 AutoTaskScript 项目的任何脚本的人都应该仔细阅读此声明。本仓库保留随时更改或补充本免责声明的权利。 一旦您使用并复制了 AutoTaskScript 项目的任何相关脚本或规则,您就被视为接受了本免责声明。
65 | - 您必须在下载后 24 小时内从您的电脑或手机上彻底删除以上内容。
66 |
67 | > 您在本仓库使用或复制了本库中由本人开发的任何脚本,即视为已接受此声明。请在使用前仔细阅读以上条款。
68 |
69 | ## 🥣打赏支持
70 |
71 | [打赏作者](https://rh-docs.netlify.app/docs/support/)
72 |
73 | 如果觉得这个项目帮助到了你,你可以选择以打赏的方式来表达你的赞赏,无论是一杯奶茶🧋还是一包辣条🌶️
74 |
75 | 每一份打赏都是我开发脚本的极大鼓励,也是我继续前进的动力。
76 |
77 | > 打赏是完全自愿的,我从未也不会强迫任何人这样做
78 |
79 | ## ⚖️License
80 |
81 | [GPLv3](https://github.com/sudojia/AutoTaskScript/blob/script/LICENSE) licensed.
82 |
--------------------------------------------------------------------------------
/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | # Author:Akira
2 | # Modify:sudojia
3 | FROM alpine:3.12
4 |
5 | LABEL AUTHOR="sudojia" \
6 | VERSION=1.0.0
7 |
8 | # 设置工作目录为 /AutoTaskScript
9 | WORKDIR /AutoTaskScript
10 |
11 | # 设置环境变量
12 | # 用于配置默认的定时文件、合并类型(append:追加默认定时任务、overwrite:自定义任务)和脚本仓库地址
13 | ENV DEFAULT_LIST_FILE=crontab_list.sh \
14 | CUSTOM_LIST_MERGE_TYPE=append \
15 | REPO_URL=https://github.com/sudojia/AutoTaskScript
16 |
17 | RUN set -ex \
18 | && apk update && apk upgrade\
19 | && apk add --no-cache tzdata git nodejs moreutils npm curl jq \
20 | && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
21 | && echo "Asia/Shanghai" > /etc/timezone
22 |
23 | RUN git clone ${REPO_URL} . \
24 | && npm install \
25 | && mkdir -p src/logs
26 |
27 | RUN cp /AutoTaskScript/docker/docker_entrypoint.sh /usr/local/bin \
28 | && chmod +x /usr/local/bin/docker_entrypoint.sh
29 |
30 | ENTRYPOINT ["docker_entrypoint.sh"]
31 |
32 | # 容器启动时,默认执行crond服务
33 | CMD [ "crond" ]
34 |
--------------------------------------------------------------------------------
/docker/crontab_list.sh:
--------------------------------------------------------------------------------
1 | # 每隔 3 天 23:50 清理一次日志
2 | 50 23 */3 * * rm -rf /AutoTaskScript/src/logs/*.log
3 |
4 | # 以下只是示例,自行删除添加
5 | ##############小程序##############
6 | # 霸王茶姬
7 | 22 11 * * * node /AutoTaskScript/src/wx_mini/sudojia_bwtea.js >> /AutoTaskScript/src/logs/sudojia_bwtea.log 2>&1
8 |
9 | ##############客户端##############
10 | # 多娇江山
11 | 14 7 * * * node /AutoTaskScript/src/client/sudojia_jiangshan.js >> /AutoTaskScript/src/logs/sudojia_jiangshan.log 2>&1
12 |
13 | ##############网页端##############
14 | # v2ex
15 | 0 9 * * * node /AutoTaskScript/src/web/sudojia_v2ex.js >> /AutoTaskScript/src/logs/sudojia_v2ex.log 2>&1
16 |
17 | ##############公众号##############
18 | # 水费易
19 | 3 9 * * * node /AutoTaskScript/src/public/sudojia_shuifei.js >> /AutoTaskScript/src/logs/sudojia_shuifei.log 2>&1
20 |
--------------------------------------------------------------------------------
/docker/default_task.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Author: lxk0301
3 | # Modify:sudojia
4 | set -e
5 |
6 | echo "定义定时任务合并处理用到的文件路径..."
7 | defaultListFile="/AutoTaskScript/docker/$DEFAULT_LIST_FILE"
8 | echo "默认文件定时任务文件路径为 ${defaultListFile}"
9 | mergedListFile="/AutoTaskScript/docker/merged_list_file.sh"
10 | echo "合并后定时任务文件路径为 ${mergedListFile}"
11 | echo "##############自动生成的定时任务##############" > /AutoTaskScript/docker/crontab_list.sh
12 |
13 | echo "开始自动生成定时任务列表..."
14 | find /AutoTaskScript/src -type f -name "*.js" ! -path "*/utils/*" | while read -r js_file; do
15 | if [ -f "$js_file" ]; then
16 | script_name=$(basename "$js_file")
17 | cron_expression=$(grep -o 'cron: [^#\n\r]*' "$js_file" | sed 's/cron: //')
18 | task_name=$(grep -o "new Env('[^']*')" "$js_file" | sed "s/new Env('//;s/')//")
19 | if [ -n "$cron_expression" ]; then
20 | if [ -n "$task_name" ]; then
21 | echo "# $task_name" >> /AutoTaskScript/docker/crontab_list.sh
22 | else
23 | echo "# 未定义的任务名称" >> /AutoTaskScript/docker/crontab_list.sh
24 | fi
25 | echo "$cron_expression node $js_file >> /AutoTaskScript/src/logs/${script_name%.js}.log 2>&1" >> /AutoTaskScript/docker/crontab_list.sh
26 | else
27 | echo "警告:$js_file 没有 cron 或 cron 有误"
28 | fi
29 | fi
30 | done
31 |
32 | echo "第1步将默认定时任务列表添加到并后定时任务文件..."
33 | cat "$defaultListFile" > "$mergedListFile"
34 |
35 | echo "第2步判断是否存在自定义任务任务列表并追加..."
36 | if [ $CUSTOM_LIST_FILE ]; then
37 | echo "您配置了自定义任务文件:$CUSTOM_LIST_FILE,自定义任务类型为:$CUSTOM_LIST_MERGE_TYPE..."
38 | # 无论远程还是本地挂载, 均复制到 $customListFile
39 | customListFile="/AutoTaskScript/docker/custom_list_file.sh"
40 | echo "自定义定时任务文件临时工作路径为 ${customListFile}"
41 | if expr "$CUSTOM_LIST_FILE" : 'http.*' &>/dev/null; then
42 | echo "自定义任务文件为远程脚本,开始下载自定义远程任务。"
43 | wget -O $customListFile $CUSTOM_LIST_FILE
44 | echo "下载完成..."
45 | elif [ -f /AutoTaskScript/docker/$CUSTOM_LIST_FILE ]; then
46 | echo "自定义任务文件为本地挂载。"
47 | cp /AutoTaskScript/docker/$CUSTOM_LIST_FILE $customListFile
48 | fi
49 | if [ -f "$customListFile" ]; then
50 | if [ $CUSTOM_LIST_MERGE_TYPE == "append" ]; then
51 | echo "合并默认定时任务文件:$DEFAULT_LIST_FILE 和 自定义定时任务文件:$CUSTOM_LIST_FILE"
52 | echo -e "" >>$mergedListFile
53 | cat $customListFile >>$mergedListFile
54 | elif [ $CUSTOM_LIST_MERGE_TYPE == "overwrite" ]; then
55 | echo "配置了自定义任务文件:$CUSTOM_LIST_FILE,自定义任务类型为:$CUSTOM_LIST_MERGE_TYPE..."
56 | cat $customListFile >$mergedListFile
57 | else
58 | echo "配置配置了错误的自定义定时任务类型:$CUSTOM_LIST_MERGE_TYPE,自定义任务类型为只能为 append 或者 overwrite..."
59 | fi
60 | else
61 | echo "配置的自定义任务文件:$CUSTOM_LIST_FILE未找到,使用默认配置$DEFAULT_LIST_FILE..."
62 | fi
63 | else
64 | echo "当前只使用了默认定时任务文件 $DEFAULT_LIST_FILE ..."
65 | fi
66 |
67 | echo "第3步判断是否配置了随即延迟参数..."
68 | if [ $RANDOM_DELAY_MAX ]; then
69 | if [ $RANDOM_DELAY_MAX -ge 1 ]; then
70 | echo "已设置随机延迟为 $RANDOM_DELAY_MAX , 设置延迟任务中..."
71 | sed -i "s/node/sleep $((RANDOM % RANDOM_DELAY_MAX)); node/g" "$mergedListFile"
72 | fi
73 | else
74 | echo "未配置随即延迟对应的环境变量,故不设置延迟任务..."
75 | fi
76 |
77 | echo "第4步删除不运行的脚本任务..."
78 | if [ $DO_NOT_RUN_SCRIPTS ]; then
79 | echo "您配置了不运行的脚本:$DO_NOT_RUN_SCRIPTS"
80 | arr=${DO_NOT_RUN_SCRIPTS//&/ }
81 | for item in $arr; do
82 | sed -ie '/'"${item}"'/d' ${mergedListFile}
83 | done
84 | fi
85 |
86 | echo "第5步设定下次运行 docker_entrypoint.sh 时间..."
87 | echo "删除原有 docker_entrypoint.sh 任务"
88 | sed -ie '/'docker_entrypoint.sh'/d' ${mergedListFile}
89 |
90 | echo "设定 docker_entrypoint.sh cron为:"
91 | echo -e "\n# 必要的默认定时任务请勿删除" >>$mergedListFile
92 | echo -e "52 */6 * * * docker_entrypoint.sh >> /AutoTaskScript/src/logs/default_task.log 2>&1" >>$mergedListFile
93 |
94 | echo "第6步增加 |ts 任务日志输出时间戳..."
95 | sed -i "/\( ts\| |ts\|| ts\)/!s/>>/\|ts >>/g" $mergedListFile
96 |
97 | echo "第7步加载最新的定时任务文件..."
98 | crontab $mergedListFile
99 |
100 | echo "第8步将仓库的 docker_entrypoint.sh 脚本更新至系统 /usr/local/bin/docker_entrypoint.sh 内..."
101 | cat /AutoTaskScript/docker/docker_entrypoint.sh > /usr/local/bin/docker_entrypoint.sh
102 |
--------------------------------------------------------------------------------
/docker/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 | services:
3 | AutoTaskScript:
4 | image: sudojia/auto_task_script
5 | container_name: AutoTaskScript
6 | restart: always
7 | # 挂载容器目录(默认即可)
8 | volumes:
9 | - ./logs:/AutoTaskScript/src/logs
10 | - ./my_crontab_list.sh:/AutoTaskScript/docker/my_crontab_list.sh
11 | tty: true
12 | environment:
13 | # 脚本更新仓库地址
14 | - REPO_URL=https://github.com/sudojia/AutoTaskScript
15 | # 注意环境变量填写值的时候一律不需要引号(""或者'')
16 | # 注意环境变量填写值的时候一律不需要引号(""或者'')
17 | # 注意环境变量填写值的时候一律不需要引号(""或者'')
18 | # --------------- 配置消息通知区域 ---------------
19 | # 需要哪个就配置哪个变量
20 | # 通知环境变量参考源码:https://github.com/sudojia/AutoTaskScript/blob/script/src/utils/sendNotify.js
21 | # 以下这些只是示例,根据自己的需求增加删除
22 | # wxPusher
23 | - WXPUSHER_TOKEN=
24 | - WXPUSHER_UID=
25 | # telegram
26 | - TG_BOT_TOKEN=
27 | - TG_USER_ID=
28 | # Bark App
29 | - BARK_PUSH=
30 | # 钉钉机器人
31 | - DD_BOT_TOKEN=
32 | - DD_BOT_SECRET=
33 | # 企业微信机器人
34 | - QYWX_KEY=
35 | # 其它...
36 |
37 | # --------------- 配置脚本变量区域 ---------------
38 | # 自行添加脚本所需的变量
39 | # 脚本环境变量参考:https://rh-docs.netlify.app/docs/category/%E8%84%9A%E6%9C%AC%E5%88%97%E8%A1%A8
40 | # 安慕希
41 | - AMX_TOKEN=
42 | # 飞蚂蚁旧衣回收
43 | - FLY_ANT_TOKEN=
44 | # 其它...
45 |
46 | # --------------- 延迟配置 ---------------
47 | # 这个选项将决定脚本在实际执行前将随机延迟多少秒
48 | # 如果不设置此项,则不使用延迟。
49 | # 填写数字,单位为秒,比如 RANDOM_DELAY_MAX=30 就是随机产生 0 到 29 之间的一个秒数,执行延迟的意思。
50 | - RANDOM_DELAY_MAX=
51 |
52 | # --------------- 其它配置 ---------------
53 | # 配置不运行的脚本,多个脚本用 & 分隔,例如:sudojia_starMom.js&sudojia_tilta.js
54 | - DO_NOT_RUN_SCRIPTS=
55 | # 下面选项默认即可
56 | # 使用自定义任务,上面 volumes 挂载之后这里配置对应的文件名
57 | - CUSTOM_LIST_FILE=my_crontab_list.sh
58 |
--------------------------------------------------------------------------------
/docker/docker_entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Author: lxk0301
3 | # Modify:sudojia
4 | set -e
5 |
6 | # 获取配置的自定义参数
7 | if [ $1 ]; then
8 | run_cmd=$1
9 | fi
10 |
11 | echo "设定远程仓库地址..."
12 | cd /AutoTaskScript
13 | git remote set-url origin $REPO_URL
14 | git reset --hard
15 |
16 | echo "git pull 拉取最新代码..."
17 | git -C /AutoTaskScript pull --rebase
18 |
19 | echo "设置 npm 源为淘宝镜像..."
20 | npm config set registry https://registry.npmmirror.com
21 |
22 | echo "npm install 安装最新依赖"
23 | npm install --prefix /AutoTaskScript
24 | # 恢复默认 npm 源
25 | npm config delete registry
26 |
27 | echo "------------------------------------执行定时任务任务shell脚本------------------------------------"
28 | sh -x /AutoTaskScript/docker/default_task.sh
29 |
30 | echo "------------------------------------默认定时任务执行完成------------------------------------"
31 | # 根据自定义参数决定是否启动crontab定时任务主进程
32 | if [ $run_cmd ]; then
33 | echo -e "启动 crontab 定时任务主进程...\n\n"
34 | crond -f
35 | else
36 | echo -e "默认定时任务执行结束。\n\n"
37 | fi
38 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "autotaskscript",
3 | "version": "1.0.0",
4 | "description": "A script project based on the daily sign-in automation task of Qinglong panel",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/sudojia/AutoTaskScript.git"
12 | },
13 | "keywords": [
14 | "签到,脚本,自动化"
15 | ],
16 | "author": "sudojia",
17 | "license": "GPL-3.0",
18 | "dependencies": {
19 | "axios": "^1.6.8",
20 | "cheerio": "^1.0.0-rc.12",
21 | "download": "^8.0.0",
22 | "got": "^11.8.3",
23 | "http-server": "^0.12.3",
24 | "moment": "^2.30.1",
25 | "tough-cookie": "^5.0.0",
26 | "tunnel": "0.0.6",
27 | "ws": "^7.4.3"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/client/sudojia_moto.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 摩托范 APP
3 | *
4 | * 抓包 Host:https://api.58moto.com 获取请求头 token 的值和 uid (token#uid)
5 | * export MOTO_TOKEN = 'f08xxxxxxxxxxxxxxxxx#22222222'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/08/27
11 | *
12 | * const $ = new Env('摩托范')
13 | * cron: 33 3 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('摩托范');
17 | const moment = require("moment/moment");
18 | const motoList = process.env.MOTO_TOKEN ? process.env.MOTO_TOKEN.split(/[\n&]/) : [];
19 | // 消息推送
20 | let message = '';
21 | // 接口地址
22 | const baseUrl = 'https://api.58moto.com'
23 | // 请求头
24 | const headers = {
25 | 'User-Agent': 'okhttp/4.11.0',
26 | 'Content-Type': 'application/x-www-form-urlencoded',
27 | 'Accept-Encoding': 'gzip',
28 | 'os': 'OPPO:OPPO+R9s',
29 | 'osversion': '28',
30 | 'referer': 'api.58moto.com',
31 | 'version': '3.57.63',
32 | 'timestamp': Date.now()
33 | };
34 |
35 | !(async () => {
36 | await checkUpdate($.name, motoList);
37 | for (let i = 0; i < motoList.length; i++) {
38 | const index = i + 1;
39 | const [token, uid] = motoList[i].split('#');
40 | headers.token = token;
41 | $.userId = uid;
42 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
43 | message += `📣====${$.name}账号[${index}]====📣\n`;
44 | await main();
45 | await $.wait(sudojia.getRandomWait(2000, 2500));
46 | }
47 | if (message) {
48 | await notify.sendNotify(`「${$.name}」`, `${message}`);
49 | }
50 | })().catch((e) => $.logErr(e)).finally(() => $.done());
51 |
52 | async function main() {
53 | await getUserInfo();
54 | await $.wait(sudojia.getRandomWait(800, 1200));
55 | await isSign();
56 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
57 | await getPoints();
58 | }
59 |
60 | /**
61 | * 获取用户信息
62 | *
63 | * @returns {Promise}
64 | */
65 | async function getUserInfo() {
66 | try {
67 | const data = await sudojia.sendRequest(`${baseUrl}/user/center/info/v2/principal`, 'post', headers, `uid=${$.userId}`);
68 | if (data.code !== 0) {
69 | return $.log(data.msg);
70 | }
71 | const mobile = data.data.mobile;
72 | const hiddenMobile = `${mobile.slice(0, 3)}***${mobile.slice(-3)}` || '18888888888';
73 | console.log(`${data.data.nickname}(${hiddenMobile})`);
74 | message += `${data.data.nickname}(${mobile})\n`;
75 | headers.token = data.data.token;
76 | } catch (e) {
77 | console.error(`获取用户信息时发生异常:` + e);
78 | }
79 | }
80 |
81 | /**
82 | * 检测签到
83 | *
84 | * @returns {Promise}
85 | */
86 | async function isSign() {
87 | try {
88 | const data = await sudojia.sendRequest(`${baseUrl}/coins/task/v2/isSign?uid=${$.userId}`, 'get', headers);
89 | if (data.code !== 0) {
90 | return $.log(data.msg);
91 | }
92 | if (data.data.isSign) {
93 | message += `今日已签到\n`;
94 | return $.log(`今日已签到`);
95 | }
96 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
97 | await sign();
98 | } catch (e) {
99 | console.error(`检测签到时发生异常:` + e);
100 | }
101 | }
102 |
103 | /**
104 | * 签到
105 | *
106 | * @returns {Promise}
107 | */
108 | async function sign() {
109 | try {
110 | const data = await sudojia.sendRequest(`${baseUrl}/coins/task/dailyCheckIn`, 'post', headers, `uid=${$.userId}&weekDate=${moment().format('YYYYMMDD')}`);
111 | if (0 !== data.code) {
112 | return $.log(data.msg);
113 | }
114 | console.log(data.data.contentDesc || '签到成功');
115 | message += '签到成功\n';
116 | } catch (e) {
117 | console.error(`签到时发生异常:` + e);
118 | }
119 | }
120 |
121 | /**
122 | * 获取积分
123 | *
124 | * @returns {Promise}
125 | */
126 | async function getPoints() {
127 | try {
128 | const data = await sudojia.sendRequest(`${baseUrl}/coins/account/energy?uid=${$.userId}`, 'get', headers);
129 | if (data.code !== 0) {
130 | return $.log(data.msg);
131 | }
132 | console.log(`当前能量:${data.data.available}`);
133 | message += `当前能量:${data.data.available}\n\n`;
134 | } catch (e) {
135 | console.error(`获取积分时发生异常:` + e);
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/src/client/sudojia_tieba_taskSign.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 百度贴吧APP - 我的 - 成长任务 - 每日签到
3 | * 就成长值,没什么用
4 | *
5 | * 抓包 Host:https://tieba.baidu.com 获取 Cookie
6 | * export TIE_BA_COOKIE = 'CUID=00bCCExxxxxxxx; BDUSS=jhxbxxxxxxxxxxxxxxxx'
7 | * 与贴吧签到变量共用, 多了个 CUID
8 | * 多账号用 & 或换行
9 | *
10 | * @author Telegram@sudojia
11 | * @site https://blog.imzjw.cn
12 | * @date 2024/09/07
13 | *
14 | * const $ = new Env('贴吧任务签到')
15 | * cron: 19 7 * * *
16 | */
17 | const initScript = require('../utils/initScript')
18 | const {$, notify, sudojia, checkUpdate} = initScript('贴吧任务签到');
19 | const tieBaList = process.env.TIE_BA_COOKIE ? process.env.TIE_BA_COOKIE.split(/[\n&]/) : [];
20 | // 消息推送
21 | let message = '';
22 | // 接口地址
23 | const baseUrl = 'https://tieba.baidu.com';
24 | // 请求头
25 | const headers = {
26 | 'Host': 'tieba.baidu.com',
27 | 'Accept': 'application/json, text/plain, */*',
28 | 'User-Agent': sudojia.getRandomUserAgent('H5'),
29 | };
30 |
31 | !(async () => {
32 | await checkUpdate($.name, tieBaList);
33 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
34 | for (let i = 0; i < tieBaList.length; i++) {
35 | const index = i + 1;
36 | headers.Cookie = tieBaList[i];
37 | $.cuidValue = tieBaList[i].split(';').find(part => part.startsWith('CUID=')).split('=')[1];
38 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
39 | message += `📣====${$.name}账号[${index}]====📣\n`;
40 | await main();
41 | await $.wait(sudojia.getRandomWait(2000, 3000));
42 | }
43 | if (message) {
44 | await notify.sendNotify(`「${$.name}」`, `${message}`);
45 | }
46 | })().catch((e) => $.logErr(e)).finally(() => $.done());
47 |
48 | async function main() {
49 | await getUserInfo();
50 | await $.wait(sudojia.getRandomWait(1000, 1500));
51 | await sign();
52 | await $.wait(sudojia.getRandomWait(1000, 1500));
53 | await getPoints();
54 | }
55 |
56 | /**
57 | * 获取用户信息
58 | *
59 | * @returns {Promise}
60 | */
61 | async function getUserInfo() {
62 | try {
63 | const data = await sudojia.sendRequest(`${baseUrl}/mo/q/usergrowth/showUserGrowth?client_type=2&client_version=12.60.1.2`, 'get', headers);
64 | if (0 !== data.no) {
65 | return $.log(data.error);
66 | }
67 | // 用户名
68 | const userName = data.data.user.uname;
69 | // tbs
70 | $.tbs = data.data.tbs;
71 | console.log(`昵称:${userName}`);
72 | message += `昵称:${userName}\n`;
73 | } catch (e) {
74 | console.error(`获取用户信息时发生异常:${e}`);
75 | }
76 | }
77 |
78 | /**
79 | * 每日签到
80 | *
81 | * @returns {Promise}
82 | */
83 | async function sign() {
84 | try {
85 | const params = `tbs=${$.tbs}&act_type=page_sign&cuid=${$.cuidValue}&client_type=2&brand=OPPO&model=OPPO%20R9s&zid=&clientVersion=12.60.1.2&clientType=2`
86 | const data = await sudojia.sendRequest(`${baseUrl}/mo/q/usergrowth/commitUGTaskInfo`, 'post', headers, params);
87 | if (0 !== data.no) {
88 | return $.log(data.error);
89 | }
90 | console.log('签到成功');
91 | message += '签到成功\n';
92 | } catch (e) {
93 | console.error(`签到时发生异常:${e}`);
94 | }
95 | }
96 |
97 | /**
98 | * 获取用户积分
99 | *
100 | * @returns {Promise}
101 | */
102 | async function getPoints() {
103 | try {
104 | const data = await sudojia.sendRequest(`${baseUrl}/mo/q/usergrowth/showUserGrowth?client_type=2&client_version=12.60.1.2`, 'get', headers);
105 | if (0 !== data.no) {
106 | return $.log(data.error);
107 | }
108 | // 当前成长值
109 | const currentValue = data.data.growth_info.value;
110 | // 贴贝余额
111 | const currentMoney = data.data.tmoney.current;
112 | // 当前等级信息体
113 | const currentLevelBody = data.data.level_info.find(cu => cu.is_current === 1);
114 | // 下一等级
115 | const nextLevel = (currentLevelBody.next_level_value - currentLevelBody.growth_value);
116 | console.log(`当前成长值:${currentValue}`);
117 | console.log(`当前贴贝余额:${currentMoney}`);
118 | console.log(`当前等级:Lv.${currentLevelBody.level}`);
119 | console.log(`距离下一等级还需${nextLevel}成长值`);
120 | message += `当前成长值:${currentValue}\n`;
121 | message += `当前贴贝余额:${currentMoney}\n`;
122 | message += `当前等级:Lv.${currentLevelBody.level}\n`;
123 | message += `距离下一等级还需${nextLevel}成长值\n\n`;
124 | } catch (e) {
125 | console.error(`获取积分时发生异常:${e}`);
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/src/client/sudojia_tuchong.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 图虫APP
3 | *
4 | * 每日签到及部分任务获取积分
5 | * 自行重设密码
6 | * export TUC_ACCOUNTS = '手机号#密码'
7 | * 多账号用 & 或换行
8 | *
9 | * @author Telegram@sudojia
10 | * @site https://blog.imzjw.cn
11 | * @date 2024/12/28
12 | *
13 | * const $ = new Env('图虫')
14 | * cron: 38 5 * * *
15 | */
16 | const initScript = require('../utils/initScript')
17 | const {$, notify, sudojia, checkUpdate} = initScript('图虫');
18 | const crypto = require('crypto');
19 | const tuList = process.env.TUC_ACCOUNTS ? process.env.TUC_ACCOUNTS.split(/[\n&]/) : [];
20 | const key = Buffer.from('41343045353832423133303141423545', 'hex');
21 | // 消息推送
22 | let message = '';
23 | // 接口地址
24 | const baseUrl = 'https://api.tuchong.com'
25 | // 请求头
26 | const headers = {
27 | 'User-Agent': 'okhttp/3.12.2 com.ss.android.tuchong (Tuchong: 7391 7.39.1) (Android: 11 30)',
28 | 'Accept-Encoding': 'gzip',
29 | 'Content-Type': 'application/x-www-form-urlencoded',
30 | 'version': '7576',
31 | 'channel': 'oppo',
32 | 'platform': 'android',
33 | };
34 |
35 | !(async () => {
36 | await checkUpdate($.name, tuList);
37 | for (let i = 0; i < tuList.length; i++) {
38 | const index = i + 1;
39 | const [phone, pwd] = tuList[i].split('#');
40 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
41 | const isLogin = await login(phone, pwd);
42 | if (!isLogin) {
43 | continue;
44 | }
45 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
46 | message += `📣====${$.name}账号[${index}]====📣\n`;
47 | await main();
48 | await $.wait(sudojia.getRandomWait(2000, 2500));
49 | }
50 | if (message) {
51 | await notify.sendNotify(`「${$.name}」`, `${message}`);
52 | }
53 | })().catch((e) => $.logErr(e)).finally(() => $.done());
54 |
55 | async function main() {
56 | await getUserInfo();
57 | await $.wait(sudojia.getRandomWait(1e3, 2e3))
58 | await checkIn();
59 | await $.wait(sudojia.getRandomWait(1e3, 2e3))
60 | await getArticle();
61 | await $.wait(sudojia.getRandomWait(1e3, 2e3))
62 | await getPointStatus();
63 | }
64 |
65 | /**
66 | * 登录
67 | *
68 | * @param phone
69 | * @param pwd
70 | * @returns {Promise}
71 | */
72 | async function login(phone, pwd) {
73 | try {
74 | const encryptedPhone = encrypt(phone);
75 | const data = await sudojia.sendRequest(`${baseUrl}/accounts/login`, 'post', headers, {
76 | "password": pwd,
77 | "account": encryptedPhone
78 | });
79 | if (0 !== data.account_status) {
80 | console.error(`账号或密码错误`);
81 | return false;
82 | }
83 | headers.token = data.token;
84 | $.accountId = data.identity;
85 | console.log(`登录成功`);
86 | return true;
87 | } catch (e) {
88 | console.error(`登录时发生异常:${e}`);
89 | }
90 | }
91 |
92 | /**
93 | * 获取用户信息
94 | *
95 | * @returns {Promise}
96 | */
97 | async function getUserInfo() {
98 | try {
99 | const data = await sudojia.sendRequest(`${baseUrl}/2/sites/${$.accountId}`, 'get', headers);
100 | if ('SUCCESS' !== data.result) {
101 | return console.error(`获取用户信息失败 ->`, data);
102 | }
103 | console.log(`${data.site.name}(${data.site.site_id})`);
104 | message += `${data.site.name}(${data.site.site_id})\n`;
105 | } catch (e) {
106 | console.error(`获取用户信息时发生异常:${e}`);
107 | }
108 | }
109 |
110 | /**
111 | * 签到
112 | *
113 | * @returns {Promise}
114 | */
115 | async function checkIn() {
116 | try {
117 | const data = await sudojia.sendRequest(`${baseUrl}/point/check-in`, 'get', headers);
118 | if ('SUCCESS' !== data.result) {
119 | message += `签到失败, ${data.message}\n`;
120 | return console.error(`签到失败 ->`, data);
121 | }
122 | console.log('签到成功');
123 | message += `签到成功\n`;
124 | } catch (e) {
125 | console.error(`签到时发生异常:${e}`);
126 | }
127 | }
128 |
129 | /**
130 | * 获取文章信息
131 | * 然后随机选择一篇文章进行点赞和关注作者操作
132 | *
133 | * @returns {Promise}
134 | */
135 | async function getArticle() {
136 | try {
137 | const data = await sudojia.sendRequest(`https://tuchong.com/gapi/feed/app`, 'get', headers);
138 | // 过滤掉没有data_id的项,得到有效的文章列表
139 | const filteredFeedList = data.feedList.filter(item => item.data_id !== undefined);
140 | let listElement = filteredFeedList[Math.floor(Math.random() * filteredFeedList.length)];
141 | console.log(`获取到文章id:${listElement.data_id}`);
142 | // 执行点赞操作
143 | await performAction('点赞', favorite, listElement.data_id);
144 | // 执行关注作者操作
145 | await performAction('关注作者', follow, listElement.entry.author_id);
146 | } catch (e) {
147 | console.error(`开宝箱时发生异常:${e}`);
148 | }
149 | }
150 |
151 | /**
152 | * 点赞操作
153 | * 调用performInteraction函数来执行点赞操作
154 | *
155 | * @param postId
156 | * @returns {Promise}
157 | */
158 | async function favorite(postId) {
159 | return await performInteraction('favorite', postId);
160 | }
161 |
162 | /**
163 | * 关注作者操作
164 | * 调用performInteraction函数来执行关注作者操作
165 | *
166 | * @param userId
167 | * @returns {Promise}
168 | */
169 | async function follow(userId) {
170 | return await performInteraction('follow', userId, 'site_id');
171 | }
172 |
173 | /**
174 | * 执行交互操作,点赞和关注
175 | *
176 | * @param action 交互操作类型 'favorite' 或 'follow'
177 | * @param id 文章ID或用户ID
178 | * @param paramKey 请求参数中的键名,默认为 'post_id'
179 | *
180 | * @returns {Promise}
181 | */
182 | async function performInteraction(action, id, paramKey = 'post_id') {
183 | try {
184 | let data = await sudojia.sendRequest(`https://tuchong.com/gapi/interactive/${action}?_rticket=${new Date().getTime()}`, 'put', headers, {
185 | [paramKey]: id
186 | });
187 | console.log(`开始取消操作`);
188 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
189 | data = await sudojia.sendRequest(`https://tuchong.com/gapi/interactive/${action}?${paramKey}=${id}`, 'DELETE', headers);
190 | console.log(data);
191 | } catch (e) {
192 | console.error(`${action}时发生异常:${e}`);
193 | }
194 | }
195 |
196 | async function performAction(description, actionFunction, id) {
197 | console.log(`开始${description}`);
198 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
199 | // 执行传入的操作函数
200 | await actionFunction(id);
201 | }
202 |
203 | /**
204 | * 获取积分
205 | *
206 | * @returns {Promise}
207 | */
208 | async function getPointStatus() {
209 | try {
210 | const data = await sudojia.sendRequest(`https://m.tuchong.com/tuchonggapi/misc/point/v2/status?platform=android&version=7.57.6`, 'get', headers);
211 | console.log(`当前积分:${data.status.total_point}`);
212 | console.log(`当前等级:${data.status.influence_level_text}`);
213 | message += `当前积分:${data.status.total_point}\n当前等级:${data.status.influence_level_text}\n\n`;
214 | } catch (e) {
215 | console.error(`获取积分状态时发生异常:${e}`);
216 | }
217 | }
218 |
219 | function encrypt(text) {
220 | const cipher = crypto.createCipheriv('aes-128-ecb', key, '');
221 | cipher.setAutoPadding(true);
222 | let encrypted = cipher.update(text, 'utf8', 'base64');
223 | encrypted += cipher.final('base64');
224 | return encrypted;
225 | }
226 |
--------------------------------------------------------------------------------
/src/client/sudojia_xhn.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 新湖南 APP
3 | *
4 | * 开发不易,作者专属邀请码:RWY6745
5 | *
6 | * 注册请使用真机注册,请勿使用模拟器,否则会导致账号黑号
7 | * 目前只写了每日签到,因为其它任务打开文章模拟器直接闪退
8 | *
9 | * 登录之前开启抓包,登录成功之后找到 URL:https://xhnapi2.voc.com.cn/v5/user/login 并全选复制请求体参数
10 | * export XHN_ACCOUNTS = 'password=XXXX&logintype=1&RegistrationID=AsE7lggMxlmXXXXXXXXXXXX&appid=9&type=0&username=18888888888'
11 | * 多账号用 “换行”,不要用 & 不要用 & 不要用 &
12 | *
13 | * @author Telegram@sudojia
14 | * @site https://blog.imzjw.cn
15 | * @date 2024/11/29
16 | *
17 | * const $ = new Env('新湖南')
18 | * cron: 51 4 * * *
19 | */
20 | const initScript = require('../utils/initScript')
21 | const {$, notify, sudojia, checkUpdate} = initScript('新湖南');
22 | const crypto = require('crypto');
23 | const xhnList = process.env.XHN_ACCOUNTS ? process.env.XHN_ACCOUNTS.split(/\n/) : [];
24 | // 消息推送
25 | let message = '';
26 | // 接口地址
27 | const baseUrl = 'https://usergrow-xhncloud.voc.com.cn'
28 | // 请求头
29 | const headers = {
30 | 'User-Agent': 'xhn-11.0.3-Mozilla/5.0 (Linux; Android 9; V1916A Build/PQ3B.190801.06131105; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/91.0.4472.114 Mobile Safari/537.36',
31 | 'Accept-Encoding': 'gzip, deflate',
32 | 'referer': 'https://usergrow-xhncloud.voc.com.cn/points/web/',
33 | };
34 |
35 | !(async () => {
36 | await checkUpdate($.name, xhnList);
37 | for (let i = 0; i < xhnList.length; i++) {
38 | const index = i + 1;
39 | $.isLogin = true;
40 | $.accounts = xhnList[i];
41 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
42 | await login()
43 | if (!$.isLogin) {
44 | console.error('账号已失效');
45 | await notify.sendNotify(`「账号失效通知」`, `${$.name}账号[${index}]已失效,请手动尝试登录\n\n`);
46 | continue;
47 | }
48 | message += `📣====${$.name}账号[${index}]====📣\n`;
49 | await main();
50 | await $.wait(sudojia.getRandomWait(2000, 2500));
51 | }
52 | if (message) {
53 | await notify.sendNotify(`「${$.name}」`, `${message}`);
54 | }
55 | })().catch((e) => $.logErr(e)).finally(() => $.done());
56 |
57 | async function main() {
58 | await sign();
59 | await $.wait(sudojia.getRandomWait(2000, 2500));
60 | await getPoints();
61 | }
62 |
63 |
64 | /**
65 | * 登录接口
66 | *
67 | * @returns {Promise}
68 | */
69 | async function login() {
70 | try {
71 | const randomBytes = crypto.randomBytes(20);
72 | const hexString = randomBytes.toString('hex').toUpperCase();
73 | const timestamp = Date.now();
74 | const header = {
75 | 'User-Agent': 'xhn/11.0.3 (vivo/V1916A; android/28; okhttp/4.12.0)',
76 | 'Accept-Encoding': 'gzip',
77 | 'Content-Type': 'application/x-www-form-urlencoded',
78 | 'os': 'android',
79 | 'rmt-device-id': hexString,
80 | 'appversion': '11.0.3',
81 | 'rmt-device-type': 'android',
82 | 'rmt-build': '1100302',
83 | 'rmt-app-version': '11.0.3',
84 | 'rmt-app-id': '9',
85 | 'rmt-hash': sudojia.md5(`C50GIK6GDhQNjtMRVRoQbwxVovXCX8DUv5android${hexString}${timestamp}`),
86 | 'rmt-request-time': timestamp,
87 | }
88 | const data = await sudojia.sendRequest('https://xhnapi2.voc.com.cn/v5/user/login', 'post', header, $.accounts)
89 | if (1 !== data.state_code) {
90 | $.isLogin = false;
91 | return console.error('登录失败 ->', data.message);
92 | }
93 | console.log('登录成功');
94 | $.authToken = data.data.auth;
95 | } catch (e) {
96 | console.error(`登录时发生异常:${e}`);
97 | }
98 | }
99 |
100 | /**
101 | * 获取签名头
102 | *
103 | * @param headers
104 | * @param nonce
105 | * @returns {any}
106 | */
107 | function getSignHeaders(headers, nonce) {
108 | const headersCp = JSON.parse(JSON.stringify(headers));
109 | headersCp.time = Date.now();
110 | headersCp.nonce = nonce;
111 | const originalData = `${headersCp.time}${headersCp.nonce}hHacFKN5DxR5sPwyc1ns52M168rdoe3AGrWaseN3zYd2XoKaxYhYQTqDXvCtMkwz`;
112 | headersCp.signature = crypto.createHash('sha1').update(originalData).digest('hex');
113 | return headersCp;
114 | }
115 |
116 | async function sign() {
117 | try {
118 | const headersCp = getSignHeaders(headers, '300000');
119 | const data = await sudojia.sendRequest(`${baseUrl}/usergrow/api/v2/points/`, 'post', headersCp, `points_rule_id=8&appid=9&oauth_token=${$.authToken}`);
120 | if (1 !== data.statecode) {
121 | message += `签到失败 -> ${data.message}\n`;
122 | return console.error('签到失败 ->', data.message);
123 | }
124 | console.log(`${data.data.successNote}(${data.data.ruleName})`);
125 | message += `${data.data.successNote}(${data.data.ruleName})\n`;
126 | } catch (e) {
127 | console.error(`签到时发生异常:${e}`);
128 | }
129 | }
130 |
131 | async function getPoints() {
132 | try {
133 | const headersCp = getSignHeaders(headers, '700000');
134 | const data = await sudojia.sendRequest(`${baseUrl}/usergrow/api/v2/points/pointsUser?refreshUserInfo=0&appid=9&oauth_token=${$.authToken}`, 'get', headersCp);
135 | if (1 !== data.statecode) {
136 | return console.error('获取用户积分失败 ->', data.message);
137 | }
138 | console.log(`当前积分:${data.data.validPoints}`);
139 | message += `当前积分:${data.data.validPoints}\n\n`;
140 | } catch (e) {
141 | console.error(`获取用户积分时发生异常:${e}`);
142 | }
143 | }
144 |
145 | // async function getTaskList() {
146 | // try {
147 | // const headersCp = getSignHeaders(headers, '600000');
148 | // const data = await sudojia.sendRequest(`${baseUrl}/usergrow/api/v2/points/pointsData?appid=9&oauth_token=${$.authToken}`, 'get', headersCp);
149 | // if (1 !== data.statecode) {
150 | // return console.error('获取任务列表失败 ->', data.message);
151 | // }
152 | //
153 | // for (const task of data.data.pointsRuleBeanList) {
154 | // if (!task.buttonName) {
155 | // continue;
156 | // }
157 | // console.log(task.buttonName, task.pointsRuleId);
158 | // }
159 | //
160 | // } catch (e) {
161 | // }
162 | // }
163 |
--------------------------------------------------------------------------------
/src/public/sudojia_shuifei.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 微信公众号:水费易
3 | *
4 | * 抓包 Host:https://m.ipaiyun.cn 获取请求头 Cookie 的值和请求 Body 参数 memberId,用 # 分割
5 | * export SHUI_FEI_COOKIE = 'ASP.NET_SessionId=xxxxxx; IPAI_UV=xxxx; temp_clause=1#123456'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/07/31
11 | *
12 | * const $ = new Env('水费易签到')
13 | * cron: 3 9 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('水费易签到');
17 | const shuiFeiList = process.env.SHUI_FEI_COOKIE ? process.env.SHUI_FEI_COOKIE.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://m.ipaiyun.cn'
21 | // 请求头
22 | const headers = {
23 | 'Host': 'm.ipaiyun.cn',
24 | 'User-Agent': sudojia.getRandomUserAgent('PC'),
25 | 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
26 | 'Accept': '*/*',
27 | 'Origin': 'https://m.ipaiyun.cn',
28 | 'Referer': 'https://m.ipaiyun.cn/Ipai/Home/Index?code=031sLtFa11eBTH0d0uFa1NqtY53sLtFQ&state=wxbe5b7a2bc0467240',
29 | 'Accept-Encoding': 'gzip, deflate, br',
30 | };
31 |
32 | !(async () => {
33 | await checkUpdate($.name, shuiFeiList);
34 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
35 | for (let i = 0; i < shuiFeiList.length; i++) {
36 | const index = i + 1;
37 | const [cookie, mId] = shuiFeiList[i].split('#');
38 | headers.Cookie = cookie || '';
39 | $.memberId = mId || '';
40 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
41 | message += `📣====${$.name}账号[${index}]====📣\n`;
42 | await main();
43 | await $.wait(sudojia.getRandomWait(2000, 2500));
44 | }
45 | if (message) {
46 | await notify.sendNotify(`「${$.name}」`, `${message}`);
47 | }
48 | })().catch((e) => $.logErr(e)).finally(() => $.done());
49 |
50 | async function main() {
51 | await getUserInfo();
52 | await $.wait(sudojia.getRandomWait(2000, 2500));
53 | await getPoints();
54 | }
55 |
56 | /**
57 | * 获取用户信息
58 | *
59 | * @return {Promise}
60 | */
61 | async function getUserInfo() {
62 | try {
63 | const data = await sudojia.sendRequest(`${baseUrl}/PersonalCenter/PersonalCenter/GetShopMemberDetail`, 'post', headers, `memberId=${$.memberId}`);
64 | if (0 !== data.code) {
65 | console.error(data.message);
66 | return;
67 | }
68 | // 昵称
69 | const nickName = data.resultJson.userMember.nickName;
70 | // 手机号
71 | const phone = data.resultJson.userMember.mobilePhone;
72 | // 剩余签到次数
73 | const signNum = data.resultJson.signNum;
74 | console.log(`${nickName}(${phone})`);
75 | message += `${nickName}(${phone})\n`;
76 | await $.wait(sudojia.getRandomWait(500, 1200));
77 | if (0 === signNum) {
78 | console.log('今日已签到');
79 | message += '今日已签到\n';
80 | return;
81 | }
82 | await $.wait(sudojia.getRandomWait(2000, 2500));
83 | await sign();
84 | } catch (e) {
85 | console.error(`获取用户信息时发生异常:${e}`);
86 | }
87 | }
88 |
89 | /**
90 | * 签到
91 | *
92 | * @return {Promise}
93 | */
94 | async function sign() {
95 | try {
96 | const data = await sudojia.sendRequest(`${baseUrl}/PersonalCenter/PersonalCenter/ShopMemberSign`, 'post', headers, `memberId=${$.memberId}`);
97 | if (0 !== data.code) {
98 | console.error(data.message);
99 | return;
100 | }
101 | console.log(`签到成功,已连续签到${data.resultJson.signdays}天`);
102 | message += `签到成功,已连续签到${data.resultJson.signdays}天\n`;
103 | } catch (e) {
104 | console.error(`签到时发生异常:${e}`);
105 | }
106 | }
107 |
108 | /**
109 | * 积分查询
110 | *
111 | * @return {Promise}
112 | */
113 | async function getPoints() {
114 | try {
115 | const data = await sudojia.sendRequest(`${baseUrl}/PersonalCenter/PersonalCenter/GetShopMemberDetail`, 'post', headers, `memberId=${$.memberId}`);
116 | if (0 !== data.code) {
117 | console.error(data.message);
118 | return;
119 | }
120 | // 积分
121 | const points = data.resultJson.meberinfo.totalIntegral;
122 | console.log(`当前积分:${points}`);
123 | message += `当前积分:${points}\n\n`;
124 | } catch (e) {
125 | console.error(`获取积分时发生异常:${e}`);
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/src/utils/envCheck.js:
--------------------------------------------------------------------------------
1 | module.exports = async function checkUpdate(prefix, list) {
2 | if (JSON.stringify(process.env).indexOf('GITHUB') > -1) {
3 | console.log('\n不建议使用 GitHub Actions 方式运行脚本\n推荐使用青龙面板');
4 | console.log('服务器推荐:https://github.com/sudojia/AutoTaskScript?tab=readme-ov-file#%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%8E%A8%E8%8D%90');
5 | // process.exit(0);
6 | }
7 | if (!list || list.length === 0) {
8 | console.error(`\n未配置环境变量...`);
9 | process.exit(1);
10 | }
11 | console.log(`\n开始执行${prefix}`);
12 | }
--------------------------------------------------------------------------------
/src/utils/initScript.js:
--------------------------------------------------------------------------------
1 | module.exports = (appName) => {
2 | const Env = require('./env');
3 | const $ = new Env(appName);
4 | const notify = $.isNode() ? require('./sendNotify') : '';
5 | const sudojia = require('./common');
6 | const checkUpdate = require('./envCheck');
7 | return {$, notify, sudojia, checkUpdate};
8 | };
--------------------------------------------------------------------------------
/src/web/sudojia_33agilestudio.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 33台词 https://33.agilestudio.cn/invite?userCode=Rx5X7gjH
3 | * 一个通过台词找影片素材
4 | * 每日签到获得积分
5 | *
6 | * 积分有什么用?
7 | * 官方文档回答:
8 | * 1. 积分可以用来截取图片和剪切视频。
9 | * 2. 积分可以兑换会员。(限普通积分)
10 | *
11 | * export AGILE_STUDIO_ACCOUNTS = 'email#password'
12 | * 多账号用 & 或换行
13 | *
14 | * @author Telegram@sudojia
15 | * @site https://blog.imzjw.cn
16 | * @date 2024/12/3
17 | *
18 | * const $ = new Env('33台词')
19 | * cron: 1 11 * * *
20 | */
21 | const initScript = require('../utils/initScript')
22 | const {$, notify, sudojia, checkUpdate} = initScript('33台词');
23 | const agileList = process.env.AGILE_STUDIO_ACCOUNTS ? process.env.AGILE_STUDIO_ACCOUNTS.split(/[\n&]/) : [];
24 | let message = '';
25 | // 接口地址
26 | const baseUrl = 'https://ssv-api.agilestudio.cn'
27 | // 请求头
28 | const headers = {
29 | 'User-Agent': sudojia.getRandomUserAgent('PC'),
30 | 'Accept': 'application/json, text/plain, */*',
31 | 'Accept-Encoding': 'gzip, deflate, br, zstd',
32 | 'Host': 'ssv-api.agilestudio.cn',
33 | 'Origin': 'https://33.agilestudio.cn',
34 | 'Content-Type': 'application/json;charset=UTF-8',
35 | };
36 |
37 | !(async () => {
38 | await checkUpdate($.name, agileList);
39 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
40 | for (let i = 0; i < agileList.length; i++) {
41 | const index = i + 1;
42 | const [email, password] = agileList[i].split('#');
43 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
44 | console.log('开始登录~');
45 | const loginSuccess = await login(email, password);
46 | if (!loginSuccess) {
47 | break;
48 | }
49 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
50 | message += `📣====${$.name}账号[${index}]====📣\n`;
51 | await main();
52 | await $.wait(sudojia.getRandomWait(1500, 2300));
53 | }
54 | if (message) {
55 | await notify.sendNotify(`「${$.name}」`, `${message}`);
56 | }
57 | })().catch((e) => $.logErr(e)).finally(() => $.done());
58 |
59 | async function main() {
60 | await getUserInfo();
61 | await $.wait(sudojia.getRandomWait(1500, 2300));
62 | await dailyCheck();
63 | await $.wait(sudojia.getRandomWait(1500, 2300));
64 | await getPoints();
65 | }
66 |
67 | /**
68 | * 登录
69 | *
70 | * @param email
71 | * @param password
72 | * @returns {Promise}
73 | */
74 | async function login(email, password) {
75 | try {
76 | const ts = (new Date).getTime() - 9999;
77 | headers['x-signature'] = generateXSignature(ts);
78 | const data = await sudojia.sendRequest(`${baseUrl}/api/auth/email-login?_platform=web&_versioin=0.2.5&_ts=${ts}`, 'post', headers, {
79 | "email": email,
80 | "password": password
81 | });
82 | if (0 !== data.code) {
83 | console.error(data.msg);
84 | return false;
85 | }
86 | headers['x-token'] = data.data.token;
87 | console.log('登录成功~');
88 | return true;
89 | } catch (e) {
90 | console.error(`登录时发生异常:${e}`);
91 | return false;
92 | }
93 | }
94 |
95 | async function getUserInfo() {
96 | try {
97 | const ts = (new Date).getTime() - 9999;
98 | headers['x-signature'] = generateXSignature(ts);
99 | const data = await sudojia.sendRequest(`${baseUrl}/api/user/my-info?_platform=web&_versioin=0.2.5&_ts=${ts}`, 'get', headers);
100 | if (0 !== data.code) {
101 | return console.error(data.msg);
102 | }
103 | console.log(`用户:${data.data.email}`);
104 | message += `用户:${data.data.email}\n`;
105 | } catch (e) {
106 | console.error(`获取用户信息时发生异常:${e}`);
107 | }
108 | }
109 |
110 | async function dailyCheck() {
111 | try {
112 | const ts = (new Date).getTime() - 9999;
113 | headers['x-signature'] = generateXSignature(ts);
114 | const data = await sudojia.sendRequest(`${baseUrl}/api/integral/do-daily-check?_platform=web&_versioin=0.2.5&_ts=${ts}`, 'post', headers);
115 | if (0 !== data.code) {
116 | return console.error(data.msg);
117 | }
118 | console.log('签到成功!');
119 | message += `签到成功!\n`;
120 | } catch (e) {
121 | console.error(`签到时发生异常:${e}`);
122 | }
123 | }
124 |
125 | async function getPoints() {
126 | try {
127 | const ts = (new Date).getTime() - 9999;
128 | headers['x-signature'] = generateXSignature(ts);
129 | const data = await sudojia.sendRequest(`${baseUrl}/api/user/user-info?_platform=web&_versioin=0.2.5&_ts=${ts}`, 'get', headers);
130 | if (0 !== data.code) {
131 | return console.error(data.msg);
132 | }
133 | console.log(`当前积分:${data.data.integral}`);
134 | message += `当前积分:${data.data.integral}\n\n`;
135 | } catch (e) {
136 | console.error(`获取积分时发生异常:${e}`);
137 | }
138 | }
139 |
140 | function generateXSignature(ts) {
141 | return sudojia.md5(`_platform=web,_ts=${ts},_versioin=0.2.5,`);
142 | }
143 |
--------------------------------------------------------------------------------
/src/web/sudojia_aliyundrive.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 阿里云盘每日签到
3 | *
4 | * 移除了获取奖励, 目前仅支持签到
5 | * export ALI_REFRESH_TOKEN = 'xxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/5/18
11 | *
12 | * const $ = new Env('阿里云盘签到')
13 | * cron: 35 10 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('阿里云盘签到');
17 | // 环境变量
18 | const refreshTokenList = process.env.ALI_REFRESH_TOKEN ? process.env.ALI_REFRESH_TOKEN.split(/[\n&]/) : [];
19 | // 消息推送
20 | let message = '';
21 | // 阿里云盘 API 配置
22 | const API_CONFIG = {
23 | "SIGN_IN_API": "https://member.aliyundrive.com/v1/activity/sign_in_list",
24 | "GET_REWARD_API": "https://member.aliyundrive.com/v1/activity/sign_in_reward?_rx-s=mobile",
25 | "ACCESS_TOKEN_API": "https://auth.aliyundrive.com/v2/account/token"
26 | }
27 |
28 | !(async () => {
29 | await checkUpdate($.name, refreshTokenList);
30 | for (let i = 0; i < refreshTokenList.length; i++) {
31 | const index = i + 1;
32 | const refreshToken = refreshTokenList[i];
33 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
34 | message += `📣====${$.name}账号[${index}]====📣\n`;
35 | await main(refreshToken);
36 | await $.wait(sudojia.getRandomWait(2300, 2800));
37 | }
38 | if (message) {
39 | await notify.sendNotify(`「${$.name}」`, `${message}`);
40 | }
41 | })().catch((e) => $.logErr(e)).finally(() => $.done());
42 |
43 | async function main(refreshToken) {
44 | const accessToken = await getAccessToken(refreshToken);
45 | if (!accessToken) {
46 | console.log('获取access_token失败, refresh_token可能有误');
47 | return;
48 | }
49 | await $.wait(sudojia.getRandomWait(1200, 2000));
50 | const signInCount = await AliSignIn(refreshToken, accessToken);
51 | // await $.wait(1000);
52 | // await getReward(accessToken, signInCount);
53 | }
54 |
55 | /**
56 | * 获取 access_token
57 | *
58 | * @returns {Promise}
59 | */
60 | async function getAccessToken(refreshToken) {
61 | try {
62 | const params = {
63 | grant_type: 'refresh_token',
64 | refresh_token: refreshToken
65 | }
66 | const data = await sudojia.sendRequest(API_CONFIG.ACCESS_TOKEN_API, 'post', {}, params);
67 | if (!data.access_token) {
68 | console.log('获取access_token失败, refresh_token可能有误');
69 | process.exit(0);
70 | }
71 | message += `【用户昵称】${data.nick_name}(${data.user_name})\n`;
72 | return data.access_token;
73 | } catch (e) {
74 | $.logErr('获取access_token接口异常:', e);
75 | return null;
76 | }
77 | }
78 |
79 | /**
80 | * 签到
81 | *
82 | * @returns {Promise}
83 | */
84 | async function AliSignIn(refreshToken, accessToken) {
85 | try {
86 | const params = {
87 | grant_type: 'refresh_token',
88 | refresh_token: refreshToken
89 | }
90 | const headers = {
91 | 'Content-Type': 'application/json',
92 | 'Authorization': `Bearer ${accessToken}`
93 | }
94 | const data = await sudojia.sendRequest(API_CONFIG.SIGN_IN_API, 'post', headers, params);
95 | console.log(data.success ? '签到成功\n' : '签到失败\n');
96 | message += data.success ? '【签到状态】签到成功\n' : '【签到状态】签到失败\n'
97 | message += `【签到统计】已累计签到${data.result.signInCount}天\n\n`;
98 | // 返回签到天数
99 | return data.result.signInCount;
100 | } catch (e) {
101 | $.logErr('请求签到接口异常:', e);
102 | return null;
103 | }
104 | }
105 |
106 | /**
107 | * 获取签到奖励
108 | *
109 | * @returns {Promise}
110 | */
111 | async function getReward(accessToken, signInCount) {
112 | const params = {
113 | signInDay: signInCount
114 | }
115 | const headers = {
116 | 'Content-Type': 'application/json',
117 | 'Authorization': `Bearer ${accessToken}`
118 | }
119 | const data = await sudojia.sendRequest(API_CONFIG.GET_REWARD_API, 'post', headers, params);
120 | console.log(`奖励: ${data.result.notice}\n`);
121 | message += `【签到奖励】${data.result.notice}\n`
122 | }
123 |
--------------------------------------------------------------------------------
/src/web/sudojia_fnnas.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 飞牛私有云
3 | *
4 | * 官网:https://club.fnnas.com
5 | * 获取 Cookie,格式:pvRK_2132_auth=46exxxxxxxx; pvRK_2132_saltkey=F3xxxxx
6 | * export FN_NAS_COOKIE = 'pvRK_2132_auth=46exxxxxxxx; pvRK_2132_saltkey=F3xxxxx'
7 | * 多账号用 & 或换行
8 | *
9 | * @author Telegram@sudojia
10 | * @site https://blog.imzjw.cn
11 | * @date 2024/09/20
12 | *
13 | * const $ = new Env('飞牛私有云')
14 | * cron: 10 0 * * *
15 | */
16 | const initScript = require('../utils/initScript')
17 | const {$, notify, sudojia, checkUpdate} = initScript('飞牛私有云');
18 | const cheerio = require("cheerio");
19 | const fnNasList = process.env.FN_NAS_COOKIE ? process.env.FN_NAS_COOKIE.split(/[\n&]/) : [];
20 | // 消息推送
21 | let message = '';
22 | // 获取配置信息
23 | let formHash, signLink, uid;
24 | // 接口地址
25 | const baseUrl = 'https://club.fnnas.com'
26 | // 请求头
27 | const headers = {
28 | 'User-Agent': sudojia.getRandomUserAgent('PC'),
29 | 'Accept-Encoding': 'gzip, deflate, br, zstd',
30 | };
31 |
32 | !(async () => {
33 | await checkUpdate($.name, fnNasList);
34 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
35 | for (let i = 0; i < fnNasList.length; i++) {
36 | const index = i + 1;
37 | headers.Cookie = fnNasList[i];
38 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
39 | message += `📣====${$.name}账号[${index}]====📣\n`;
40 | await main();
41 | await $.wait(sudojia.getRandomWait(2000, 2500));
42 | }
43 | if (message) {
44 | await notify.sendNotify(`「${$.name}」`, `${message}`);
45 | }
46 | })().catch((e) => $.logErr(e)).finally(() => $.done());
47 |
48 | async function main() {
49 | await getUidAndUserName();
50 | await $.wait(sudojia.getRandomWait(800, 1200));
51 | await follow();
52 | await $.wait(sudojia.getRandomWait(1200, 1800));
53 | await checkIn();
54 | await $.wait(sudojia.getRandomWait(1200, 1800));
55 | await getCount();
56 | await $.wait(sudojia.getRandomWait(1200, 1800));
57 | await getPoints();
58 | }
59 |
60 | /**
61 | * 获取重要信息
62 | *
63 | * @returns {Promise}
64 | */
65 | async function getUidAndUserName() {
66 | try {
67 | const data = await sudojia.sendRequest(`${baseUrl}`, 'get', headers);
68 | const $ = cheerio.load(data);
69 | uid = $('a', '.icon_msg').attr('href').match(/uid=(\d+)/)[1];
70 | const userName = $('.quater_phone_nav .z').text().trim();
71 | console.log(`${userName}(${uid})`);
72 | // 拿到 formhash 和签到地址
73 | const logoutLink = $('li.l4 a').attr('href');
74 | formHash = logoutLink.split('formhash=')[1];
75 | signLink = $('a[href*="plugin.php?id=zqlj_sign"]').attr('href');
76 | message += `${userName}(${uid})\n`;
77 | } catch (e) {
78 | console.error('获取重要信息时发生异常:', e);
79 | }
80 | }
81 |
82 | /**
83 | * 签到
84 | *
85 | * @returns {Promise}
86 | */
87 | async function checkIn() {
88 | try {
89 | let data = await sudojia.sendRequest(`${baseUrl}/${signLink}`, 'get', headers);
90 | if (!data.includes('点击打卡')) {
91 | console.log('今日已打卡');
92 | return;
93 | }
94 | await $.wait(sudojia.getRandomWait(800, 1200));
95 | data = await sudojia.sendRequest(`${baseUrl}/${signLink}&sign=${formHash}`, 'get', headers);
96 | console.log('打卡成功!');
97 | message += `打卡成功\n`;
98 | } catch (e) {
99 | console.error('签到时发生异常:', e);
100 | }
101 | }
102 |
103 | /**
104 | * 统计信息
105 | *
106 | * @returns {Promise}
107 | */
108 | async function getCount() {
109 | try {
110 | const data = await sudojia.sendRequest(`${baseUrl}/${signLink}`, 'get', headers);
111 | const $ = cheerio.load(data);
112 | const items = {};
113 | // 使用选择器提取信息
114 | $('.xl li').each((index, element) => {
115 | const text = $(element).text().trim();
116 | switch (text.substring(0, 4)) {
117 | case '最近打卡':
118 | items['zjdk'] = text.substring(5).trim();
119 | break;
120 | case '本月打卡':
121 | items['bydk'] = text.substring(5).trim();
122 | break;
123 | case '连续打卡':
124 | items['lxdk'] = text.substring(5).trim();
125 | break;
126 | case '累计打卡':
127 | items['ljdk'] = text.substring(5).trim();
128 | break;
129 | case '累计奖励':
130 | items['ljjl'] = text.substring(5).trim();
131 | break;
132 | case '最近奖励':
133 | items['zjjl'] = text.substring(5).trim();
134 | break;
135 | case '当前打卡':
136 | items['currenDkLevel'] = text.substring(7).trim();
137 | break;
138 | }
139 | });
140 | console.log(`最近打卡:${items.zjdk}\n本月打卡:${items.bydk}\n连续打卡:${items.lxdk}\n累计打卡:${items.ljdk}\n累计奖励:${items.ljjl}\n最近奖励:${items.zjjl}\n当前打卡等级:${items.currenDkLevel}`);
141 | message += `最近打卡:${items.zjdk}\n本月打卡:${items.bydk}\n连续打卡:${items.lxdk}\n累计打卡:${items.ljdk}\n累计奖励:${items.ljjl}\n最近奖励:${items.zjjl}\n当前打卡等级:${items.currenDkLevel}\n`;
142 | } catch (e) {
143 | console.error('获取统计信息时发生异常:', e);
144 | }
145 | }
146 |
147 | /**
148 | * 获取个人信息
149 | *
150 | * @returns {Promise}
151 | */
152 | async function getPoints() {
153 | try {
154 | const data = await sudojia.sendRequest(`${baseUrl}/home.php?mod=space&uid=${uid}&do=profile&from=space`, 'get', headers);
155 | const $ = cheerio.load(data);
156 | const ulElement = $('.pf_l');
157 | const item = {};
158 | ulElement.find('li').each((index, element) => {
159 | const label = $(element).find('em').text().trim();
160 | const value = $(element).text().replace(label, '').trim();
161 | switch (label) {
162 | case '积分':
163 | item.points = parseInt(value);
164 | break;
165 | case '牛值':
166 | item.bullValue = parseInt(value);
167 | break;
168 | case '飞牛币':
169 | item.flyingBullCoins = parseInt(value);
170 | break;
171 | case '登陆天数':
172 | item.loginDays = parseInt(value);
173 | break;
174 | }
175 | });
176 | console.log(`当前积分:${item.points}\n当前牛值:${item.bullValue}\n当前飞牛币:${item.flyingBullCoins}\n当前登录天数:${item.loginDays}`);
177 | message += `当前积分:${item.points}\n当前牛值:${item.bullValue}\n当前飞牛币:${item.flyingBullCoins}\n当前登录天数:${item.loginDays}\n\n`;
178 | } catch (e) {
179 | console.error('获取个人信息时发生异常:', e);
180 | }
181 | }
182 |
183 | async function follow() {
184 | const data = await sudojia.sendRequest(`${baseUrl}/home.php?mod=spacecp&ac=follow&op=add&hash=${formHash}&fuid=6441&infloat=yes&handlekey=followmod&inajax=1&ajaxtarget=fwin_content_followmod`, 'get', headers);
185 | }
186 |
--------------------------------------------------------------------------------
/src/web/sudojia_jlc.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 嘉立创
3 | * 官网:https://m.jlc.com/mapp/
4 | * 小程序:嘉立创下单助手
5 | *
6 | * 机械行业可以跑跑,基本兑换的实物都是有关机械的
7 | *
8 | * 抓包 Host:https://m.jlc.com 获取请求头 x-jlc-accesstoken 和 secretkey 的值, 用 # 分割
9 | * export JLC_TOKEN = '2616xx-xxx-xxx#xxxxxxxxxxxxxxx'
10 | * 多账号用 & 或换行
11 | *
12 | * @author Telegram@sudojia
13 | * @site https://blog.imzjw.cn
14 | * @date 2024/08/30
15 | *
16 | * const $ = new Env('嘉立创')
17 | * cron: 30 6 * * *
18 | */
19 | const initScript = require('../utils/initScript')
20 | const {$, notify, sudojia, checkUpdate} = initScript('嘉立创');
21 | const jlcToken = process.env.JLC_TOKEN ? process.env.JLC_TOKEN.split(/[\n&]/) : [];
22 | // 信息推送
23 | let message = '';
24 | // 接口地址
25 | const baseUrl = 'https://m.jlc.com'
26 | // 请求头
27 | const headers = {
28 | 'user-agent': sudojia.getRandomUserAgent('PC'),
29 | // 'accept-encoding': 'gzip, deflate, br, zstd',
30 | 'x-jlc-clienttype': 'WEB',
31 | 'accept': 'application/json, text/plain, */*',
32 | 'Referer': 'https://m.jlc.com/mapp/pages/my/index',
33 | }
34 |
35 | !(async () => {
36 | await checkUpdate($.name, jlcToken);
37 | for (let i = 0; i < jlcToken.length; i++) {
38 | const index = i + 1;
39 | const [tokens, secretKey] = jlcToken[i].split('#');
40 | headers['x-jlc-accesstoken'] = tokens;
41 | headers['secretkey'] = secretKey;
42 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
43 | message += `📣====${$.name}账号[${index}]====📣\n`;
44 | await main();
45 | await $.wait(sudojia.getRandomWait(2000, 2500));
46 | }
47 | if (message) {
48 | await notify.sendNotify(`「${$.name}」`, `${message}`);
49 | }
50 | })().catch((e) => $.logErr(e)).finally(() => $.done());
51 |
52 | async function main() {
53 | await getUserInfo();
54 | await $.wait(sudojia.getRandomWait(1000, 1500));
55 | await checkSign();
56 | await $.wait(sudojia.getRandomWait(1000, 1500));
57 | await getPoints();
58 | }
59 |
60 | /**
61 | * 获取用户信息
62 | *
63 | * @returns {Promise}
64 | */
65 | async function getUserInfo() {
66 | try {
67 | const data = await sudojia.sendRequest(`${baseUrl}/api/appPlatform/center/setting/selectPersonalInfo`, 'get', headers);
68 | if (!data.success) {
69 | console.error(data.message);
70 | return;
71 | }
72 | console.log(`昵称:${data.data.customerCode}`);
73 | message += `昵称:${data.data.customerCode}\n`;
74 | } catch (e) {
75 | console.error(`获取用户信息时发生异常:${e}`);
76 | }
77 | }
78 |
79 | /**
80 | * 检测签到
81 | *
82 | * @returns {Promise}
83 | */
84 | async function checkSign() {
85 | try {
86 | const data = await sudojia.sendRequest(`${baseUrl}/api/activity/sign/getCurrentUserSignInConfig`, 'get', headers, '');
87 | if (!data.success) {
88 | console.error(data.message);
89 | return;
90 | }
91 | if (data.data.haveSignIn) {
92 | console.error(`今日已签到`);
93 | message += `今日已签到\n`;
94 | return;
95 | }
96 | await $.wait(sudojia.getRandomWait(2000, 2500));
97 | await sign();
98 | } catch (e) {
99 | console.error(`检测签到时发生异常:${e}`);
100 | }
101 | }
102 |
103 | /**
104 | * 签到
105 | *
106 | * @returns {Promise}
107 | */
108 | async function sign() {
109 | try {
110 | const data = await sudojia.sendRequest(`${baseUrl}/api/activity/sign/signIn?source=4`, 'get', headers, '');
111 | if (!data.success) {
112 | console.error(data.message);
113 | return;
114 | }
115 | if (!data.data.gainNum) {
116 | console.log(`有奖励可领取,先领取奖励,默认选择类型2:金豆`);
117 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
118 | await receiveVoucher();
119 | } else {
120 | console.log(`签到成功,金豆+${data.data.gainNum}`);
121 | message += `签到成功,金豆+${data.data.gainNum}\n`;
122 | }
123 | } catch (e) {
124 | console.error(`签到时发生异常:${e}`);
125 | }
126 | }
127 |
128 | /**
129 | * 领取奖励
130 | *
131 | * @returns {Promise}
132 | */
133 | async function receiveVoucher() {
134 | try {
135 | const data = await sudojia.sendRequest(`${baseUrl}/api/activity/sign/receiveVoucher`, 'get', headers, '');
136 | if (!data.success) {
137 | console.error(data.message);
138 | return;
139 | }
140 | console.log(`领取成功`);
141 | message += `领取成功\n`;
142 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
143 | await sign();
144 | } catch (e) {
145 | console.error(`领取奖励时发生异常:${e}`);
146 | }
147 | }
148 |
149 | /**
150 | * 获取金豆
151 | *
152 | * @returns {Promise}
153 | */
154 | async function getPoints() {
155 | try {
156 | const data = await sudojia.sendRequest(`${baseUrl}/api/activity/front/getCustomerIntegral`, 'get', headers, '');
157 | if (!data.success) {
158 | console.error(data.message);
159 | return
160 | }
161 | console.log(`当前金豆:${data.data.integralVoucher}`);
162 | message += `当前金豆:${data.data.integralVoucher}\n\n`;
163 | } catch (e) {
164 | console.error(`获取金豆时发生异常:${e}`);
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/src/web/sudojia_jlc_yj.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 嘉立创硬件开源平台
3 | *
4 | * 奖励详情:https://github.com/sudojia/AutoTaskScript/issues/126
5 | * 官网:https://oshwhub.com/sign_in
6 | * 抓包 Host:https://oshwhub.com 获取 Cookie,全选复制
7 | * export JLC_COOKIE = 'oshwhub_session=xxx; acw_tc=xxx; oshwhub_csrf=xxx'
8 | * 多账号用 & 或换行
9 | *
10 | * @author Telegram@sudojia
11 | * @site https://blog.imzjw.cn
12 | * @date 2025/01/02
13 | *
14 | * const $ = new Env('嘉立创硬件开源平台')
15 | * cron: 44 5 * * *
16 | */
17 | const initScript = require('../utils/initScript')
18 | const {$, notify, sudojia, checkUpdate} = initScript('嘉立创硬件开源平台');
19 | const jlcToken = process.env.JLC_COOKIE ? process.env.JLC_COOKIE.split(/[\n&]/) : [];
20 | // 信息推送
21 | let message = '';
22 | // 接口地址
23 | const baseUrl = 'https://oshwhub.com'
24 | // 请求头
25 | const headers = {
26 | 'user-agent': sudojia.getRandomUserAgent('PC'),
27 | 'Accept': 'application/json, text/plain, */*',
28 | 'Accept-Encoding': 'gzip, deflate, br, zstd',
29 | 'accept-language': 'zh-CN,zh;q=0.9,ko;q=0.8,en-US;q=0.7,en;q=0.6,zh-TW;q=0.5',
30 | }
31 |
32 | !(async () => {
33 | await checkUpdate($.name, jlcToken);
34 | for (let i = 0; i < jlcToken.length; i++) {
35 | const index = i + 1;
36 | headers.Cookie = jlcToken[i];
37 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
38 | message += `📣====${$.name}账号[${index}]====📣\n`;
39 | await main();
40 | await $.wait(sudojia.getRandomWait(2000, 2500));
41 | }
42 | if (message) {
43 | await notify.sendNotify(`「${$.name}」`, `${message}`);
44 | }
45 | })().catch((e) => $.logErr(e)).finally(() => $.done());
46 |
47 | async function main() {
48 | await getUserInfo();
49 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
50 | await signIn();
51 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
52 | await getPoints();
53 | }
54 |
55 | /**
56 | * 获取用户信息
57 | *
58 | * @returns {Promise}
59 | */
60 | async function getUserInfo() {
61 | try {
62 | const data = await sudojia.sendRequest(`${baseUrl}/api/users`, 'get', headers, '');
63 | if (!data.success) {
64 | console.error(data);
65 | return;
66 | }
67 | console.log(`昵称:${data.result.nickname}`);
68 | message += `昵称:${data.result.nickname}\n`;
69 | $.userId = data.result.uuid;
70 | } catch (e) {
71 | console.error(`获取用户信息时发生异常:${e}`);
72 | }
73 | }
74 |
75 | async function signIn() {
76 | try {
77 | const data = await sudojia.sendRequest(`${baseUrl}/api/users/signIn`, 'post', headers, {
78 | "_t": Date.now(),
79 | });
80 | if (!data.success) {
81 | message += `签到失败:${data}\n`;
82 | return console.error(data);
83 | }
84 | console.log(`签到成功`);
85 | message += `签到成功\n`;
86 | } catch (e) {
87 | console.error(`签到时发生异常:${e}`);
88 | }
89 | }
90 |
91 | async function getPoints() {
92 | try {
93 | const data = await sudojia.sendRequest(`${baseUrl}/api/users`, 'get', headers, '');
94 | if (!data.success) {
95 | console.error(data);
96 | return;
97 | }
98 | console.log(`当前积分:${data.result.points}`);
99 | message += `当前积分:${data.result.points}\n\n`;
100 | } catch (e) {
101 | console.error(`获取当前积分时发生异常:${e}`);
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/src/web/sudojia_juejin.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 稀土掘金 https://juejin.cn/
3 | *
4 | * 仅每日签到(不维护了)
5 | * 获取 Cookie、只要 sessionid 的值和手动签到之后抓取 https://api.juejin.cn/growth_api/v1/check_in 的 url 拼接的 uuid=123456&spider=0&msToken=xxxxxx&a_bogus=xxxxxx 用 # 分开
6 | * 填写示例:
7 | * export JUEJIN_COOKIE = 'sessionid#uuid=123456&spider=0&msToken=xxxxxx&a_bogus=xxxxxx'
8 | * 多账号用换行,不要用 &
9 | *
10 | * @author Telegram@sudojia
11 | * @site https://blog.imzjw.cn
12 | * @date 2022/01/19
13 | * @lastModify 2024/08/16
14 | *
15 | * const $ = new Env('稀土掘金')
16 | * cron: 5 10 * * *
17 | */
18 | const initScript = require('../utils/initScript')
19 | const {$, notify, sudojia, checkUpdate} = initScript('稀土掘金');
20 | const jueJinList = process.env.JUEJIN_COOKIE ? process.env.JUEJIN_COOKIE.split(/\n/) : [];
21 | let message = '';
22 | // 接口地址
23 | const baseUrl = 'https://api.juejin.cn';
24 | // 请求头
25 | const headers = {
26 | 'Accept': '*/*',
27 | 'Accept-Encoding': 'gzip, deflate, br, zstd',
28 | "Content-type": "application/json",
29 | 'Referer': 'https://juejin.cn/',
30 | 'Origin': 'https://juejin.cn',
31 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36',
32 | };
33 |
34 | !(async () => {
35 | await checkUpdate($.name, jueJinList);
36 | // console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
37 | for (let i = 0; i < jueJinList.length; i++) {
38 | const [juejinCookie, urlList] = jueJinList[i].split('#');
39 | headers.Cookie = `sid_tt=${juejinCookie}; sessionid=${juejinCookie}; sessionid_ss=${juejinCookie}`;
40 | const index = i + 1;
41 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
42 | if (await checkStatus()) {
43 | console.error('Cookie 已失效');
44 | await notify.sendNotify(`「Cookie失效通知」`, `${$.name}账号[${index}] Cookie 已失效,请重新登录获取 Cookie\n\n`);
45 | continue;
46 | }
47 | message += `📣====${$.name}账号[${index}]====📣\n`;
48 | await $.wait(sudojia.getRandomWait(800, 1200));
49 | await main(urlList);
50 | await $.wait(sudojia.getRandomWait(2000, 2500));
51 | }
52 | if (message) {
53 | await notify.sendNotify(`「${$.name}」`, `${message}`);
54 | }
55 | })().catch((e) => $.logErr(e)).finally(() => $.done());
56 |
57 | /**
58 | * 主函数
59 | *
60 | * @returns {Promise}
61 | */
62 | async function main(urlList) {
63 | await getUserName();
64 | await $.wait(sudojia.getRandomWait(2300, 2700));
65 | await checkIn(urlList);
66 | await $.wait(sudojia.getRandomWait(3000, 3500));
67 | await getOreNum(urlList);
68 | await $.wait(sudojia.getRandomWait(3000, 3500));
69 | await getCount();
70 | }
71 |
72 | /**
73 | * 获取用户信息
74 | */
75 | async function getUserName() {
76 | try {
77 | const data = await sudojia.sendRequest(baseUrl + '/user_api/v1/user/get_info_pack?aid=2608', 'post', headers, {
78 | "pack_req": {
79 | "user_counter": true,
80 | "user_growth_info": true,
81 | "user": true
82 | }
83 | });
84 | // 用户昵称
85 | const userName = data.data.user_basic.user_name;
86 | message += `【账号昵称】${userName}\n`;
87 | console.log(`【账号昵称】${userName}`);
88 | } catch (e) {
89 | console.error(`获取用户信息发生异常: ${e.response.data}`);
90 | }
91 | }
92 |
93 | /**
94 | * 检查状态
95 | *
96 | * @return {Promise<*>}
97 | */
98 | async function checkStatus() {
99 | const data = await sudojia.sendRequest(baseUrl + '/growth_api/v1/get_today_status', 'get', headers);
100 | return 403 === data.err_no;
101 | }
102 |
103 | /**
104 | * 签到函数
105 | *
106 | * @returns {*}
107 | */
108 | async function checkIn(urlList) {
109 | try {
110 | // uuid=7402961076386793000&spider=0&msToken=6N7P3ETmcpkVBSBdIEAoOvIE5TlEhnAmt382dbZpa1tNLnKhYR8QkGIKTJINouJxXGwc-JkvcwmUPhinCBGBtXg7ZsNn5LZzJtOpR4PSuRejD4spLQYUJ3tJdEurDng%3D&a_bogus=mX-QkcZ8Msm1Zhvtkhkz9GWEeOm0YWRkgZENqN9HUUo7
111 | const data = await sudojia.sendRequest(baseUrl + `/growth_api/v1/check_in?aid=2608&${urlList}`, 'post', headers);
112 | if (15001 === data.err_no) {
113 | console.log(data.err_msg);
114 | message += `【签到信息】${data.err_msg}\n`
115 | return;
116 | }
117 | console.log(`签到成功,获得 ${data.data.incr_point} 矿石`);
118 | message += `【签到信息】签到成功, 获得 ${data.data.incr_point} 矿石\n`
119 | } catch (e) {
120 | console.error(`签到时发生异常: ${e.response.data}`);
121 | }
122 | }
123 |
124 | /**
125 | * 获取总账号矿石数
126 | */
127 | async function getOreNum(urlList) {
128 | const data = await sudojia.sendRequest(baseUrl + `/growth_api/v1/get_cur_point?aid=2608&${urlList}`, 'get', headers);
129 | console.log(`当前矿石数:${data.data}`);
130 | message += `【总矿石数】${data.data} 矿石\n`
131 | }
132 |
133 | /**
134 | * 查询免费抽奖次数
135 | */
136 | async function queryFreeLuckyDrawCount(urlList) {
137 | try {
138 | const data = await sudojia.sendRequest(baseUrl + `/growth_api/v1/lottery_config/get?aid=2608&${urlList}`, 'get', headers);
139 | // 获取免费抽奖次数
140 | return data.data.free_count;
141 | } catch (e) {
142 | console.error(`查询免费抽奖次数时发生异常: ${e.response.data}`);
143 | return 0;
144 | }
145 | }
146 |
147 | /**
148 | * 统计签到天数, 没什么用~
149 | */
150 | async function getCount() {
151 | const data = await sudojia.sendRequest(baseUrl + '/growth_api/v1/get_counts?aid=2608', 'get', headers);
152 | console.log(`已连续签到${data.data.cont_count}天、累计签到${data.data.sum_count}天`);
153 | message += `【签到统计】已连续签到${data.data.cont_count}天、累计签到${data.data.sum_count}天\n`
154 | }
155 |
--------------------------------------------------------------------------------
/src/web/sudojia_sspanel.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 机场每日签到
3 | *
4 | * 如何鉴别是 SSPANEL 面板?
5 | * 网站拉到最下面有 Powered by SSPANEL 就是 SSPANEL 面板框架的机场
6 | * 格式要求:网站1,邮箱1:密码1&网站2,邮箱2:密码2
7 | * export SITE_ACCOUNTS = 'https://paolu.com,abc@gmail.com:123456'
8 | * 多账号用 & 或换行
9 | *
10 | * @author Telegram@sudojia
11 | * @site https://blog.imzjw.cn
12 | * @date 2021/9/25
13 | * @lastModifyTime: 2024/09/16
14 | *
15 | * const $ = new Env('SSPANEL面板签到')
16 | * cron: 35 9 * * *
17 | */
18 | const initScript = require('../utils/initScript')
19 | const {$, notify, sudojia, checkUpdate} = initScript('SSPANEL面板签到');
20 | const {default: axios} = require("axios");
21 | const accountList = process.env.SITE_ACCOUNTS ? process.env.SITE_ACCOUNTS.split(/[\n&]/) : [];
22 | // 消息推送
23 | let message = '';
24 | // 请求头
25 | const headers = {
26 | "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
27 | "User-Agent": sudojia.getRandomUserAgent('PC'),
28 | 'Accept': 'application/json, text/javascript, */*; q=0.01',
29 | 'Accept-Encoding': 'gzip, deflate, br, zstd',
30 | };
31 |
32 | !(async () => {
33 | await checkUpdate($.name, accountList);
34 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
35 | // 校验格式
36 | const isValidFormat = accountList.every(account => {
37 | const parts = account.split(',');
38 | if (parts.length !== 2) {
39 | return false;
40 | }
41 | const [site, credentials] = parts;
42 | const credParts = credentials.split(':');
43 | return !(credParts.length !== 2 || !site || !credentials);
44 | });
45 | if (!isValidFormat) {
46 | console.error('格式错误,请确保遵循要求格式:网站1,邮箱1:密码1&网站2,邮箱2:密码2');
47 | process.exit(0);
48 | }
49 | for (let i = 0; i < accountList.length; i++) {
50 | const index = i + 1;
51 | const [rawUrl, emailPwd] = accountList[i].split(',');
52 | const [email, pwd] = emailPwd.split(':');
53 | const url = rawUrl.endsWith('/') ? rawUrl.slice(0, -1) : rawUrl;
54 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
55 | console.log(`设定的机场网站是:${url}`);
56 | await $.wait(sudojia.getRandomWait(300, 666));
57 | message += `📣====${$.name}账号[${index}]====📣\n`;
58 | await login(url, email, pwd);
59 | }
60 | if (message) {
61 | await notify.sendNotify(`「${$.name}」`, `${message}`);
62 | }
63 | })().catch((e) => $.logErr(e)).finally(() => $.done());
64 |
65 | /**
66 | * 登录
67 | *
68 | * @returns {*}
69 | */
70 | async function login(url, email, pwd) {
71 | try {
72 | const options = {
73 | url: `${url}/auth/login`,
74 | method: 'POST',
75 | headers: headers,
76 | data: `email=${email}&passwd=${pwd}&code=`
77 | }
78 | const response = await axios(options);
79 | if (1 !== response.data.ret) {
80 | return console.error(`登录失败:${response.data.msg}`);
81 | }
82 | const cookies = response.headers['set-cookie'];
83 | headers.Cookie = cookies.join('; ');
84 | console.log('登录成功~');
85 | await $.wait(sudojia.getRandomWait(800, 1200));
86 | await checkin(url);
87 | } catch (e) {
88 | console.error(`登录时发生异常:${e}`);
89 | }
90 | }
91 |
92 | /**
93 | * 签到
94 | *
95 | * @returns {*}
96 | */
97 | async function checkin(url) {
98 | try {
99 | const data = await sudojia.sendRequest(`${url}/user/checkin`, 'post', headers, {});
100 | if (1 !== data.ret) {
101 | return console.error(`签到失败:${data.msg}`);
102 | }
103 | const {lastUsedTraffic, unUsedTraffic} = data.trafficInfo;
104 | console.log(`签到成功,${data.msg}`);
105 | console.log(`总套餐:${data.traffic}`);
106 | console.log(`已使用:${lastUsedTraffic}`);
107 | console.log(`剩余流量:${unUsedTraffic}`);
108 | message += `签到成功,${data.msg}\n`;
109 | message += `总套餐:${data.traffic}\n`;
110 | message += `已使用:${lastUsedTraffic}\n`;
111 | message += `剩余流量:${unUsedTraffic}\n\n`;
112 | } catch (e) {
113 | console.error(`签到时发生异常:${e}`);
114 | }
115 | }
--------------------------------------------------------------------------------
/src/web/sudojia_tieba.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 百度贴吧每日签到
3 | *
4 | * 打开 tieba.baidu.com 登录后复制 cookie 只要 BDUSS 的值
5 | * export TIE_BA_COOKIE = 'xxxxxxxxxxxxxxxxxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/5/18
11 | *
12 | * const $ = new Env('贴吧签到')
13 | * cron: 33 13 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('贴吧签到');
17 | const crypto = require("crypto");
18 | const tieBaList = process.env.TIE_BA_COOKIE ? process.env.TIE_BA_COOKIE.split(/[\n&]/) : [];
19 | let message = '';
20 | // 贴吧 API
21 | const TIEBA_API = {
22 | TBS_API: 'http://tieba.baidu.com/dc/common/tbs',
23 | FOLLOW_API: 'https://tieba.baidu.com/mo/q/newmoindex',
24 | SIGN_API: 'http://c.tieba.baidu.com/c/c/forum/sign'
25 | }
26 | // 请求头
27 | const headers = {
28 | 'connection': 'keep-alive',
29 | 'Content-Type': 'application/x-www-form-urlencoded',
30 | 'Host': 'tieba.baidu.com',
31 | 'charset': 'UTF-8',
32 | 'User-Agent': sudojia.getRandomUserAgent('H5'),
33 | };
34 | !(async () => {
35 | await checkUpdate($.name, tieBaList);
36 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
37 | for (let i = 0; i < tieBaList.length; i++) {
38 | const index = i + 1;
39 | const matchList = tieBaList[i].match(/BDUSS=([^;]+);?/);
40 | if (matchList) {
41 | headers.Cookie = `BDUSS=${matchList[1]}`;
42 | } else {
43 | headers.Cookie = `BDUSS=${tieBaList[i]}`;
44 | }
45 | // 签到响应的数组存放信息
46 | $.success = [];
47 | // 存储用户所关注的贴吧
48 | $.follow = [];
49 | // 签到失败的贴吧列表
50 | $.failed = [];
51 | // 失效的贴吧列表
52 | $.invalid = []
53 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
54 | $.tbs = await getTBS();
55 | if (!$.tbs) {
56 | console.error('Cookie 已失效');
57 | await notify.sendNotify(`「Cookie失效通知」`, `${$.name}账号[${index}] Cookie 已失效,请重新登录获取 Cookie\n\n`);
58 | continue;
59 | }
60 | message += `📣====${$.name}账号[${index}]====📣\n`;
61 | await $.wait(sudojia.getRandomWait(800, 1200));
62 | await main();
63 | await $.wait(sudojia.getRandomWait(2000, 3000));
64 | }
65 | if (message) {
66 | await notify.sendNotify(`「${$.name}」`, `${message}`);
67 | }
68 | })().catch((e) => $.logErr(e)).finally(() => $.done());
69 |
70 | async function main() {
71 | await getTieBaFollow();
72 | await $.wait(sudojia.getRandomWait(1200, 1800));
73 | await signTieBa();
74 | }
75 |
76 | /**
77 | * 获取 TBS
78 | *
79 | * @returns {Promise<*>}
80 | */
81 | async function getTBS() {
82 | try {
83 | const data = await sudojia.sendRequest(`${TIEBA_API.TBS_API}`, 'get', headers);
84 | return data.tbs;
85 | } catch (e) {
86 | console.error(`获取 TBS 发生异常:${e}`);
87 | return null;
88 | }
89 | }
90 |
91 | /**
92 | * 获取贴吧列表
93 | *
94 | * @returns {Promise<*[]>}
95 | */
96 | async function getTieBaFollow() {
97 | // 存储用户所关注的贴吧
98 | try {
99 | const data = await sudojia.sendRequest(TIEBA_API.FOLLOW_API, 'get', headers);
100 | $.followNum = data.data.like_forum.length;
101 | for (const likeForum of data.data.like_forum) {
102 | // 0 表示未签到
103 | if (0 === likeForum.is_sign) {
104 | const tiebaName = likeForum.forum_name.replace('+', '%2B');
105 | $.follow.push(tiebaName);
106 | const isTrue = await isTieBaNotExist(tiebaName);
107 | await $.wait(sudojia.getRandomWait(1000, 2000));
108 | if (isTrue) {
109 | $.follow = $.follow.filter(item => item !== tiebaName);
110 | $.invalid.push(tiebaName);
111 | $.failed.push(tiebaName);
112 | }
113 | } else {
114 | $.success.push(likeForum.forum_name.replace('+', '%2B'));
115 | }
116 | }
117 | console.log(`正在开始签到所有贴吧, 共计 ${$.followNum} 个贴吧, 请耐心等待...`);
118 | } catch (error) {
119 | console.error(`获取关注贴吧失败:${error}`);
120 | }
121 | }
122 |
123 | /**
124 | * 判断贴吧是否失效 true:贴吧失效,false:贴吧存在
125 | *
126 | * @param forum_name
127 | *
128 | * @return {Promise}
129 | */
130 | async function isTieBaNotExist(forum_name) {
131 | try {
132 | const data = await sudojia.sendRequest(`https://tieba.baidu.com/f?ie=utf-8&kw=${forum_name}&fr=search`, 'get', headers);
133 | const dataAsString = typeof data === 'string' ? data : data.toString();
134 | return dataAsString.includes('很抱歉,没有找到相关内容');
135 | } catch (e) {
136 | console.error(`获取失效贴吧发生异常:${e}`);
137 | }
138 | }
139 |
140 | /**
141 | * 签到函数
142 | *
143 | * @return {Promise<*[]>}
144 | */
145 | async function signTieBa() {
146 | try {
147 | let maxAttempts = 5;
148 | while ($.success.length < $.followNum && maxAttempts > 0) {
149 | try {
150 | for (let forumName of Array.from($.follow)) {
151 | const sign = `kw=${forumName}tbs=${$.tbs}tiebaclient!!!`;
152 | const encodedSign = crypto.createHash('md5').update(sign).digest('hex');
153 | const postData = {
154 | kw: forumName,
155 | tbs: $.tbs,
156 | sign: encodedSign
157 | };
158 | const rotation = forumName.replace('%2B', '+');
159 | const data = await sudojia.sendRequest(TIEBA_API.SIGN_API, 'post', headers, postData);
160 | await $.wait(sudojia.getRandomWait(1000, 2000));
161 | if (data.error_code === '0') {
162 | $.follow = $.follow.filter(item => item !== forumName);
163 | $.success.push(rotation);
164 | $.failed = $.failed.filter(item => item !== forumName);
165 | } else {
166 | $.failed.push(rotation);
167 | }
168 | }
169 | } catch (error) {
170 | console.error('签到失败:', error);
171 | maxAttempts--;
172 | await $.wait(sudojia.getRandomWait(5000, 10000));
173 | }
174 | if ($.success.length !== $.followNum - $.invalid.length) {
175 | await $.wait(sudojia.getRandomWait(15000, 30000));
176 | $.tbs = await getTBS();
177 | }
178 | maxAttempts--;
179 | }
180 | const totalFailed = $.followNum.length - $.success.length || 0;
181 | message += `【贴吧总结】${$.followNum}个\n【签到统计】成功签到${$.success.length}个, 失败${totalFailed}个, 过滤失效贴吧${$.invalid.length}个\n\n`;
182 | console.log(`成功签到${$.success.length}个, 失败${totalFailed}个, 过滤失效贴吧${$.invalid.length}个`);
183 | } catch (e) {
184 | console.error(`签到发生异常:${e}`);
185 | }
186 | }
187 |
--------------------------------------------------------------------------------
/src/web/sudojia_v2ex.js:
--------------------------------------------------------------------------------
1 | /**
2 | * v2ex 每日签到 https://www.v2ex.com/
3 | *
4 | * export V2EX_COOKIE = 'xxxxx'
5 | * 多账号用 & 或换行
6 | *
7 | * @author Telegram@sudojia
8 | * @site https://blog.imzjw.cn
9 | * @date 2024/5/22
10 | *
11 | * const $ = new Env('V2EX每日签到')
12 | * cron: 0 9 * * *
13 | */
14 | const initScript = require('../utils/initScript')
15 | const {$, notify, sudojia, checkUpdate} = initScript('V2EX每日签到');
16 | const cheerio = require('cheerio');
17 | const v2exList = process.env.V2EX_COOKIE ? process.env.V2EX_COOKIE.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://www.v2ex.com';
21 | // 请求头
22 | const headers = {
23 | 'Accept-Encoding': `gzip, deflate, br`,
24 | 'Connection': `keep-alive`,
25 | 'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`,
26 | "User-Agent": sudojia.getRandomUserAgent('PC'),
27 | };
28 | !(async () => {
29 | await checkUpdate($.name, v2exList);
30 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
31 | for (let i = 0; i < v2exList.length; i++) {
32 | const index = i + 1;
33 | headers.Cookie = v2exList[i];
34 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
35 | const isCookie = await checkCookie();
36 | if (!isCookie) {
37 | console.error('Cookie 已失效');
38 | await notify.sendNotify(`「Cookie失效通知」`, `${$.name}账号[${index}] Cookie 已失效,请重新登录获取 Cookie\n\n`);
39 | continue;
40 | }
41 | message += `📣====${$.name}账号[${index}]====📣\n`;
42 | await $.wait(sudojia.getRandomWait(800, 1200));
43 | await main();
44 | await $.wait(sudojia.getRandomWait(2000, 3000));
45 | }
46 | if (message) {
47 | await notify.sendNotify(`「${$.name}」`, `${message}`);
48 | }
49 | })().catch((e) => $.logErr(e)).finally(() => $.done());
50 |
51 | async function main() {
52 | await getOnce();
53 | await wait();
54 | await getInfo();
55 | }
56 |
57 | /**
58 | * 检测 Cookie 有效返回 true
59 | *
60 | * @return {Promise}
61 | */
62 | async function checkCookie() {
63 | try {
64 | const data = await sudojia.sendRequest('https://v2ex.com/', 'get', headers);
65 | return data.indexOf('登出') > -1;
66 | } catch (e) {
67 | console.error(`检测 Cookie 状态发生异常:${e}`);
68 | return false;
69 | }
70 | }
71 |
72 | /**
73 | * 获取once
74 | *
75 | * @returns {Promise}
76 | */
77 | async function getOnce() {
78 | try {
79 | const data = await sudojia.sendRequest(`${baseUrl}/mission/daily`, 'GET', headers, {})
80 | const $ = cheerio.load(data);
81 | const targetLink = $('a.top').eq(1);
82 | const userName = targetLink.text();
83 | message += `【用户名称】${userName}\n`
84 | if (data.indexOf('每日登录奖励已领取') < 0) {
85 | console.log('开始签到...')
86 | const once = $('input[type="button"]')[0].attribs['onclick'].match(/once=(\d+)/)[1];
87 | await wait();
88 | await checkIn(once);
89 | } else {
90 | message += `【签到状态】已经签到过了\n`
91 | console.log('已经签到过了');
92 | }
93 | } catch (e) {
94 | console.error(`获取 once 发生异常:${e}`);
95 | }
96 | }
97 |
98 | /**
99 | * 签到
100 | *
101 | * @param once
102 | * @returns {Promise}
103 | */
104 | async function checkIn(once) {
105 | try {
106 | const data = await sudojia.sendRequest(`${baseUrl}/mission/daily/redeem?once=${once}`, 'GET', headers, {})
107 | if (data.indexOf('每日登录奖励已领取') > -1) {
108 | console.log('签到成功');
109 | message += `【签到状态】签到成功!\n`
110 | const continueDays = data.match(/已连续登录 (\d+?) 天/)[1];
111 | message += `【签到统计】已连续签到${continueDays}天\n`
112 | } else {
113 | console.log('签到失败');
114 | }
115 | } catch (e) {
116 | console.error(`签到时发生异常:${e}`);
117 | }
118 | }
119 |
120 | /**
121 | * 获取用户信息
122 | *
123 | * @return {Promise}
124 | */
125 | async function getInfo() {
126 | try {
127 | const data = await sudojia.sendRequest(`${baseUrl}/balance`, 'GET', headers, {})
128 | const $ = cheerio.load(data);
129 | const balanceArea = $('.balance_area').first();
130 | // 提取文本内容
131 | const text = balanceArea.text();
132 | // 使用正则表达式匹配数字
133 | const matches = text.match(/\d+/g);
134 | let goldAmount = 0;
135 | let silverAmount = 0;
136 | let bronzeAmount = 0;
137 | // 如果匹配到三个数字,则分别赋值给金币、银币和铜币
138 | if (matches && matches.length === 3) {
139 | goldAmount = parseInt(matches[0], 10);
140 | silverAmount = parseInt(matches[1], 10);
141 | bronzeAmount = parseInt(matches[2], 10);
142 | } else if (matches && matches.length === 2) {
143 | silverAmount = parseInt(matches[0], 10);
144 | bronzeAmount = parseInt(matches[1], 10);
145 | }
146 | message += `【账户余额】${goldAmount}金币 ${silverAmount}银币 ${bronzeAmount}铜币\n\n`
147 | } catch (e) {
148 | console.error(`获取获取用户信息时发生异常:${e}`);
149 | }
150 | }
151 |
152 | async function wait() {
153 | await $.wait(sudojia.getRandomWait(2000, 3000));
154 | }
155 |
--------------------------------------------------------------------------------
/src/web/sudojia_znds.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 智能电视 https://www.znds.com/?fromuid=7565102
3 | *
4 | * export ZNDS_COOKIE = 's9it_2132_auth=xxx;s9it_2132_saltkey=xxx'
5 | * 多账号用 & 或换行
6 | *
7 | * @author Telegram@sudojia
8 | * @site https://blog.imzjw.cn
9 | * @date 2024/5/31
10 | *
11 | * const $ = new Env('智能电视')
12 | * cron: 5 11 * * *
13 | */
14 | const initScript = require('../utils/initScript')
15 | const {$, notify, sudojia, checkUpdate} = initScript('智能电视');
16 | const cheerio = require('cheerio');
17 | const zndsList = process.env.ZNDS_COOKIE ? process.env.ZNDS_COOKIE.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://www.znds.com';
21 | // 请求头
22 | const headers = {
23 | 'User-Agent': sudojia.getRandomUserAgent('PC'),
24 | 'Content-Type': 'text/html; charset=utf-8',
25 | 'Accept-Encoding': 'gzip, deflate, br',
26 | 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
27 | };
28 |
29 | !(async () => {
30 | await checkUpdate($.name, zndsList);
31 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
32 | for (let i = 0; i < zndsList.length; i++) {
33 | const index = i + 1;
34 | headers.Cookie = zndsList[i];
35 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
36 | message += `📣====${$.name}账号[${index}]====📣\n`;
37 | const userInfo = await getFormHashAndUid();
38 | if (!userInfo) {
39 | console.error('Cookie 已失效');
40 | await notify.sendNotify(`「Cookie失效通知」`, `${$.name}账号[${index}] Cookie 已失效,请重新登录获取 Cookie\n\n`);
41 | continue;
42 | }
43 | await $.wait(sudojia.getRandomWait(800, 1200));
44 | await main(userInfo);
45 | await $.wait(sudojia.getRandomWait(2000, 2500));
46 | }
47 | if (message) {
48 | await notify.sendNotify(`「${$.name}」`, `${message}`);
49 | }
50 | })().catch((e) => $.logErr(e)).finally(() => $.done());
51 |
52 | async function main(userInfo) {
53 | await checkIn(userInfo.formHash);
54 | await $.wait(sudojia.getRandomWait(1500, 2000));
55 | await getSpace(userInfo.uid);
56 | await $.wait(sudojia.getRandomWait(1500, 2000));
57 | await getCount(userInfo.uid);
58 | }
59 |
60 | /**
61 | * 获取 formHash 和 uid
62 | *
63 | * @return {Promise<{uid: string, formHash: string}>}
64 | */
65 | async function getFormHashAndUid() {
66 | try {
67 | const data = await sudojia.sendRequest(`${baseUrl}/?fromuid=7565102`, 'post', headers, {});
68 | const $ = cheerio.load(data);
69 | // 获取 formHash 的值
70 | const logoutLink = $('a[href^="member.php?mod=logging"]');
71 | // 获取 uid
72 | const userIdLink = $('a.avts').attr('href');
73 | return {
74 | uid: userIdLink.match(/uid=(\d+)/)[1],
75 | formHash: logoutLink.attr('href').split('&formhash=')[1]
76 | }
77 | } catch (e) {
78 | console.error(`获取 uid 发生异常:${e}\n`);
79 | return null;
80 | }
81 | }
82 |
83 | /**
84 | * 签到
85 | *
86 | * @param formHash
87 | * @return {Promise}
88 | */
89 | async function checkIn(formHash) {
90 | try {
91 | const data = await sudojia.sendRequest(`${baseUrl}/plugin.php?id=ljdaka:daka&action=msg&formhash=${formHash}&infloat=yes&handlekey=ljdaka&inajax=1&ajaxtarget=fwin_content_ljdaka`, 'post', headers, {});
92 | const $ = cheerio.load(data);
93 | message += $('div.alert_info').first().text() + '\n';
94 | console.log($('div.alert_info').first().text());
95 | } catch (e) {
96 | console.error(`签到发生异常:${e}`);
97 | }
98 | }
99 |
100 | /**
101 | * 每日访问空间
102 | *
103 | * @return {Promise}
104 | */
105 | async function getSpace(uid) {
106 | if (uid === '7565102') {
107 | await sudojia.sendRequest(`${baseUrl}/home.php?mod=space&uid=6014765`, 'post', headers);
108 | } else {
109 | await sudojia.sendRequest(`${baseUrl}/home.php?mod=space&uid=7565102`, 'post', headers);
110 | }
111 | }
112 |
113 | /**
114 | * 获取积分、威望、金币和 Z币
115 | *
116 | * @param uid
117 | * @return {Promise}
118 | */
119 | async function getCount(uid) {
120 | try {
121 | const data = await sudojia.sendRequest(`${baseUrl}/home.php?mod=space&uid=${uid}`, 'post', headers, {});
122 | if (!data) {
123 | console.error('获取数据失败');
124 | return;
125 | }
126 | const $ = cheerio.load(data);
127 | // 使用选择器找到包含积分、威望、金币和 Z币的 元素
128 | const statisticItems = $('#statistic_content .xl li');
129 | // 初始化一个对象来存储结果
130 | const result = {
131 | jifen: '--',
132 | weiwang: '--',
133 | jinbi: '--',
134 | zbi: '--'
135 | };
136 | // 遍历找到的元素,并提取信息
137 | statisticItems.each((index, element) => {
138 | const $element = $(element);
139 | const text = $element.text().trim();
140 | extractStatInfo($element, result, text);
141 | });
142 | message += '积分:' + result.jifen + '\n' + '威望:' + result.weiwang + '\n' + '金币:' + result.jinbi + '\n' + 'Z币:' + result.zbi + '\n\n';
143 | console.log('当前积分:' + result.jifen + '、威望:' + result.weiwang + '、金币:' + result.jinbi + '、Z币:' + result.zbi);
144 | } catch (e) {
145 | console.error(`获取积分、威望、金币和 Z币发生异常:${e}`);
146 | }
147 | }
148 |
149 | /**
150 | * 提取统计信息
151 | *
152 | * @param $element
153 | * @param result
154 | * @param text
155 | */
156 | function extractStatInfo($element, result, text) {
157 | if (text.includes('积分')) {
158 | result.jifen = $element.find('a').text();
159 | } else if (text.includes('威望')) {
160 | result.weiwang = $element.find('a').text();
161 | } else if (text.includes('金币')) {
162 | result.jinbi = $element.find('a').text();
163 | } else if (text.includes('Z币')) {
164 | result.zbi = $element.find('a').text();
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_allGirls.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 所有女生会员服务中心小程序
3 | *
4 | * 抓包 Host:7.wawo.cc 获取请求头 AccessToken 的值
5 | * export ALL_GIRLS_TOKEN = 'xxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/07/09
11 | *
12 | * const $ = new Env('所有女生')
13 | * cron: 19 16 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('所有女生');
17 | const girlsList = process.env.ALL_GIRLS_TOKEN ? process.env.ALL_GIRLS_TOKEN.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://7.wawo.cc'
21 | // 请求头
22 | const headers = {
23 | 'user-agent': sudojia.getRandomUserAgent(),
24 | 'accept-encoding': 'gzip, deflate, br',
25 | 'referer': 'https://servicewechat.com/wx7d1403fe84339669/1076/page-frame.html',
26 | 'content-type': 'application/json',
27 | 'accept': '*/*',
28 | };
29 |
30 | !(async () => {
31 | await checkUpdate($.name, girlsList);
32 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
33 | for (let i = 0; i < girlsList.length; i++) {
34 | const index = i + 1;
35 | headers.AccessToken = girlsList[i];
36 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
37 | message += `📣====${$.name}账号[${index}]====📣\n`;
38 | await main();
39 | await $.wait(sudojia.getRandomWait(2000, 2500));
40 | }
41 | if (message) {
42 | await notify.sendNotify(`「${$.name}」`, `${message}`);
43 | }
44 | })().catch((e) => $.logErr(e)).finally(() => $.done());
45 |
46 | async function main() {
47 | await getUserInfo();
48 | await $.wait(sudojia.getRandomWait(800, 1200));
49 | await signStatus();
50 | }
51 |
52 | /**
53 | * 获取用户信息
54 | *
55 | * @return {Promise}
56 | */
57 | async function getUserInfo() {
58 | try {
59 | const data = await sudojia.sendRequest(`${baseUrl}/api/account/wx/member/base`, 'get', headers);
60 | if ('000' !== data.code) {
61 | console.error(`获取用户信息失败:${data.message}`);
62 | return;
63 | }
64 | $.nickName = data.data.nickName;
65 | $.cardNo = data.data.cardNo;
66 | console.log(`[${$.nickName}]登录成功~`);
67 | message += `昵称:${$.nickName}\n`;
68 | } catch (e) {
69 | console.error(`获取用户信息时发生异常:${e}`);
70 | }
71 | }
72 |
73 | /**
74 | * 签到状态
75 | *
76 | * @return {Promise}
77 | */
78 | async function signStatus() {
79 | try {
80 | const data = await sudojia.sendRequest(`${baseUrl}/api/activity/wx/task/sign/signMsg`, 'post', headers, {cardNo: $.cardNo,});
81 | if ('000' !== data.code) {
82 | console.error(`查询签到状态失败:${data.message}`);
83 | return;
84 | }
85 | if (1 === data.data.signed) {
86 | // 已签到
87 | console.log('已签到,无需重复签到');
88 | message += '已签到,无需重复签到\n';
89 | await $.wait(sudojia.getRandomWait(800, 1100));
90 | await getPoints();
91 | return;
92 | }
93 | await $.wait(sudojia.getRandomWait(800, 1100));
94 | await sign();
95 | } catch (e) {
96 | console.error(`查询签到状态时发生异常:${e}`);
97 | }
98 | }
99 |
100 | /**
101 | * 签到
102 | *
103 | * @return {Promise}
104 | */
105 | async function sign() {
106 | try {
107 | const data = await sudojia.sendRequest(`${baseUrl}/api/activity/wx/task/sign/signIn`, 'post', headers);
108 | if ('000' === data.code && data.data.success) {
109 | console.log('签到成功!');
110 | message += `签到成功!\n`;
111 | await $.wait(sudojia.getRandomWait(800, 1200));
112 | await getPoints();
113 | } else console.error(`签到失败:${data.message}`);
114 | } catch (e) {
115 | console.error(`签到时发生异常:${e}`);
116 | }
117 | }
118 |
119 | /**
120 | * 获取积分
121 | *
122 | * @return {Promise}
123 | */
124 | async function getPoints() {
125 | try {
126 | const data = await sudojia.sendRequest(`${baseUrl}/api/score/wx/score/queryAmount`, 'get', headers);
127 | if ('000' !== data.code) {
128 | console.error(`获取积分失败:${data.message}`);
129 | return;
130 | }
131 | message += `当前积分:${data.data}\n\n`;
132 | console.log(`当前积分:${data.data}`);
133 | } catch (e) {
134 | console.error(`获取积分时发生异常:${e}`);
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_amx.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 安慕希小程序
3 | *
4 | * 抓包 Host:https://msmarket.msx.digitalyili.com 获取请求头 access-token 的值
5 | * export AMX_TOKEN = 'xxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/06/16
11 | *
12 | * const $ = new Env('安慕希')
13 | * cron: 33 14 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('安慕希');
17 | const amxList = process.env.AMX_TOKEN ? process.env.AMX_TOKEN.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://msmarket.msx.digitalyili.com/gateway'
21 | // 请求头
22 | const headers = {
23 | 'user-agent': sudojia.getRandomUserAgent(),
24 | 'accept-encoding': 'gzip, deflate, br',
25 | 'referer': 'https://servicewechat.com/wxf2a6206f7e2fd712/666/page-frame.html',
26 | 'content-type': 'application/x-www-form-urlencoded',
27 | 'accept': '*/*',
28 | };
29 |
30 | !(async () => {
31 | await checkUpdate($.name, amxList);
32 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
33 | for (let i = 0; i < amxList.length; i++) {
34 | const index = i + 1;
35 | headers['access-token'] = amxList[i];
36 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
37 | message += `📣====${$.name}账号[${index}]====📣\n`;
38 | await main();
39 | await $.wait(sudojia.getRandomWait(2000, 2500));
40 | }
41 | if (message) {
42 | await notify.sendNotify(`「${$.name}」`, `${message}`);
43 | }
44 | })().catch((e) => $.logErr(e)).finally(() => $.done());
45 |
46 | async function main() {
47 | await getUserInfo();
48 | await $.wait(sudojia.getRandomWait(1500, 2300));
49 | await getSignStatus();
50 | await $.wait(sudojia.getRandomWait(1500, 2300));
51 | await getPoints();
52 | }
53 |
54 | /**
55 | * 获取用户信息
56 | *
57 | * @returns {Promise}
58 | */
59 | async function getUserInfo() {
60 | try {
61 | const data = await sudojia.sendRequest(`${baseUrl}/api/auth/account/user/info`, 'get', headers);
62 | if (!data.status) {
63 | return console.error(`获取用户信息失败:${data.error}`);
64 | }
65 | const {nickName, mobile} = data?.data;
66 | console.log(`${nickName}(${mobile})`);
67 | message += `${nickName}(${mobile})\n`;
68 | } catch (e) {
69 | console.error(`获取用户信息时发生异常:${e}`);
70 | }
71 | }
72 |
73 | /**
74 | * 获取签到状态
75 | *
76 | * @return {Promise}
77 | */
78 | async function getSignStatus() {
79 | try {
80 | const data = await sudojia.sendRequest(`${baseUrl}/api/member/sign/status`, 'get', headers);
81 | if (!data.status) {
82 | return console.error(`获取签到状态失败:${data.error}`);
83 | }
84 | if (data?.data.signed) {
85 | message += `今日已签到\n`;
86 | return console.error(`今日已签到`);
87 | }
88 | await $.wait(sudojia.getRandomWait(1500, 2300));
89 | await signIn();
90 | } catch (e) {
91 | console.error(`获取签到状态时发生异常:${e}`);
92 | }
93 | }
94 |
95 | /**
96 | * 签到
97 | *
98 | * @return {Promise}
99 | */
100 | async function signIn() {
101 | try {
102 | const data = await sudojia.sendRequest(`${baseUrl}/api/member/daily/sign`, 'post', headers);
103 | if (!data.status) {
104 | return console.error(`签到失败:${data.error}`);
105 | }
106 | console.log(`签到成功,积分+${data?.data?.dailySign?.bonusPoint}`);
107 | message += `签到成功,积分+${data?.data?.dailySign?.bonusPoint}\n`;
108 | } catch
109 | (e) {
110 | console.error(`签到时发生异常:${e}`);
111 | }
112 | }
113 |
114 | /**
115 | * 获取积分
116 | *
117 | * @return {Promise}
118 | */
119 | async function getPoints() {
120 | try {
121 | const data = await sudojia.sendRequest(`${baseUrl}/api/member/point`, 'get', headers);
122 | if (!data.status) {
123 | return console.error(`获取积分失败:${data.error}`);
124 | }
125 | console.log(`当前积分:${data?.data}`);
126 | message += `当前积分:${data?.data}\n\n`;
127 | } catch (e) {
128 | console.error(`获取积分时发生异常:${e}`);
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_beiyinmei.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 贝因美小程序
3 | *
4 | * 抓包 Host:https://h5.youzan.com 找到并获取请求头 extra-data 的 sid 值
5 | * export BYM_SID = 'YZ126xxxxxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * 时效性很短,不建议跑
9 | *
10 | * @author Telegram@sudojia
11 | * @site https://blog.imzjw.cn
12 | * @date 2024/07/21
13 | *
14 | * const $ = new Env('贝因美')
15 | * cron: 19 11 * * *
16 | */
17 | const initScript = require('../utils/initScript')
18 | const {$, notify, sudojia, checkUpdate} = initScript('贝因美');
19 | const bymList = process.env.BYM_SID ? process.env.BYM_SID.split(/[\n&]/) : [];
20 | let message = '';
21 | // 接口地址
22 | const baseUrl = 'https://h5.youzan.com'
23 | // 请求头
24 | const headers = {
25 | 'User-Agent': sudojia.getRandomUserAgent(),
26 | 'Content-Type': 'application/json',
27 | 'Accept': '*/*',
28 | 'Referer': 'https://servicewechat.com/wx8b625f82fd29eda7/46/page-frame.html',
29 | 'Accept-Encoding': 'gzip, deflate, br',
30 | };
31 |
32 | !(async () => {
33 | await checkUpdate($.name, bymList);
34 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
35 | for (let i = 0; i < bymList.length; i++) {
36 | const index = i + 1;
37 | $.isLogin = true;
38 | $.sid = bymList[i];
39 | headers['extra-data'] = '{"sid":"' + $.sid + '","version":"2.175.7.201","clientType":"weapp-miniprogram","client":"weapp","bizEnv":"","uuid":"kcLq9rh5f7rAd1o1721544429919","ftime":' + new Date().getTime() + '}';
40 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
41 | message += `📣====${$.name}账号[${index}]====📣\n`;
42 | await main();
43 | await $.wait(sudojia.getRandomWait(2000, 2500));
44 | }
45 | if (message) {
46 | await notify.sendNotify(`「${$.name}」`, `${message}`);
47 | }
48 | })().catch((e) => $.logErr(e)).finally(() => $.done());
49 |
50 | async function main() {
51 | await getUserInfo();
52 | if (!$.isLogin) {
53 | console.error('sid 失效');
54 | process.exit(0);
55 | }
56 | await $.wait(sudojia.getRandomWait(2000, 2500));
57 | await checkin();
58 | }
59 |
60 | /**
61 | * 获取用户信息
62 | *
63 | * @return {Promise}
64 | */
65 | async function getUserInfo() {
66 | try {
67 | const data = await sudojia.sendRequest(`${baseUrl}/wscaccount/api/authorize/data.json?kdt_id=43704621`, 'get', headers);
68 | if (!data.data.userInfo.hasLogin) {
69 | $.isLogin = false;
70 | return;
71 | }
72 | const mobile = data.data.userInfo.mobile;
73 | const nickName = data.data.userInfo.nickname;
74 | const hiddenMobile = `${mobile.slice(0, 3)}***${mobile.slice(-3)}`;
75 | console.log(`${nickName}(${hiddenMobile})`);
76 | message += `🎉${nickName}(${hiddenMobile})\n`;
77 | } catch (e) {
78 | console.error(`获取用户信息时发生异常:${e}`);
79 | }
80 | }
81 |
82 | /**
83 | * 签到
84 | *
85 | * @return {Promise}
86 | */
87 | async function checkin() {
88 | try {
89 | const data = await sudojia.sendRequest(`${baseUrl}/wscump/checkin/checkinV2.json?checkinId=2845584&app_id=wx8b625f82fd29eda7&kdt_id=43704621&access_token=b60985830b869f705a8bf0a784a07d`, 'get', headers);
90 | if (0 !== data.code) {
91 | console.error(data.msg);
92 | message += `今日已签到!\n\n`;
93 | return;
94 | }
95 | console.log(`签到成功,+${data.data.list[0].infos.title}`);
96 | message += `签到成功,+${data.data.list[0].infos.title}\n\n`;
97 | } catch (e) {
98 | console.error(`签到时发生异常:${e}`);
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_botanyStar.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 植物星球小程序
3 | *
4 | * 注册登录之后在 我的 -> 账号管理 -> 修改密码 进行重设密码
5 | * export BOTANY_ACCOUNT = '18888888888#sudojia' 手机号#密码
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/07/09
11 | *
12 | * const $ = new Env('植物星球')
13 | * cron: 32 13 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('植物星球');
17 | const botanyList = process.env.BOTANY_ACCOUNT ? process.env.BOTANY_ACCOUNT.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://api.pftp2012.com'
21 | // 请求头
22 | const headers = {
23 | 'user-agent': sudojia.getRandomUserAgent(),
24 | 'accept-encoding': 'gzip, deflate, br',
25 | 'referer': 'https://servicewechat.com/wxd7296b6421fc974e/1/page-frame.html',
26 | 'content-type': 'application/x-www-form-urlencoded',
27 | 'accept': '*/*',
28 | };
29 |
30 | !(async () => {
31 | await checkUpdate($.name, botanyList);
32 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
33 | for (let i = 0; i < botanyList.length; i++) {
34 | const index = i + 1;
35 | const [phone, password] = botanyList[i].split('#');
36 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
37 | if (!await login(phone, sudojia.md5(password))) {
38 | continue;
39 | }
40 | message += `📣====${$.name}账号[${index}]====📣\n`;
41 | await $.wait(sudojia.getRandomWait(800, 1200));
42 | await main();
43 | await $.wait(sudojia.getRandomWait(2000, 2500));
44 | }
45 | if (message) {
46 | await notify.sendNotify(`「${$.name}」`, `${message}`);
47 | }
48 | })().catch((e) => $.logErr(e)).finally(() => $.done());
49 |
50 | async function main() {
51 | await sign();
52 | await $.wait(sudojia.getRandomWait(800, 1200));
53 | console.log(`开始浏览任务...\n如果绿星币+0,那么说明已经完成浏览任务了`);
54 | await doTask('10');
55 | await $.wait(11000);
56 | await doTask('60');
57 | await $.wait(sudojia.getRandomWait(800, 1200));
58 | await getPoints();
59 | }
60 |
61 | /**
62 | * 登录
63 | *
64 | * @param phone
65 | * @param password
66 | * @return {Promise}
67 | */
68 | async function login(phone, password) {
69 | try {
70 | const data = await sudojia.sendRequest(`${baseUrl}/api/Member/Login`, 'post', headers, `userName=${phone}&userPwd=${password}`);
71 | if (100 !== data.Status) {
72 | return null;
73 | }
74 | $.userToken = data.Data.MemberInfo.Token;
75 | headers.Authorization = `Bearer ${$.userToken}`;
76 | return $.userToken;
77 | } catch (e) {
78 | console.error(`登录时发生异常:${e}`);
79 | return null;
80 | }
81 | }
82 |
83 | /**
84 | * 签到
85 | *
86 | * @return {Promise}
87 | */
88 | async function sign() {
89 | await $.wait(sudojia.getRandomWait(800, 1100));
90 | try {
91 | const data = await sudojia.sendRequest(`${baseUrl}/api/Member/SignIn`, 'post', headers);
92 | if (100 !== data.Status) {
93 | console.error(data.Msg);
94 | return;
95 | }
96 | // 签到天数
97 | const signDays = data.Data.ContinuouNum;
98 | console.log(`签到成功!绿星币+${data.Data.PollenNum},已连续签到${signDays}天`);
99 | message += `签到成功!绿星币+${data.Data.PollenNum}\n已连续签到${signDays}天\n`;
100 | } catch (e) {
101 | console.error(`签到时发生异常:${e}`);
102 | }
103 | }
104 |
105 | /**
106 | * 浏览任务
107 | *
108 | * @param taskId 任务ID
109 | * @return {Promise}
110 | */
111 | async function doTask(taskId) {
112 | try {
113 | const data = await sudojia.sendRequest(`${baseUrl}/api/Member/CompleteMemberMission`, 'post', headers, `type=${taskId}&channel=40`);
114 | if (100 !== data.Status) {
115 | console.error(data.Msg);
116 | return;
117 | }
118 | console.log(`浏览任务成功,绿星币+${data.Data}`);
119 | } catch (e) {
120 | console.error(`浏览任务时发生异常:${e}`);
121 | }
122 | }
123 |
124 | /**
125 | * 获取绿星币
126 | *
127 | * @return {Promise}
128 | */
129 | async function getPoints() {
130 | try {
131 | const data = await sudojia.sendRequest(`${baseUrl}/api/Member/GetMemberInfo`, 'get', headers);
132 | if (100 !== data.Status) {
133 | console.error(data.Msg);
134 | return;
135 | }
136 | const points = data.Data.MemberInfo.MemberPollen;
137 | console.log(`当前绿星币:${points}`);
138 | message += `当前绿星币:${points}\n\n`;
139 | } catch (e) {
140 | console.error(`获取绿星币时发生异常:${e}`);
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_hgf.js:
--------------------------------------------------------------------------------
1 | /**
2 | * #小程序://厚工坊商城/aWVCNOaniBxf4Pk
3 | *
4 | * 抓包 Host:https://api.hgf1862.com 获取请求头 sessionid
5 | * export HGF_COOKIE = 'hgfappmin.8848xxxxxxxxxxxxxxxxxxxxx.eyJxxxxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/09/15
11 | *
12 | * const $ = new Env('厚工坊')
13 | * cron: 33 5 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('厚工坊');
17 | const moment = require("moment");
18 | const hgfList = process.env.HGF_COOKIE ? process.env.HGF_COOKIE.split(/[\n&]/) : [];
19 | // 消息推送
20 | let message = '';
21 | // 接口地址
22 | const baseUrl = 'https://api.hgf1862.com'
23 | // 请求头
24 | const headers = {
25 | 'User-Agent': sudojia.getRandomUserAgent(),
26 | 'Accept': 'application/json, text/javascript, */*; q=0.01',
27 | 'Accept-Encoding': 'gzip, deflate, br',
28 | 'x-requested-with': 'XMLHttpRequest',
29 | 'sec-fetch-site': 'same-origin',
30 | 'sec-fetch-mode': 'cors',
31 | 'sec-fetch-dest': 'empty',
32 | 'accept-language': 'zh-CN,zh;q=0.9',
33 | };
34 |
35 | !(async () => {
36 | await checkUpdate($.name, hgfList);
37 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
38 | for (let i = 0; i < hgfList.length; i++) {
39 | const index = i + 1;
40 | headers.Cookie = `user=SessionID=${hgfList[i]}`;
41 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
42 | message += `📣====${$.name}账号[${index}]====📣\n`;
43 | await main();
44 | await $.wait(sudojia.getRandomWait(2000, 2500));
45 | }
46 | if (message) {
47 | await notify.sendNotify(`「${$.name}」`, `${message}`);
48 | }
49 | })().catch((e) => $.logErr(e)).finally(() => $.done());
50 |
51 | async function main() {
52 | await sign();
53 | await $.wait(sudojia.getRandomWait(1000, 1500));
54 | await doTask();
55 | }
56 |
57 | /**
58 | * 签到
59 | *
60 | * @returns {Promise}
61 | */
62 | async function sign() {
63 | try {
64 | const data = await sudojia.sendRequest(`${baseUrl}/YUN//Game/2021/QianDao/QianDaoAjax_By28.aspx?op=now&vers=${moment().format('YYYYMMDD')}`, 'post', headers);
65 | if (1 !== data.status) {
66 | message += `${data.msg}\n`;
67 | return console.error(`签到失败:${data.msg}`);
68 | }
69 | message += `签到成功,获得${data.jiubi}酒币\n`;
70 | console.log(`签到成功,获得${data.jiubi}酒币`);
71 | console.log(data.Lianxu.jp_txt);
72 | } catch (e) {
73 | console.error(`获取签到信息时发生异常:${e}`);
74 | }
75 | }
76 |
77 | /**
78 | * 领取任务奖励
79 | *
80 | * @returns {Promise}
81 | */
82 | async function doTask() {
83 | try {
84 | const data = await sudojia.sendRequest(`${baseUrl}/YUN//Game/2024/RenWuJB/AjaxGo.aspx?cid=9`, 'post', headers);
85 | if (1 !== data.status) {
86 | return console.error(`浏览失败:${data.msg}`);
87 | }
88 | await $.wait(sudojia.getRandomWait(2000, 2500));
89 | console.log('浏览小阿头条成功!');
90 | message += `浏览小阿头条成功!\n\n`;
91 | } catch (e) {
92 | console.error(`浏览任务时发生异常:${e}`);
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_hzhfp.js:
--------------------------------------------------------------------------------
1 | /**
2 | * #小程序://媓钻/gANSWauVDzi4SPH
3 | *
4 | * 抓包 Host:https://api.hzyxhfp.com 获取请求头 Authorization 并且删掉 Bearer
5 | * export HZHFP_TOKEN = 'eyJ0exxxxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/08/18
11 | *
12 | * const $ = new Env('媓钻护肤品')
13 | * cron: 29 11 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('媓钻护肤品');
17 | const hzhfpList = process.env.HZHFP_TOKEN ? process.env.HZHFP_TOKEN.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://api.hzyxhfp.com'
21 | // 请求头
22 | const headers = {
23 | 'User-Agent': sudojia.getRandomUserAgent(),
24 | 'Content-Type': 'application/json;charset=UTF-8',
25 | 'app': 'wx3df7476c42cace5d',
26 | 'Accept': '*/*',
27 | 'Referer': 'https://servicewechat.com/wx3df7476c42cace5d/377/page-frame.html',
28 | 'Accept-Encoding': 'gzip, deflate, br',
29 | 'Host': 'api.hzyxhfp.com',
30 | };
31 |
32 | !(async () => {
33 | await checkUpdate($.name, hzhfpList);
34 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
35 | for (let i = 0; i < hzhfpList.length; i++) {
36 | const index = i + 1;
37 | headers.Authorization = `Bearer ${hzhfpList[i]}`;
38 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
39 | message += `📣====${$.name}账号[${index}]====📣\n`;
40 | await main();
41 | await $.wait(sudojia.getRandomWait(2000, 2500));
42 | }
43 | if (message) {
44 | await notify.sendNotify(`「${$.name}」`, `${message}`);
45 | }
46 | })().catch((e) => $.logErr(e)).finally(() => $.done());
47 |
48 | async function main() {
49 | await getUserInfo();
50 | await $.wait(sudojia.getRandomWait(1000, 1500));
51 | await signIn();
52 | await $.wait(sudojia.getRandomWait(1000, 1500));
53 | await getUserPoints();
54 | }
55 |
56 | /**
57 | * 获取用户信息
58 | *
59 | * @return {Promise}
60 | */
61 | async function getUserInfo() {
62 | try {
63 | const data = await sudojia.sendRequest(`${baseUrl}/api/users/getUserDetailInfo`, 'post', headers);
64 | if (0 !== data.code) {
65 | return $.log(data.msg);
66 | }
67 | const phone = data.data.phone;
68 | const hiddenMobile = `${phone.slice(0, 3)}***${phone.slice(-3)}`;
69 | console.log(`${data.data.wx_nickname}(${hiddenMobile})`);
70 | message += `${data.data.wx_nickname}(${phone})\n`;
71 | } catch (e) {
72 | console.error('获取用户信息时发生异常:', e.response.data);
73 | }
74 | }
75 |
76 | /**
77 | * 签到
78 | *
79 | * @return {Promise}
80 | */
81 | async function signIn() {
82 | try {
83 | const data = await sudojia.sendRequest(`${baseUrl}/api/signInLog/addSignIn`, 'post', headers);
84 | if (0 !== data.code) {
85 | message += `${data.msg}\n`;
86 | return $.log(data.msg);
87 | }
88 | console.log(`签到成功!已连续签到${data.data.cont_days}天`);
89 | message += `签到成功!已连续签到${data.data.cont_days}天\n`;
90 | } catch (e) {
91 | console.error('签到时发生异常:', e.response.data);
92 | }
93 | }
94 |
95 | /**
96 | * 获取用户积分
97 | *
98 | * @return {Promise}
99 | */
100 | async function getUserPoints() {
101 | try {
102 | const data = await sudojia.sendRequest(`${baseUrl}/api/userRight/getUserRightDetail`, 'post', headers);
103 | if (0 !== data.code) {
104 | return $.log(data.msg);
105 | }
106 | console.log(`当前积分:${data.data.integral}`);
107 | message += `当前积分:${data.data.integral}\n\n`;
108 | } catch (e) {
109 | console.error('获取积分时发生异常:', e.response.data);
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_instax.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 富士instax玩拍由我俱乐部小程序
3 | *
4 | * 抓包 Host:https://instax.app.xcxd.net.cn 获取请求头 Authorization 的值,并且删掉 Bearer
5 | * 首次登录在我的 - 绑定手机号加入会员
6 | * 脚本默认执行抽奖,如需禁用请在变量值后面添加 #false
7 | * export INSTAX_TOKEN = 'xxxxx#false'
8 | * 多账号用 & 或换行
9 | *
10 | * @author Telegram@sudojia
11 | * @site https://blog.imzjw.cn
12 | * @date 2024/07/17
13 | *
14 | * const $ = new Env('玩拍由我俱乐部')
15 | * cron: 41 9 * * *
16 | */
17 | const initScript = require('../utils/initScript')
18 | const {$, notify, sudojia, checkUpdate} = initScript('玩拍由我俱乐部');
19 | const instaxList = process.env.INSTAX_TOKEN ? process.env.INSTAX_TOKEN.split(/[\n&]/) : [];
20 | let message = '';
21 | // 接口地址
22 | const baseUrl = 'https://instax.app.xcxd.net.cn'
23 | // 请求头
24 | const headers = {
25 | 'User-Agent': sudojia.getRandomUserAgent(),
26 | 'Accept-Encoding': 'gzip, deflate, br',
27 | 'Referer': 'https://servicewechat.com/wx3cb572fbf3aa30c8/136/page-frame.html',
28 | 'Content-Type': 'application/json',
29 | 'Accept': '*/*',
30 | 'Host': 'instax.app.xcxd.net.cn',
31 | };
32 |
33 | !(async () => {
34 | await checkUpdate($.name, instaxList);
35 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
36 | for (let i = 0; i < instaxList.length; i++) {
37 | const index = i + 1;
38 | const [auth, enableDraw] = instaxList[i].split('#');
39 | headers.Authorization = `Bearer ${auth}`;
40 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
41 | message += `📣====${$.name}账号[${index}]====📣\n`;
42 | await $.wait(sudojia.getRandomWait(800, 1200));
43 | await main(enableDraw);
44 | await $.wait(sudojia.getRandomWait(2000, 2500));
45 | }
46 | if (message) {
47 | await notify.sendNotify(`「${$.name}」`, `${message}`);
48 | }
49 | })().catch((e) => $.logErr(e)).finally(() => $.done());
50 |
51 | async function main(enableDraw) {
52 | await getUserInfo();
53 | await $.wait(sudojia.getRandomWait(1500, 2000));
54 | await signActivity();
55 | await $.wait(sudojia.getRandomWait(1500, 2000));
56 | if (enableDraw === 'false') {
57 | console.log('检测到未开启抽奖,本次将取消抽奖');
58 | return;
59 | }
60 | await getChance();
61 | }
62 |
63 | /**
64 | * 获取用户信息
65 | *
66 | * @return {Promise}
67 | */
68 | async function getUserInfo() {
69 | try {
70 | const data = await sudojia.sendRequest(`${baseUrl}/api/me`, 'get', headers);
71 | if (data.error === false) {
72 | $.userId = data.data.user.id;
73 | console.log(`昵称:${data.data.user.nickname}\n当前积分:${data.data.user.credit}\n等级:${data.data.user.user_level_id}`);
74 | message += `昵称:${data.data.user.nickname}\n当前积分:${data.data.user.credit}\n等级:Lv.${data.data.user.user_level_id}\n`;
75 | }
76 | } catch (e) {
77 | console.error(`获取用户信息时发生异常:${e.response.data}`);
78 | }
79 | }
80 |
81 | /**
82 | * 签到
83 | *
84 | * @return {Promise}
85 | */
86 | async function signActivity() {
87 | try {
88 | const data = await sudojia.sendRequest(`${baseUrl}/api/user/${$.userId}/sign-activity/25/sign`, 'post', headers);
89 | if (data.error === false) {
90 | console.log('签到成功');
91 | message += '签到成功\n';
92 | }
93 | } catch (e) {
94 | if (e.response.status === 422) {
95 | message += e.response.data.tips + '\n';
96 | console.error(e.response.data.tips);
97 | } else {
98 | console.error(`签到时发生异常:${e}`);
99 | }
100 | }
101 | }
102 |
103 | /**
104 | * 获取抽奖次数
105 | *
106 | * @return {Promise}
107 | */
108 | async function getChance() {
109 | try {
110 | let data = await sudojia.sendRequest(`${baseUrl}/api/user/${$.userId}/draw-activities/42/chance`, 'get', headers);
111 | if (data.error === false) {
112 | let count = data.data;
113 | if (count <= 0) {
114 | console.log('今日抽奖次数已用光啦~');
115 | message += '今日抽奖次数已用光啦~\n\n';
116 | return;
117 | }
118 | message += '抽奖获得了:\n';
119 | while (count > 0) {
120 | console.log(`第${count}次抽奖机会`);
121 | await $.wait(sudojia.getRandomWait(3000, 3500));
122 | await draw();
123 | // 抽奖后再次检查抽奖次数
124 | await $.wait(sudojia.getRandomWait(2000, 2600));
125 | data = await sudojia.sendRequest(`${baseUrl}/api/user/${$.userId}/draw-activities/42/chance`, 'get', headers);
126 | count = data.data;
127 | // await getChance();
128 | }
129 | }
130 | message += '\n\n';
131 | } catch (e) {
132 | console.error(`获取抽奖次数时发生异常:${e.response.data}`);
133 | }
134 | }
135 |
136 | /**
137 | * 抽奖
138 | *
139 | * @return {Promise}
140 | */
141 | async function draw() {
142 | try {
143 | const data = await sudojia.sendRequest(`${baseUrl}/api/user/${$.userId}/draw-activities/42/draw`, 'post', headers);
144 | if (data.error === false) {
145 | console.log(`抽奖成功,获得[${data.data.record.desc}]`);
146 | message += `${data.data.record.desc}、`;
147 | }
148 | } catch (e) {
149 | console.error(`抽奖时发生异常:${e.response.data}`);
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_jindian.js:
--------------------------------------------------------------------------------
1 | /**
2 | * #小程序://金典有机生活+/ckaZpSbeaws4Dbd
3 | *
4 | * 抓包 Host:https://msmarket.msx.digitalyili.com 获取请求头 access-token 的值
5 | * export JINDIAN_TOKEN = 'xxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/07/21
11 | *
12 | * const $ = new Env('金典有机生活+')
13 | * cron: 56 7 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('金典有机生活+');
17 | const jinDianList = process.env.JINDIAN_TOKEN ? process.env.JINDIAN_TOKEN.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://msmarket.msx.digitalyili.com'
21 | // 请求头
22 | const headers = {
23 | 'User-Agent': sudojia.getRandomUserAgent(),
24 | 'Content-Type': 'application/json',
25 | 'Accept': '*/*',
26 | 'Referer': 'https://servicewechat.com/wxf32616183fb4511e/616/page-frame.html',
27 | 'Accept-Encoding': 'gzip, deflate, br',
28 | };
29 |
30 | !(async () => {
31 | await checkUpdate($.name, jinDianList);
32 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
33 | for (let i = 0; i < jinDianList.length; i++) {
34 | const index = i + 1;
35 | headers['access-token'] = jinDianList[i];
36 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
37 | const isLogin = await getUserInfo();
38 | if (!isLogin) {
39 | console.error(`Token 已失效`);
40 | await notify.sendNotify(`「Token失效通知」`, `${$.name}账号[${index}] Token 已失效,请重新登录获取 Token\n\n`);
41 | continue;
42 | }
43 | message += `📣====${$.name}账号[${index}]====📣\n`;
44 | message += `昵称:${$.nickName}\n`;
45 | console.log(`昵称:${$.nickName}`);
46 | await $.wait(sudojia.getRandomWait(800, 1200));
47 | await main();
48 | await $.wait(sudojia.getRandomWait(2000, 2500));
49 | }
50 | if (message) {
51 | await notify.sendNotify(`「${$.name}」`, `${message}`);
52 | }
53 | })().catch((e) => $.logErr(e)).finally(() => $.done());
54 |
55 | async function main() {
56 | console.log(`开始检测签到状态...`);
57 | await checkStatus();
58 | await $.wait(sudojia.getRandomWait(1500, 2300))
59 | if ($.signed) {
60 | message += `今日已签到,请勿重复签到\n\n`;
61 | console.log(`今日已签到,请勿重复签到`);
62 | return;
63 | }
64 | console.log(`状态:未签到\n开始签到...`);
65 | await sign();
66 | await $.wait(sudojia.getRandomWait(1500, 2300));
67 | await getPoint();
68 | }
69 |
70 | /**
71 | * 获取用户信息
72 | *
73 | * @return {Promise}
74 | */
75 | async function getUserInfo() {
76 | try {
77 | const data = await sudojia.sendRequest(`${baseUrl}/gateway/api/auth/account/user/info`, 'get', headers);
78 | if (data.status) {
79 | $.nickName = data.data.nickName;
80 | return true;
81 | }
82 | console.log(data.error);
83 | return false;
84 | } catch (e) {
85 | console.error(`获取用户信息时发生异常:${e}`);
86 | }
87 | }
88 |
89 | /**
90 | * 检测签到状态
91 | *
92 | * @return {Promise}
93 | */
94 | async function checkStatus() {
95 | try {
96 | const data = await sudojia.sendRequest(`${baseUrl}/gateway/api/member/sign/status`, 'get', headers);
97 | if (data.status) {
98 | // false:未签到
99 | $.signed = data.data.signed
100 | }
101 | } catch (e) {
102 | console.error(`检测签到状态时发生异常:${e}`);
103 | }
104 | }
105 |
106 | /**
107 | * 签到
108 | *
109 | * @return {Promise}
110 | */
111 | async function sign() {
112 | try {
113 | const data = await sudojia.sendRequest(`${baseUrl}/gateway/api/member/daily/sign`, 'post', headers, {});
114 | if (data.status) {
115 | message += `签到成功\n`;
116 | console.log(`签到成功,积分+${data.data.dailySign.bonusPoint}`);
117 | }
118 | } catch (e) {
119 | console.error(`签到时发生异常:${e}`);
120 | }
121 | }
122 |
123 | /**
124 | * 获取积分
125 | *
126 | * @return {Promise}
127 | */
128 | async function getPoint() {
129 | try {
130 | const data = await sudojia.sendRequest(`${baseUrl}/gateway/api/member/point`, 'get', headers);
131 | if (data.status) {
132 | message += `当前积分:${data.data}\n\n`;
133 | console.log(`当前积分:${data.data}`);
134 | } else {
135 | console.log(`获取积分失败:${data}`);
136 | }
137 | } catch (e) {
138 | console.error(`获取积分时发生异常:${e}`);
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_kozbs.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 植白说官方商城小程序
3 | *
4 | * 抓包 url:https://www.kozbs.com 获取请求头 x-dts-token 的值
5 | * export KOZBS_TOKEN = '1l967bxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/08/07
11 | *
12 | * const $ = new Env('植白说官方商城')
13 | * cron: 18 9 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('植白说官方商城');
17 | const kozbsList = process.env.KOZBS_TOKEN ? process.env.KOZBS_TOKEN.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://www.kozbs.com'
21 | // 请求头
22 | const headers = {
23 | 'xweb_xhr': 1,
24 | 'User-Agent': sudojia.getRandomUserAgent(),
25 | 'Content-Type': 'application/json',
26 | 'Accept': '*/*',
27 | 'Referer': `https://servicewechat.com/wx6b6c5243359fe265/153/page-frame.html`,
28 | 'Accept-Encoding': 'gzip, deflate, br',
29 | 'Accept-Language': 'zh-CN,zh;q=0.9'
30 | };
31 |
32 | !(async () => {
33 | await checkUpdate($.name, kozbsList);
34 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
35 | for (let i = 0; i < kozbsList.length; i++) {
36 | const index = i + 1;
37 | headers['x-dts-token'] = kozbsList[i];
38 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
39 | message += `📣====${$.name}账号[${index}]====📣\n`;
40 | await main();
41 | await $.wait(sudojia.getRandomWait(2000, 2500));
42 | }
43 | if (message) {
44 | await notify.sendNotify(`「${$.name}」`, `${message}`);
45 | }
46 | })().catch((e) => $.logErr(e)).finally(() => $.done());
47 |
48 | async function main() {
49 | await getUserInfo();
50 | await $.wait(sudojia.getRandomWait(2000, 2500));
51 | await signDay();
52 | }
53 |
54 | /**
55 | * 获取用户信息
56 | *
57 | * @return {Promise}
58 | */
59 | async function getUserInfo() {
60 | try {
61 | const data = await sudojia.sendRequest(`${baseUrl}/demo/wx/user/getUserIntegral`, 'get', headers);
62 | if (0 !== data.errno) {
63 | console.error(data.errmsg);
64 | return;
65 | }
66 | // 当前积分
67 | const integer = data.data.integer
68 | // 昵称
69 | const userName = data.data.list[0].userName
70 | console.log(`${userName}`);
71 | console.log(`当前积分:${integer}`);
72 | message += `${userName}\n当前积分:${integer}\n`;
73 | } catch (e) {
74 | console.error(`获取用户信息时发生异常:${e}`);
75 | }
76 | }
77 |
78 | /**
79 | * 检测签到状态
80 | *
81 | * @return {Promise}
82 | */
83 | async function signDay() {
84 | try {
85 | const data = await sudojia.sendRequest(`${baseUrl}/demo/wx/home/signDay`, 'get', headers);
86 | if (0 !== data.errno) {
87 | console.error(data.errmsg);
88 | return;
89 | }
90 | if (1 === data.data.isSign) {
91 | console.log(`今天已经签到过了`);
92 | message += `今天已经签到过了\n\n`;
93 | return;
94 | }
95 | await $.wait(sudojia.getRandomWait(2000, 2500));
96 | await sign();
97 | } catch (e) {
98 | console.error(`检测签到状态时发生异常:${e}`);
99 | }
100 | }
101 |
102 | /**
103 | * 签到
104 | *
105 | * @return {Promise}
106 | */
107 | async function sign() {
108 | try {
109 | const data = await sudojia.sendRequest(`${baseUrl}/demo/wx/home/sign`, 'get', headers);
110 | if (0 !== data.errno) {
111 | console.error(data.errmsg);
112 | return;
113 | }
114 | console.log(`签到成功`);
115 | message += `签到成功\n\n`;
116 | } catch (e) {
117 | console.error(`签到时发生异常:${e}`);
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_ktgzs.js:
--------------------------------------------------------------------------------
1 | /**
2 | * #小程序://开天工作室/cBFFdQoybN35EEh
3 | *
4 | * 抓包 Host:https://api.box.vipinfinity.com 获取请求头 Authorization 的值
5 | * export KTGZS_TOKEN = 'vqGjEixxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/08/19
11 | *
12 | * const $ = new Env('开天工作室')
13 | * cron: 33 9 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('开天工作室');
17 | const ktgzsList = process.env.KTGZS_TOKEN ? process.env.KTGZS_TOKEN.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://api.box.vipinfinity.com'
21 | // 请求头
22 | const headers = {
23 | 'User-Agent': sudojia.getRandomUserAgent(),
24 | 'Accept-Encoding': 'gzip, deflate, br',
25 | 'Client-Name': 'default',
26 | 'Referer': 'https://servicewechat.com/wxa1ff7cf5ddff1da2/9/page-frame.html',
27 | 'Client-Type': 'wechat--miniapp-windows',
28 | 'Content-Type': 'application/json',
29 | 'Accept': '*/*',
30 | 'Host': 'api.box.vipinfinity.com',
31 | };
32 |
33 | !(async () => {
34 | await checkUpdate($.name, ktgzsList);
35 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
36 | for (let i = 0; i < ktgzsList.length; i++) {
37 | const index = i + 1;
38 | headers.Authorization = ktgzsList[i];
39 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
40 | message += `📣====${$.name}账号[${index}]====📣\n`;
41 | await $.wait(sudojia.getRandomWait(800, 1200));
42 | await main();
43 | await $.wait(sudojia.getRandomWait(2000, 2500));
44 | }
45 | if (message) {
46 | await notify.sendNotify(`「${$.name}」`, `${message}`);
47 | }
48 | })().catch((e) => $.logErr(e)).finally(() => $.done());
49 |
50 | async function main() {
51 | await getUserInfo();
52 | await $.wait(sudojia.getRandomWait(1000, 1500));
53 | await sign();
54 | await $.wait(sudojia.getRandomWait(1000, 1500));
55 | await pointsInfo();
56 | }
57 |
58 | /**
59 | * 获取用户信息
60 | *
61 | * @return {Promise}
62 | */
63 | async function getUserInfo() {
64 | try {
65 | const data = await sudojia.sendRequest(`${baseUrl}/user`, 'get', headers);
66 | if (0 !== data.code) {
67 | return $.log(data.message);
68 | }
69 | const {name, phone} = data.data.user
70 | console.log(`${name}(${phone})`);
71 | message += `${name}(${phone})\n`;
72 | } catch (e) {
73 | console.error(`获取用户信息时发生异常:`, e.response.data);
74 | }
75 | }
76 |
77 | /**
78 | * 签到
79 | * @return {Promise}
80 | */
81 | async function sign() {
82 | try {
83 | const data = await sudojia.sendRequest(`${baseUrl}/sign-in`, 'post', headers);
84 | if (0 !== data.code) {
85 | return $.log(data.message);
86 | }
87 | const {continuous_days, award_score} = data.data;
88 | console.log(`签到成功,积分+${award_score}`);
89 | console.log(`已连续签到${continuous_days}天`);
90 | message += `签到成功\n已连续签到${continuous_days}天\n`;
91 | } catch (e) {
92 | console.error(`签到时发生异常:`, e.response.data);
93 | }
94 | }
95 |
96 | /**
97 | * 查询积分
98 | *
99 | * @return {Promise}
100 | */
101 | async function pointsInfo() {
102 | try {
103 | const data = await sudojia.sendRequest(`${baseUrl}/asset-records/score?page=1&per_page=20`, 'get', headers);
104 | if (0 !== data.code) {
105 | return $.log(data.message);
106 | }
107 | console.log(`当前积分:${data.data.list[0].after}`);
108 | message += `当前积分:${data.data.list[0].after}\n\n`;
109 | } catch (e) {
110 | console.error(`积分查询时发生异常:`, e.response.data);
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_kukahome.js:
--------------------------------------------------------------------------------
1 | /**
2 | * #小程序://顾家会员/DUUpEeo0zF2Gw8k
3 | *
4 | * 抓包 Host:https://mc.kukahome.com 获取请求头 AccessToken 和 X-Customer
5 | * export GU_HOME_TOKEN = 'AccessToken#X-Customer'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/12/3
11 | * @lastModifyTime 2024/12/27
12 | *
13 | * const $ = new Env('顾家家居')
14 | * cron: 5 10 * * *
15 | */
16 | const initScript = require('../utils/initScript')
17 | const {$, notify, sudojia, checkUpdate} = initScript('顾家家居');
18 | const kukaList = process.env.GU_HOME_TOKEN ? process.env.GU_HOME_TOKEN.split(/[\n&]/) : [];
19 | // 消息推送
20 | let message = '';
21 | const appId = '667516';
22 | const appSecret = 'FH3yRrHG2RfexND8';
23 | // 接口地址
24 | const baseUrl = 'https://mc.kukahome.com'
25 | let headers = {
26 | "user-agent": sudojia.getRandomUserAgent(),
27 | 'Content-Type': 'application/json',
28 | 'brandCode': 'K001',
29 | 'appid': '667516',
30 | 'Referer': 'https://servicewechat.com/wx0770280d160f09fe/214/page-frame.html',
31 | 'Accept-Language': 'zh-CN,zh;q=0.9',
32 | };
33 | !(async () => {
34 | await checkUpdate($.name, kukaList);
35 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
36 | for (let i = 0; i < kukaList.length; i++) {
37 | const index = i + 1;
38 | const [aToken, xCustomer] = kukaList[i].split('#');
39 | // 添加请求头
40 | headers.AccessToken = aToken;
41 | headers['X-Customer'] = xCustomer;
42 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
43 | message += `📣====${$.name}账号[${index}]====📣\n`;
44 | await main();
45 | await $.wait(sudojia.getRandomWait(2000, 2500));
46 | }
47 | if (message) {
48 | await notify.sendNotify(`「${$.name}」`, `${message}`);
49 | }
50 | })().catch((e) => $.logErr(e)).finally(() => $.done());
51 |
52 | async function main() {
53 | await getUserInfo();
54 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
55 | await sign();
56 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
57 | await getArticleList();
58 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
59 | await getScore();
60 | }
61 |
62 | async function getUserInfo() {
63 | try {
64 | const data = await sendSignRequest(`/club-server/api/user/info`, 'post');
65 | const nickName = data.data.nickName || '简朴寨';
66 | const mobile = data.data.mobile || '18888888888';
67 | console.log(`${nickName}(${mobile})`);
68 | message += `${nickName}(${mobile})\n`;
69 | } catch (e) {
70 | console.error(`获取用户信息时发生异常:${e}`);
71 | }
72 | }
73 |
74 | async function sign() {
75 | try {
76 | const data = await sendSignRequest('/integral-server/scenePoint/scene/point', 'post', {
77 | "scene": "sign",
78 | "brandCode": "K001"
79 | });
80 | console.log(`签到成功,积分+${data.data}`);
81 | message += `签到成功,积分+${data.data}\n`;
82 | } catch (e) {
83 | console.error(`签到时发生异常:${e}`);
84 | }
85 | }
86 |
87 | async function getArticleList() {
88 | try {
89 | const data = await sendSignRequest(`/club-server/applet/waterfall/newWaterfall`, 'post', {
90 | pageNum: 1,
91 | pageSize: 30,
92 | source: 1
93 | });
94 | const article = data.data[Math.floor(Math.random() * data.data.length)];
95 | const {id, title} = article;
96 | console.log(`开始点赞【${title}】`);
97 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
98 | await likePost(id);
99 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
100 | await collectPost(id);
101 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
102 | await sharePost(id);
103 | } catch (e) {
104 | console.error(`获取文章时发生异常:${e}`);
105 | }
106 | }
107 |
108 | async function likePost(postId) {
109 | try {
110 | const body = {id: postId};
111 | await sendSignRequest(`/club-server/front/postOrder/like`, 'post', body);
112 | await sendSignRequest(`/club-server/front/member/likeSendPoint`, 'post', {
113 | postOrderId: postId,
114 | triggerType: 1,
115 | content: "点赞"
116 | });
117 | console.log('点赞成功~');
118 | await $.wait(sudojia.getRandomWait(2e3, 3e3));
119 | console.log('开始取消点赞');
120 | await sendSignRequest(`/club-server/front/postOrder/like`, 'post', body);
121 | console.log('取消点赞成功~');
122 | } catch (e) {
123 | console.error(`点赞时发生异常:${e}`);
124 | }
125 | }
126 |
127 | async function collectPost(postId) {
128 | try {
129 | const body = {id: postId};
130 | await sendSignRequest(`/club-server/front/postOrder/collect`, 'post', body);
131 | await sendSignRequest(`/club-server/front/member/likeSendPoint`, 'post', {
132 | postOrderId: postId,
133 | triggerType: 2,
134 | content: "收藏"
135 | });
136 | console.log('收藏文章成功`');
137 | await $.wait(sudojia.getRandomWait(2e3, 3e3));
138 | console.log('开始取消收藏');
139 | await sendSignRequest(`/club-server/front/postOrder/collect`, 'post', body);
140 | console.log('取消收藏成功~');
141 | } catch (e) {
142 | console.error(`收藏时发生异常:${e}`);
143 | }
144 | }
145 |
146 | async function sharePost(postId) {
147 | try {
148 | await sendSignRequest(`/club-server/front/postOrder/share`, 'post', {id: postId});
149 | console.log('分享成功~');
150 | await $.wait(sudojia.getRandomWait(500, 800));
151 | await sendSignRequest(`/club-server/front/member/likeSendPoint`, 'post', {
152 | postOrderId: postId,
153 | triggerType: 3,
154 | content: "微信好友转发",
155 | forwardType: 2
156 | });
157 | } catch (e) {
158 | console.error(`分享时发生异常:${e}`);
159 | }
160 | }
161 |
162 | async function getScore() {
163 | try {
164 | const data = await sendSignRequest(`/club-server/front/member/userCenterScore`, 'get');
165 | console.log(`已连续签到${data.data.signCount}天`);
166 | console.log(`当前积分:${data.data.point}`);
167 | message += `已连续签到${data.data.signCount}天\n`;
168 | message += `当前积分:${data.data.point}\n\n`;
169 | } catch (e) {
170 | console.error(`获取积分时发生异常:${e}`);
171 | }
172 | }
173 |
174 | async function sendSignRequest(url, method, body) {
175 | headers.sign = genSign();
176 | if (body) {
177 | headers.parameterSign = genSign(body);
178 | }
179 | const data = await sudojia.sendRequest(`${baseUrl}${url}`, method, headers, body);
180 | if (0 !== data.code) {
181 | throw new Error(`请求 ${url} 失败:${data.message}\n`);
182 | }
183 | return data;
184 | }
185 |
186 | function genSign(body) {
187 | const ts = new Date().getTime();
188 | headers.timestamp = ts;
189 | if (body) {
190 | return sudojia.md5(sudojia.md5(processBody(body)) + String(ts).substring(4, 10));
191 | } else {
192 | return sudojia.md5(appId + appSecret + ts).toLowerCase();
193 | }
194 | }
195 |
196 | function processBody(data) {
197 | return Object.keys(data).sort((a, b) => a.localeCompare(b)).map(key => {
198 | const value = data[key];
199 | return [key, typeof value === 'object' || Array.isArray(value) ? JSON.stringify(value) : value];
200 | }).filter(pair => pair !== null).map(([key, value]) => `${key}=${value}`).join('&');
201 | }
202 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_longfor.js:
--------------------------------------------------------------------------------
1 | /**
2 | * #小程序://龙湖天街/pi5MO0UC9oQJ49D
3 | *
4 | * 抓包 Host:https://gw2c-hw-open.longfor.com 获取请求头 token 的值
5 | * export LONG_FOR_TOKEN = '8b465xxxxxxxxxxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * 作者号黑了,而且基本也没跑过,所以懒得修复了,解密版本放出来,有能力的自行改一改,就几个接口,抓抓包改改就好了
9 | *
10 | * @author Telegram@sudojia
11 | * @site https://blog.imzjw.cn
12 | * @date 2024/09/18
13 | *
14 | * const $ = new Env('龙湖天街')
15 | * cron: 39 8 * * *
16 | */
17 | const initScript = require('../utils/initScript')
18 | const {$, notify, sudojia, checkUpdate} = initScript('龙湖天街');
19 | const longForList = process.env.LONG_FOR_TOKEN ? process.env.LONG_FOR_TOKEN.split(/[\n&]/) : [];
20 | // 消息推送
21 | let message = '';
22 | // 接口地址
23 | const baseUrl = 'https://gw2c-hw-open.longfor.com'
24 | // 请求头
25 | const headers = {
26 | 'User-Agent': sudojia.getRandomUserAgent(),
27 | 'Content-Type': 'application/json',
28 | 'Accept-Language': 'zh-CN,zh;q=0.9',
29 | };
30 | // 签到抽奖的key
31 | const API_KEY = 'c06753f1-3e68-437d-b592-b94656ea5517';
32 | const BU_CODE = 'C20400';
33 | const DX_RISK_SOURCE = 5;
34 | const DX_RISK_CAPTCHA_TOKEN = 'undefined';
35 | const CHANNEL = 'C2';
36 | // 签到活动ID
37 | const ACTIVITY_NO_SIGN = '11111111111686241863606037740000';
38 | // 抽奖活动ID
39 | const ACTIVITY_NO_LOTTERY = '11111111111725156856102879310000';
40 |
41 | !(async () => {
42 | await checkUpdate($.name, longForList);
43 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
44 | for (let i = 0; i < longForList.length; i++) {
45 | const index = i + 1;
46 | // headers.token = longForList[i];
47 | headers.lmToken = longForList[i];
48 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
49 | message += `📣====${$.name}账号[${index}]====📣\n`;
50 | await main();
51 | await $.wait(sudojia.getRandomWait(2e3, 3e3));
52 | }
53 | if (message) {
54 | await notify.sendNotify(`「${$.name}」`, `${message}`);
55 | }
56 | })().catch((e) => $.logErr(e)).finally(() => $.done());
57 |
58 | async function main() {
59 | await getUserInfo();
60 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
61 | await sign()
62 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
63 | await lotterySign();
64 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
65 | await lottery();
66 | }
67 |
68 | /**
69 | * 获取用户信息
70 | *
71 | * @return {Promise}
72 | */
73 | async function getUserInfo() {
74 | try {
75 | const headerCp = JSON.parse(JSON.stringify(headers));
76 | headerCp['X-Gaia-Api-Key'] = '646fce29-3a77-462a-aabe-0fe77bc3023f';
77 | const data = await sudojia.sendRequest(`${baseUrl}/riyuehu-miniapp-prod/service/ryh/user/info`, 'post', headerCp, {
78 | "data": {
79 | "projectId": "B379F9F1-C176-4925-B6F6-92555AC62E61"
80 | }
81 | });
82 | console.log(`${data.data.nickName}(${data.data.mobile})`);
83 | message += `${data.data.nickName}(${data.data.mobile})\n`;
84 | } catch (e) {
85 | console.error(`获取用户信息时发生异常:`, e.response.data);
86 | }
87 | }
88 |
89 | /**
90 | * 每日签到
91 | *
92 | * @returns {Promise}
93 | */
94 | async function sign() {
95 | try {
96 | const data = await sudojia.sendRequest(`${baseUrl}/lmarketing-task-api-mvc-prod/openapi/task/v1/signature/clock`, 'post', prepareHeaders(), {
97 | "activity_no": ACTIVITY_NO_SIGN
98 | });
99 | if ('0000' !== data.code) {
100 | return console.error(`签到失败 ->`, data);
101 | }
102 | data.data.is_popup === 1 ? console.log(`签到成功!成长值+${data.data.reward_info[0].reward_num}`) : console.log(`今日已签到`);
103 | data.data.is_popup === 1 ? message += `签到成功!成长值+${data.data.reward_info[0].reward_num}\n` : message += `今日已签到\n`;
104 | } catch (e) {
105 | console.error(`签到时发生异常:`, e.response.data);
106 | }
107 | }
108 |
109 | /**
110 | * 签到抽奖
111 | *
112 | * @returns {Promise}
113 | */
114 | async function lotterySign() {
115 | try {
116 | const data = await sudojia.sendRequest(`${baseUrl}/lmarketing-task-api-mvc-prod/openapi/task/v1/lottery/sign`, 'post', prepareHeaders(), {
117 | "activity_no": ACTIVITY_NO_LOTTERY,
118 | "task_id": ""
119 | });
120 | if ('0000' !== data.code) {
121 | return console.error(`抽奖签到失败 ->`, data);
122 | }
123 | console.log(`抽奖签到成功,获得${data.data.ticket_times}次抽奖机会`);
124 | message += `抽奖签到成功\n`
125 | } catch (e) {
126 | console.error(`抽奖签到时发生异常:`, e.response.data);
127 | }
128 | }
129 |
130 | /**
131 | * 抽奖
132 | *
133 | * @returns {Promise}
134 | */
135 | async function lottery() {
136 | try {
137 | const data = await sudojia.sendRequest(`${baseUrl}/lmarketing-task-api-mvc-prod/openapi/task/v1/lottery/luck`, 'post', prepareHeaders(), {
138 | "activity_no": ACTIVITY_NO_LOTTERY,
139 | "task_id": ""
140 | });
141 | if ('0000' !== data.code) {
142 | return console.error(`抽奖失败`, data);
143 | }
144 | console.log(`抽奖成功,获得${data.data.desc}`);
145 | message += `抽奖成功,获得${data.data.desc}\n\n`;
146 | } catch (e) {
147 | console.error(`抽奖时发生异常:`, e.response.data);
148 | }
149 | }
150 |
151 | function prepareHeaders() {
152 | const headerCp = JSON.parse(JSON.stringify(headers));
153 | headerCp['X-Gaia-Api-Key'] = API_KEY;
154 | headerCp['X-LF-UserToken'] = headers.token;
155 | headerCp['X-LF-Bu-Code'] = BU_CODE;
156 | headerCp['X-LF-DXRisk-Source'] = DX_RISK_SOURCE;
157 | headerCp['X-LF-DXRisk-Captcha-Token'] = DX_RISK_CAPTCHA_TOKEN;
158 | headerCp['X-LF-Channel'] = CHANNEL;
159 | return headerCp;
160 | }
161 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_mallcoo.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 欣都龙城小程序
3 | *
4 | * 抓包 Host:https://m.mallcoo.cn 随便找一个 url,在 Body 中获取 Token 的值
5 | * export MALLCOO_TOKEN = '_Fl34xxxxxxxxxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/07/22
11 | *
12 | * const $ = new Env('欣都龙城')
13 | * cron: 48 10 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('欣都龙城');
17 | const mallcooList = process.env.MALLCOO_TOKEN ? process.env.MALLCOO_TOKEN.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://m.mallcoo.cn'
21 | // 请求头
22 | const headers = {
23 | 'User-Agent': sudojia.getRandomUserAgent(),
24 | 'Content-Type': 'application/json',
25 | 'Accept': '*/*',
26 | 'Referer': 'https://servicewechat.com/wx7ef63cf605a639fb/18/page-frame.html',
27 | 'Accept-Encoding': 'gzip, deflate, br',
28 | };
29 | // 请求体
30 | let getBody = {
31 | "MallId": 10144,
32 | "Header": {
33 | "systemInfo": {
34 | "model": "microsoft",
35 | "SDKVersion": "3.5.0",
36 | "system": "Windows 11 x64",
37 | "version": "3.9.10",
38 | "miniVersion": "2.67.7"
39 | }
40 | }
41 | }
42 |
43 | !(async () => {
44 | await checkUpdate($.name, mallcooList);
45 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
46 | for (let i = 0; i < mallcooList.length; i++) {
47 | const index = i + 1;
48 | $.isLogin = true;
49 | getBody.Header.Token = mallcooList[i];
50 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
51 | message += `📣====${$.name}账号[${index}]====📣\n`;
52 | await main();
53 | await $.wait(sudojia.getRandomWait(2000, 2500));
54 | }
55 | if (message) {
56 | await notify.sendNotify(`「${$.name}」`, `${message}`);
57 | }
58 | })().catch((e) => $.logErr(e)).finally(() => $.done());
59 |
60 | async function main() {
61 | await getUserInfo();
62 | if (!$.isLogin) {
63 | console.error('用户token错误或已过期');
64 | process.exit(0);
65 | }
66 | await $.wait(sudojia.getRandomWait(2000, 2500));
67 | await checkinBefore();
68 | await $.wait(sudojia.getRandomWait(2000, 2500));
69 | await getPoints();
70 | await $.wait(sudojia.getRandomWait(2000, 2500));
71 | await getCheckinDetail();
72 | await $.wait(sudojia.getRandomWait(2000, 2500));
73 | await getUserExpiredBonus();
74 | }
75 |
76 | /**
77 | * 获取用户信息
78 | *
79 | * @return {Promise}
80 | */
81 | async function getUserInfo() {
82 | try {
83 | const data = await sudojia.sendRequest(`${baseUrl}/api/user/user/GetUserAndMallCard`, 'post', headers, getBody);
84 | if (1 === data.m) {
85 | console.log(`昵称:${data.d.NickName}`);
86 | message += `昵称:${data.d.NickName}\n`;
87 | } else {
88 | if (320 === data.m) {
89 | $.isLogin = false;
90 | return;
91 | }
92 | console.log(data);
93 | }
94 | } catch (e) {
95 | console.error(`获取用户信息时发生异常:${e}`);
96 | }
97 | }
98 |
99 | /**
100 | * 检测签到状态
101 | *
102 | * @return {Promise}
103 | */
104 | async function checkinBefore() {
105 | try {
106 | let body = JSON.parse(JSON.stringify(getBody));
107 | body.IsCheckMemberCard = true;
108 | const data = await sudojia.sendRequest(`${baseUrl}/api/user/user/CheckinBefore`, 'post', headers, body);
109 | if (1 === data.m) {
110 | if (!data.d.IsCheckIn) {
111 | await $.wait(sudojia.getRandomWait(2000, 2500));
112 | await signIn();
113 | }
114 | } else {
115 | console.error(data.e);
116 | }
117 | } catch (e) {
118 | console.error(`检测签到状态时发生异常:${e}`);
119 | }
120 | }
121 |
122 | /**
123 | * 签到
124 | *
125 | * @return {Promise}
126 | */
127 | async function signIn() {
128 | try {
129 | let body = JSON.parse(JSON.stringify(getBody));
130 | delete body.MallId
131 | body.MallID = 10144;
132 | const data = await sudojia.sendRequest(`${baseUrl}/api/user/User/CheckinV2`, 'post', headers, body);
133 | if (1 === data.m) {
134 | console.log(`签到成功,积分+${data.d.Content}`);
135 | message += `签到成功,积分+${data.d.Content}\n`;
136 | } else {
137 | console.log(data.e);
138 | message += `${data.e}\n`;
139 | }
140 | } catch (e) {
141 |
142 | }
143 | }
144 |
145 | /**
146 | * 获取积分信息
147 | *
148 | * @return {Promise}
149 | */
150 | async function getPoints() {
151 | try {
152 | let body = JSON.parse(JSON.stringify(getBody));
153 | delete body.MallId
154 | body.MallID = 10144;
155 | body.PageIndex = 1;
156 | body.PageSize = 10;
157 | const data = await sudojia.sendRequest(`${baseUrl}/api/user/Bonus/GetBonusHistoryList`, 'post', headers, body);
158 | if (1 === data.m) {
159 | console.log(`当前积分:${data.d.TotalBonus}`);
160 | message += `当前积分:${data.d.TotalBonus}\n`;
161 | } else {
162 | console.log(data.e);
163 | }
164 | } catch (e) {
165 | console.error(`获取积分信息时发生异常:${e}`);
166 | }
167 | }
168 |
169 | /**
170 | * 获取签到天数
171 | *
172 | * @return {Promise}
173 | */
174 | async function getCheckinDetail() {
175 | try {
176 | let body = JSON.parse(JSON.stringify(getBody));
177 | delete body.MallId
178 | body.MallID = 10144;
179 | const data = await sudojia.sendRequest(`${baseUrl}/api/user/User/GetCheckinDetail`, 'post', headers, body);
180 | if (1 === data.m) {
181 | console.log(`已连续签到${data.d.ContinueDay}天`);
182 | message += `已连续签到${data.d.ContinueDay}天\n`;
183 | } else {
184 | console.log(data.e);
185 | }
186 | } catch (e) {
187 | console.error(`获取签到天数时发生异常:${e}`);
188 | }
189 | }
190 |
191 | /**
192 | * 获取过期积分
193 | *
194 | * @return {Promise}
195 | */
196 | async function getUserExpiredBonus() {
197 | try {
198 | let body = JSON.parse(JSON.stringify(getBody));
199 | delete body.MallId
200 | body.MallID = 10144;
201 | const data = await sudojia.sendRequest(`${baseUrl}/api/user/Bonus/GetUserExpiredBonus`, 'post', headers, body);
202 | if (1 === data.m) {
203 | console.log(`${data.d.ExpiredBounsTips}`);
204 | message += `${data.d.ExpiredBounsTips}\n\n`;
205 | } else {
206 | console.log(data.e);
207 | }
208 | } catch (e) {
209 | console.error(`获取过期积分时发生异常:${e}`);
210 | }
211 | }
212 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_mawuwang.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 微信小程序 - 馬伍旺饮料厂
3 | *
4 | * 抓包 URL:https://webapi.qmai.cn/web/seller/oauth/flash-sale-login 在响应体 Json 找到 token 和 user 下的 id, 用 # 分割
5 | * export MAWUW_TOKEN = 'token#id'
6 | * 多账号用 & 或换行
7 | *
8 | * 和霸王茶姬一样
9 | *
10 | * @author Telegram@sudojia
11 | * @site https://blog.imzjw.cn
12 | * @date 2024/09/01
13 | *
14 | * const $ = new Env('馬伍旺饮料厂')
15 | * cron: 48 6 * * *
16 | */
17 | const initScript = require('../utils/initScript')
18 | const {$, notify, sudojia, checkUpdate} = initScript('馬伍旺饮料厂');
19 | const mwwToken = process.env.MAWUW_TOKEN ? process.env.MAWUW_TOKEN.split(/[\n&]/) : [];
20 | let message = '';
21 | // 接口地址
22 | const baseUrl = 'https://webapi.qmai.cn'
23 | // AppId
24 | const appId = 'wxc1381dc6f2213b72';
25 | // 签到活动ID
26 | const activityId = '1103263769176125440';
27 | // 请求头
28 | const headers = {
29 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a1b)XWEB/11097',
30 | 'content-type': 'application/json',
31 | 'accept-encoding': 'gzip, deflate, br',
32 | 'qm-from': 'wechat',
33 | 'referer': `https://servicewechat.com/${appId}/26/page-frame.html`,
34 | }
35 |
36 | !(async () => {
37 | await checkUpdate($.name, mwwToken);
38 | for (let i = 0; i < mwwToken.length; i++) {
39 | const index = i + 1;
40 | const [token, uid] = mwwToken[i].split('#');
41 | headers['qm-user-token'] = token;
42 | $.userId = uid;
43 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
44 | const isLogin = await checkLogin();
45 | if (!isLogin) {
46 | console.error(`Token 已失效`);
47 | await notify.sendNotify(`「Token失效通知」`, `${$.name}账号[${index}] Token 已失效,请重新登录获取 Token\n\n`);
48 | continue;
49 | }
50 | message += `📣====${$.name}账号[${index}]====📣\n`;
51 | await $.wait(sudojia.getRandomWait(800, 1200));
52 | await main();
53 | await $.wait(sudojia.getRandomWait(2000, 2500));
54 | }
55 | if (message) {
56 | await notify.sendNotify(`「${$.name}」`, `${message}`);
57 | }
58 | })().catch((e) => $.logErr(e)).finally(() => $.done());
59 |
60 | async function main() {
61 | await getUserInfo();
62 | await $.wait(sudojia.getRandomWait(1000, 1500));
63 | await getSignInStatus();
64 | await $.wait(sudojia.getRandomWait(1000, 1500));
65 | await pointsInfo();
66 | }
67 |
68 | /**
69 | * 检测 Token
70 | *
71 | * @returns {Promise<*>}
72 | */
73 | async function checkLogin() {
74 | try {
75 | const data = await sudojia.sendRequest(`${baseUrl}/web/catering/crm/customer-center?appid=${appId}`, 'get', headers);
76 | return data.status;
77 | } catch (e) {
78 | console.error(`检测 Token 时发生异常:${e}`);
79 | }
80 | }
81 |
82 | /**
83 | * 获取用户信息
84 | *
85 | * @returns {Promise}
86 | */
87 | async function getUserInfo() {
88 | try {
89 | const data = await sudojia.sendRequest(`${baseUrl}/web/catering/crm/personal-info`, 'get', headers, {
90 | appid: appId
91 | });
92 | if (data.status) {
93 | message += `${data.data.mobilePhone}\n`;
94 | console.log(`${$.nickName}登录成功~`);
95 | } else {
96 | console.error(data.message);
97 | }
98 | } catch (e) {
99 | console.error(`获取用户信息时发生异常:`, e);
100 | }
101 | }
102 |
103 | /**
104 | * 查询签到状态
105 | *
106 | * @return {Promise}
107 | */
108 | async function getSignInStatus() {
109 | try {
110 | const data = await sudojia.sendRequest(`${baseUrl}/web/cmk-center/sign/userSignStatistics`, 'post', headers, {
111 | activityId: activityId,
112 | appid: appId,
113 | });
114 | if (data.status) {
115 | const {signDays, signStatus} = data.data;
116 | if (1 === signStatus) {
117 | console.log(`今天已经签到过了\n已连续签到${signDays}天`);
118 | message += `今天已经签到过了\n已连续签到${signDays}天\n`;
119 | } else {
120 | await $.wait(sudojia.getRandomWait(3e3, 5e3));
121 | await sign();
122 | }
123 | }
124 | } catch (e) {
125 | console.error('查询签到状态时发生异常:', e);
126 | }
127 | }
128 |
129 | /**
130 | * 签到
131 | *
132 | * @return {Promise}
133 | */
134 | async function sign() {
135 | try {
136 | const times = new Date().getTime();
137 | const data = await sudojia.sendRequest(`${baseUrl}/web/cmk-center/sign/takePartInSign`, 'post', headers, {
138 | activityId: activityId,
139 | storeId: 215357,
140 | timestamp: times,
141 | signature: getSign(times, 10086),
142 | appid: appId,
143 | });
144 | if (data.status) {
145 | message += `签到成功\n`;
146 | console.log(`签到成功`);
147 | } else {
148 | console.error('签到失败:', data.message);
149 | }
150 | } catch (e) {
151 | console.error('签到时发生异常:', e);
152 | }
153 | }
154 |
155 | /**
156 | * 积分查询
157 | *
158 | * @return {Promise}
159 | */
160 | async function pointsInfo() {
161 | try {
162 | const data = await sudojia.sendRequest(`${baseUrl}/web/catering/crm/points-info`, 'post', headers, {
163 | appid: appId
164 | });
165 | if (data.status) {
166 | const {soonExpiredPoints, totalPoints, expiredTime} = data.data;
167 | message += `当前积分:${totalPoints}\n`;
168 | console.log(`当前积分:${totalPoints}`);
169 | soonExpiredPoints > 0 ? message += `${soonExpiredPoints}积分将在${expiredTime}失效\n\n` : message += `暂无过期积分\n\n`;
170 | soonExpiredPoints > 0 ? console.log(`${soonExpiredPoints}积分将在${expiredTime}失效`) : console.log(`暂无过期积分`);
171 | }
172 | } catch (e) {
173 | console.error('获取积分时发生异常:', e);
174 | }
175 | }
176 |
177 | function getSign(timestamp, userId) {
178 | const sellerId = 215357;
179 | const params = {
180 | activityId: activityId,
181 | sellerId: sellerId.toString(),
182 | timestamp: timestamp,
183 | userId: userId
184 | };
185 | const sortedKeys = Object.keys(params).sort();
186 | const sortedParams = sortedKeys.reduce((acc, key) => {
187 | acc[key] = params[key];
188 | return acc;
189 | }, {});
190 | const encodedParams = Object.entries(sortedParams).map(([key, value]) => {
191 | return key + "=" + value;
192 | }).join("&") + "&key=" + activityId.split("").reverse().join("");
193 | return sudojia.md5(encodedParams).toUpperCase();
194 | }
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_midea.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 美的会员小程序
3 | *
4 | * 抓包 Host:https://mvip.midea.cn 获取请求头 Cookie 的值
5 | * export MIDEA_COOKIE = 'xxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/07/21
11 | *
12 | * const $ = new Env('美的会员')
13 | * cron: 33 11 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('美的会员');
17 | const mideaList = process.env.MIDEA_COOKIE ? process.env.MIDEA_COOKIE.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://mvip.midea.cn'
21 | // 请求头
22 | const headers = {
23 | 'Host': 'mvip.midea.cn',
24 | 'User-Agent': sudojia.getRandomUserAgent(),
25 | 'Content-Type': 'application/json',
26 | 'Accept': '*/*',
27 | 'Referer': 'https://servicewechat.com/wx03925a39ca94b161/437/page-frame.html',
28 | 'Accept-Encoding': 'gzip, deflate, br',
29 | };
30 |
31 | !(async () => {
32 | await checkUpdate($.name, mideaList);
33 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
34 | for (let i = 0; i < mideaList.length; i++) {
35 | const index = i + 1;
36 | headers.Cookie = mideaList[i];
37 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
38 | message += `📣====${$.name}账号[${index}]====📣\n`;
39 | await main();
40 | await $.wait(sudojia.getRandomWait(2000, 2500));
41 | }
42 | if (message) {
43 | await notify.sendNotify(`「${$.name}」`, `${message}`);
44 | }
45 | })().catch((e) => $.logErr(e)).finally(() => $.done());
46 |
47 | async function main() {
48 | await getUserInfo();
49 | await $.wait(sudojia.getRandomWait(1300, 2000));
50 | await sign();
51 | await $.wait(sudojia.getRandomWait(1300, 2000));
52 | await getPoints();
53 | }
54 |
55 | /**
56 | * 获取用户信息
57 | *
58 | * @return {Promise}
59 | */
60 | async function getUserInfo() {
61 | try {
62 | const data = await sudojia.sendRequest(`${baseUrl}/next/mucuserinfo/getmucuserinfo`, 'get', headers);
63 | if (0 === data.errcode) {
64 | const mobile = data.data.userinfo.Mobile;
65 | // 当前等级
66 | const levelName = data.data.userinfo.LevelName;
67 | const hiddenMobile = `${mobile.slice(0, 3)}***${mobile.slice(-3)}`;
68 | console.log(`${levelName}(${hiddenMobile})登录成功~`);
69 | message += `${levelName}(${mobile})\n`;
70 | } else {
71 | console.log(JSON.stringify(data));
72 | }
73 | } catch (e) {
74 | console.error(`获取用户信息时发生异常:${e}`);
75 | }
76 | }
77 |
78 | /**
79 | * 签到
80 | *
81 | * @return {Promise}
82 | */
83 | async function sign() {
84 | try {
85 | const data = await sudojia.sendRequest(`${baseUrl}/my/score/create_daily_score`, 'get', headers);
86 | if (0 === data.errcode) {
87 | console.log('签到成功!');
88 | message += `签到成功!\n`;
89 | } else {
90 | console.log(JSON.stringify(data));
91 | message += `今日已签到!\n`;
92 | }
93 | } catch (e) {
94 | console.error(`签到时发生异常:${e}`);
95 | }
96 | }
97 |
98 | /**
99 | * 获取积分
100 | *
101 | * @return {Promise}
102 | */
103 | async function getPoints() {
104 | try {
105 | const data = await sudojia.sendRequest(`${baseUrl}/my/muc/get_growth_status`, 'get', headers);
106 | if (0 === data.errcode) {
107 | console.log(`当前积分:${data.data.vipPoint}\n成长值:${data.data.vipGrow}`);
108 | message += `当前积分:${data.data.vipPoint}\n成长值:${data.data.vipGrow}\n\n`;
109 | } else {
110 | console.log(JSON.stringify(data));
111 | }
112 | } catch (e) {
113 | console.error(`获取积分时发生异常:${e}`);
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_mxbc.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 蜜雪冰城小程序
3 | *
4 | * 抓包 Host:https://mxsa.mxbc.net 获取请求头 Access-Token
5 | * export MXBC_TOKEN = 'eyJ0xxxxxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/07/27
11 | *
12 | * const $ = new Env('蜜雪冰城')
13 | * cron: 28 10 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('蜜雪冰城');
17 | const crypto = require('crypto');
18 | const mxbcList = process.env.MXBC_TOKEN ? process.env.MXBC_TOKEN.split(/[\n&]/) : [];
19 | let message = '';
20 | // 接口地址
21 | const baseUrl = 'https://mxsa.mxbc.net'
22 | // appId
23 | const appId = 'd82be6bbc1da11eb9dd000163e122ecb';
24 | // 请求头
25 | const headers = {
26 | 'Host': 'mxsa.mxbc.net',
27 | 'app': 'mxbc',
28 | 'appchannel': 'xiaomi',
29 | 'User-Agent': sudojia.getRandomUserAgent(),
30 | 'Content-Type': 'application/json',
31 | 'Accept': '*/*',
32 | 'Referer': `https://servicewechat.com/wx7696c66d2245d107/123/page-frame.html`,
33 | 'Accept-Encoding': 'gzip, deflate, br',
34 | };
35 |
36 | !(async () => {
37 | await checkUpdate($.name, mxbcList);
38 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
39 | for (let i = 0; i < mxbcList.length; i++) {
40 | const index = i + 1;
41 | headers['Access-Token'] = mxbcList[i];
42 | $.isLogin = true;
43 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
44 | message += `📣====${$.name}账号[${index}]====📣\n`;
45 | await main();
46 | await $.wait(sudojia.getRandomWait(2000, 2500));
47 | }
48 | if (message) {
49 | await notify.sendNotify(`「${$.name}」`, `${message}`);
50 | }
51 | })().catch((e) => $.logErr(e)).finally(() => $.done());
52 |
53 | async function main() {
54 | await getUserInfo();
55 | if (!$.isLogin) {
56 | console.error('Token 失效');
57 | return;
58 | }
59 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
60 | await signIn();
61 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
62 | await getPoints();
63 | }
64 |
65 | /**
66 | * 获取用户信息
67 | *
68 | * @return {Promise}
69 | */
70 | async function getUserInfo() {
71 | try {
72 | const data = await sudojia.sendRequest(`${baseUrl}/api/v1/customer/info?appId=${appId}&t=${ts13()}&sign=${getSHA256withRSA(`appId=${appId}&t=${ts13()}`)}`, 'get', headers);
73 | if (0 !== data.code) {
74 | console.error(data.msg);
75 | $.isLogin = false;
76 | return;
77 | }
78 | console.log(`${data.data.mobilePhone}登陆成功~`);
79 | message += `用户:${data.data.mobilePhone}\n`;
80 | } catch (e) {
81 | console.error(`获取用户信息时发生异常:${e}`);
82 | $.isLogin = false;
83 | }
84 | }
85 |
86 | /**
87 | * 签到
88 | *
89 | * @return {Promise}
90 | */
91 | async function signIn() {
92 | try {
93 | const data = await sudojia.sendRequest(`${baseUrl}/api/v1/customer/signin?appId=${appId}&t=${ts13()}&sign=${getSHA256withRSA(`appId=${appId}&t=${ts13()}`)}`, 'get', headers);
94 | if (0 !== data.code) {
95 | console.error(`签到失败:${data.msg}`);
96 | return;
97 | }
98 | console.log(`签到成功,雪王币+${data.data.ruleValuePoint}`);
99 | console.log(`已连续签到${data.data.ruleValueGrowth}天`);
100 | message += `签到成功,已连续签到${data.data.ruleValueGrowth}天\n`;
101 | } catch (e) {
102 | console.error(`签到时发生异常:${e}`);
103 | }
104 | }
105 |
106 | /**
107 | * 获取雪王币
108 | *
109 | * @return {Promise}
110 | */
111 | async function getPoints() {
112 | try {
113 | const data = await sudojia.sendRequest(`${baseUrl}/api/v1/customer/info?appId=${appId}&t=${ts13()}&sign=${getSHA256withRSA(`appId=${appId}&t=${ts13()}`)}`, 'get', headers);
114 | if (0 !== data.code) {
115 | console.error(data.msg);
116 | return;
117 | }
118 | console.log(`当前雪王币:${data.data.customerPoint}`);
119 | message += `当前雪王币:${data.data.customerPoint}\n\n`;
120 | } catch (e) {
121 | console.error(`获取雪王币时发生异常:${e}`);
122 | }
123 | }
124 |
125 | function getSHA256withRSA(content) {
126 | const signer = crypto.createSign('RSA-SHA256').update(content);
127 | const signature = signer.sign(privateKeyStr, 'base64');
128 | return signature.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
129 | }
130 |
131 | function ts13() {
132 | return Math.round(new Date().getTime()).toString();
133 | }
134 |
135 | const privateKeyStr = `
136 | -----BEGIN PRIVATE KEY-----
137 | MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCtypUdHZJKlQ9L
138 | L6lIJSphnhqjke7HclgWuWDRWvzov30du235cCm13mqJ3zziqLCwstdQkuXo9sOP
139 | Ih94t6nzBHTuqYA1whrUnQrKfv9X4/h3QVkzwT+xWflE+KubJZoe+daLKkDeZjVW
140 | nUku8ov0E5vwADACfntEhAwiSZUALX9UgNDTPbj5ESeII+VztZ/KOFsRHMTfDb1G
141 | IR/dAc1mL5uYbh0h2Fa/fxRPgf7eJOeWGiygesl3CWj0Ue13qwX9PcG7klJXfToI
142 | 576MY+A7027a0aZ49QhKnysMGhTdtFCksYG0lwPz3bIR16NvlxNLKanc2h+ILTFQ
143 | bMW/Y3DRAgMBAAECggEBAJGTfX6rE6zX2bzASsu9HhgxKN1VU6/L70/xrtEPp4SL
144 | SpHKO9/S/Y1zpsigr86pQYBx/nxm4KFZewx9p+El7/06AX0djOD7HCB2/+AJq3iC
145 | 5NF4cvEwclrsJCqLJqxKPiSuYPGnzji9YvaPwArMb0Ff36KVdaHRMw58kfFys5Y2
146 | HvDqh4x+sgMUS7kSEQT4YDzCDPlAoEFgF9rlXnh0UVS6pZtvq3cR7pR4A9hvDgX9
147 | wU6zn1dGdy4MEXIpckuZkhwbqDLmfoHHeJc5RIjRP7WIRh2CodjetgPFE+SV7Sdj
148 | ECmvYJbet4YLg+Qil0OKR9s9S1BbObgcbC9WxUcrTgECgYEA/Yj8BDfxcsPK5ebE
149 | 9N2teBFUJuDcHEuM1xp4/tFisoFH90JZJMkVbO19rddAMmdYLTGivWTyPVsM1+9s
150 | tq/NwsFJWHRUiMK7dttGiXuZry+xvq/SAZoitgI8tXdDXMw7368vatr0g6m7ucBK
151 | jZWxSHjK9/KVquVr7BoXFm+YxaECgYEAr3sgVNbr5ovx17YriTqe1FLTLMD5gPrz
152 | ugJj7nypDYY59hLlkrA/TtWbfzE+vfrN3oRIz5OMi9iFk3KXFVJMjGg+M5eO9Y8m
153 | 14e791/q1jUuuUH4mc6HttNRNh7TdLg/OGKivE+56LEyFPir45zw/dqwQM3jiwIz
154 | yPz/+bzmfTECgYATxrOhwJtc0FjrReznDMOTMgbWYYPJ0TrTLIVzmvGP6vWqG8rI
155 | S8cYEA5VmQyw4c7G97AyBcW/c3K1BT/9oAj0wA7wj2JoqIfm5YPDBZkfSSEcNqqy
156 | 5Ur/13zUytC+VE/3SrrwItQf0QWLn6wxDxQdCw8J+CokgnDAoehbH6lTAQKBgQCE
157 | 67T/zpR9279i8CBmIDszBVHkcoALzQtU+H6NpWvATM4WsRWoWUx7AJ56Z+joqtPK
158 | G1WztkYdn/L+TyxWADLvn/6Nwd2N79MyKyScKtGNVFeCCJCwoJp4R/UaE5uErBNn
159 | OH+gOJvPwHj5HavGC5kYENC1Jb+YCiEDu3CB0S6d4QKBgQDGYGEFMZYWqO6+LrfQ
160 | ZNDBLCI2G4+UFP+8ZEuBKy5NkDVqXQhHRbqr9S/OkFu+kEjHLuYSpQsclh6XSDks
161 | 5x/hQJNQszLPJoxvGECvz5TN2lJhuyCupS50aGKGqTxKYtiPHpWa8jZyjmanMKnE
162 | dOGyw/X4SFyodv8AEloqd81yGg==
163 | -----END PRIVATE KEY-----
164 | `;
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_nestle.js:
--------------------------------------------------------------------------------
1 | /**
2 | * #小程序://雀巢会员/4EpKApLxlhQhsiu
3 | *
4 | * 抓包 Host:https://crm.nestlechinese.com 获取请求头 authorization 并且删掉 Bearer
5 | * export NESTLE_TOKEN = 'eyJhbxxxxXXXXxxxxxXXX'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/11/27
11 | *
12 | * const $ = new Env('雀巢会员')
13 | * cron: 28 8 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('雀巢会员');
17 | const nestleList = process.env.NESTLE_TOKEN ? process.env.NESTLE_TOKEN.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://crm.nestlechinese.com'
21 | // 请求头
22 | const headers = {
23 | 'User-Agent': sudojia.getRandomUserAgent(),
24 | 'content-type': 'application/json',
25 | 'referer': 'https://servicewechat.com/wxc5db704249c9bb31/353/page-frame.html',
26 | };
27 |
28 | !(async () => {
29 | await checkUpdate($.name, nestleList);
30 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
31 | for (let i = 0; i < nestleList.length; i++) {
32 | const index = i + 1;
33 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
34 | headers.authorization = `Bearer ${nestleList[i]}`;
35 | message += `📣====${$.name}账号[${index}]====📣\n`;
36 | await main();
37 | await $.wait(sudojia.getRandomWait(2000, 2500));
38 | }
39 | if (message) {
40 | await notify.sendNotify(`「${$.name}」`, `${message}`);
41 | }
42 | })().catch((e) => $.logErr(e)).finally(() => $.done());
43 |
44 | async function main() {
45 | await getUserInfo();
46 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
47 | await getTaskList();
48 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
49 | await getUserBalance();
50 | }
51 |
52 | /**
53 | * 获取用户信息
54 | *
55 | * @return {Promise}
56 | */
57 | async function getUserInfo() {
58 | try {
59 | const data = await sudojia.sendRequest(`${baseUrl}/openapi/member/api/User/GetUserInfo`, 'get', headers);
60 | if (200 !== data.errcode) {
61 | return console.error(`获取用户信息失败:${data.errmsg}`);
62 | }
63 | const {nickname, mobile} = data.data;
64 | console.log(`用户:${nickname}(${mobile})`);
65 | message += `用户:${nickname}(${mobile})\n`;
66 | } catch (e) {
67 | console.error(`获取用户信息时发生异常 -> ${e}`);
68 | }
69 | }
70 |
71 | async function getTaskList() {
72 | try {
73 | const data = await sudojia.sendRequest(`${baseUrl}/openapi/activityservice/api/task/getlist`, 'post', headers);
74 | if (200 !== data.errcode) {
75 | return console.error(`获取任务列表失败:${data.errmsg}`);
76 | }
77 | for (const task of data.data) {
78 | console.log(`开始【${task.task_title}】任务`)
79 | await doTask(task.task_guid);
80 | await $.wait(sudojia.getRandomWait(2000, 2500));
81 | }
82 | } catch (e) {
83 | console.error(`获取任务列表时发生异常 -> ${e}`);
84 | }
85 | }
86 |
87 | async function doTask(task_guid) {
88 | try {
89 | const data = await sudojia.sendRequest(`${baseUrl}/openapi/activityservice/api/task/add`, 'post', headers, {
90 | "task_guid": task_guid
91 | });
92 | if (200 !== data.errcode) {
93 | return console.error(`任务失败 -> ${data.errmsg}\n`);
94 | }
95 | console.log(`完成任务 -> ${data.errmsg}\n`);
96 | } catch (e) {
97 | console.error(`完成任务时发生异常 -> ${e}`);
98 | }
99 | }
100 |
101 | async function getUserBalance() {
102 | try {
103 | const data = await sudojia.sendRequest(`${baseUrl}/openapi/pointsservice/api/Points/getuserbalance`, 'post', headers);
104 | if (200 !== data.errcode) {
105 | return console.error(`获取用户积分余额失败:${data.errmsg}`);
106 | }
107 | console.log(`当前巢币:${data.data}`);
108 | message += `当前巢币:${data.data}\n\n`;
109 | } catch (e) {
110 | console.error(`获取用户巢币时发生异常 -> ${e}`);
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_nfhk.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 南方航空小程序
3 | *
4 | * 抓包 URL:https://wxapi.csair.com/marketing-tools/ 这个路径下的 cookie 只要 sign_user_token = xxxxxx
5 | * 不要带 sign_user_token=
6 | * 需实名认证
7 | * export NFHK_COOKIE = 'b59234ecxxxxxxxxxxxxxxxxxx'
8 | * 多账号用 & 或换行
9 | *
10 | * @author Telegram@sudojia
11 | * @site https://blog.imzjw.cn
12 | * @date 2024/08/10
13 | * @lastModifyTime: 2024/08/12
14 | *
15 | * const $ = new Env('南方航空')
16 | * cron: 49 11 * * *
17 | */
18 | const initScript = require('../utils/initScript')
19 | const {$, notify, sudojia, checkUpdate} = initScript('南方航空');
20 | const moment = require("moment");
21 | const nfhkList = process.env.NFHK_COOKIE ? process.env.NFHK_COOKIE.split(/[\n&]/) : [];
22 | let message = '';
23 | // 接口地址
24 | const baseUrl = 'https://wxapi.csair.com'
25 | // 请求头
26 | let headers = {
27 | 'User-Agent': 'okhttp/3.12.1;jdmall;android;version/10.3.4;build/92451;',
28 | 'Content-Type': 'application/json',
29 | };
30 |
31 | !(async () => {
32 | await checkUpdate($.name, nfhkList);
33 | for (let i = 0; i < nfhkList.length; i++) {
34 | const index = i + 1;
35 | headers.cookie = [
36 | `sign_user_token=${nfhkList[i]}`,
37 | `TOKEN=${nfhkList[i]}`,
38 | `cs1246643sso=${nfhkList[i]}`,
39 | ].join('; ');
40 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
41 | message += `📣====${$.name}账号[${index}]====📣\n`;
42 | await main();
43 | await $.wait(sudojia.getRandomWait(2000, 2500));
44 | }
45 | if (message) {
46 | await notify.sendNotify(`「${$.name}」`, `${message}`);
47 | }
48 | })().catch((e) => $.logErr(e)).finally(() => $.done());
49 |
50 | async function main() {
51 | await sign();
52 | await $.wait(sudojia.getRandomWait(1200, 2000));
53 | await getSignDays();
54 | await $.wait(sudojia.getRandomWait(1000, 2000));
55 | await getMinPriceMileage();
56 | }
57 |
58 | /**
59 | * 签到
60 | *
61 | * @return {Promise}
62 | */
63 | async function sign() {
64 | try {
65 | const data = await sudojia.sendRequest(`${baseUrl}/marketing-tools/activity/join?type=APPTYPE&chanel=ss&lang=zh`, 'post', headers, {
66 | "activityType": "sign",
67 | "channel": "app",
68 | "entrance": 1,
69 | });
70 | await $.wait(sudojia.getRandomWait(1500, 2300));
71 | if ('000' !== data.respCode) {
72 | if ('S2001' === data.respCode) {
73 | console.log(data.respMsg);
74 | message += '今日已签到\n';
75 | return;
76 | }
77 | console.error(data.respMsg);
78 | return;
79 | }
80 | console.log(data);
81 | message += `签到成功!\n`;
82 | } catch (e) {
83 | console.error('签到时发生异常:', e.response.data);
84 | }
85 | }
86 |
87 | /**
88 | * 获取签到天数
89 | *
90 | * @return {Promise}
91 | */
92 | async function getSignDays() {
93 | try {
94 | const firstDay = moment().startOf('month').format('YYYY-MM-DD');
95 | const lastDay = moment().endOf('month').format('YYYY-MM-DD');
96 | const data = await sudojia.sendRequest(`${baseUrl}/marketing-tools/sign/getSignCalendar?type=APPTYPE&chanel=ss&lang=zh&startQueryDate=${firstDay}&endQueryDate=${lastDay}`, 'get', headers);
97 | if ('0000' !== data.respCode) {
98 | console.error(data.respMsg);
99 | }
100 | console.log(data.data.signProgressMsg.join(''));
101 | message += `${data.data.signProgressMsg.join('')}\n`;
102 | } catch (e) {
103 | console.error(`获取签到天数时发生异常:`, e.response.data);
104 | }
105 | }
106 |
107 | /**
108 | * 获取里程
109 | *
110 | * @return {Promise}
111 | */
112 | async function getMinPriceMileage() {
113 | try {
114 | const data = await sudojia.sendRequest(`${baseUrl}/marketing-tools/sign/minPriceMileage`, 'post', headers, 'type=APPTYPE&chanel=ss&lang=zh');
115 | if ('0000' !== data.respCode) {
116 | console.error(data.respMsg);
117 | }
118 | console.log(`当前里程:${data.data.availableMileage}`);
119 | message += `当前里程:${data.data.availableMileage}\n\n`;
120 | } catch (e) {
121 | console.error(`获取里程时发生异常:`, e.response.data);
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_pangGe.js:
--------------------------------------------------------------------------------
1 | /**
2 | * #小程序://胖哥俩肉蟹煲/R6ANaXRZmnBeLSB
3 | *
4 | * 抓包 Host:https://saash5.namek.com.cn 获取请求头 token
5 | * export PANG_GE_TOKEN = '1158xxxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/09/03
11 | *
12 | * const $ = new Env('胖哥俩肉蟹煲')
13 | * cron: 19 6 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('胖哥俩肉蟹煲');
17 | const pangGeList = process.env.PANG_GE_TOKEN ? process.env.PANG_GE_TOKEN.split(/[\n&]/) : [];
18 | // 消息推送
19 | let message = '';
20 | // 接口地址
21 | const baseUrl = 'https://saash5.namek.com.cn'
22 | // 请求头
23 | const headers = {
24 | 'deviceWidth': '414',
25 | 'clientVersionType': '1',
26 | 'serviceId': 'namek-saas-web-page',
27 | 'accessPageType': '2',
28 | 'pageCatetory': '2',
29 | 'guidePageType': '13',
30 | 'deviceHeight': '780',
31 | 'clientVersion': '3.13.8',
32 | 'tenantId': 24,
33 | 'User-Agent': sudojia.getRandomUserAgent(),
34 | 'Content-Type': 'application/json;charset=UTF-8',
35 | 'Accept-Encoding': 'gzip, deflate, br',
36 | 'Referer': 'https://servicewechat.com/wxe61905cae01a6c7d/81/page-frame.html',
37 | 'Accept-Language': 'zh-CN,zh;q=0.9'
38 | };
39 |
40 | !(async () => {
41 | await checkUpdate($.name, pangGeList);
42 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
43 | for (let i = 0; i < pangGeList.length; i++) {
44 | const index = i + 1;
45 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
46 | headers.token = pangGeList[i]
47 | const member = await checkLogin();
48 | if (!member) {
49 | console.error(`Token 已失效`);
50 | await notify.sendNotify(`「Token失效通知」`, `${$.name}账号[${index}] Token 已失效,请重新登录获取 Token\n\n`);
51 | continue;
52 | }
53 | message += `📣====${$.name}账号[${index}]====📣\n`;
54 | await $.wait(sudojia.getRandomWait(800, 1200));
55 | await main();
56 | await $.wait(sudojia.getRandomWait(2000, 2500));
57 | }
58 | if (message) {
59 | await notify.sendNotify(`「${$.name}」`, `${message}`);
60 | }
61 | })().catch((e) => $.logErr(e)).finally(() => $.done());
62 |
63 | async function main() {
64 | await getUserInfo();
65 | await $.wait(sudojia.getRandomWait(2000, 2500));
66 | await checkInStatus();
67 | await $.wait(sudojia.getRandomWait(2000, 2500));
68 | await getUserPoints();
69 | }
70 |
71 | /**
72 | * 检测登录状态
73 | *
74 | * @returns {Promise<*>}
75 | */
76 | async function checkLogin() {
77 | try {
78 | const data = await sudojia.sendRequest(`${baseUrl}//api/v1/member/info/byToken?tenantId=24&agreementVer=`, 'get', getSignHeader());
79 | if (0 !== data.header.code) {
80 | console.error(data.header.message);
81 | return;
82 | }
83 | return data.body.member;
84 | } catch (e) {
85 | console.error(`检测登录状态接口请求失败,请检查网络问题:`, e);
86 | }
87 | }
88 |
89 | /**
90 | * 获取用户信息
91 | *
92 | * @return {Promise<*>}
93 | */
94 | async function getUserInfo() {
95 | try {
96 | const data = await sudojia.sendRequest(`${baseUrl}//api/v1/member/index/personal?needPoints=1&needBalance=0&needCouponCount=1&needActivityCount=1&needFrozenState=0`, 'get', getSignHeader());
97 | if (0 !== data.header.code) {
98 | return console.error('获取用户信息失败 ->', data.header.message);
99 | }
100 | $.userId = data.body.member.id;
101 | const {nickname, phone} = data.body.member;
102 | const hiddenMobile = `${phone.slice(0, 3)}***${phone.slice(-3)}` || '18888888888';
103 | console.log(`${nickname}(${hiddenMobile})`);
104 | message += `${nickname}(${phone})\n`;
105 | } catch (e) {
106 | console.error(`获取用户信息接口请求失败,请检查网络问题:`, e);
107 | }
108 | }
109 |
110 | /**
111 | * 检测签到状态
112 | *
113 | * @returns {Promise}
114 | */
115 | async function checkInStatus() {
116 | try {
117 | const data = await sudojia.sendRequest(`${baseUrl}//api/v1/ope/checkin/100135/member?totalSignDayList=`, 'get', getSignHeader());
118 | if (0 !== data.header.code) {
119 | return console.error('获取签到状态失败 ->', data.header.message);
120 | }
121 | console.log(`已连续签到[${data.body.signContinuedCount}]天, 累计签到[${data.body.signTotalCount}]天`);
122 | message += `已连续签到[${data.body.signContinuedCount}]天, 累计签到[${data.body.signTotalCount}]天\n`;
123 | if (data.body.isSignToday) {
124 | console.log(`今日已签到!`);
125 | message += `今日已签到!\n`;
126 | return;
127 | }
128 | console.log('开始签到...');
129 | await $.wait(sudojia.getRandomWait(1200, 2000));
130 | await sign();
131 | } catch (e) {
132 | console.error(`获取签到状态接口请求失败,请检查网络问题:`, e);
133 | }
134 | }
135 |
136 | /**
137 | * 签到
138 | *
139 | * @returns {Promise}
140 | */
141 | async function sign() {
142 | try {
143 | const data = await sudojia.sendRequest(`${baseUrl}//api/v1/ope/checkin/member/sign`, 'post', getSignHeader());
144 | if (0 !== data.header.code) {
145 | return console.error('签到失败 ->', data.header.message);
146 | }
147 | console.log(`签到成功,积分+${data.body.getPoint}`);
148 | message += `签到成功\n`;
149 | } catch (e) {
150 | console.error(`签到接口请求失败,请检查网络问题:`, e);
151 | }
152 | }
153 |
154 | /**
155 | * 获取用户积分
156 | *
157 | * @returns {Promise}
158 | */
159 | async function getUserPoints() {
160 | try {
161 | const data = await sudojia.sendRequest(`${baseUrl}//api/v1/member/115824951/points/changed/list?startIndex=0&pageCount=20&shopId=24&memberId=${$.userId}`, 'get', getSignHeader());
162 | if (0 !== data.header.code) {
163 | return console.error('获取积分失败 ->', data.header.message);
164 | }
165 | console.log(`当前积分:${data.body.points}`);
166 | message += `当前积分:${data.body.points}\n\n`;
167 | } catch (e) {
168 | console.error(`获取积分接口请求失败,请检查网络问题:`, e);
169 | }
170 | }
171 |
172 | /**
173 | * 生成随机字符串
174 | *
175 | * @returns {string}
176 | */
177 | function genNonce() {
178 | const digits = `174088${Math.floor(100000 + Math.random() * 900000)}`;
179 | const letters = Array.from({length: 16}, () =>
180 | String.fromCharCode(Math.random() < 0.5 ?
181 | Math.floor(Math.random() * 26) + 65 :
182 | Math.floor(Math.random() * 26) + 97
183 | )
184 | ).join('');
185 | return digits + letters;
186 | }
187 |
188 | /**
189 | * 获取签名请求头
190 | *
191 | * @returns {{deviceWidth: string, clientVersionType: string, "User-Agent": string, Referer: string, sign: string, "Accept-Encoding": string, clientVersion: string, nonce: string, pageCatetory: string, deviceHeight: string, tenantId: number, "Accept-Language": string, serviceId: string, accessPageType: string, guidePageType: string, "Content-Type": string, timestamp: number}}
192 | */
193 | function getSignHeader() {
194 | const timestamp = Date.now();
195 | const nonceStr = genNonce();
196 | return {
197 | ...headers,
198 | 'timestamp': timestamp,
199 | 'nonce': nonceStr,
200 | 'sign': sudojia.md5(`nonce=${nonceStr}&tenantId=24×tamp=${timestamp}&token=${headers.token}udHw9173SheXhd`),
201 | };
202 | }
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_paotea.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 爷爷不泡茶
3 | * #小程序://爷爷不泡茶/gv0jvm4SRgYkqMJ
4 | *
5 | * 抓包 Host:https://webapi.qmai.cn 获取请求头 qm-user-token
6 | * export PAO_TEA_TOKEN = 'token#activityId&token2&token3'
7 | * 多账号用 & 或换行
8 | *
9 | * @author Telegram@sudojia
10 | * @site https://blog.imzjw.cn
11 | * @date 2024/10/03
12 | *
13 | * const $ = new Env('爷爷不泡茶')
14 | * cron: 30 9 * * *
15 | */
16 | const initScript = require('../utils/initScript')
17 | const {$, notify, sudojia, checkUpdate} = initScript('爷爷不泡茶');
18 | const paoTeaList = process.env.PAO_TEA_TOKEN ? process.env.PAO_TEA_TOKEN.split(/[\n&]/) : [];
19 | let message = '';
20 | // 接口地址
21 | const baseUrl = 'https://webapi.qmai.cn'
22 | // AppId
23 | const appId = 'wx3423ef0c7b7f19af';
24 | // 请求头
25 | const headers = {
26 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a1b)XWEB/11097',
27 | 'Content-Type': 'application/json',
28 | 'store-id': '216652',
29 | 'qm-from': 'wechat',
30 | 'scene': '1145',
31 | 'referer': `https://servicewechat.com/${appId}/49/page-frame.html`
32 | }
33 | !(async () => {
34 | await checkUpdate($.name, paoTeaList);
35 | for (let i = 0; i < paoTeaList.length; i++) {
36 | let activityId;
37 | const [token, firstActivityId] = paoTeaList[i].split('#');
38 | activityId = firstActivityId || (paoTeaList[0].split('#')[1] || '1078694295517364225');
39 | const index = i + 1;
40 | headers['qm-user-token'] = token;
41 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
42 | const isLogin = await checkLogin();
43 | if (!isLogin) {
44 | console.error(`Token 已失效`);
45 | await notify.sendNotify(`「Token失效通知」`, `${$.name}账号[${index}] Token 已失效,请重新登录获取 Token\n\n`);
46 | continue;
47 | }
48 | message += `📣====${$.name}账号[${index}]====📣\n`;
49 | await $.wait(sudojia.getRandomWait(800, 1200));
50 | await main(activityId);
51 | await $.wait(sudojia.getRandomWait(2000, 2500));
52 | }
53 | if (message) {
54 | await notify.sendNotify(`「${$.name}」`, `${message}`);
55 | }
56 | })().catch((e) => $.logErr(e)).finally(() => $.done());
57 |
58 | async function main(activityId) {
59 | await queryNewSign(activityId);
60 | await $.wait(sudojia.getRandomWait(1000, 1500));
61 | await querySignDays(activityId);
62 | await $.wait(sudojia.getRandomWait(1000, 1500));
63 | await pointsInfo();
64 | }
65 |
66 | /**
67 | * 检测 Token
68 | *
69 | * @returns {Promise<*>}
70 | */
71 | async function checkLogin() {
72 | try {
73 | const data = await sudojia.sendRequest(`${baseUrl}/web/catering2-apiserver/crm/customer-center?appid=${appId}`, 'get', headers);
74 | return data.status;
75 | } catch (e) {
76 | console.error(`检测 Token 时发生异常:${e}`);
77 | }
78 | }
79 |
80 |
81 | /**
82 | * 查询新版签到
83 | *
84 | * @return {Promise}
85 | */
86 | async function queryNewSign(activityId) {
87 | try {
88 | const data = await sudojia.sendRequest(`${baseUrl}/web/cmk-center/sign/userSignStatistics`, 'post', headers, {
89 | "activityId": activityId,
90 | "appid": appId
91 | });
92 | if (data.status) {
93 | const {signStatus} = data.data;
94 | if (1 === signStatus) {
95 | console.log(`今天已经签到过了`);
96 | message += `今天已经签到过了\n`;
97 | return;
98 | }
99 | await $.wait(sudojia.getRandomWait(3e3, 5e3));
100 | await newSign(activityId);
101 | }
102 | } catch (e) {
103 | console.error('查询签到接口请求失败:', e);
104 | }
105 | }
106 |
107 | /**
108 | * 签到
109 | *
110 | * @return {Promise}
111 | */
112 | async function newSign(activityId) {
113 | try {
114 | const times = new Date().getTime();
115 | const data = await sudojia.sendRequest(`${baseUrl}/web/cmk-center/sign/takePartInSign`, 'post', headers, {
116 | "activityId": activityId,
117 | "storeId": 216652,
118 | "timestamp": times,
119 | "appid": appId
120 | });
121 | if (data.status) {
122 | message += `签到成功\n`;
123 | console.log(`签到成功`);
124 | } else {
125 | console.error('签到失败:', data.message);
126 | }
127 | } catch (e) {
128 | console.error('签到接口请求失败:', e);
129 | }
130 | }
131 |
132 | async function querySignDays(activityId) {
133 | try {
134 | const data = await sudojia.sendRequest(`${baseUrl}/web/cmk-center/sign/userSignStatistics`, 'post', headers, {
135 | "activityId": activityId,
136 | "appid": appId
137 | });
138 | if (!data.status) {
139 | return console.error(`获取签到天数失败:${data}`);
140 | }
141 | let {signDays, rewardList} = data.data;
142 | console.log(`已连续签到[${signDays}]天`);
143 | let found = false;
144 | for (const reward of rewardList) {
145 | if (reward.signNum > signDays) {
146 | const daysToNextStage = reward.signNum - signDays;
147 | const rewardName = reward.rewardList[0].rewardName;
148 | console.log(`下一阶段奖励[${rewardName}]还需签到[${daysToNextStage}]天`);
149 | message += `下一阶段奖励[${rewardName}]还需签到[${daysToNextStage}]天\n`;
150 | found = true;
151 | break;
152 | }
153 | }
154 | if (!found) {
155 | console.log("已达到所有签到奖励阶段!");
156 | }
157 | } catch (e) {
158 | console.error('查询新版接口请求失败:', e);
159 | }
160 | }
161 |
162 | /**
163 | * 积分查询
164 | *
165 | * @return {Promise}
166 | */
167 | async function pointsInfo() {
168 | try {
169 | const data = await sudojia.sendRequest(`${baseUrl}/web/catering/crm/points-info`, 'post', headers, {
170 | appid: appId
171 | });
172 | if (data.status) {
173 | const {soonExpiredPoints, totalPoints, expiredTime} = data.data;
174 | message += `当前积分:${totalPoints}\n`;
175 | console.log(`当前积分:${totalPoints}`);
176 | soonExpiredPoints > 0 ? message += `${soonExpiredPoints}积分将在${expiredTime}失效\n\n`
177 | : message += `暂无过期积分\n\n`;
178 | }
179 | } catch (e) {
180 | console.error('积分查询接口请求失败:', e);
181 | }
182 | }
183 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_tastientech.js:
--------------------------------------------------------------------------------
1 | /**
2 | * #小程序://塔斯汀+/4mcUQx62ogk9QgE
3 | *
4 | * 抓包 Host:https://sss-web.tastientech.com 获取请求头 user-token 的值
5 | * export TASTI_TOKEN = 'sss7eXX-XXXXX-XXXX-XXXX-XXXX'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/12/17
11 | *
12 | * const $ = new Env('塔斯汀')
13 | * cron: 40 12 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('塔斯汀');
17 | const tastList = process.env.TASTI_TOKEN ? process.env.TASTI_TOKEN.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://sss-web.tastientech.com'
21 | // 签到活动ID
22 | let signActivityId;
23 | // 请求头
24 | const headers = {
25 | 'User-Agent': sudojia.getRandomUserAgent(),
26 | 'Content-Type': 'application/json',
27 | 'version': '3.2.3',
28 | 'channel': '1',
29 | 'xweb_xhr': '1',
30 | 'Referer': 'https://servicewechat.com/wx557473f23153a429/378/page-frame.html',
31 | 'Accept-Language': 'zh-CN,zh;q=0.9'
32 | };
33 |
34 | !(async () => {
35 | await checkUpdate($.name, tastList);
36 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
37 | for (let i = 0; i < tastList.length; i++) {
38 | const index = i + 1;
39 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
40 | headers['user-token'] = tastList[i];
41 | message += `📣====${$.name}账号[${index}]====📣\n`;
42 | await main();
43 | await $.wait(sudojia.getRandomWait(2000, 2500));
44 | }
45 | if (message) {
46 | await notify.sendNotify(`「${$.name}」`, `${message}`);
47 | }
48 | })().catch((e) => $.logErr(e)).finally(() => $.done());
49 |
50 | async function main() {
51 | await getActivityId()
52 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
53 | await getUserInfo();
54 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
55 | await getPoint();
56 | }
57 |
58 | /**
59 | * 自动获取签到 ID
60 | *
61 | * @returns {Promise}
62 | */
63 | async function getActivityId() {
64 | try {
65 | let data = await sudojia.sendRequest(`${baseUrl}/api/minic/shop/intelligence/banner/c/list`, 'post', headers);
66 | if (200 !== data.code) {
67 | return console.error(`获取活动ID失败 ->`, data.msg);
68 | }
69 | const dailySignInBanner = data.result.find(item => item.bannerName === '每日签到');
70 | if (!dailySignInBanner) {
71 | return console.error('未找到每日签到活动');
72 | }
73 | // 解析 jumpPara 字段
74 | const jumpPara = JSON.parse(dailySignInBanner.jumpPara);
75 | if (!jumpPara || !jumpPara.path) {
76 | return console.error('jumpPara 结构不符合预期:', jumpPara);
77 | }
78 | const decodedPath = decodeURIComponent(jumpPara.path);
79 | const urlParams = new URLSearchParams(new URL(decodedPath, 'https://example.com').search);
80 | const jumpCode = urlParams.get('jumpCode');
81 | const encodedJumpPara = urlParams.get('jumpPara');
82 | if (!jumpCode || !encodedJumpPara) {
83 | return console.error('查询参数不符合预期:', decodedPath);
84 | }
85 | // 解码 jumpPara
86 | const decodedJumpPara = decodeURIComponent(encodedJumpPara);
87 | // 解析 jumpPara JSON
88 | const jumpParaObj = JSON.parse(decodedJumpPara);
89 | if (!jumpParaObj || !jumpParaObj.activityId) {
90 | return console.error('jumpPara JSON 结构不符合预期:', decodedJumpPara);
91 | }
92 | signActivityId = jumpParaObj.activityId;
93 | const today = new Date();
94 | const month = today.getMonth() + 1;
95 | const day = today.getDate();
96 | console.log(`${month}月${day}日-签到活动ID: ${signActivityId}`);
97 | } catch (e) {
98 | console.error(`获取活动ID时发生异常:${e}`);
99 | }
100 | }
101 |
102 | async function getUserInfo() {
103 | try {
104 | let data = await sudojia.sendRequest(`${baseUrl}/api/intelligence/member/getMemberDetail`, 'get', headers);
105 | if (200 !== data.code) {
106 | return console.log(`获取用户信息失败 ->`, data.msg);
107 | }
108 | const {nickName, phone} = data.result;
109 | const hiddenMobile = `${phone.slice(0, 3)}***${phone.slice(-3)}` || '18888888888';
110 | console.log(`${nickName}(${hiddenMobile})`);
111 | message += `${nickName}(${phone})\n`;
112 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
113 | data = await sudojia.sendRequest(`${baseUrl}/api/sign/member/signV2`, 'post', headers, {
114 | "activityId": signActivityId,
115 | "memberName": nickName,
116 | "memberPhone": phone
117 | });
118 | if (200 !== data.code) {
119 | message += `签到失败:${data.msg}\n`;
120 | return console.log(`签到失败 ->`, data.msg);
121 | }
122 | if (!data.result.rewardInfoList[0].rewardName) {
123 | console.log(`签到成功,积分+${data.result.rewardInfoList[0].point}`);
124 | message += `签到成功,积分+${data.result.rewardInfoList[0].point}\n`;
125 | } else {
126 | console.log(`签到成功,获得奖品;${data.result.rewardInfoList[0].rewardName}`);
127 | message += `签到成功,获得奖品;${data.result.rewardInfoList[0].rewardName}\n`;
128 | }
129 | } catch (e) {
130 | console.error(`获取用户信息或签到时发生异常:${e}`);
131 | }
132 | }
133 |
134 | /**
135 | * 获取积分
136 | *
137 | * @returns {Promise}
138 | */
139 | async function getPoint() {
140 | try {
141 | let data = await sudojia.sendRequest(`${baseUrl}/api/wx/point/myPoint`, 'post', headers);
142 | if (200 !== data.code) {
143 | return console.log(`获取积分失败 ->`, data.msg);
144 | }
145 | console.log(`当前积分:${data.result.point}`);
146 | message += `当前积分:${data.result.point}\n\n`;
147 | } catch (e) {
148 | console.error(`获取积分时发生异常:${e}`);
149 | }
150 | }
151 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_tebu.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 特步会员中心小程序
3 | *
4 | * 抓包 URL:https://mall-mobile-v6.vecrp.com 获取请求头 token
5 | * export TEBU_TOKEN = 'eyJhxxxxxxxxxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/07/20
11 | * @lastModifyTime: 2024/11/2
12 | *
13 | * const $ = new Env('特步会员中心')
14 | * cron: 26 10 * * *
15 | */
16 | const initScript = require('../utils/initScript')
17 | const moment = require("moment");
18 | const {$, notify, sudojia, checkUpdate} = initScript('特步会员中心');
19 | const tbList = process.env.TEBU_TOKEN ? process.env.TEBU_TOKEN.split(/[\n&]/) : [];
20 | let message = '';
21 | // 接口地址
22 | const baseUrl = 'https://mall-mobile-v6.vecrp.com'
23 | // 店铺ID
24 | const shopId = '100656040';
25 | // 活动ID
26 | let activityId;
27 | // 请求头
28 | const headers = {
29 | "user-agent": sudojia.getRandomUserAgent(),
30 | 'ts': Date.now(),
31 | 'Content-Type': 'application/json;charset=UTF-8',
32 | 'appid': 'wx12e1cb3b09a0e6f0',
33 | 'Referer': 'https://servicewechat.com/wx12e1cb3b09a0e6f0/132/page-frame.html',
34 | 'Accept-Language': 'zh-CN,zh;q=0.9'
35 | };
36 |
37 | !(async () => {
38 | await checkUpdate($.name, tbList);
39 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
40 | for (let i = 0; i < tbList.length; i++) {
41 | const index = i + 1;
42 | headers.token = tbList[i];
43 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
44 | message += `📣====${$.name}账号[${index}]====📣\n`;
45 | await main();
46 | await $.wait(sudojia.getRandomWait(2000, 2500));
47 | }
48 | if (message) {
49 | await notify.sendNotify(`「${$.name}」`, `${message}`);
50 | }
51 | })().catch((e) => $.logErr(e)).finally(() => $.done());
52 |
53 | async function main() {
54 | await getUserInfo();
55 | await $.wait(sudojia.getRandomWait(1200, 2000));
56 | await getActivityId();
57 | await $.wait(sudojia.getRandomWait(1200, 2000));
58 | await sign();
59 | await $.wait(sudojia.getRandomWait(1200, 2000));
60 | await getMyBonusLogs();
61 | }
62 |
63 | /**
64 | * 获取用户信息
65 | *
66 | * @return {Promise}
67 | */
68 | async function getUserInfo() {
69 | try {
70 | const data = await sudojia.sendRequest(`${baseUrl}/mobile/customer/initMy?shopId=${shopId}`, 'get', headers);
71 | if (!data.success) {
72 | return console.error(data.msg);
73 | }
74 | const info = data.result.customer;
75 | const hiddenMobile = `${info.mobile.slice(0, 3)}***${info.mobile.slice(-3)}`;
76 | console.log(`${info.customerName}(${hiddenMobile})`);
77 | message += `${info.customerName}(${info.mobile})\n`;
78 | } catch (e) {
79 | console.error(`获取用户信息时发生异常:${e}`);
80 | }
81 | }
82 |
83 | /**
84 | * 获取活动ID
85 | *
86 | * @returns {Promise}
87 | */
88 | async function getActivityId() {
89 | try {
90 | const data = await sudojia.sendRequest(`${baseUrl}/mobile/customer/queryMobilePersonCenterTemplateByShopId?shopId=${shopId}`, 'get', headers);
91 | if (!data.success) {
92 | return console.error(data.msg);
93 | }
94 | const component = data.result.views.find(item => item.componentId === 'WHXG8614883');
95 | if (!component) {
96 | return console.warn('未找到 componentId 为 WHXG8614883');
97 | }
98 | const getActivityId = component.defaultConfig.img.find(img => img.link && img.link.path === '/pages/ehd/activities/signIn/index');
99 | if (!getActivityId) {
100 | return console.warn('未找到 activityId');
101 | }
102 | activityId = getActivityId.link.id;
103 | console.log(`activityId 已更新:${activityId}`);
104 | } catch (e) {
105 | console.error(`获取活动ID时发生异常:${e}`);
106 | }
107 | }
108 |
109 | /**
110 | * 签到
111 | *
112 | * @return {Promise}
113 | */
114 | async function sign() {
115 | try {
116 | const data = await sudojia.sendRequest(`${baseUrl}/mobile/activity/sign/sign`, 'post', headers, {
117 | "shopId": shopId,
118 | "activityId": activityId,
119 | "signDate": moment().format('YYYY-MM-DD')
120 | });
121 | if (!data.success) {
122 | return console.error(data.msg);
123 | }
124 | console.log(`签到成功,积分+${data.result.integral}`);
125 | message += `签到成功,积分+${data.result.integral}\n`;
126 | } catch (e) {
127 | console.error(`签到时发生异常:${e}`);
128 | }
129 | }
130 |
131 | /**
132 | * 获取积分详细
133 | *
134 | * @return {Promise}
135 | */
136 | async function getMyBonusLogs() {
137 | try {
138 | const data = await sudojia.sendRequest(`${baseUrl}/mobile/customer/getMyAllPoint?shopId=${shopId}`, 'get', headers);
139 | if (!data.success) {
140 | return console.error(data.msg);
141 | }
142 | console.log(`当前积分:${data.result[0].score}`);
143 | message += `当前积分:${data.result[0].score}\n\n`;
144 | } catch (e) {
145 | console.error(`获取积分时发生异常:${e}`);
146 | }
147 | }
148 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_wnna.js:
--------------------------------------------------------------------------------
1 | /**
2 | * #小程序://薇诺娜专柜商城/fHmvJS57pgeOFCJ
3 | *
4 | * 抓包 Host:https://api.qiumeiapp.com 获取请求体 appUserToken
5 | * export WNNA_TOKEN = '40c8xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/10/01
11 | *
12 | * const $ = new Env('薇诺娜专柜商城')
13 | * cron: 39 9 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('薇诺娜专柜商城');
17 | const moment = require("moment");
18 | const wnnList = process.env.WNNA_TOKEN ? process.env.WNNA_TOKEN.split(/[\n&]/) : [];
19 | let message = '';
20 | // 接口地址
21 | const baseUrl = 'https://api.qiumeiapp.com'
22 | // 请求头
23 | const headers = {
24 | 'User-Agent': sudojia.getRandomUserAgent(),
25 | 'Content-Type': 'application/x-www-form-urlencoded',
26 | 'Referer': 'https://servicewechat.com/wx250394ab3f680bfa/599/page-frame.html',
27 | 'Accept-Language': 'zh-CN,zh;q=0.9'
28 | };
29 |
30 | !(async () => {
31 | await checkUpdate($.name, wnnList);
32 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
33 | for (let i = 0; i < wnnList.length; i++) {
34 | const index = i + 1;
35 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
36 | $.userToken = wnnList[i] || '';
37 | message += `📣====${$.name}账号[${index}]====📣\n`;
38 | await main();
39 | await $.wait(sudojia.getRandomWait(2000, 2500));
40 | }
41 | if (message) {
42 | await notify.sendNotify(`「${$.name}」`, `${message}`);
43 | }
44 | })().catch((e) => $.logErr(e)).finally(() => $.done());
45 |
46 | async function main() {
47 | await getZgSigninCalendarNew();
48 | await $.wait(sudojia.getRandomWait(1500, 2500));
49 | await getUserInfo();
50 | }
51 |
52 | /**
53 | * 获取签到状态
54 | *
55 | * @returns {Promise}
56 | */
57 |
58 | async function getZgSigninCalendarNew() {
59 | try {
60 | const data = await sudojia.sendRequest(`${baseUrl}/zg-activity/zg-daily/getZgSigninCalendarNew`, 'post', headers, `appUserToken=${$.userToken}`);
61 | if (200 !== data.code) {
62 | return console.error(`获取签到状态失败:${data.msg}`);
63 | }
64 | const isSign = data.data.currentMonth.signinList.find(d => d.date === moment().format('D'))
65 | if (1 === isSign.isSignin) {
66 | message += '今天已经签过到了\n';
67 | return console.error('今天已经签过到了');
68 | }
69 | await $.wait(sudojia.getRandomWait(1500, 2500));
70 | await signIn();
71 | } catch (e) {
72 | console.error('获取签到状态时发生异常 ->', e.response.data);
73 | }
74 | }
75 |
76 | /**
77 | * 签到
78 | *
79 | * @returns {Promise}
80 | */
81 | async function signIn() {
82 | try {
83 | const data = await sudojia.sendRequest(`${baseUrl}/zg-activity/zg-daily/zgSigninNew`, 'post', headers, `appUserToken=${$.userToken}`);
84 | if (200 !== data.code) {
85 | return console.error(`签到失败:${data.msg}`);
86 | }
87 | console.log(`签到成功`);
88 | console.log(`已连续签到${data.data.signinCount}天`);
89 | message += `签到成功\n已连续签到${data.data.signinCount}天\n`;
90 | } catch (e) {
91 | console.error('签到时发生异常 ->', e.response.data);
92 | }
93 | }
94 |
95 | /**
96 | * 获取用户信息
97 | *
98 | * @return {Promise}
99 | */
100 | async function getUserInfo() {
101 | try {
102 | const data = await sudojia.sendRequest(`${baseUrl}/zgxcx/10001/getZgUserInfo`, 'post', headers, `zgUserToken=${$.userToken}`);
103 | if (200 !== data.code) {
104 | return console.error(`获取用户信息失败:${data.msg}`);
105 | }
106 | console.log(`${data.data.nickname}(${data.data.levelName})`);
107 | console.log(`当前积分:${data.data.winonaPoint}`);
108 | message += `${data.data.nickname}(${data.data.levelName})\n当前积分:${data.data.winonaPoint}\n\n`;
109 | } catch (e) {
110 | console.error('获取用户信息时发生异常 ->', e.response.data);
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_xiaomi_community.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 微信小程序:小米社区
3 | *
4 | * 每日签到获得成长值
5 | *
6 | * 抓包 Host:https://api.vip.miui.com 获取请求头 Cookie
7 | * export XIAOMI_COMM_COOKIE = 'serviceToken=xxxxx'
8 | * 多账号用 & 或换行
9 | *
10 | * @author Telegram@sudojia
11 | * @site https://blog.imzjw.cn
12 | * @date 2025/04/27
13 | *
14 | * const $ = new Env('小米社区-小程序')
15 | * cron: 48 9 * * *
16 | */
17 | const initScript = require('../utils/initScript')
18 | const {$, notify, sudojia, checkUpdate} = initScript('小米社区-小程序');
19 | const xiaoMiComGeList = process.env.XIAOMI_COMM_COOKIE ? process.env.XIAOMI_COMM_COOKIE.split(/[\n&]/) : [];
20 | // 消息推送
21 | let message = '';
22 | // 接口地址
23 | const baseUrl = 'https://api.vip.miui.com'
24 | // 请求头
25 | const headers = {
26 | 'User-Agent': sudojia.getRandomUserAgent(),
27 | 'Accept': 'application/json, text/plain, */*',
28 | 'xweb_xhr': '1',
29 | 'Origin': 'https://servicewechat.com',
30 | 'Content-Type': 'application/x-www-form-urlencoded',
31 | 'Referer': 'https://servicewechat.com/wx240a4a764023c444/3/page-frame.html',
32 | 'Accept-Language': 'zh-CN,zh;q=0.9'
33 | };
34 |
35 | !(async () => {
36 | await checkUpdate($.name, xiaoMiComGeList);
37 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
38 | for (let i = 0; i < xiaoMiComGeList.length; i++) {
39 | const index = i + 1;
40 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
41 | headers.Cookie = xiaoMiComGeList[i]
42 | message += `📣====${$.name}账号[${index}]====📣\n`;
43 | await main();
44 | await $.wait(sudojia.getRandomWait(2000, 2500));
45 | }
46 | if (message) {
47 | await notify.sendNotify(`「${$.name}」`, `${message}`);
48 | }
49 | })().catch((e) => $.logErr(e)).finally(() => $.done());
50 |
51 | async function main() {
52 | await getUserInfo();
53 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
54 | await sign();
55 | await $.wait(sudojia.getRandomWait(1e3, 2e3));
56 | await getPoints();
57 | }
58 |
59 | async function getUserInfo() {
60 | try {
61 | const data = await sudojia.sendRequest(`${baseUrl}/mtop/planet/lite/userinfo`, 'get', headers);
62 | if (200 !== data.status) {
63 | return console.error(`获取用户信息失败:${data.message}`);
64 | }
65 | const {username, userId} = data?.entity;
66 | console.log(`${username}(${userId})`);
67 | message += `${username}(${userId})\n`;
68 | } catch (e) {
69 | console.error(`获取用户接口请求失败:`, e.response.data);
70 | }
71 | }
72 |
73 | async function sign() {
74 | try {
75 | const miuiVipPh = headers.Cookie.match(/miui_vip_ph=([^;]+)/)[1];
76 | if (!miuiVipPh) {
77 | return console.error(`未找到 miui_vip_ph`);
78 | }
79 | const data = await sudojia.sendRequest(`${baseUrl}/mtop/planet/vip/member/addCommunityGrowUpPointByActionV2?miui_vip_ph=${encodeURIComponent(miuiVipPh)}`, 'post', headers, 'action=WECHAT_CHECKIN_TASK');
80 | if (200 !== data.status) {
81 | message += `${data.message} -> 如果加分失败,说明签到过了\n`;
82 | return console.error(`签到失败:${data.message}`);
83 | }
84 | console.log(`签到成功,积分+${data?.entity?.score}`);
85 | message += `签到成功,积分+${data?.entity?.score}\n`;
86 | } catch (e) {
87 | console.error(`签到接口请求失败:`, e.response.data);
88 | }
89 | }
90 |
91 | async function getPoints() {
92 | try {
93 | const data = await sudojia.sendRequest(`${baseUrl}/mtop/planet/wechat/growup/points/detail`, 'get', headers);
94 | if (200 !== data.status) {
95 | return console.error(`获取积分失败:${data.message}`);
96 | }
97 | const totalPoints = (data?.entity || []).reduce((sum, item) => {
98 | const points = parseInt(item.jumpText.replace(/\D/g, ''), 10);
99 | return sum + (isNaN(points) ? 0 : points);
100 | }, 0);
101 | console.log(`当前成长值: ${totalPoints}`);
102 | message += `当前成长值: ${totalPoints}\n\n`;
103 | } catch (e) {
104 | console.error(`获取成长值接口请求失败:`, e.response.data);
105 | }
106 | }
--------------------------------------------------------------------------------
/src/wx_mini/sudojia_zxice.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 甄稀冰淇淋小程序
3 | *
4 | * 抓包 Host:https://msmarket.msx.digitalyili.com 获取请求头 access-token 的值
5 | * export ZX_ICE_TOKEN = 'xxxxxxxxxxxxxxxxxxxxxx'
6 | * 多账号用 & 或换行
7 | *
8 | * @author Telegram@sudojia
9 | * @site https://blog.imzjw.cn
10 | * @date 2024/06/16
11 | *
12 | * const $ = new Env('甄稀冰淇淋')
13 | * cron: 22 15 * * *
14 | */
15 | const initScript = require('../utils/initScript')
16 | const {$, notify, sudojia, checkUpdate} = initScript('甄稀冰淇淋');
17 | const zxList = process.env.ZX_ICE_TOKEN ? process.env.ZX_ICE_TOKEN.split(/[\n&]/) : [];
18 | let message = '';
19 | // 接口地址
20 | const baseUrl = 'https://msmarket.msx.digitalyili.com'
21 | // 请求头
22 | const headers = {
23 | 'user-agent': sudojia.getRandomUserAgent(),
24 | 'referer': 'https://servicewechat.com/wx21fd8b5d6d4cf1ca/195/page-frame.html',
25 | 'content-type': 'application/json',
26 | 'accept': '*/*',
27 | 'accept-encoding': 'gzip, deflate, br',
28 | };
29 | !(async () => {
30 | await checkUpdate($.name, zxList);
31 | console.log(`\n已随机分配 User-Agent\n\n${headers['user-agent'] || headers['User-Agent']}`);
32 | for (let i = 0; i < zxList.length; i++) {
33 | const index = i + 1;
34 | headers['access-token'] = zxList[i];
35 | console.log(`\n*****第[${index}]个${$.name}账号*****`);
36 | const isLogin = await getUserInfo();
37 | if (!isLogin) {
38 | console.error(`Token 已失效`);
39 | await notify.sendNotify(`「Token失效通知」`, `${$.name}账号[${index}] Token 已失效,请重新登录获取 Token\n\n`);
40 | continue;
41 | }
42 | message += `📣====${$.name}账号[${index}]====📣\n`;
43 | message += `昵称:${$.nickName}\n`;
44 | console.log(`${$.nickName}登录成功~`);
45 | await $.wait(sudojia.getRandomWait(800, 1200));
46 | await main();
47 | await $.wait(sudojia.getRandomWait(2000, 2500));
48 | }
49 | if (message) {
50 | await notify.sendNotify(`「${$.name}」`, `${message}`);
51 | }
52 | })().catch((e) => $.logErr(e)).finally(() => $.done());
53 |
54 | async function main() {
55 | console.log(`开始检测签到状态...`);
56 | await checkStatus();
57 | await $.wait(sudojia.getRandomWait(1500, 2300))
58 | if ($.signed) {
59 | message += `今日已签到,请勿重复签到\n\n`;
60 | console.log(`今日已签到,请勿重复签到`);
61 | return;
62 | }
63 | console.log(`状态:未签到\n开始签到...`);
64 | await sign();
65 | await $.wait(sudojia.getRandomWait(1500, 2300));
66 | await getPoint();
67 | }
68 |
69 | /**
70 | * 获取用户信息
71 | *
72 | * @return {Promise}
73 | */
74 | async function getUserInfo() {
75 | try {
76 | const data = await sudojia.sendRequest(`${baseUrl}/gateway/api/auth/account/user/info`, 'get', headers);
77 | if (data.status) {
78 | $.nickName = data.data.nickName;
79 | return true;
80 | }
81 | console.log(data.error);
82 | return false;
83 | } catch (e) {
84 | console.error(`获取用户信息时发生异常:${e}`);
85 | return false;
86 | }
87 | }
88 |
89 | /**
90 | * 检测签到状态
91 | *
92 | * @return {Promise}
93 | */
94 | async function checkStatus() {
95 | try {
96 | const data = await sudojia.sendRequest(`${baseUrl}/gateway/api/member/sign/status`, 'get', headers);
97 | if (data.status) {
98 | // false:未签到
99 | $.signed = data.data.signed
100 | }
101 | } catch (e) {
102 | console.error(`检测签到状态时发生异常:${e}`);
103 | }
104 | }
105 |
106 | /**
107 | * 签到
108 | *
109 | * @return {Promise}
110 | */
111 | async function sign() {
112 | try {
113 | const data = await sudojia.sendRequest(`${baseUrl}/gateway/api/member/daily/sign`, 'post', headers, {});
114 | if (data.status) {
115 | message += `签到成功,奶滴值+${data.data.dailySign.bonusPoint}\n`;
116 | console.log(`签到成功,奶滴值+${data.data.dailySign.bonusPoint}`);
117 | }
118 | } catch (e) {
119 | console.error(`签到时发生异常:${e}`);
120 | }
121 | }
122 |
123 | /**
124 | * 获取奶滴值
125 | *
126 | * @return {Promise}
127 | */
128 | async function getPoint() {
129 | try {
130 | const data = await sudojia.sendRequest(`${baseUrl}/gateway/api/member/point`, 'get', headers);
131 | if (data.status) {
132 | message += `当前奶滴值:${data.data}\n\n`;
133 | console.log(`当前奶滴值:${data.data}`);
134 | } else {
135 | console.log(`获取奶滴值失败:${data}`);
136 | }
137 | } catch (e) {
138 | console.error(`获取奶滴值时发生异常:${e}`);
139 | }
140 | }
141 |
--------------------------------------------------------------------------------