universal-media-downloader

Original🇨🇳 Chinese
Translated
1 scriptsChecked / no sensitive code detected

Automatically download corresponding media files and deliver them to users after inputting links from various video websites/podcast platforms. Prioritizes using yt-dlp to cover common video websites such as Douyin, Bilibili, YouTube, etc., and can also be used for podcast platforms that directly expose audio addresses (e.g., single episode links from Xiaoyuzhou). When encountering 403/login/age or regional restrictions, it supports retrying with cookies.txt; for platforms that may have DRM/encryption or terms restrictions (such as some Spotify content), users should be prompted to only download content they are authorized to save, and if download is not possible, suggest switching to official offline/export channels or providing original RSS/direct links.

5installs
Added on

NPX Install

npx skill4agent add cat-xierluo/legal-skills universal-media-downloader

SKILL.md Content (Chinese)

View Translation Comparison →

Universal Media Downloader (General Video/Podcast Download)

Scope of Application

Prioritized Coverage (Usually Directly Usable)
  • Douyin: Sharing/video links like
    douyin.com
    ,
    v.douyin.com
    , etc.
  • Bilibili: Links like
    bilibili.com
    ,
    b23.tv
    , etc.
  • YouTube:
    youtube.com
    ,
    youtu.be
  • And other websites supported by yt-dlp (a large number)
Podcast Platforms
  • Xiaoyuzhou (Single Episode/Program Page): Audio can usually be downloaded directly in most cases (yt-dlp is usually applicable)
  • Other podcast platforms: If the page can parse out direct audio links, downloads are usually possible
Compliance Note: Only use to download content you are authorized to save (e.g., content you uploaded/own copyright for/obtained authorization for/platform allows offline access to). Do not attempt to bypass when encountering DRM/encryption or platform restrictions.

Quick Start

1) Download Video (Default)

  • Command:
    • python scripts/download_media.py "<URL>"
  • Default save directory:
    • The
      downloads/
      folder under the skill directory (self-contained)
    • Custom output path can be set via the
      --out-dir
      parameter

2) Download Audio Only (Suitable for Podcasts / Only Want MP3)

  • Command:
    • python scripts/download_media.py --audio-only --audio-format mp3 "<URL>"

3) Encounter 403 / Need Login / Risk Control Block: Retry with Cookies

  • Ask users to provide Netscape format
    cookies.txt
    exported from the browser
  • Then retry:
    • python scripts/download_media.py --cookies "/path/to/cookies.txt" "<URL>"

4) Proxy Required (Optional)

  • Example:
    • --proxy "socks5://127.0.0.1:7890"

5) Specify Download Path

  • Users can specify the save location via natural language, and the AI should automatically convert it to the
    --out-dir
    parameter
  • Examples:
    • User says "Download to desktop" →
      --out-dir ~/Desktop
    • User says "Save to Videos/bilibili" →
      --out-dir "~/Videos/bilibili"
    • User says "Download to this folder" (specify a path) → Use the absolute path specified by the user
  • Note: Ensure the target directory exists; if not, it can be created automatically

Platform Differences and Restrictions (Important)

  • YouTube/Bilibili/Douyin:
    • Common failure reasons: Age restrictions, regional restrictions, frequent requests triggering risk control, need for login
    • Handling methods: Use cookies, proxy, or reduce concurrency/retry after waiting
    • Additional YouTube note: If a Signature solving failed / JS challenge warning appears, follow yt-dlp's EJS guidelines to enable the challenge-solving component (e.g., add
      --remote-components ejs:github
      ), or ask the user to provide cookies
  • Spotify:
    • Content on Spotify may have DRM, account permission/subscription restrictions, and "downloading" may violate platform terms.
    • This skill does not guarantee that Spotify links can be downloaded for sure.
    • Viable alternatives:
      • Use official offline functions (if provided by the platform)
      • Provide the RSS/audio direct link of the podcast (if you own/obtain it), then use this script to download

Bundled scripts

  • scripts/download_media.py
    • General downloader based on
      yt-dlp
    • Output: Last line
      SAVED_FILEPATH=...
      when successful
    • AI Usage Guide: When users specify a save path, automatically use the
      --out-dir
      parameter
    • Parameters:
      • url
        (required)
      • --audio-only
        /
        --audio-format
      • --subtitles
        (optional, automatically downloads subtitles)
      • --sub-lang
        (optional, subtitle language, default is all)
      • --cookies
        (optional)
      • --proxy
        (optional)
      • --out-dir
        (optional, custom output directory)

Dependencies

System Dependencies

DependencyInstallation Method
yt-dlp
pip install yt-dlp
ffmpeg
(optional, used for subtitle extraction and audio conversion)
macOS:
brew install ffmpeg
<br>Linux:
sudo apt-get install ffmpeg

Python Packages

No additional Python dependencies required;
yt-dlp
already includes the necessary libraries.