YouTube Integration Setup
This site automatically syncs with your YouTube channel every 6 hours using GitHub Actions.
Setup Instructions
1. Get a YouTube API Key
- Go to Google Cloud Console
- Create a new project or select existing
- Enable YouTube Data API v3
- Create credentials → API Key
- (Optional) Restrict the key to YouTube Data API v3
2. Add API Key to GitHub Secrets
- Go to your repository Settings → Secrets and variables → Actions
- Click “New repository secret”
- Name:
YOUTUBE_API_KEY
- Value: Your API key from step 1
3. Get Your Channel ID (if needed)
Your channel handle is @faptured, but if the script needs the UC… ID:
- Go to your YouTube channel
- View page source
- Search for “channelId” or “UC”
- Or use this tool: https://commentpicker.com/youtube-channel-id.php
Update the CHANNEL_ID
in .github/scripts/fetch_youtube_videos.py
if needed.
4. Run the Action
- Go to Actions tab in your repository
- Select “Sync YouTube Videos”
- Click “Run workflow”
The action will:
- Fetch your latest videos
- Save them to
_data/youtube_videos.yml
- Commit and push the changes
- Your site will rebuild automatically
Automatic Updates
The workflow runs every 6 hours automatically. You can change this in .github/workflows/youtube-sync.yml
by modifying the cron schedule.
Alternative Options
Option 1: YouTube RSS Feed (No API Key needed)
// Simple RSS feed approach
const RSS_URL = 'https://www.youtube.com/feeds/videos.xml?channel_id=YOUR_CHANNEL_ID';
Option 2: Manual Update
Simply edit _data/youtube_videos.yml
manually with your video information.
Option 3: Client-side JavaScript
Use YouTube’s embed API to load videos dynamically in the browser.