Migrating YouTube Videos to Invidious
Wed Jan 14 2026As I continue my journey towards a more privacy-respecting and open internet, I've decided to migrate my YouTube video links to Invidious instances. Invidious is an alternative front-end for YouTube that allows users to watch videos without being tracked by Genocide Google.
I had some issues migrating my playlists, and of course used AI to help me out. Here's a quick guide (written by Claude) on how to do it. My advice, share link of this conversation to your preferred AI (ideally, not Gemini, nor ChatGPT, nor Grok -- all of them are genociders), and let it do it for you:
Why Migrate to Invidious?
If you're tired of:
- Google tracking everything you watch
- Constant ads and Premium upsells
- Your data being sold to advertisers
- YouTube's invasive algorithm
Then Invidious is your answer. It's an open-source, privacy-respecting YouTube frontend that lets you:
- ✅ Subscribe to channels without a Google account
- ✅ Watch ad-free (always)
- ✅ Create and manage playlists
- ✅ No tracking or data collection
- ✅ SponsorBlock support built-in
The Problem: YouTube's Export is Broken
When you export your playlists from Google Takeout, you get CSV files. Invidious has an "Import YouTube playlist" feature, but it's buggy due to Google changing their export format.
You'll hit this error:
Title: Index out of bounds (IndexError)
Route: /data_control?referer=/feed/playlists
The solution? Convert your CSV files to Invidious's JSON format.
Step-by-Step Migration Process
Step 1: Export Your YouTube Data
- Go to Google Takeout
- Deselect all products
- Select only YouTube and YouTube Music
- Click "All YouTube data included" → Deselect everything except playlists
- Click "Next step" → Choose export format (doesn't matter)
- Click "Create export"
- Wait for Google to prepare your data (can take hours)
- Download and extract the archive
You'll get a folder with:
playlists.csv(contains playlist metadata)[PlaylistName]-videos.csv(one file per playlist with video IDs)
Step 2: Convert CSV to Invidious JSON Format
The CSV files need to be converted to JSON. Here's a Python script that does it:
#!/usr/bin/env python3
import csv
import json
import time
import os
def convert_playlist(csv_file, playlist_name):
"""Convert YouTube Takeout CSV to Invidious JSON format"""
video_ids = []
with open(csv_file, 'r', encoding='utf-8') as f:
reader = csv.DictReader(f)
for row in reader:
video_id = row.get('Video ID', '').strip()
if video_id: # Skip empty rows
video_ids.append(video_id)
return {
"title": playlist_name,
"description": f"Imported from YouTube - {len(video_ids)} videos",
"privacy": "Private",
"updated": int(time.time()),
"videos": video_ids # Just the IDs as strings
}
def convert_all_playlists(playlist_files):
"""Convert multiple playlists into single Invidious import file"""
all_playlists = []
for csv_file, name in playlist_files.items():
if os.path.exists(csv_file):
playlist_data = convert_playlist(csv_file, name)
all_playlists.append(playlist_data)
print(f"✓ Converted '{name}': {len(playlist_data['videos'])} videos")
# Create Invidious data structure
invidious_data = {
"thin_mode": False,
"subscriptions": [],
"watch_history": [],
"preferences": {},
"playlists": all_playlists
}
# Save to file
with open('invidious_import.json', 'w', encoding='utf-8') as f:
json.dump(invidious_data, f, indent=2, ensure_ascii=False)
print(f"\n✓ Created invidious_import.json with {len(all_playlists)} playlists")
print(f"✓ Total videos: {sum(len(p['videos']) for p in all_playlists)}")
# Example usage:
playlist_files = {
"Music-videos.csv": "Music",
"Favorites-videos.csv": "Favorites",
"Watch_later-videos.csv": "Watch Later",
# Add more playlists here
}
convert_all_playlists(playlist_files)
Important notes:
- Remove any empty lines at the end of CSV files (they cause parsing errors)
- The script creates a single JSON file with all your playlists
- Videos are stored as simple arrays of video IDs
Step 3: Choose an Invidious Instance
Invidious is decentralized - you pick which server (instance) to use. Popular instances by country:
- Netherlands (NL) - Strong privacy laws, GDPR compliant
- Switzerland (CH) - Excellent privacy protections
- Sweden (SE) - Good infrastructure
- United States (US) - Fast but weaker privacy laws
Find a full list at: https://docs.invidious.io/instances/
Pro tip: Avoid instances that are frequently down or slow. Check the status page first.
Step 4: Import to Invidious
- Create an account on your chosen Invidious instance
- Go to Settings (gear icon)
- Scroll down and click "Data Preferences"
- Click "Import/Export Data"
- Under "Import", click "Import Invidious data" (NOT "Import YouTube playlist")
- Upload your
invidious_import.jsonfile - Wait for the import to complete
If you hit capacity limits:
- Your instance may have playlist size limits
- Split your playlists into smaller batches
- Remove already-imported playlists from the JSON and re-import
Step 5: Verify Your Playlists
- Go to "Playlists" in the main menu
- Check that all your playlists are there
- Open a few to verify videos are present
- Done! You're degoogled.
Common Issues & Solutions
Issue: "Index out of bounds" error
Cause: You're trying to use the CSV import feature directly, which is broken.
Solution: Use the JSON conversion method described above.
Issue: Playlist creates but no videos appear
Cause: Incorrect JSON structure. Videos need to be an array of string IDs, not objects.
Wrong:
"videos": [
{
"videoId": "abc123",
"title": "Video Title"
}
]
Correct:
"videos": ["abc123", "def456", "ghi789"]
Issue: Instance capacity limits
Cause: Some instances limit playlist sizes or total playlists per user.
Solutions:
- Remove already-imported playlists from your JSON
- Split large playlists into smaller ones
- Try a different instance with higher limits
Bonus: Converting Just Subscriptions
If you only want to migrate channel subscriptions (not playlists):
- Export from YouTube Takeout (select "subscriptions")
- You'll get
subscriptions.csv - In Invidious: Subscriptions → Manage Subscriptions → Import/Export
- Click "Import YouTube subscriptions"
- Upload the CSV directly (this import works fine)
Additional Privacy Tips
Once you're on Invidious:
- Enable "Proxy videos" in preferences - Routes video through the instance server so Google never sees your IP
- Use a VPN - Extra layer of protection
- Disable watch history - If you don't need it
- Use RSS feeds - Invidious provides RSS feeds for channels, works with any RSS reader
Conclusion
Migrating from YouTube to Invidious takes about 30 minutes but gives you:
- Complete privacy from Google's tracking
- Ad-free viewing forever
- Open-source, community-driven platform
- All your subscriptions and playlists intact
The hardest part is the initial export/conversion, but once you're set up, Invidious works just like YouTube - minus the corporate surveillance.
Stop giving your data to Google. Make the switch today.