A blazing-fast HTTP API for downloading video and audio from multiple sites with automatic cleanup, file serving, and a modern web interface!
This project provides a robust HTTP API for downloading video and audio from multiple sites using yt-dlp, built with Rust and Axum for maximum performance and reliability.
Public examples from these sources have been downloaded and decoded by FFmpeg in the live test suite:
| Source | Verified media |
|---|---|
| YouTube | Video with audio |
| TikTok | Video |
| Public reel | |
| SoundCloud | Audio track |
| Public video | |
| X / Twitter | Public video |
| Video with separate audio and silent video |
These checks confirm the tested examples. Individual posts can require login, expire, or become unavailable. Other yt-dlp sources may work, but are not part of this confirmed list.
If a source is broken, open an issue with a public URL, the Snatchr revision, your yt-dlp binary version, and the error. We will investigate and fix it. Remove cookies, tokens, and signed CDN URLs from any logs you share.
Snatchr uses our Rust wrapper fork, based on boul2gom/yt-dlp, together with the Python yt-dlp binary. Python yt-dlp supplies the site extractors. The Rust fork fixes how Snatchr reads metadata, selects formats, and downloads media: optional metadata, decimal durations and timestamps, unlabeled MP4 formats, protected CDN requests, DASH/HLS merging, silent video, audio-only sources, and output-directory handling.
The fork retains upstream improvements while keeping these compatibility fixes. The crates.io package does not include our fork changes. Snatchr's Git dependency and Cargo.lock select the wrapper revision; the downloaded Python binary has its own version.
|
Powered by yt-dlp with concurrent downloads and optimized performance settings. |
Direct HTTP access to downloaded files with streaming support. |
|
Beautiful, responsive web UI with video preview, download history, and drag-and-drop support. |
Choose video/audio quality, codecs, and format preferences through environment configuration. |
|
Automated cleanup of old downloads with configurable retention periods and scheduling. |
Reuse completed media by source ID while it remains cached. |
|
Detailed request tracking, error handling, and performance monitoring with structured logging. |
Unique job IDs for each request with full traceability from HTTP handler to download completion. |
- Rust with the current stable toolchain (edition 2024 and locked dependencies)
Snatchr includes a beautiful, modern web interface for easy video downloading!
Snatchr_WebUI.mp4
- 🎬 Instant Video Preview - Watch downloaded videos directly in the browser with our sleek video player
- 📋 Smart Download History - Keep track of all your previous downloads with timestamps and file info
- 🎨 Modern & Responsive - Beautiful design that works perfectly on desktop, tablet, and mobile
- ⚡ Lightning-Fast - Just paste a supported media URL and watch your video download in seconds
- 🎯 One-Click Downloads - No complex settings, just pure simplicity and speed
- Start your Snatchr server
- Open your browser and navigate to
http://localhost:3000 - Paste a supported video or audio URL in the elegant input field
- Click "Download Video" and watch the magic happen!
- 📋 Clipboard Integration - Use the "Paste" button for instant URL pasting from your clipboard
- 🎬 Instant Preview - Downloaded videos appear immediately in the video player for instant gratification
- 📱 Mobile-First - The interface is optimized for mobile devices with touch-friendly controls
- 🔄 Auto-Refresh - The interface automatically updates to show your latest downloads
If you're running locally and your server is bound to 0.0.0.0, some browsers and extensions may block video playback. Use localhost in your browser URL instead of 0.0.0.0 for the best experience.
You can disable the web interface by setting the environment variable:
ENABLE_WEB_UI=falseWhen disabled, only the API endpoints will be available.
Download videos directly from your Apple device with our iOS Shortcut integration!
🔗 Download: Snatchr iOS Shortcut
-
Configure Server URL: After downloading, open the shortcut and set
EXTERNAL_URLin the dictionary at the top to your own Snatchr server URL- Include the
/downloadendpoint (e.g.,https://your-server.com/download)
- Include the
-
Codec Compatibility: For automatic saving to your photo gallery, ensure your Snatchr instance uses compatible codecs:
- Video:
AVC1(recommended) - Audio:
AAC(recommended)
- Video:
-
Alternative Save Method: If you experience issues with gallery saving, edit the shortcut and change
Save URL to RecentstoSave Fileinstead
Note: This shortcut is currently in beta. Please report any issues on our GitHub Issues page.
🐳 Deploy with Docker
1. Download the docker-compose.yml file or clone the repository:
git clone https://github.com/Valhalla-Development/Snatchr.git
cd Snatchr-
Review and modify the environment variables in docker-compose.yml if needed (PORT, DOWNLOAD_DIR, etc.)
-
Run with Docker Compose:
docker-compose up -d
-
The server will be available at http://localhost:3000
🚀 Build Locally (Rust)
1. Download the latest release or clone the repository:
git clone https://github.com/Valhalla-Development/Snatchr.git-
Navigate to the project directory:
cd Snatchr -
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Rename or copy the
.env.example>.envand fill in the required variables. -
Build the project:
cargo build --release
-
Run the server:
cargo run --release
curl -X POST "http://localhost:3000/download" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'Response:
{
"success": true,
"file_url": "http://localhost:3000/files/dQw4w9WgXcQ/file_name.mp4"
}Send one public media URL in the url field. Snatchr downloads one item rather than a playlist. Video responses normally point to an MP4; audio-only sources such as SoundCloud retain the selected audio container, for example M4A. Use the returned file_url instead of assuming a file extension.
Check the JSON success field. Download errors can return HTTP 200 with success: false and an error message. A successful response means the file is available at the returned URL until cleanup removes it.
The server automatically cleans up old downloads based on your CLEANUP_AFTER_MINUTES setting. Cleanup runs periodically in the background and logs all operations.
Snatchr features intelligent video caching that dramatically improves performance:
- Video ID Caching: Media is stored using a platform ID extracted from the URL when possible, otherwise the canonical ID returned by yt-dlp
- Instant Returns: If completed media is already cached, it's returned immediately without re-downloading
- Bandwidth Savings: Reuse downloads until cleanup removes them
- Basic Validation: Incomplete temporary files and files below the minimum size are excluded from cache hits
downloads/
├── dQw4w9WgXcQ/ # Video ID directory
│ └── video_title.mp4 # Cached video file
├── zwMEhBq4kYM/ # Another video ID
│ └── another_video.mp4
└── cache/ # System cache (preserved)
- First Download: Normal speed (downloads and caches)
- Subsequent Downloads: Instant! (returns cached file)
- Multiple Users: Share cached content across all users
- Server Efficiency: Reduced bandwidth and processing load
Run the regular regression tests:
cargo test --lockedThe opt-in tests download actual public examples from all seven confirmed sources, decode the media with libs/ffmpeg, and verify cache reuse. Reddit includes both an audio/video example and a silent example. Ensure libs/yt-dlp and libs/ffmpeg are installed, then run serially because the tests temporarily change process-wide configuration:
cargo test --locked downloads_real_ -- --ignored --test-threads=1To replace an expired public example, set SNATCHR_TEST_YOUTUBE_URL, SNATCHR_TEST_TIKTOK_URL, SNATCHR_TEST_INSTAGRAM_URL, SNATCHR_TEST_SOUNDCLOUD_URL, SNATCHR_TEST_FACEBOOK_URL, SNATCHR_TEST_X_URL, SNATCHR_TEST_REDDIT_URL, or SNATCHR_TEST_REDDIT_SILENT_URL. Live checks are ignored by default because site availability can change independently of Snatchr.
We welcome contributions to improve Snatchr! If you'd like to contribute:
- Fork the repository
- Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
- Make your changes and commit them with a clear, descriptive message:
git commit -m '✨ (downloads): Add support for a source' - Push your changes to your fork:
git push origin feature/your-feature-name
- Open a Pull Request against the main repository's
mainbranch
Please ensure your code adheres to the project's coding standards and include tests for new features or bug fixes where applicable. We appreciate detailed descriptions in your Pull Request to help with the review process.
This project is licensed under the GPL-3.0 License - see the LICENSE file for details. (It's mostly "Share the love, and keep it open!")
- yt-dlp for the powerful video download engine
- Axum for the high-performance web framework
- Tokio for the async runtime
- Rust for the blazing-fast and memory-safe foundation
- All contributors who help improve this project
We're constantly working to make Snatchr even better! Here's what we're cooking up:
- 🌐 More Confirmed Sources - Expand live coverage and fix reported source failures
Have a feature request or idea? We'd love to hear it! Open an issue or join our Discord to discuss.
Got questions or need help? Join our Discord server for support and to connect with other bot developers!
💻 Crafted with ❤️ by Valhalla-Development