mk-youtube-get-audio
Original:🇺🇸 English
Translated
7 scripts
Download YouTube video audio file. Use when user wants to extract audio or download music/podcast from a video.
15installs
Added on
NPX Install
npx skill4agent add kouko/monkey-knowledge-youtube-skills mk-youtube-get-audioTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →YouTube Audio Download
Download video audio file (best available format, no conversion).
Quick Start
/mk-youtube-get-audio <URL> [output_dir] [browser] [--force]Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
| URL | Yes | - | YouTube video URL |
| output_dir | No | /tmp/monkey_knowledge/youtube/audio | Output directory for audio file |
| browser | No | auto | Browser for cookies (chrome, firefox, safari, edge, brave) |
| --force | No | false | Force re-download even if cached file exists |
Examples
- - Download with auto cookie fallback
/mk-youtube-get-audio https://youtube.com/watch?v=xxx - - Save to custom directory
/mk-youtube-get-audio https://youtube.com/watch?v=xxx ~/Music - - Use Chrome cookies
/mk-youtube-get-audio https://youtube.com/watch?v=xxx /tmp chrome
How it Works
- Execute:
{baseDir}/scripts/audio.sh "<URL>" "<output_dir>" "<browser>" - First attempt: download without authentication
- If failed: retry with browser cookies (auto-detect or specified)
- Parse JSON output to get file path
┌─────────────────────────────┐
│ First attempt (no auth) │
└──────────────┬──────────────┘
│
┌───────┴───────┐
│ │
Success Failed
│ │
▼ ▼
[Return] ┌─────────────────────┐
│ Retry with cookies │
│ chrome → firefox → │
│ safari → edge → │
│ brave │
└──────────┬──────────┘
│
┌───────┴───────┐
│ │
Success Failed
│ │
▼ ▼
[Return] [Error]Output Format
Success:
json
{
"status": "success",
"file_path": "/tmp/monkey_knowledge/youtube/audio/20091025__VIDEO_ID.m4a",
"file_size": "5.2M",
"cached": false,
"video_id": "dQw4w9WgXcQ",
"title": "Video Title",
"channel": "Channel Name",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"duration_string": "3:32"
}Cache hit (returns existing file):
json
{
"status": "success",
"file_path": "/tmp/monkey_knowledge/youtube/audio/20091025__VIDEO_ID.m4a",
"file_size": "5.2M",
"cached": true,
...
}Error:
json
{
"status": "error",
"message": "Download failed (tried with and without cookies)"
}Filename Format
Files use unified naming with date prefix:
{YYYYMMDD}__{video_id}.{ext}Example:
20091025__dQw4w9WgXcQ.m4aBrowser Cookie Fallback
When download fails (e.g., member-only or age-restricted content), the script automatically:
- Tries each browser: chrome → firefox → safari → edge → brave
- For Chrome: tries all profiles (Default, Profile 1, Profile 2, ...)
- Uses first successful browser/profile combination
Supported browsers:
| Browser | Parameter | Chrome Profile Support |
|---|---|---|
| Chrome | | Yes (auto-detect all profiles) |
| Firefox | | Default profile only |
| Safari | | Default profile only |
| Edge | | Default profile only |
| Brave | | Default profile only |
Use Cases
- Download audio for speech-to-text when video has no subtitles
- Podcast or music download
- Member-only or age-restricted content (with browser cookies)
Notes
- File caching: If audio file already exists for this video, it will be reused (returns )
cached: true - Force refresh: Use flag to re-download even if cached file exists
--force - Uses system yt-dlp/jq if available, otherwise auto-downloads on first run
- No ffmpeg required (uses best available format without conversion)
- Output format depends on source (typically m4a, webm, or opus)
- Cookie fallback only activates when initial download fails
- Using cookies may risk YouTube account suspension - use secondary account if needed
Next Step
After downloading the audio, invoke with the from the output:
/mk-youtube-audio-transcribefile_path/mk-youtube-audio-transcribe <file_path> [model] [language]Tip: If you know the video's language from , pass it as the language parameter for better model auto-selection (e.g., → belle-zh, → kotoba-ja).
/mk-youtube-get-infozhja