Skip to content

jtechbyte/grabster

Repository files navigation

GrabSter

Self-hosted media downloader and converter β€” download videos from YouTube, Vimeo, and 1000+ other sites. Built for security, clean deployment, and easy self-hosting.

License Docker Python


Features

  • πŸ“₯ Download video and audio from YouTube and 1000+ sites (via yt-dlp)
  • 🎬 Convert uploaded video files with FFmpeg (mp4, mkv, webm, mp3, m4a, and more)
  • πŸ“š Library β€” tag downloads into a personal video library with a built-in player
  • πŸ‘€ Multi-user β€” admin panel, user management, role-based access control
  • πŸ”’ Secure by default β€” JWT auth, HttpOnly cookies, strict security headers, rate limiting
  • 🐳 Docker-first β€” one command to deploy

Screenshots

Login Dashboard
Login page Dashboard
Video Fetcher My Library
Video fetcher Library

Tech Stack

Layer Technology
Backend FastAPI (Python 3.11)
Auth JWT (python-jose) + PBKDF2-SHA256
Database SQLite
Downloader yt-dlp
Converter FFmpeg
Frontend Vanilla JS + Jinja2 HTML
Deployment Docker + Docker Compose

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Browser Client            β”‚
β”‚  (Vanilla JS, WebSocket for progress)β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚ HTTPS
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         FastAPI Application          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚  β”‚ Auth/JWT β”‚  β”‚ Download Manager  β”‚β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  (yt-dlp worker)  β”‚β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β”‚  β”‚ Settings β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚ Convert Manager   β”‚β”‚
β”‚                β”‚  (FFmpeg worker)  β”‚β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β”‚  β”‚ SQLite   β”‚                        β”‚
β”‚  β”‚ (data/)  β”‚                        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data is persisted in Docker volumes and never stored in the container image.


Quick Start (Docker)

Prerequisites

  • Docker and Docker Compose v2+
  • A machine with internet access

Deploy in 3 steps

# 1. Clone the repository
git clone https://github.com/your-username/grabster.git
cd grabster

# 2. Configure environment
cp .env.example .env

Edit .env and set a strong SECRET_KEY:

# Generate a secure key:
openssl rand -hex 32
# 3. Start GrabSter
docker compose up -d

# Then open: http://localhost:8001

On first launch, register a new account. The first registered user is automatically made an Admin. If you need to manually promote another user to admin via the command line, run:

docker exec -it grabster sqlite3 /app/data/app.db "UPDATE users SET role = 'admin' WHERE username = 'YOUR_USERNAME';"

Environment Variables

All configuration is done via environment variables in your .env file.

Variable Required Default Description
SECRET_KEY βœ… Yes β€” JWT signing secret. Generate with openssl rand -hex 32.
PORT No 8000 Host port to bind.
DEBUG No false Enables /docs, /redoc, verbose logging. Off in prod.
DB_PATH No data/app.db Path to SQLite database file.
DOWNLOAD_DIR No downloads Note: Managed internally via Settings UI (DB).
CONVERT_DIR No converted Directory for FFmpeg output files.
COOKIE_SECURE No false Set to true if hosting behind an HTTPS TLS reverse proxy.

Development

cp .env.example .env
# Set DEBUG=true, COOKIE_SECURE=false, SECRET_KEY=any-dev-string

docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build
# App runs on http://localhost:8001 with live reload

See CONTRIBUTING.md for full local setup instructions.


Security

GrabSter is designed and hardened for self-hosted deployments:

  • πŸ”‘ JWT tokens signed with a user-provided secret key (required, no defaults)
  • πŸ”’ HttpOnly + SameSite cookies β€” tokens are not accessible via JavaScript
  • πŸ›‘οΈ Security headers on every response (CSP, HSTS, X-Frame-Options, X-Content-Type-Options)
  • 🚦 Rate limiting β€” 5 login attempts per IP per minute
  • 🚫 Debug endpoints disabled in production (no /docs, /openapi.json)
  • πŸ‘€ Non-root Docker container user (uid 1000)
  • πŸ—‚οΈ Input validation with allowlists for file conversion formats

Recommendation: Place GrabSter behind a reverse proxy (e.g., nginx or Caddy) with TLS. Do not expose it directly to the public internet without additional authentication.


Volumes & Data

All user data lives in Docker volumes, not in the image. On a docker compose down, your data is preserved. To fully reset, remove the local directories:

data/       ← SQLite database
downloads/  ← Downloaded media
converted/  ← Converted output files
uploads/    ← Temporary upload staging (auto-cleared)

License

MIT License β€” free to use, modify, and self-host.


Reporting Security Issues

See SECURITY.md. Please do not open public GitHub issues for security vulnerabilities.

About

Self-hosted media downloader and converter. Built with FastAPI, yt-dlp, and FFmpeg.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors