zget

zget

MCP server for archiving media from 600+ sites (YouTube, TikTok, etc.) and managing a local library with search, metadata, and download tools.

Category
访问服务器

README

zget

The Archival Engine. Download and preserve media from YouTube, Instagram, TikTok, Reddit, X, Twitch, C-SPAN, and 600+ other sites to your own local library.

zget demo

Why zget?

The internet is ephemeral. Your library isn't.

Content disappears constantly—videos get deleted, accounts get banned, platforms shut down. zget lets you build a personal archive that you control.

  • Save before it's gone. That tutorial you keep referencing, that interview, that viral clip
  • Share without barriers. Send videos to people who can't access the original (geo-blocks, login walls)
  • Watch offline. Download for flights, road trips, anywhere with bad connectivity
  • Research and journalism. Archive footage before it gets altered or removed
  • Family media server. One household library accessible from every device

Requirements

  • macOS (Apple Silicon or Intel) or Linux
  • Python 3.10+
  • uv (fast Python package manager)
  • ffmpeg (for video processing)

Installation

1. Install Dependencies

# Install uv (if you don't have it)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install ffmpeg (macOS)
brew install ffmpeg

2. Clone the Repository

git clone https://github.com/bubroz/zget.git
cd zget

3. First Run (Setup)

# This installs all Python dependencies automatically
./zget-start.command

Your browser will open to http://localhost:9989. You're ready to archive!

Quick Start (Robust Launcher)

We recommend using the included Launcher Script for daily use.

1. Daily Use

Double-click zget-start.command in Finder.

This will:

  1. Open a terminal window (keep this open!)
  2. Start the server on port 9989
  3. Securely bind to your Tailscale network
  4. Launch your browser automatically

Why keep the window open? Running in a visible terminal ensures zget has permission to use your browser's cookies. This is critical for downloading from sites like TikTok and YouTube which block background bots.

2. Mobile Access (Tailscale)

To access your library from your phone (e.g. while away from home), use Tailscale.

  1. Install Tailscale on both your Mac and your Phone.

  2. Log in to the same account.

  3. Visit the server IP from your phone:

    http://100.x.y.z:9989
    

    (Find your Mac's Tailscale IP in the Tailscale menu bar icon)

Features

Core

  • Multi-Platform Downloads: YouTube, Instagram, TikTok, Reddit, Twitch, X, and 600+ sites via yt-dlp
  • Full-Text Search: Find videos by title, uploader, or description (SQLite FTS5)
  • Metadata Preservation: Original titles, upload dates, view counts, descriptions
  • H.264 Transcoding: Conversion for iOS/Safari compatibility (when enabled in settings)
  • Duplicate Detection: By URL and file hash

Media Server Integration (Plex / Jellyfin)

  • Custom Output Directory: Point downloads directly at your library folder
  • Flat Structure: Skip platform subdirectories for watch-folder scanning
  • NFO Sidecar Generation: Kodi-style XML metadata files
  • Local Thumbnails: Poster images placed alongside videos

Verified Platforms

Platform Status
YouTube ✅ Verified
Instagram ✅ Verified
X ✅ Verified
TikTok ✅ Verified
Reddit ✅ Verified
Twitch ✅ Verified
C-SPAN ✅ Verified

Additional sites may work via yt-dlp but are not officially tested.

CLI Reference

Download a Video

uv run zget <url>                    # Download to default location
uv run zget <url> --output /path     # Download to specific directory
uv run zget <url> --flat             # Skip platform subdirectory

Library Commands

uv run zget search <query>           # Full-text search
uv run zget stats                    # Library statistics
uv run zget doctor                   # Health check (find orphans, verify files)
uv run zget doctor --fix             # Auto-fix issues
uv run zget formats <url>            # List available formats without downloading

Configuration

Persistent settings stored in ~/.config/zget/config.json:

uv run zget config show              # View current settings
uv run zget config set <key> <value> # Set a value
uv run zget config unset <key>       # Remove a value

Common keys:

Key Description Example
output_dir Custom output path /Volumes/Media/Videos
flat Skip platform subdirs true
template Filename format %(upload_date>%Y-%m-%d)s %(title)s.%(ext)s

Plex Setup Example

uv run zget config set output_dir "/Volumes/Media/Social Videos"
uv run zget config set flat true

Videos will now download directly to your Plex library with proper metadata (NFO) and artwork generated automatically.

AI Agent Integration (MCP)

zget exposes tools for AI agents via the Model Context Protocol.

Available Tools

Tool Description
zget_download Download a video from URL
zget_search Full-text search the library
zget_get_video Get metadata by video ID
zget_get_local_path Get filesystem path for a video
zget_extract_info Extract metadata without downloading
zget_list_formats List available formats
zget_check_url Check if URL exists in library
zget_get_recent Get recently downloaded videos
zget_get_by_uploader Get videos by uploader/channel

Configuration

Add this to your agent's MCP config (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "zget": {
      "command": "uv",
      "args": ["run", "zget-mcp"],
      "cwd": "/path/to/your/zget",
      "env": {
        "PATH": "/opt/homebrew/bin:/usr/bin:/bin"
      }
    }
  }
}

Replace /path/to/your/zget with the actual path where you cloned the repository.

Run Standalone

uv run zget-mcp

Troubleshooting

"Connection Refused" on TikTok

If TikTok downloads fail with 0.0.0.0 or Connection Refused, check your Pi-hole or router. TikTok uses CNAME chains that may be blocked.

Required whitelist domains:

  • vm.tiktok.com.edgesuite.net
  • www.tiktok.com.edgesuite.net
  • a2047.r.akamai.net

Server Not Starting

Check if another process is using port 9989:

lsof -i :9989

Kill the conflicting process or use a different port:

uv run zget-server --port 8080

Mobile Can't Connect

  1. Verify Tailscale is running: tailscale status
  2. Ensure both devices are logged into the same Tailscale account
  3. Try accessing via IP instead of hostname: http://100.x.y.z:9989

Architecture

src/zget/
├── server/           # FastAPI backend + Web Components frontend
├── mcp/              # Model Context Protocol server
├── library/          # Video ingest pipeline (ingest, export, thumbnails)
├── queue/            # Async download queue manager
├── db/               # SQLite FTS5 database (async_store, store, models)
├── metadata/         # NFO sidecar generation
├── commands/         # CLI subcommands
├── core.py           # yt-dlp wrapper (download, extract_info)
├── config.py         # Centralized configuration and path constants
├── types.py          # Project-local yt-dlp type aliases (YtdlpInfo, ProgressDict)
├── cookies.py        # Browser cookie extraction for yt-dlp
├── net.py            # Tailscale IP detection for Secure Mesh
├── health.py         # Self-diagnostics and health logging
├── smokescreen.py    # Platform health verification engine (yt-dlp --simulate)
├── regions.py        # Geographic site filtering and regional collections
├── safe_delete.py    # Trash-based file deletion (send2trash wrapper)
├── utils.py          # Shared utilities (sanitize_filename, MIME)
└── cli.py            # Main CLI entry point

Acknowledgments

zget is built on yt-dlp and was developed with assistance from Gemini.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选