The Playlist Sync Tool is a Python application designed to synchronize songs between Spotify and YouTube playlists. It offers functionalities to extract playlist IDs, authenticate with Spotify and YouTube APIs, add songs from Spotify to a YouTube playlist, and remove duplicate entries from the YouTube playlist.
Before you begin, ensure you have the following installed:
- Python 3.6 or higher
- pip for installing Python packages
- Clone the repository or download the source code.
- Navigate to the project directory and install the required dependencies:
pip install -r requirements.txt
- Set up environment variables by creating a
.env
file in the project root with the following contents:ReplaceSPOTIFY_CLIENT_ID='your_spotify_client_id' SPOTIFY_CLIENT_SECRET='your_spotify_client_secret' YOUTUBE_CLIENT_SECRETS='path_to_your_youtube_client_secrets.json'
'your_spotify_client_id'
,'your_spotify_client_secret'
, and'path_to_your_youtube_client_secrets.json'
with your actual credentials.
- Visit the Spotify Developer Dashboard and log in or create an account.
- Create an application to obtain the Client ID and Client Secret.
- Add these credentials to your
.env
file as shown in the Installation section.
- Go to the Google Cloud Console.
- Create a new project.
- Navigate to APIs & Services > Credentials and click on Create Credentials > OAuth client ID.
- Follow the prompts to configure the OAuth consent screen, selecting Desktop app as the application type.
- Download the JSON file containing your credentials and note the file path.
- Add the path to your
.env
file asYOUTUBE_CLIENT_SECRETS
.
- Run the main script to start the program:
python main.py
- Follow the on-screen prompts to authenticate and choose between removing duplicates from your YouTube playlist or adding songs from Spotify to YouTube.
- Add your playlist ids by following the prompts and copy and pasting your full URL when on each respective playlist
- Playlist ID Extraction: Automatically extracts and updates playlist IDs based on URLs.
- Spotify Authentication: Uses the Spotify Web API to fetch tracks from a Spotify playlist.
- YouTube Authentication: Authenticates with the YouTube API to add songs to a YouTube playlist and remove duplicates.
- Song Synchronization: Adds tracks from a Spotify playlist to a YouTube playlist, with checks to avoid duplicates.
- Duplicate Removal: Identifies and removes duplicate songs from a YouTube playlist.
Contributions are welcome! Please feel free to submit pull requests or create issues for bugs, questions, or new features.
For detailed information on this project please refer to our documentation: