Use when localizing external media (images, videos, audio) in a private clipping to archive them as local assets. Triggers when user wants to download, archive, or localize media from content/private/clippers/ files.
Download external images, videos, and audio from a private clipping into content/private/assets/, replacing external URLs with local relative paths. Preserves content for offline studying without publishing third-party media.
Scan for these patterns — handle ALL of them:
| Pattern | Example |
|---|---|
| Markdown images |  |
| HTML video/source tags | <video controls=""><source src="https://...mp4"></video> |
| HTML audio tags | <audio src="https://...mp3"></audio> |
| YouTube/Vimeo embeds |  |
Skip: wikilinks (![[...]]), text hyperlinks, already-local paths (../assets/...), data: URLs.
Images/direct files:
curl -L --fail -o "content/private/assets/{filename}" "{url}"
YouTube/Vimeo:
# Get the actual video title first for the filename
yt-dlp --get-title "{url}"
yt-dlp --merge-output-format mp4 -o "content/private/assets/{filename}" "{url}"
CDN URLs — try stripped URL first, fall back to original if it 404s:
cdn-cgi/image/width=...,quality=...,format=.../ prefix?w=600&quality=80Pattern: {article-slug}-{descriptive-name}.{ext}
.mp4 for yt-dlp downloadscontent/private/assets/ for collisions before savingExamples from existing assets: ane-m4-hero.jpeg, ane-software-stack.png, rodney-terminal-demo.jpg
CRITICAL: Use standard markdown with relative paths. Do NOT use Obsidian wikilink embeds.
Images — preserve any alt text:

HTML video tags — replace entire tag with markdown:

HTML audio tags — replace entire tag with markdown:

YouTube embeds — same pattern after yt-dlp download:

ls -lh each downloaded file to verify non-empty| Mistake | Fix |
|---|---|
Using ![[wikilink]] embeds | Use  relative paths |
| Downloading YouTube with curl | Use yt-dlp for YouTube/Vimeo |
| Keeping CDN params in URL | Strip transformation params for full quality |
Missing <video> or <audio> tags | Scan for markdown ![](), HTML <video>, AND <audio> tags |
| Guessing YouTube video filename | Run yt-dlp --get-title first, then derive slug from actual title |
| CDN-stripped URL 404s | Try stripped URL first, fall back to original CDN URL |
| Generic filenames | Prefix with article slug for namespacing |