universal-media-downloader
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.
NPX Install
npx skill4agent add cat-xierluo/legal-skills universal-media-downloaderTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Universal Media Downloader (General Video/Podcast Download)
Scope of Application
- Douyin: Sharing/video links like ,
douyin.com, etc.v.douyin.com - Bilibili: Links like ,
bilibili.com, etc.b23.tv - YouTube: ,
youtube.comyoutu.be - And other websites supported by yt-dlp (a large number)
- 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 folder under the skill directory (self-contained)
downloads/ - Custom output path can be set via the parameter
--out-dir
- The
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 formatexported from the browser
cookies.txt -
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 parameter
--out-dir - 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
- User says "Download to desktop" →
- 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 ), or ask the user to provide cookies
--remote-components ejs:github
-
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 when successful
SAVED_FILEPATH=... - AI Usage Guide: When users specify a save path, automatically use the parameter
--out-dir - Parameters:
- (required)
url - /
--audio-only--audio-format - (optional, automatically downloads subtitles)
--subtitles - (optional, subtitle language, default is all)
--sub-lang - (optional)
--cookies - (optional)
--proxy - (optional, custom output directory)
--out-dir
- General downloader based on
Dependencies
System Dependencies
| Dependency | Installation Method |
|---|---|
| |
| macOS: |
Python Packages
yt-dlp