Import Videos Skill
This skill lets you automatically import YouTube videos into your Astro documentation site. It parses a list of video URLs, fetches their metadata using yt-dlp, and generates dedicated markdown files with rich frontmatter and video embeds.
Prerequisites
- The command line utility
yt-dlpmust be installed and available in the system path. - A
videos.txtfile should exist in the root of your workspace, containing one YouTube video URL per line.
When to Use
Use this skill whenever:
- You want to sync your YouTube video uploads into the local Astro content collections.
- You have updated
videos.txtwith new YouTube URLs that need importing.
How it Works
The under-the-hood import script:
- Reads
videos.txtfrom the project root. - For each URL, executes
yt-dlp --dump-jsonto fetch the video's title, description, id, and upload date. - Automatically fetches the video transcript from
https://defuddle.md/youtube.com/watch?v=<id>usingcurl. - Handles rate limits dynamically (with automatic sleep/retry backoffs).
- Generates a clean URL slug.
- Generates a markdown file under
src/content/docs/videos/<slug>.mdwith structured Astro frontmatter (title, summary, date, draft, tags), an embedded<SocialEmbed />component, and the full timestamped transcript.
Execution
Ensure videos.txt has the target YouTube URLs, then run this command from the project root to import them:
node .agents/skills/import-videos/scripts/import-videos.mjs
Refresh / Bulk Update Existing Transcripts
To batch-refresh transcripts for existing markdown files in the repository (e.g., if transcripts were missing or failed to download), use the companion update-transcripts.js script:
Process Everything (Both podcasts and videos):
node .agents/skills/import-videos/scripts/update-transcripts.jsPodcasts Only:
node .agents/skills/import-videos/scripts/update-transcripts.js --podcasts-onlyVideos Only:
node .agents/skills/import-videos/scripts/update-transcripts.js --videos-only