A unified web dashboard for scraping Douyin, TikTok, Reddit, X (Twitter), and YouTube — built with FastAPI + Vue 3. All five scrapers are controlled from a single browser interface with real-time log streaming and an AI-powered comment analysis panel.
Current version: v1.2.1
- 5 platforms in one UI — Douyin, TikTok, Reddit, X, YouTube
- Keyword search & profile/channel scraping for each platform
- Safe mode & Fast mode — Safe mode uses sequential browser scraping; Fast mode opens 3 concurrent browser tabs for ~3× speed (Douyin/TikTok keyword only)
- Pause / Stop controls — Pause and resume mid-run, or stop with data saved up to that point (Douyin/TikTok)
- Real-time terminal logs streamed via SSE (no page refresh needed)
- Manual intervention flow — browser auto-opens for login/captcha; click Resume when done
- AI chat analysis — select up to 10 scraped datasets and chat with your comment data (streaming, token-by-token output)
- Data management — browse output folders, clean empty directories
# 1. Install dependencies (per platform as needed)
pip install -r douyin/requirements.txt
pip install -r tiktok/requirements.txt
pip install -r reddit/requirements.txt
pip install -r x/requirements.txt
pip install -r youtube/requirements.txt
# 2. Start the server
python3 server.py
# 3. Open http://localhost:8000macOS one-click launch (opens browser automatically):
./Start_Scraper.commandStop the server:
kill -9 $(lsof -t -i :8000)YouTube also requires system-level
yt-dlp:brew install yt-dlp
| Mode | How it works | Speed |
|---|---|---|
| Safe | One browser tab, sequential per video | Baseline |
| Fast | 3 concurrent tabs in the same browser session | ~3× faster |
Both modes share the same login session and comment parsing logic. Fast mode requires no extra configuration.
While a scrape is running, two control buttons appear in the UI:
- ⏸ Pause — suspends the scrape (browser stays open); click again to resume
- ■ Stop — terminates the run and saves all data collected so far
| Platform | Method | Auth |
|---|---|---|
| 抖音 (Douyin) | Playwright (Chromium) | Manual login → auto-saved cookies |
| TikTok | Playwright (Chromium) | Manual login → auto-saved cookies |
| HTTP requests | Cookie-Editor browser export | |
| X (Twitter) | twikit async client | Cookie-Editor browser export |
| YouTube | yt-dlp subprocess | No auth required |
Each run creates a timestamped folder under data/:
data/{label}_{YYYYMMDD_HHMMSS}/
├── videos.json / videos.csv # Video/post/tweet metadata
├── all_comments.json / .csv # All comments aggregated
└── comments/
└── {item_id}.json # Per-item comment files
The AI Data Analysis tab lets you load one or more all_comments.json files and ask questions about the data. Responses stream token-by-token.
Supported providers (bring your own API key):
| Provider | Model |
|---|---|
| Moonshot Kimi | moonshot-v1-32k |
| 智谱 ChatGLM | glm-4 |
| MiniMax | abab6.5s-chat |
| OpenRouter | openai/gpt-4o-mini |
server.py # FastAPI: routing, SSE logs, dynamic scraper loading
static/index.html # Vue 3 + Tailwind CSS single-file UI (no build step)
data/ # All scraped output + shared cookies.json
encrypt/ # Signature utilities (ABogus, XBogus, XGnarly)
douyin/ tiktok/ reddit/ x/ youtube/ # Platform scrapers
Key design patterns:
platform_env()context manager — isolatessys.pathandsys.modulesper platform to prevent namespace collisions between the fiveconfig/utilsmodules- SSE log queue — all
print()replaced withself._log()→asyncio.Queue→/api/logsevent stream - User intervention —
request_user_intervention()suspends the scraper and waits for the frontend Resume button instead of blockinginput() - ScrapeControl state machine —
idle / running / paused / stoppedstates withpause_eventandstop_eventfor cooperative cancellation
- Fast scrape mode (Douyin/TikTok keyword): 3 concurrent browser tabs in a shared session, ~3× speedup
- Pause / Stop controls: new
/api/pauseand/api/stopendpoints; UI buttons visible during active scrapes - Fix: TikTok comment section now reliably opens (
data-e2e='comments'added as primary click target, with retry logic) - Added
encrypt/package (ABogus, XBogus, XGnarly signature utilities)
- Unified FastAPI + Vue 3 dashboard replacing CLI-only workflow
- SSE real-time log streaming
- AI comment analysis panel (4 providers)
- Advanced search filters: sort by recency/popularity, time-window filtering
- Python 3.10+ required (X/twikit uses
matchstatements internally) - Scraped data and
cookies.jsonare excluded from this repository via.gitignore - Playwright browsers must be installed:
playwright install chromium
- Social Media Scraper Skills — AI Agent skills for this project (one folder per platform,
prompt.md+run.py)