media-downloader

Knuckles-Team/media-downloader

3.3

If you are the rightful owner of media-downloader and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

Media Downloader is a versatile tool designed to download videos and audio from various online platforms, supporting both CLI and MCP server functionalities.

Tools
1
Resources
0
Prompts
0

Media Downloader - A2A | AG-UI | MCP

PyPI - Version MCP Server PyPI - Downloads GitHub Repo stars GitHub forks GitHub contributors PyPI - License GitHub

GitHub last commit (by committer) GitHub pull requests GitHub closed pull requests GitHub issues

GitHub top language GitHub language count GitHub repo size GitHub repo file count (file type) PyPI - Wheel PyPI - Implementation

Version: 2.2.21

Overview

Download videos and audio from the internet!

This package comes ready with an MCP Server and an A2A Server so you can plug this Agent into any of your existing agentic framework!

You can also plug in the MCP Server directly to your own agent if you prefer!

This repository is actively maintained - Contributions are welcome!

Supports:

  • YouTube
  • Twitter
  • Rumble
  • BitChute
  • Vimeo
  • And More!

This requires a javascript runtime. However, the container is fully baked and ready to go!

Usage

CLI

Short FlagLong FlagDescription
-h--helpSee usage
-a--audioDownload audio only
-c--channelYouTube Channel/User - Downloads all videos
-f--fileFile with video links
-l--linksComma separated links
-d--directoryLocation to save videos
media-downloader --file "C:\Users\videos.txt" --directory "C:\Users\Downloads" --channel "WhiteHouse" --links "URL1,URL2,URL3"

MCP CLI

Short FlagLong FlagDescription
-h--helpDisplay help information
-t--transportTransport method: 'stdio', 'http', or 'sse' [legacy] (default: stdio)
-s--hostHost address for HTTP transport (default: 0.0.0.0)
-p--portPort number for HTTP transport (default: 8000)
--auth-typeAuthentication type: 'none', 'static', 'jwt', 'oauth-proxy', 'oidc-proxy', 'remote-oauth' (default: none)
--token-jwks-uriJWKS URI for JWT verification
--token-issuerIssuer for JWT verification
--token-audienceAudience for JWT verification
--oauth-upstream-auth-endpointUpstream authorization endpoint for OAuth Proxy
--oauth-upstream-token-endpointUpstream token endpoint for OAuth Proxy
--oauth-upstream-client-idUpstream client ID for OAuth Proxy
--oauth-upstream-client-secretUpstream client secret for OAuth Proxy
--oauth-base-urlBase URL for OAuth Proxy
--oidc-config-urlOIDC configuration URL
--oidc-client-idOIDC client ID
--oidc-client-secretOIDC client secret
--oidc-base-urlBase URL for OIDC Proxy
--remote-auth-serversComma-separated list of authorization servers for Remote OAuth
--remote-base-urlBase URL for Remote OAuth
--allowed-client-redirect-urisComma-separated list of allowed client redirect URIs
--eunomia-typeEunomia authorization type: 'none', 'embedded', 'remote' (default: none)
--eunomia-policy-filePolicy file for embedded Eunomia (default: mcp_policies.json)
--eunomia-remote-urlURL for remote Eunomia server

Using as an MCP Server

The MCP Server can be run in two modes: stdio (for local testing) or http (for networked access). To start the server, use the following commands:

Run in stdio mode (default):
media-downloader-mcp
Run in HTTP mode:
media-downloader-mcp --transport http --host 0.0.0.0 --port 8012

AI Prompt:

Download me this video: https://youtube.com/watch?askdjfa

AI Response:

Sure thing, the video has been downloaded to:

"C:\Users\User\Downloads\YouTube Video - Episode 1.mp4"

Use in Python

# Import library
from media_downloader.media_downloader import MediaDownloader

# Set URL of video/audio here
url = "https://YootToob.com/video"

# Instantiate vide_downloader_instance
video_downloader_instance = MediaDownloader()

# Set the location to save the video
video_downloader_instance.set_save_path("C:/Users/you/Downloads")

# Add URL to download
video_downloader_instance.append_link(url)

# Download all videos appended
video_downloader_instance.download_all()
# Optional - Set Audio to True, Default is False if unspecified.
video_downloader_instance.set_audio(audio=True)

# Optional - Open a file of video/audio URL(s)
video_downloader_instance.open_file("FILE")

# Optional - Enter a YouTube channel name and download their latest videos
video_downloader_instance.get_channel_videos("YT-Channel Name")

Agent-to-Agent (A2A) Server

This package includes an Agent utilizing pydantic-ai that can be deployed as an A2A server. This agent is capable of using the media-downloader MCP server to fulfill media retrieval requests.

Endpoints
  • Web UI: http://localhost:8000/ (if enabled)
  • A2A: http://localhost:8000/a2a (Discovery: /a2a/.well-known/agent.json)
  • AG-UI: http://localhost:8000/ag-ui (POST)
A2A CLI
Long FlagDescriptionDefault
--hostHost to bind the server to0.0.0.0
--portPort to bind the server to8000
--reloadEnable auto-reloadFalse
--providerLLM Provider (openai, anthropic, google, etc)openai
--model-idLLM Model IDqwen3:4b
--base-urlLLM Base URL (for OpenAI compatible providers)http://ollama.arpa/v1
--api-keyLLM API Keyollama
--mcp-urlMCP Server URL to connect tohttp://media-downloader-mcp.arpa/mcp
--allowed-toolsList of allowed MCP toolsdownload_media
--webEnable Pydantic AI Web UIFalse
Run A2A Server
media-downloader-agent --provider openai --model-id qwen2.5:7b --mcp-url http://localhost:8004/mcp

Deploy A2A Server as a Service

docker run -e CMD=media-downloader-agent \
           -e PROVIDER=openai \
           -e MODEL_ID=qwen2.5:7b \
           -p 8000:8000 \
           my-media-downloader-image

Deploy MCP Server as a Service

The MCP server can be deployed using Docker, with configurable authentication, middleware, and Eunomia authorization.

Using Docker Run
docker pull knucklessg1/media-downloader:latest

docker run -d \
  --name media-downloader-mcp \
  -p 8004:8004 \
  -e HOST=0.0.0.0 \
  -e PORT=8004 \
  -e TRANSPORT=http \
  -e AUTH_TYPE=none \
  -e EUNOMIA_TYPE=none \
  -e DOWNLOAD_DIRECTORY=/downloads \
  -e AUDIO_ONLY=false \
  -v "/home/genius/Downloads:/downloads" \
  knucklessg1/media-downloader:latest

For advanced authentication (e.g., JWT, OAuth Proxy, OIDC Proxy, Remote OAuth) or Eunomia, add the relevant environment variables:

docker run -d \
  --name media-downloader-mcp \
  -p 8004:8004 \
  -e HOST=0.0.0.0 \
  -e PORT=8004 \
  -e TRANSPORT=http \
  -e AUTH_TYPE=oidc-proxy \
  -e OIDC_CONFIG_URL=https://provider.com/.well-known/openid-configuration \
  -e OIDC_CLIENT_ID=your-client-id \
  -e OIDC_CLIENT_SECRET=your-client-secret \
  -e OIDC_BASE_URL=https://your-server.com \
  -e ALLOWED_CLIENT_REDIRECT_URIS=http://localhost:*,https://*.example.com/* \
  -e EUNOMIA_TYPE=embedded \
  -e EUNOMIA_POLICY_FILE=/app/mcp_policies.json \
  -e DOWNLOAD_DIRECTORY=/downloads \
  -e AUDIO_ONLY=false \
  -v "/home/genius/Downloads:/downloads" \
  knucklessg1/media-downloader:latest
Using Docker Compose

Create a docker-compose.yml file:

services:
  media-downloader-mcp:
    image: knucklessg1/media-downloader:latest
    environment:
      - HOST=0.0.0.0
      - PORT=8004
      - TRANSPORT=http
      - AUTH_TYPE=none
      - EUNOMIA_TYPE=none
      - DOWNLOAD_DIRECTORY=/downloads
      - AUDIO_ONLY=false
    volumes:
      - "/home/genius/Downloads:/downloads"
    ports:
      - 8004:8004

For advanced setups with authentication and Eunomia:

services:
  media-downloader-mcp:
    image: knucklessg1/media-downloader:latest
    environment:
      - HOST=0.0.0.0
      - PORT=8004
      - TRANSPORT=http
      - AUTH_TYPE=oidc-proxy
      - OIDC_CONFIG_URL=https://provider.com/.well-known/openid-configuration
      - OIDC_CLIENT_ID=your-client-id
      - OIDC_CLIENT_SECRET=your-client-secret
      - OIDC_BASE_URL=https://your-server.com
      - ALLOWED_CLIENT_REDIRECT_URIS=http://localhost:*,https://*.example.com/*
      - EUNOMIA_TYPE=embedded
      - EUNOMIA_POLICY_FILE=/app/mcp_policies.json
      - DOWNLOAD_DIRECTORY=/downloads
      - AUDIO_ONLY=false
    ports:
      - 8004:8004
    volumes:
      - ./mcp_policies.json:/app/mcp_policies.json
      - "/home/genius/Downloads:/downloads"

Run the service:

docker-compose up -d
Configure mcp.json for AI Integration
{
  "mcpServers": {
    "media_downloader": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "media-downloader",
        "media-downloader-mcp"
      ],
      "env": {
        "DOWNLOAD_DIRECTORY": "~/Downloads", // Optional - Can be specified at prompt
        "AUDIO_ONLY": false // Optional - Can be specified at prompt
      },
      "timeout": 300000
    }
  }
}

Install Python Package

python -m pip install --upgrade media-downloader

or

uv pip install --upgrade media-downloader

Repository Owners

GitHub followers GitHub User's stars