Data Sync & ETL
Sync Spotify Playlists to YouTube with Supabase
On a schedule, it detects changes in a Spotify playlist, finds the songs on YouTube, updates a YouTube playlist and logs to Supabase and Discord.
What it does
# Spotify to YouTube Playlist Synchronization ## A workflow that maintains a YouTube playlist in sync with a Spotify playlist, featuring smart video matching and persistent synchronization. ## Key Features - One-way Sync: Spotify playlist → YouTube playlist (additions and deletions - Continuous Monitoring: Automatic synchronization (every hour by default, but you can put any time you want) - Smart Video Matching: Considers video length and content relevance - Auto-Recovery: Automatically handles deleted YouTube videos - Database Backup: Persistent storage using Supabase ## Prerequisites 1. Supabase project with the following table structure: sql CREATE TABLE IF NOT EXISTS musics ( id TEXT PRIMARY KEY, title TEXT NOT NULL, artist TEXT NOT NULL, duration INT8 NOT NULL, youtube_video_id TEXT, to_delete BOOLEAN DEFAULT FALSE ); 2. Empty YouTube playlist (recommended as duplicates are not handled) 3. Configured credentials for YouTube, Spotify, and Supabase APIs 4. Properly set variables in all "variables" nodes (variables, variables1, variables2, variables3, variables4 (all the same)) 5. Activate the workflow ! ## Workflow Components ### Workflow 1: Main Sync Process 1. Change Detection - Monitors Spotify playlist for changes - Compares database state with current playlist 2. Video Matching - Searches YouTube based on title, artist, and duration - Evaluates top 5 results for best match - Marks unmatched tracks with "NOTFOUND" - Notifies user of successful matches and failures ### Workflow 2: YouTube Maintenance - Monitors YouTube playlist for removed videos - Flags removed videos for re-search - Handles deletion of marked videos ### Workflow 3: Recovery Process - Clears "NOTFOUND" flags periodically to re-search previously unmatched tracks ## Implementation Notes - Workflows can be separated into different files for better monitoring - Recovery process ensures long-term playlist maintenance
The steps
- Get playlist snapshot
- Get playlist snapshot1
- If different snapshot
- Get all musics
- Update to_delete to true
- Add music
- Compare Datasets
- Spotify
- No Operation, do nothing
- Get all musics not in youtube playlist
- Every day at noon
- Every day at noon + 1mn
- Every hour
- Wait 1 hour
48 steps in total.
Similar automations