instagram-reel-downloader-whatsapp

TotalClaw 作者 totalclaw

通过 sssinstagram.com 下载 Instagram Reel 并将其作为 WhatsApp 就绪的视频文件返回。当提供了卷 URL 并且 yt-dlp 被阻止或不首选时使用。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~besaif-instagram-reel-downloader-whatsapp
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~besaif-instagram-reel-downloader-whatsapp/file -o besaif-instagram-reel-downloader-whatsapp.md
# Instagram Reel via sssinstagram

## Requirements

- Node.js 18+.
- `playwright-core` installed in the runtime.
- Chromium-compatible browser binary available via:
  - `BROWSER_EXECUTABLE_PATH` (preferred), or
  - default `/usr/bin/brave-browser`.

## Environment variables

- `OPENCLAW_WORKSPACE` (optional): workspace root used for output path.
- `REEL_DOWNLOAD_DIR` (optional): explicit download directory override.
- `BROWSER_EXECUTABLE_PATH` (optional): browser binary path override.

1. Validate input URL.
   - Accept only `https://www.instagram.com/reel/...` (or `/reels/...`) links.

2. Run downloader automation script.
   - Execute:
     - `node scripts/download_via_sss.mjs "<instagram-url>"`
   - On success it prints:
     - `MEDIA_PATH=<absolute path>`

3. Send the file to user on WhatsApp.
   - Use `message` `action=send` with `media` set to `MEDIA_PATH`.
   - Add a small caption like `Done 🐾`.

4. If the site blocks automation.
   - Retry once after a short wait.
   - If it still fails, report failure cleanly and ask user for another link.

## Notes
- Uses `BROWSER_EXECUTABLE_PATH` if set, otherwise defaults to `/usr/bin/brave-browser`.
- Saves videos to `REEL_DOWNLOAD_DIR` when set, else `<workspace>/downloads` (`OPENCLAW_WORKSPACE` or current working directory).
- Uses Playwright (`playwright-core`) in headless mode.
- Optional cleanup script: `bash scripts/cleanup_reels.sh 30` (minutes to retain, default 30).
- For user privacy, do not store links longer than needed for the download run.

---

## 中文说明

# 通过 sssinstagram 下载 Instagram Reel

## 要求

- Node.js 18+。
- 运行时已安装 `playwright-core`。
- 通过以下方式提供与 Chromium 兼容的浏览器二进制文件:
  - `BROWSER_EXECUTABLE_PATH`(首选),或
  - 默认 `/usr/bin/brave-browser`。

## 环境变量

- `OPENCLAW_WORKSPACE`(可选):用于输出路径的工作区根目录。
- `REEL_DOWNLOAD_DIR`(可选):显式覆盖下载目录。
- `BROWSER_EXECUTABLE_PATH`(可选):覆盖浏览器二进制文件路径。

1. 验证输入 URL。
   - 仅接受 `https://www.instagram.com/reel/...`(或 `/reels/...`)链接。

2. 运行下载器自动化脚本。
   - 执行:
     - `node scripts/download_via_sss.mjs "<instagram-url>"`
   - 成功时会输出:
     - `MEDIA_PATH=<absolute path>`

3. 在 WhatsApp 上将文件发送给用户。
   - 使用 `message` `action=send`,并将 `media` 设置为 `MEDIA_PATH`。
   - 添加一个简短的说明文字,例如 `Done 🐾`。

4. 如果该网站阻止自动化。
   - 短暂等待后重试一次。
   - 如果仍然失败,干净地报告失败并请求用户提供另一个链接。

## 备注
- 如果设置了 `BROWSER_EXECUTABLE_PATH` 则使用它,否则默认使用 `/usr/bin/brave-browser`。
- 设置了 `REEL_DOWNLOAD_DIR` 时将视频保存到该目录,否则保存到 `<workspace>/downloads`(`OPENCLAW_WORKSPACE` 或当前工作目录)。
- 以无头模式使用 Playwright(`playwright-core`)。
- 可选的清理脚本:`bash scripts/cleanup_reels.sh 30`(保留的分钟数,默认 30)。
- 为保护用户隐私,存储链接的时间不要超过下载运行所需的时长。