baidu-reporter/README.md
2025-04-04 20:30:12 +08:00

74 lines
3.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# baidu-reporter
## 使用方式
```shell
# WEB 模式,只启动 web 控制台,不启动任何引擎
python main.py --web
# 等价于
python main.py --web-only
# 启动 web 的时候启动引擎
python main.py --web --crawl --evidence --report wap,pc,site
# 这几个选项可以任意组合,例如只启动采集引擎和证据收集引擎
python main.py --web --crawl --evidence
```
```shell
# 采集模式采集指定关键字的URL列表直接存入数据库
python main.py --crawl www.yunzhiju.net
# 批量采集模式,使用英文逗号分割多个域名
python main.py --crawl www.yunzhiju.net,www.yunzhiju.net
# 另外一种批量采集模式,从文件中读取域名,每行一个
python main.py --crawl-file ./domains.txt
# 这两种采集模式可以一起使用
python main.py --crawl www.yunzhiju.net,www.yunzhiju.net --crawl-file ./domains.txt
# 收集模式,收集所有待举报的链接的截图与 Token
python main.py --evidence
# 举报模式,干他丫的
# 可以通过参数决定使用哪个举报渠道
python main.py --report wap,pc,site
```
## 目录结构
```plain
├── app # 程序主包
│   ├── app.py # 包入口
│   ├── config/ # 配置管理
│   ├── engines/ # 存放所有的 engine
│   │   ├── crawl_engine.py # 采集引擎从百度中采集指定域名的URL列表
│   │   ├── evidence_engine.py # 证据收集引擎,截图、获取举报 Token
│   │   ├── report_engine.py # 举报引擎入口,负责调用各个渠道的举报引擎
│   │   └── reporters # 举报器
│   │   ├── base.py # 举报器基类
│   │   ├── pc_reporter.py # PC 渠道举报器
│   │   ├── site_reporter.py # Site 渠道举报器
│   │   └── wap_reporter.py # wap 渠道举报器
│   ├── models # ORM 层,数据库模型
│   │   ├── base.py # ORM 基类
│   │   ├── domain.py # Domain 模型,存储域名记录
│   │   └── report_urls.py # ReportURL 模型,存储举报记录
│   └── utils # 工具类
│   ├── common.py
│   ├── custom_base64.py
│   ├── dp.py # chrome 类
│   ├── gen_cookie.py
│   ├── ua.py
│   └── ydm_verify.py # 验证码打码
├── captcha/ # 验证码图片
├── data/ # 目前主要放了 cookie 文件
├── imgs/ # evidence 中用到的截图
├── js/ # repoter 中用到的 js 文件
├── main.py # 程序主入口
├── config.local.toml # 开发环境配置文件
├── config.prod.toml # 生产环境配置文件
└── tests # 测试文件,可以不用管
```