

A good way I found to do this was to look for auto-generated videos where have the keywords “auto-generated” or “Provided to YouTube”. Once possible videos are found, then you have to find the best one which best matches the song, as to avoid Hitler parodies or other random videos. Following this link gives the correct results as you would have expected. In this situation, you would actually need to load the page from the “Search instead for eva haerts”. A search for this song shows YouTube automatically corrects it: For example, when searching for the song Eva by Haerts, the name of the band Haerts seems to be mispelled even though it it isn’t. Spelling is important, because YouTube will try to change the spelling if they think it is spelled wrong. To get the songs then, first I have to make sure that the title of the song and the name of the artist are spelled right. The song finding has to have a very high positive rate and a low false positive rate. As I saw above, trying to get the song Arrive, Arrive by Ian William Craig resulted in downloading an audio clip from a Hitler parody. Getting the songs of YouTube is an important and tricky part. There are basically two components to this program: a module for getting songs ( getsong) and a command-line utility for downloading the playlists ( spotifydownload). I decided to write it in Go, because there would be no dependenecies and anyone could run it without installing an ecosystem (e.g.
#Download playlist from spotify to mp3 windows#
Then, I tried a different Spotify downloader written in Node, spotify-playlist-downloader (run using Node 10.14.1 on Windows 10) which also resulted in an error immediately, something about Cannot read property 'csrftoken' of undefined. Turns out this was a bug fix to another bug fix that wasn’t pushed to PyPI yet. For instance a search for Ian William Craig - Arrive Arrive resolted in a video parodying Hitler.īut eventually I would also get a 403 error and then another NameError: name 'time' is not defined error. I tried it again and immediately had problems with correct detection of songs. It turned out to be a youtube-dl problem, which I then upgraded to the new current version. Something about Could not find JS function 'encodeURIComponent'. Maybe it’s a Windows thing?įirst I tried a Spotify downloader written in Python, spotdl (run using Python 3.7.1 on Windows 10). Both of them resulted in errors despite my system being new and despite having all of my dependencies up-to-date. I tried the two most popular - one written in Python and one written in Node. Please support the artists by buying their music.Ī search for “Spotify Download” gives about 250 results, some which are quiet popular.
#Download playlist from spotify to mp3 download#
This tool is for educational purposes only and was created only to show how Spotify’s API can be used to download music from YouTube. I decided to try out a couple of “Spotify downloaders” but in the end I decided to make my own.ĭisclaimer: Downloading copyright songs may be illegal in your country. I’d like to listen to them offline, for personal use only - so I could put them on my old-fashioned mp3 player. I listen to a lot of Spotify and make a lot of playlists.

Download Spotify playlists into mp3 files using YouTube and a simple command-line program written in Go.
