This Python program allows users to convert Spotify track information into YouTube links. It also allows for Artist + Song Name combinations to output youtube video links.
Transparency: Most of this app was created with AI assistance, as I seek to find solutions to my problems in creative ways. After finding use of such a tool, it is only fair to share it with others who may benefit in the same way.
- Make sure you have Python installed on your system.
- Clone or download this repository.
- pip install -r requirements.txt
- Navigate to the directory containing the Python script.
- Run the script using the following command:
python sp.py
- The program will prompt you for the Spotify Client ID and Client Secret the first time you run it. These values will be saved for future runs in
client_id.txt
andclient_secret.txt
.
How to get the spotify client id and secret:
- Go to the Spotify Developer Dashboard. (https://developer.spotify.com/dashboard)
- Log in with your Spotify account or create one if you don't have one.
- Click on "Create an App" and fill in the necessary information. You can name it anything you like.
- Once you've created the app, you'll see your client_id and client_secret on the app's dashboard.
You can interact with the program in a few ways:
-
Enter Artist and Track Name: Type the artist and track name in the format
Artist,TrackName
and press Enter. The program will search for the YouTube link associated with that track. -
Enter Spotify Link: If you provide a Spotify track link (e.g.,
https://open.spotify.com/track/xxxxxxxxxxxxxxxxxxx
), the program will extract the track information and search for the corresponding YouTube link. -
You can also use the
--bulk
flag to query a playlist for youtube links. EX.--bulk [SpotifyPlaylistLink] [NameOrDescriptor]
-
Optional Discord Webhook support: simply specify a webhook URL when prompted. You will not be prompted again unless you delete your webhook_url.txt file, generated in the same directory as the program, or unless you specify a different webhook with --webhook
The playlist processing is a bit buggy with its current implementation and will only process up to 100 songs reliably. Keep your queries below 100 songs if you want to guarantee a fully processed playlist. May also crash the program. Bulk is buggy :(
Output will be generated to a .csv file dated and located under the sp-YYYY-MM folder
To exit the program, type quit
and press Enter.
- Python 3.x
- Libraries: spotipy, youtube-search-python
- sp.py: The main Python script.
- client_id.txt: Stores the Spotify Client ID.
- client_secret.txt: Stores the Spotify Client Secret.
- Spotipy: A lightweight Python library for the Spotify Web API.
- youtube-search-python: A Python library to search for YouTube videos.
Feel like this has been useful? Donate toward my latest projects. https://www.poof.io/tip/@davidinfosec