Skip to main content

Download audio/videos from the internet!

Project description

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.22

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 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.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 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
--web Enable Pydantic AI Web UI False

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

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.2.22.tar.gz (26.9 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.2.22-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: media_downloader-2.2.22.tar.gz
  • Upload date:
  • Size: 26.9 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.2.22.tar.gz
Algorithm Hash digest
SHA256 057a33c58e0d83e6a6005b58206513e48a868b3cd7adb599a65d41f8715b79a6
MD5 bc666980e778dfd1990ce0783ffa8a70
BLAKE2b-256 4474b57efeb95aefd8bb4ee7976314c59592e7f286eba61446e3a485bdcf4db0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for media_downloader-2.2.22-py3-none-any.whl
Algorithm Hash digest
SHA256 c239a8928a6389cccca8467927d96ad01c9d38fd629deb7591b19992bc763993
MD5 7b723ca6e8e1bb5a009b8a06997a8c95
BLAKE2b-256 4cae94204f4136cb55aca1c5d660d44dba61357a4031b3bf5a2eecd209ce41b9

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