agentleFS
timelapsetechtimelapsetech/mediaskills/.agents/skills/download/SKILL.md

download

Skill1 starsChanged 3 months agoMITView on GitHub

Download video and audio from URLs using yt-dlp. Use when you need to fetch media from YouTube, Vimeo, or other supported sites before local processing with inspect, audio, or video-transformation skills.

  • Installs packages

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If your tools showed a filesystem path when loading this SKILL.md, strip SKILL.md and use that folder.

    line 42
  2. Very specific:

    If you already ran another mediaskills script (for example .../audio/scripts/extract.py), this skill is a sibling of that folder: same …

    line 43
  3. Very specific:

    Prefer absolute paths for --input / --output when cwd is uncertain.

    line 66
  4. Distinctive:

    Before running any script, treat these two failures differently:

    line 71
  5. Very specific:

    Only escalate sandbox permissions if the error is explicitly a permission denial (e.g.

    line 74

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Download

Fetch remote media with yt-dlp. Use this skill when you have a URL and need a local file for downstream processing.

When to use

  • This skill — download from YouTube, Vimeo, Twitter/X, and hundreds of other sites supported by yt-dlp.
  • inspect — after download, probe the file for duration, codecs, and resolution.
  • audio / video-transformation — trim, transcode, or extract audio from downloaded files.

Gotchas

  • Network required — downloads fail offline or behind restrictive firewalls. Corporate proxies may need HTTP_PROXY / HTTPS_PROXY env vars.
  • Rate limits and bot checks — some sites block datacenter IPs or require cookies. Pass cookies via yt-dlp config (~/.config/yt-dlp/config) if downloads fail with 403/429.
  • Output location — files land in the workspace root .mediaskills/downloads/ (not inside this skill folder), or $MEDIASKILLS_DATA_DIR/downloads/ when set. Filename pattern: Title [video_id].ext.
  • Playlists — this script downloads the URL as given; playlist URLs may fetch multiple files. Prefer single-video URLs for predictable output.
  • Live streams — live content may produce partial files if recording is interrupted.
  • Legal / ToS — only download content you have rights to access. Respect platform terms and copyright.

Running scripts

This skill's scripts live in scripts/ alongside this file. Before running any script, resolve its absolute path from this skill's own directory — do not assume the shell cwd is the skill folder, the repo root, or the workspace. Stay in the workspace (so media paths resolve) and pass the absolute script path to uv run:

uv run <skill_directory>/scripts/url.py --url '<https-url>'

<skill_directory> is a placeholder. Never pass those angle brackets to the shell — the command will fail. Replace it with a real absolute directory before invoking uv run.

How to get that directory (do this yourself; do not ask the user first; do not skip the skill):

  1. If your tools showed a filesystem path when loading this SKILL.md, strip SKILL.md and use that folder.
  2. If you already ran another mediaskills script (for example .../audio/scripts/extract.py), this skill is a sibling of that folder: same parent, directory name download.
  3. Otherwise search standard install locations and confirm the script exists:
NAME=download
for d in \
  "$HOME/.agents/skills/$NAME" \
  "$HOME/.cursor/skills/$NAME" \
  "$HOME/.codex/skills/$NAME" \
  "$HOME/.claude/skills/$NAME" \
  "$PWD/.agents/skills/$NAME" \
  "$PWD/.cursor/skills/$NAME" \
  "$PWD/skills/$NAME"
do
  if [ -f "$d/SKILL.md" ] && [ -e "$d/scripts/url.py" ]; then
    SKILL_DIR=$(cd "$d" && pwd)
    break
  fi
done
[ -n "$SKILL_DIR" ] || { echo "mediaskills: $NAME not found" >&2; exit 1; }
uv run "$SKILL_DIR/scripts/url.py" --url "<https-url>"

Prefer absolute paths for --input / --output when cwd is uncertain.

Missing binaries vs permissions

Before running any script, treat these two failures differently:

  • If a required binary (uv, yt-dlp) reports No such file or directory or command not found: this is a missing or unreachable binary, not a permissions issue. Escalating sandbox permissions will not fix it. Run command -v uv and command -v yt-dlp to see whether they resolve at all. If not, install or re-link them (install-media-tools doctor/install) rather than retrying with wider permissions.
  • Only escalate sandbox permissions if the error is explicitly a permission denial (e.g. Operation not permitted, Permission denied).

Recipes

Download a video

uv run <skill_directory>/scripts/url.py --url 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'

Example result:

{"ok": true, "op": "download.url", "data": {"url": "...", "output_path": "/path/.mediaskills/downloads/Title [id].mp4", "output_dir": "/path/.mediaskills/downloads"}, "output_paths": ["..."]}

Custom data directory (CI or server)

export MEDIASKILLS_DATA_DIR=/var/mediaskills
uv run <skill_directory>/scripts/url.py --url 'https://example.com/clip.mp4'

Downloads go to /var/mediaskills/downloads/.

Chain with inspect

uv run <skill_directory>/scripts/url.py --url 'https://...' | jq -r '.output_paths[0]' | xargs -I{} uv run <inspect_skill_directory>/scripts/probe.py --input {}

Troubleshooting

Error / symptomLikely causeAction
yt-dlp not foundBinary missingbrew install yt-dlp or pip install yt-dlp
HTTP Error 403Geo-block or auth requiredUpdate yt-dlp (yt-dlp -U); try browser cookies
Video unavailableRemoved or privateVerify URL in a browser while logged in
Output file not foundPrint hook failedCheck output_dir for newest file; retry with verbose yt-dlp
Slow downloadLarge file or throttlingNormal; progress JSON emitted on stderr

Available scripts

ScriptPurpose
scripts/url.pyDownload media from a URL

Acceptance checks (agent must pass before delivery)

  1. Contract: exit 0, ok: true, every output_paths entry exists and is non-empty.
  2. Probe: immediately inspect.describe / probe the download — duration and codecs present.
  3. Spot-check: file size > 0; URL matches requested source; no truncated download errors in stderr.
  4. On failure: retry or escalate; do not chain transforms on a failed/partial download.

Do not use for

  • Local file processing without a URL
  • DRM-protected streams you cannot access with yt-dlp

Related skills

  • inspect — probe downloaded files
  • install-media-tools — install ffmpeg/ffprobe for post-download work
  • audio, video-transformation — process downloaded media

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.