Skip to content

faperac/spotify_to_ytbmusic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotify to YouTube Music Converter

This Python program allows you to convert your liked songs from Spotify to a playlist on YouTube Music.

Setup

Before running the program, you need to set up some prerequisites:

  1. Obtain Browser Headers: You need to obtain your browser headers and save them to a file named browser_headers.txt. To do this, follow the instructions below:

    • Open your browser and go to music.youtube.com.
    • Open the Developer Tools (usually by pressing F12 or right-clicking and selecting "Inspect").
    • Go to the "Network" tab.
    • Reload the page.
    • Look for a request named "account_menu" in the list of network requests.
    • Copy the request headers (excluding the "POST" request line) and paste them into a new file named browser_headers.txt.
  2. Spotify API Keys: You need to obtain your Spotify API client ID and client secret. If you don't have them already, you can create an application on the Spotify Developer Dashboard and obtain your keys there.

  3. Install Dependencies: Run pip install -r requirements.txt to install the required Python packages.

How It Works

  1. The program first uses the Spotify API to fetch your liked songs and saves the results to a JSON file named spotify_results.json.
  2. Then, it searches for each song on YouTube Music and adds it to a new playlist.
  3. Finally, it saves the songs that could not be found on YouTube Music to a file named songs_not_found.txt.

Usage

  1. Make sure you have set up the prerequisites as mentioned above.
  2. Run the main.py file using Python 3: python3 main.py.
  3. Follow the prompts to enter your Spotify API client ID and client secret if you haven't already set them up in a .env file.
  4. The program will then proceed to fetch your liked songs from Spotify and add them to a playlist on YouTube Music.

Additional Information

  • The program utilizes the spotipy library to interact with the Spotify API and the ytmusicapi library to interact with the YouTube Music API.
  • If any errors occur during the process, they will be displayed in the console, and any songs that could not be found on YouTube Music will be listed in the songs_not_found.txt file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages