Skip to main content

Download audio/videos from the internet!

Project description

Media Downloader - A2A & MCP Server

PyPI - Version 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.1.13

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!
Usage:

CLI

Short Flag Long Flag Description
-h --help See usage
-a --audio Download audio only
-c --channel YouTube Channel/User - Downloads all videos
-f --file File with video links
-l --links Comma separated links
-d --directory Location to save videos
media-downloader --file "C:\Users\videos.txt" --directory "C:\Users\Downloads" --channel "WhiteHouse" --links "URL1,URL2,URL3"

MCP CLI

Short Flag Long Flag Description
-h --help Display help information
-t --transport Transport method: 'stdio', 'http', or 'sse' [legacy] (default: stdio)
-s --host Host address for HTTP transport (default: 0.0.0.0)
-p --port Port number for HTTP transport (default: 8000)
--auth-type Authentication type: 'none', 'static', 'jwt', 'oauth-proxy', 'oidc-proxy', 'remote-oauth' (default: none)
--token-jwks-uri JWKS URI for JWT verification
--token-issuer Issuer for JWT verification
--token-audience Audience for JWT verification
--oauth-upstream-auth-endpoint Upstream authorization endpoint for OAuth Proxy
--oauth-upstream-token-endpoint Upstream token endpoint for OAuth Proxy
--oauth-upstream-client-id Upstream client ID for OAuth Proxy
--oauth-upstream-client-secret Upstream client secret for OAuth Proxy
--oauth-base-url Base URL for OAuth Proxy
--oidc-config-url OIDC configuration URL
--oidc-client-id OIDC client ID
--oidc-client-secret OIDC client secret
--oidc-base-url Base URL for OIDC Proxy
--remote-auth-servers Comma-separated list of authorization servers for Remote OAuth
--remote-base-url Base URL for Remote OAuth
--allowed-client-redirect-uris Comma-separated list of allowed client redirect URIs
--eunomia-type Eunomia authorization type: 'none', 'embedded', 'remote' (default: none)
--eunomia-policy-file Policy file for embedded Eunomia (default: mcp_policies.json)
--eunomia-remote-url URL 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 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.

A2A CLI

Long Flag Description Default
--host Host to bind the server to 0.0.0.0
--port Port to bind the server to 8000
--reload Enable auto-reload False
--provider LLM Provider (openai, anthropic, google, etc) openai
--model-id LLM Model ID qwen3:4b
--base-url LLM Base URL (for OpenAI compatible providers) http://ollama.arpa/v1
--api-key LLM API Key ollama
--mcp-url MCP Server URL to connect to http://media-downloader-mcp.arpa/mcp
--allowed-tools List of allowed MCP tools download_media

Run A2A Server

media-downloader-a2a --provider openai --model-id qwen2.5:7b --mcp-url http://localhost:8004/mcp

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
    }
  }
}
Installation Instructions:

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

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

media_downloader-2.1.13.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

media_downloader-2.1.13-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file media_downloader-2.1.13.tar.gz.

File metadata

  • Download URL: media_downloader-2.1.13.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for media_downloader-2.1.13.tar.gz
Algorithm Hash digest
SHA256 a8d74da37801a71a9df6624a229a3d90337fdb47e7fb21adf8f0e10db481b6a0
MD5 35bc5c9682c0eef1c01c470d6494f330
BLAKE2b-256 9f9c48c8f2ca0bf48044abf2ed10e3a8c2aba7f7a13650deaf90398338044300

See more details on using hashes here.

File details

Details for the file media_downloader-2.1.13-py3-none-any.whl.

File metadata

File hashes

Hashes for media_downloader-2.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 64d9f798ec4118fb1ac41b065da7d3836d278ffe2968bf276bcd3957f474090b
MD5 a3afee3e8e80f3fe02aa2089bea6ff88
BLAKE2b-256 2eb423e64d35776a653d36cc156a98608f48b7bb87590a739a507058f08a8adf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page