Skip to content

JOwen-ster/PlaylistExporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlaylistExporter

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.


🛠️ Built With

  • 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.

🚀 How It Works

The app is designed to make the playlist conversion process as straightforward as possible. Here's the flow:

  1. 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.

  2. 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.

  3. 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.

  4. 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.


How to Run the Project

  1. 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 in env.example:
      clientID="🩷"
      clientSecret="💜"
      GOOGLE_API_KEY="💛"
      
      SPOTIFY_CLIENT_ID="💚"
      SPOTIFY_CLIENT_SECRET="🧡"
  2. 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
  3. 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
    • 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
  4. 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.

Note: Both terminals must remain running simultaneously for the application to work.


🖼️ Screenshots

Screenshot 2024-12-10 at 7 51 38 PM Screenshot 2024-12-10 at 7 52 18 PM Screenshot 2024-12-10 at 7 52 38 PM Screenshot 2024-12-10 at 7 53 01 PM Screenshot 2024-12-10 at 7 53 55 PM Screenshot 2024-12-10 at 7 54 37 PM

Developed by Sama Ahmed, Boushra Bettir, James Owen Sterling, Patrick Smith

About

Export your Spotify playlist to Youtube!

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •