| name | add-training-video |
| description | Download a YouTube video for offline fullscreen playback in Victor Addons and register it on the tablet's video page. Use when Victor gives a YouTube URL plus a start time (the second playback should begin from) to add to the training video snippets. |
add-training-video
Downloads a YouTube video as an AVFoundation-playable H.264/AAC MP4 into the
gitignored videos/ folder and registers it in videos/videos.json — the manifest
the Mac app serves to the tablet at GET /videos. No APK rebuild is needed: the
tablet's video page loads the list dynamically, so a newly added video appears on
next open and plays fullscreen on the Retina, seeking to its start second, when tapped.
Inputs
- URL — a YouTube
watch / shorts / youtu.be / embed link. The 11-char video id is extracted automatically and used as the filename and manifest key.
- start time — the second playback should begin from. Accepts
145, 13s, 1:23 (m:s) or 1:02:03 (h:m:s). If the URL already carries a t= param, pass that value.
- title (optional) — the label shown on the tablet tile; auto-fetched from YouTube if omitted.
Prerequisites
yt-dlp (brew install yt-dlp) and ffmpeg (already installed).
Usage
python3 .claude/skills/add-training-video/add_video.py \
--url "<youtube-url>" --start "<sec-or-timestamp>" [--title "<label>"]
The helper:
- Extracts the YouTube id and downloads to
videos/<id>.mp4, forcing an
avc1(H.264)+mp4a(AAC) MP4 so AVFoundation can play it (YouTube's default
VP9/webm is not playable by macOS media players).
- Parses the start time to whole seconds.
- Upserts
{id, title, startSeconds, file, url} into videos/videos.json,
replacing any existing entry with the same id.
Re-running for the same id is idempotent — it skips the re-download unless --force
is passed, and always refreshes the manifest entry.
Notes
videos/ (the mp4 files and videos.json) is git-ignored — it is local runtime
data, regenerated by this skill, never committed.
- Thumbnails are not stored here: the tablet derives the tile image from the YouTube id
(
img.youtube.com/vi/<id>/…), so keeping the id as the key is what makes the thumbnail
appear automatically.