Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medba Downloader

Medba Downloader is an open-source YouTube Downloader web app. Paste a YouTube URL, pick a quality, and download MP4, MP3, or thumbnail files in seconds. No accounts, no database, no dashboard.

GitHub repo size GitHub license

Screenshots

Light Mode

Light Mode

Dark Mode

Dark Mode

Format Selection

Formats

Arabic Support

Arabic

Fully responsive

Responsive

Features

  • Fast single-page YouTube Downloader UI
  • Download YouTube videos as MP4 qualities with merged audio
  • Download YouTube audio as MP3
  • Download original YouTube thumbnail
  • English/Arabic language toggle
  • Light/Dark theme toggle
  • Friendly and readable error messages
  • Temporary file cleanup after streaming download

Tech Stack

  • Frontend: React Vite
  • Backend: Node.js !Express.js
  • Download engine: yt-dlp
  • Media processing: FFmpeg

Project Structure

medba-downloader/
├── client/
│   ├── public/
│   │   └── assets/
│   │       └── favicon.png
│   ├── src/
│   │   ├── App.jsx
│   │   ├── index.css
│   │   └── main.jsx
│   ├── index.html
│   ├── package.json
│   └── vite.config.js
├── server/
│   ├── scripts/
│   │   └── dev.js
│   ├── routes/
│   │   ├── download.js
│   │   └── formats.js
│   ├── tmp/
│   ├── package.json
│   └── server.js
├── .env.example
└── README.md

Requirements

Node.js npm yt-dlp FFmpeg

Built and tested on: Fedora

Setup by OS

Linux (general)

Install ffmpeg, python3, and pip with your distro package manager, then install yt-dlp with pip.

Examples:

Ubuntu Debian

sudo apt update
sudo apt install -y ffmpeg python3-pip
python3 -m pip install yt-dlp

Fedora

sudo dnf install ffmpeg python3-pip
python3 -m pip install yt-dlp

Arch Linux

sudo pacman -S ffmpeg python-pip
python -m pip install yt-dlp

Windows

Install dependencies with winget:

winget install --id Gyan.FFmpeg -e
winget install --id Python.Python.3.12 -e
py -m pip install yt-dlp

Then restart terminal so ffmpeg and yt-dlp are available in PATH.

Quick Start

1) Install dependencies

cd server && npm install
cd ../client && npm install

2) Configure environment

Create backend env file:

cd server
cp ../.env.example .env

PowerShell alternative:

cd server
Copy-Item ..\.env.example .env

Optional client env (client/.env):

VITE_API_URL=http://localhost:5000
VITE_GITHUB_URL=https://github.com/med6ba/medba-downloader

3) Run the app

From the project root, run:

npm run dev

Open: http://localhost:5173

You now have Medba Downloader running locally as a full YouTube Downloader web app.

Environment Variables

From .env.example:

PORT=5000
CLIENT_ORIGIN=http://localhost:5173
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX=120
YTDLP_TIMEOUT_MS=120000
REMOTE_FETCH_TIMEOUT_MS=15000
VITE_API_URL=http://localhost:5000

Notes:

  • PORT and CLIENT_ORIGIN are used by the backend.
  • RATE_LIMIT_WINDOW_MS and RATE_LIMIT_MAX control API rate limiting.
  • YTDLP_TIMEOUT_MS and REMOTE_FETCH_TIMEOUT_MS control network/process timeouts.
  • VITE_API_URL is used by the frontend and should be set in client/.env if needed.

API Endpoints

Base URL: http://localhost:5000

POST /api/formats

Returns available MP4 qualities for a YouTube URL in Medba Downloader.

Request body:

{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID"
}

Response:

{
  "title": "Video Title",
  "formats": [
    {
      "formatId": "137",
      "quality": "1080p",
      "hasAudio": false
    }
  ]
}

GET /api/download/video

Downloads MP4 file.

Query params:

  • url (required): YouTube URL
  • formatId (required): format id from /api/formats
  • hasAudio (required): true or false (controls direct format vs merge with best audio)
  • title (optional): preferred output filename base

GET /api/download/mp3

Downloads MP3 file.

Query params:

  • url (required): YouTube URL
  • title (optional): preferred output filename base

GET /api/download/thumbnail

Downloads best available thumbnail.

Query params:

  • url (required): YouTube URL
  • title (optional): preferred output filename base

Implementation Notes

  • YouTube URL validation on backend routes for safer YouTube Downloader requests
  • yt-dlp invoked with spawn for safer process handling
  • Request size limit + API rate limiting are enabled server-side
  • Security headers are enabled (X-Frame-Options, nosniff, Referrer-Policy, etc.)
  • Downloads are streamed directly to browser
  • Temporary files are auto-deleted after stream finish/close
  • Content-Disposition uses UTF-8 safe filename handling

Security & Privacy

  • Do not commit real .env files, API keys, tokens, cookies, or personal data.
  • Keep only .env.example in GitHub.
  • server/tmp is excluded from Git and should never contain committed media.
  • Before pushing, run:
git status

and verify no sensitive files are staged.

Legal Notice

This tool is for personal/authorized use only. Users are responsible for complying with YouTube Terms of Service and applicable copyright laws. Medba Downloader is an independent open-source project and is not affiliated with YouTube or Google.

Stars Forks

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages