This directory contains utility scripts for managing Devtherapy data.
The fetch-episodes script fetches episode data from YouTube and saves it locally for better performance and customization.
# Fetch all episodes from YouTube
npm run fetch-episodes
# Or run directly with tsx
npx tsx scripts/fetch-episodes/fetchEpisodes.ts- Fetches episodes from the Devtherapy YouTube channel
- Filters episodes to only include Devtherapy episodes (excludes Shorts under 30 minutes)
- Generates tags automatically based on content analysis
- Extracts episode numbers from titles
- Saves data locally in
src/server/data/episodes/directory - Creates individual files for each episode for easy customization
- Skips existing episodes to preserve your customizations
src/server/data/episodes/episodes.data.ts- Index file with all episodessrc/server/data/episodes/{episodeId}.ts- Individual episode files
After running the script, you can manually edit the generated files to:
- Add custom tags (
customTags) - Link to guests (
guestId) - Add highlights (
highlights) - Add developer notes (
notes) - Mark as featured (
featured) - Add episode numbers (
episodeNumber)
Important: The script will skip episodes that already exist, so your customizations are preserved when re-running the script.
Make sure to set your YouTube API key in .env.local:
VITE_YOUTUBE_API_KEY=your_youtube_api_key_here
- Better Performance: No API calls on every page load
- Full Customization: Add custom metadata, tags, and notes
- Guest Integration: Link episodes to guest profiles
- Resource Efficiency: Reduces YouTube API usage
- Offline Capability: Works without internet connection
- Safe Updates: Preserves existing customizations when re-running