From 3d881785d5f8f036a6b13cc821ef21a1d4f5cdc5 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Thu, 9 Apr 2026 18:16:34 +0100 Subject: [PATCH] wip --- .../claude/commands/download-playlist.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 home/common/programs/claude/commands/download-playlist.md diff --git a/home/common/programs/claude/commands/download-playlist.md b/home/common/programs/claude/commands/download-playlist.md new file mode 100644 index 0000000..aaa4ff1 --- /dev/null +++ b/home/common/programs/claude/commands/download-playlist.md @@ -0,0 +1,20 @@ +Download a music playlist for "aulas de música" (kids music classes). + +The user will paste the content of a monthly playlist from the teacher. Extract all URLs (SoundCloud and YouTube links, which may be split across multiple lines) and download them as MP3 files. + +## Steps + +1. Parse the pasted content to extract all URLs. Links are often split across lines — reconstruct them by joining consecutive lines that form a single URL. +2. Determine the month name from the content (e.g., "Creche - março" → "marco"). +3. Create the folder `aulas-musica-{month}` in the current directory. +4. Download all tracks as MP3 using yt-dlp via nix-shell: + ``` + TMPDIR=/tmp nix-shell -p yt-dlp ffmpeg --run 'cd && yt-dlp -x --audio-format mp3 -o "%(title)s.%(ext)s" ' + ``` +5. List the downloaded files to confirm everything worked. + +## Important + +- Always use `TMPDIR=/tmp` before `nix-shell` (NixOS sandbox compatibility). +- Always use `dangerouslyDisableSandbox: true` for the download command. +- Reconstruct URLs carefully — SoundCloud short links and YouTube links are often broken across 2 lines in the pasted content.