This commit is contained in:
Hex
2023-02-25 18:49:43 +08:00
parent c0363e5412
commit 20eeed7727
14 changed files with 15 additions and 381 deletions

View File

@@ -1,100 +1,5 @@
# 什么值得买每日签到脚本
<p>
<img src="https://img.shields.io/github/actions/workflow/status/Chasing66/smzdm_bot/checkin.yml?label=CheckIn">
<img src="https://img.shields.io/github/actions/workflow/status/Chasing66/smzdm_bot/build.yml?label=Build">
<img src="https://img.shields.io/github/license/Chasing66/smzdm_bot">
<img src="https://img.shields.io/docker/pulls/enwaiax/smzdm_bot">
</p>
## 1. 实现功能
- `什么值得买`每日签到
- Github Action 定时执行, **务必自行更改为随机时间**
- 本地 Docker 定时运行
- 通过`pushplus`推送运行结果到微信(不推荐)
- 通过`server酱`推送运行结果到微信
- 通过`telegram bot`推送
- 自定义反代`Telegram Bot API`, [搭建教程](https://anerg.com/2022/07/25/reverse-proxy-telegram-bot-api-using-cloudflare-worker.html)
## 2. 使用方法
### 2.1 Git Action 运行
# 什么值得买每日签到脚本 for 青龙面板
**务必自行更改为随机时间**
1. Fork[此仓库项目](https://github.com/Chasing66/smzdm_bot)>, 欢迎`star`~
2. 修改 `.github/workflows/checkin.yml`里的下面部分, 取消`schedule`两行的注释,自行设定时间
```yaml
# UTC时间对应Beijing时间 930
schedule:
- cron: "30 1 * * *"
```
3. Secret 新增`ANDROID_COOKIE`,`SK` ,`USER_AGENT``TOKEN` [方法详见](#31-手机抓包)
4. (可选) Secret 新增`PUSH_PLUS_TOKEN`用于推送通知, [详见](https://www.pushplus.plus/)
5. (可选) Secret 新增`SC_KEY`用于推送通知, [详见](https://sct.ftqq.com/)
6. (可选) Secret 新增`TG_BOT_TOKEN``TG_USER_ID`用于推送通知
7. (可选) Secret 新增`TG_BOT_API`用于自定义反代的`Telegram Bot API`
### 2.2 本地运行(支持多用户)
参考模板`app/config/config_example.toml`. 复制`app/config/config_example.toml``app/config/config.toml`,并按照需求配置
```bash
python3 -m venv .venv
source .venv/bin/activate
cd app
pip install -r requirements.txt
python main.py
```
### 2.3 本地 docker 运行
`docker-compose.yml`
本地生成一个`.env` 文件, 用于配置 docker-compose.yml 运行所需要的环境变量, 如下:
```
# Cookie
USER_AGENT = ""
ANDROID_COOKIE = ""
SK = ""
TOKEN = ""
# Notification
PUSH_PLUS_TOKEN = ""
SC_KEY = ""
TG_BOT_TOKEN = ""
TG_USER_ID = ""
# 定时设定(可选) 若未设定则随机定时执行
SCH_HOUR=
SCH_MINUTE=
```
## 3. 其它
### 3.1 手机抓包
> 抓包有一定门槛,请酌情尝试.
抓包工具可使用 HttpCanary教程参考[HttpCanary 抓包](https://juejin.cn/post/7177682063699968061)
1. 按照上述教程配置好 HttpCanary
2. 开始抓包,并打开什么值得买 APP
3. 过滤域名为`user-api.smzdm.com`的 post 请求
4. 点击右上角分享,复制 cURL转换 curl 请求为 python 格式,[方法](https://curlconverter.com/)
## 更新日志
- 2022-12-08, 签到失败,浏览器端签到需要滑动验证码认证
- 2023-01-11, 更改`User-Agent``iPhone`后可`bypass`滑块认证
- 2023-01-14, 登录认证失败, 签到失效
- 2023-02-18, 通过安卓端验证登录,感谢[jzksnsjswkw/smzdm-app](https://github.com/jzksnsjswkw/smzdm-app)的思路. 旧版代码查看[old](https://github.com/Chasing66/smzdm_bot/tree/old)分支
- 2023-02-25, 新增`all_reward``extra_reward`两个接口,本地支持多用户运行
## Stargazers over time
[![Stargazers over time](https://starchart.cc/Chasing66/smzdm_bot.svg)](https://starchart.cc/Chasing66/smzdm_bot)
按照 config/config_example.toml 例子配置文件生成自己的配置文件 config.toml