Bundle
dsh-douyin-oem-touliu-report
抖音本地推 OEM 投流日报/周报自动化插件:安装后自动把 douyin-oem-touliu-report 技能部署到用户技能根,采集抖音来客+巨量本地推三源数据并生成 docx 报告。Douyin local-promotion OEM ad-daily/weekly report automation: deploys the douyin-oem-touliu-report skill (collect 3 data sources, compute metrics, build docx reports).
- Source
- ruiyukirin
- stars
- 1 stars
- License
- MIT
- Updated
- Updated 2 days ago
Readme
# dsh-douyin-oem-touliu-report
> **作者:Kirin** · [GitHub](https://github.com/ruiyukirin) · MIT License
抖音本地推 OEM 投流日报 / 周报自动化插件(Douyin local-promotion OEM ad report automation for DeepSeek Harness)。
安装后自动把 `douyin-oem-touliu-report` 技能部署到用户技能根(`~/.dsh/skills/`),DSH 立即获得该技能:
采集抖音来客 + 巨量本地推**三源数据**(客资中心 / 计划级投放 / 视频分析),计算指标,生成 A4 版式 OEM 投流日报 / 周报 docx,可选邮件通知与 Windows 定时任务。
> 本包为脱敏发行版:不含任何真实公司名、账号 ID、SMTP 凭据与运行时数据。上架插件市场后全球用户可一键安装。
## 安装
```sh
# npm 发布后(推荐)
dsh plugin --profile web add dsh-douyin-oem-touliu-report
# 或直接从 GitHub(发布后)
dsh plugin --profile web add github:ruiyukirin/dsh-douyin-oem-touliu-report
```
安装完成并重启 `dsh web` 后,可在设置 → Plugin Market 中看到;技能出现在 agent 技能目录中(名称 `douyin-oem-touliu-report`)。
## 首次使用(三步)
1. **填业务配置**:复制
`~/.dsh/skills/douyin-oem-touliu-report/config/config.example.json`
为同目录下 `config.json`,填写公司名、advid/groupid/view_id、四个入口 URL、数据目录与报告目录。
2. **邮件通知(可选)**:复制 `config/.env.example` 为 `config/.env`,填 QQ/163/Outlook SMTP 凭据与收件人。
3. **安装 Python 依赖**:`pip install -r requirements.txt`,然后 `playwright install`(供 Edge 浏览器自动化);首次运行采集用本机 Edge 登录一次抖音来客,之后复用登录态。
## 自由设定自动执行时间(日报 / 周报)
想让它每天自动跑?不用管理员权限,不用手动建任务。在 `config.json` 里加一个 `schedule` 节,改好时间即可:
```json
"schedule": {
"daily_enabled": true,
"daily_time": "09:30",
"weekly_enabled": true,
"weekly_time": "10:00",
"weekly_day": "MON"
}
```
- `daily_enabled` / `daily_time` — 日报每天几点跑(24 小时制,如 `"09:30"`)
- `weekly_enabled` / `weekly_time` / `weekly_day` — 周报每周几几点跑(`MON`~`SUN`)
- 把某个 `_enabled` 改成 `false` 就会删掉对应任务
保存后**重启 DSH**(插件启动时自动同步),或手动执行一次:
```powershell
powershell -ExecutionPolicy Bypass -File ~\.dsh\skills\douyin-oem-touliu-report\scripts\setup_schedule.ps1
```
它会自动注册两个 Windows 计划任务:`OEM投流日报`、`OEM投流周报`(任务以隐藏窗口静默运行,不弹黑窗口)。之后每次改时间,重跑一次就更新;日志在 `runtime/daily.log`、`runtime/weekly.log`。
> 提示:定时任务用你当前 Windows 用户身份运行,`config.json` 里的 `data_dir` / `report_dir` 请填绝对路径,否则任务运行时可能找不到数据目录。
## 运行
```powershell
cd ~\.dsh\skills\douyin-oem-touliu-report
python scripts\run.py --date 2026-08-27 # 一键日报(date=报告主体日=前一日)
python scripts\weekly_report.py --week-end 2026-08-25 # 周报
```
数据落盘:`data/`(三源 xlsx)、`report/`(docx)、`archive/<date>/`(归档)、`history/metrics_history.json`(指标历史)。
定时任务与邮件通知的完整说明见技能内 `SKILL.md`「定时任务与邮件通知」一节。
## 工作原理
插件 `index.js`(`apply`)做三件事:
1. **部署**:把包内 `skills/douyin-oem-touliu-report/` 复制到 `~/.dsh/skills/`(用户技能根)。这样脚本可以写 `config.json`、`.env`、`data/`、`report/`、`runtime/`;升级插件时只同步官方文件(`SKILL.md`、`scripts/`、模板),**保留用户数据**(`config.json`、`.env`、`data/` 等)。
2. **注册**:立即把技能注册进 `ctx.skills`(runtime 层,rank 250),`resourceBase` 指向已部署目录,模型无需等待文件系统 watcher 即可发现。
3. **同步定时任务**:若 `config.json` 里有 `schedule` 节,自动调用 `scripts/setup_schedule.ps1`,把使用者设定的日报 / 周报执行时间注册为 Windows 计划任务(每次 DSH 启动同步一次;非 Windows 自动跳过)。
## 目录结构
```
dsh-douyin-oem-touliu-report/
├── package.json # npm bundle(dsh.bundle.patch)
├── cordis.patch.yml # 插件行
├── index.js # 部署 + 注册逻辑
└── skills/
└── douyin-oem-touliu-report/ # 技能本体(SKILL.md + scripts + config 模板)
```
## 许可
MIT — 见 [LICENSE](LICENSE)。
Install
dsh plugin --profile web add github:ruiyukirin/dsh-douyin-oem-touliu-report
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-douyin-oem-touliu-report from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.