PlaylistExporter is a web application that simplifies the process of transferring your favorite Spotify playlists to YouTube. Whether you’re switching platforms or just want to enjoy your music with video, this app takes care of the heavy lifting. By connecting to both Spotify and YouTube through secure logins, it fetches your playlists, matches songs with their YouTube counterparts, and creates a new YouTube playlist.
- Backend: Python and Flask handle the application’s server-side logic and API interactions.
- Frontend: The interface is built using Svelte for dynamic UI updates and styled with Tailwind CSS for a sleek, responsive design.
- APIs: The Spotify API (via the Spotipy library) fetches playlist data, and the YouTube Data API is used to search and manage videos on YouTube along with create a playlist and add to it.
- Authentication: OAuth 2.0 ensures a secure and seamless login experience for both platforms.
The app is designed to make the playlist conversion process as straightforward as possible. Here's the flow:
-
Login and Authorization
When users visit the app, they’re prompted to log in to both their Spotify and YouTube accounts. The app uses OAuth 2.0 to securely authenticate users and obtain the necessary permissions to access their playlists and create new ones. -
Fetch Spotify Playlists
Once authenticated, the app retrieves a list of all the user’s public Spotify playlists. These playlists are displayed on the screen, allowing the user to select one for conversion. -
Playlist Conversion
After selecting a Spotify playlist, the app extracts the names and artists of the songs within it. It then searches YouTube for the corresponding videos. When a match is found, the app compiles these videos into a new playlist on the user’s YouTube account. -
Limitations Each user must choose a Spotify playlist with no more than 50 songs due to Youtube's API rate limit when creating and inserting to playlists.
-
Set Up Environment Variables
- Obtain YouTube credentials (Client ID and Client Secret) from the Google Cloud Console.
- Generate a Google API Key from the Google Cloud Console.
- Obtain Spotify Developer credentials (Client ID and Client Secret) from the Spotify Developer Portal.
- Create a
.env
file in the root directory using the format inenv.example
:clientID="🩷" clientSecret="💜" GOOGLE_API_KEY="💛" SPOTIFY_CLIENT_ID="💚" SPOTIFY_CLIENT_SECRET="🧡"
-
Install Dependencies
- Ensure Python v3 is installed on your system.
- Open a terminal, navigate to the
backend/api
folder by running:cd backend/api
- Install the required Python dependencies by running:
pip install -r requirements.txt
-
Run the Application
Open two terminals:-
Terminal 1:
- From the root directory of the project, navigate to the
backend/api
folder:cd backend/api
- Start the Flask server:
- On Mac:
python3 flask-server.py
- On Windows:
python flask-server.py
- On Mac:
- From the root directory of the project, navigate to the
-
Terminal 2:
- From the root directory of the project, navigate to the
frontend
folder:cd frontend
- Install the required Node.js dependencies by running:
npm install
- Start the Svelte development server:
npm run dev
- From the root directory of the project, navigate to the
-
-
Use the Application
- Open a browser and navigate to the provided URL (usually
http://localhost:3000
). - Click Login to Spotify to authenticate.
- Select a playlist and click Submit Playlist.
- Click Login to YouTube, and you'll be redirected to a success page.
- Check your YouTube account for the exported playlist.
- Open a browser and navigate to the provided URL (usually
Note: Both terminals must remain running simultaneously for the application to work.
Developed by Sama Ahmed, Boushra Bettir, James Owen Sterling, Patrick Smith ✨