A comprehensive web application for seamlessly transferring your Spotify playlists to YouTube Music using OAuth authentication.
Important
OAuth Setup Required: You'll need to create OAuth applications for both Spotify and Google (YouTube) to use this application. Follow the OAuth Setup Guide below for detailed instructions.
Automatic Playlist Discovery: View all your Spotify playlists instantlyOne-Click Transfer: Transfer entire playlists with a single clickSmart Track Matching: Intelligent search algorithm to find songs on YouTube MusicOAuth Authentication: Secure login with Spotify and YouTube Music accountsTransfer Summary: Detailed statistics showing successful transfers and missing tracksYouTube Search Integration: Direct search links for songs that couldn't be found automatically
-
Visit Spotify Developer Dashboard
- Go to Spotify Developer Dashboard
- Log in with your Spotify account
-
Create an App
- Click "Create App"
- Fill in the details:
- App Name: StoY (or any name)
- App Description: Transfer playlists to YouTube Music
- Redirect URI:
http://127.0.0.1:8080/callback/spotify - Check the Terms of Service agreement
- Click "Save"
-
Get Credentials
- Click on your newly created app
- Click "Settings" button
- Copy the Client ID and Client Secret
- Save these for your
.envfile
-
Visit Google Cloud Console
- Go to Google Cloud Console
- Sign in with your Google account
-
Create a New Project
- Click the project dropdown at the top
- Click "New Project"
- Enter project name: StoY
- Click "Create"
-
Enable YouTube Data API v3
β οΈ IMPORTANT- In the left sidebar, go to "APIs & Services" β "Library"
- Search for "YouTube Data API v3"
- Click on it and press "Enable"
- π Direct Link to YouTube Data API v3
-
Create OAuth Credentials
- Go to "APIs & Services" β "Credentials"
- Click "Create Credentials" β "OAuth client ID"
- If prompted, configure the OAuth consent screen:
- Choose "External" user type
- Fill in app name: StoY
- Add your email as developer contact
- Add scopes:
../auth/youtube - Save and continue
-
Configure OAuth Client
- Application type: "Web application"
- Name: StoY
- Authorized redirect URIs:
- Add:
http://127.0.0.1:8080/callback/youtube
- Add:
- Click **"Create""
-
Get Credentials
- Copy the Client ID (this is your
GOOGLE_CLIENT_ID) - Copy the Client Secret (this is your
GOOGLE_CLIENT_SECRET) - Save these for your
.envfile
- Copy the Client ID (this is your
Note
Google OAuth Consent Screen: If you see a warning about unverified apps, you can continue safely since you're the developer. For personal use, you don't need to verify the app.
You have two options to run this application:
- Docker Installation (Recommended) - Easiest setup with Docker Compose
- Local Development Installation - Manual setup for development
- Docker installed (Download Docker)
- Docker Compose installed (included with Docker Desktop)
- OAuth credentials from OAuth Setup Guide
-
Clone the repository
git clone https://github.com/Max-Eee/Spotify-to-Youtube-Music cd Spotify-to-Youtube-Music -
Configure environment variables
The
.envfile is already included in the repository. Simply edit it with your credentials:# Spotify OAuth (from https://developer.spotify.com/dashboard/) SPOTIFY_CLIENT_ID=your_spotify_client_id_here SPOTIFY_CLIENT_SECRET=your_spotify_client_secret_here SPOTIFY_REDIRECT_URI=http://127.0.0.1:8080/callback/spotify # Google OAuth (from https://console.cloud.google.com/) GOOGLE_CLIENT_ID=your_google_client_id_here GOOGLE_CLIENT_SECRET=your_google_client_secret_here YOUTUBE_REDIRECT_URI=http://127.0.0.1:8080/callback/youtube # Flask Secret (random string) FLASK_SECRET_KEY=your_random_secret_key_change_this # Frontend URL FRONTEND_URL=http://127.0.0.1:3000
-
Build and run with Docker Compose
docker-compose up --build
-
Visit http://127.0.0.1:3000 and start transferring your playlists!
- Python 3.8+ (Download Python)
- Node.js 16+ (Download Node.js)
- OAuth credentials from OAuth Setup Guide
-
Clone and navigate to backend
git clone https://github.com/Max-Eee/Spotify-to-Youtube-Music cd Spotify-to-Youtube-Music/backend -
Install Python dependencies
pip install -r requirements.txt
-
Configure environment variables
Edit the
.envfile in the root directory with your credentials (same format as Docker setup) -
Run the Flask server
cd backend python main.pyServer runs on http://127.0.0.1:8080
Note: Keep this terminal running while using the application
-
Navigate to frontend
cd Spotify-to-Youtube-Music/frontend -
Install dependencies
npm install
-
Run development server
npm run dev -- --port 3000 --host 127.0.0.1
Frontend runs on http://127.0.0.1:3000
Note: Open http://127.0.0.1:3000 in your browser (use 127.0.0.1, not localhost)
- Click "Connect to Spotify" and authorize the app
- Click "Connect to YouTube Music" and authorize the app
- Your Spotify playlists will appear automatically
- Hover over a playlist and click "Transfer"
- Wait for the transfer to complete
- Success: See transfer summary with track counts
- Partial Success: View missing tracks with YouTube search links
- Click search links to manually add missing songs
Frontend
- React 18 with TypeScript
- Vite for build tooling
- TailwindCSS for styling
- ShadCN UI components
- React Router for navigation
Backend
- Flask (Python) REST API
- YTMusicAPI for YouTube Music
- Google OAuth2 for authentication
- Flask-CORS for cross-origin requests
Infrastructure
- Docker & Docker Compose
- Nginx for frontend serving
Spotify-to-Youtube-Music/
βββ backend/
β βββ main.py # Flask application entry point
β βββ auth.py # OAuth authentication logic
β βββ spotify.py # Spotify API integration
β βββ ytm.py # YouTube Music API integration
β βββ requirements.txt # Python dependencies
β βββ Dockerfile # Backend Docker configuration
βββ frontend/
β βββ src/
β β βββ pages/
β β β βββ playlist-transfer.tsx # Main transfer page
β β β βββ auth-callback.tsx # OAuth callback handler
β β βββ components/
β β β βββ ui/ # Reusable UI components
β β β βββ theme-provider.tsx # Dark mode support
β β βββ main.tsx # Application entry point
β βββ Dockerfile # Frontend Docker configuration
β βββ nginx.conf # Nginx configuration
β βββ package.json # Node.js dependencies
βββ docker-compose.yml # Docker Compose configuration
βββ .env.example # Environment variables template
βββ README.md # This file
OAuth Redirect Errors
- Ensure redirect URIs in
.envmatch exactly what's in Spotify/Google dashboards - Check for typos:
http://127.0.0.1:8080/callback/spotify(no trailing slash) - Make sure you've added both redirect URIs to your OAuth apps:
- Spotify:
http://127.0.0.1:8080/callback/spotify - YouTube:
http://127.0.0.1:8080/callback/youtube
- Spotify:
YouTube API Quota Exceeded
- Google provides 10,000 quota units per day for free
- Each playlist transfer uses approximately 50-100 units
- Wait 24 hours for quota reset or request quota increase
"Not Found" Errors for Songs
- Some songs may not be available on YouTube Music
- Use the search links provided to manually find alternatives
- Regional availability may affect results
Docker Port Conflicts
- If ports 3000 or 8080 are in use, edit
docker-compose.yml:ports: - "3001:80" # Change frontend port - "8081:8080" # Change backend port
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Open an issue
- Check existing issues for solutions
- Star β the repository if you find it useful!