A simplistic way to find songs from a Spotify playlist on YouTube and download them in the highest available quality.
IMPORTANT: Please check the issue saulojoab has pinned here.
All you gotta do is insert your >>PUBLIC<< Spotify playlist URL or ID when prompted, then the app will automatically search all songs from that playlist on YouTube and return the URLs. Youtube-dl will download them. Check below for instructions on how to make it work:
youtube-dl
ffmpeg
mutagen easyid3
1 - To use the script, you gotta register your app on both the Spotify and YouTube API services.
2 - When you finish doing that, create a JSON file named "config.json" on the project's main folder.
3 - The config.json file must have the following format:
{
"spotify":
{
"client_id": "your_spotify_client_id",
"client_secret": "your_spotify_client_secret"
},
"youtube":
{
"api_key": "your_youtube_api_key",
"client_id": "your_youtube_client_id",
"client_secret": "your_youtube_client_secret"
}
}I used the following libraries:
- Spotipy (For handling the Spotify API)
- YouTube Python (For handling the YouTube API)
- Beautiful Soup (For the YouTube alternative search)
- youtube-dl (For the youtube download)
- Mutagen EasyID3 (For the metadata tagging)
Studying purpouses, and it might actually be useful to someone. I think Discord bots could use that to queue songs and stuff.
This project needs:
- Handling of errors
- Output of logs
- Refactoring