Migrating YouTube Videos to Invidious

Wed Jan 14 2026

As 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

  1. Go to Google Takeout
  2. Deselect all products
  3. Select only YouTube and YouTube Music
  4. Click "All YouTube data included" → Deselect everything except playlists
  5. Click "Next step" → Choose export format (doesn't matter)
  6. Click "Create export"
  7. Wait for Google to prepare your data (can take hours)
  8. 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

  1. Create an account on your chosen Invidious instance
  2. Go to Settings (gear icon)
  3. Scroll down and click "Data Preferences"
  4. Click "Import/Export Data"
  5. Under "Import", click "Import Invidious data" (NOT "Import YouTube playlist")
  6. Upload your invidious_import.json file
  7. 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

  1. Go to "Playlists" in the main menu
  2. Check that all your playlists are there
  3. Open a few to verify videos are present
  4. 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:

  1. Remove already-imported playlists from your JSON
  2. Split large playlists into smaller ones
  3. Try a different instance with higher limits

Bonus: Converting Just Subscriptions

If you only want to migrate channel subscriptions (not playlists):

  1. Export from YouTube Takeout (select "subscriptions")
  2. You'll get subscriptions.csv
  3. In Invidious: Subscriptions → Manage Subscriptions → Import/Export
  4. Click "Import YouTube subscriptions"
  5. Upload the CSV directly (this import works fine)

Additional Privacy Tips

Once you're on Invidious:

  1. Enable "Proxy videos" in preferences - Routes video through the instance server so Google never sees your IP
  2. Use a VPN - Extra layer of protection
  3. Disable watch history - If you don't need it
  4. 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.