Programming

Download your Spotify My Music songs as MP3

I wanted a way to download my Spotify songs for offline listening. Ideally I’d subscribe to Spotify to make use of Offline feature, but they haven’t officially launched here so that’s out of the question.

A while back, I’d used spotify_to_mp3 which made use of Grooveshark to download, but Grooveshark shut down, leaving the script defunct. This gave me an idea to build something similar.

With this as the motivation, I built Spotify-dl to scratch an itch as well as to improve my Python skills. Since Spotify doesn’t allow you to download songs directly, I followed the same approach as spotify_to_mp3 – which is

  • Login to your Spotify library
  • Fetch all your “My Music” tracks using Spotify Web API
  • Parse the artist name & track name
  • Search for the artist name & track name against YouTube using their Data API and grab their YouTube URLs
  • Pass the YouTube URLs to youtube-dl to download the songs
  • Profit!

It didn’t take me long to build the glue script & python made it that much easier. The script is available on my github. Huge thanks to Rohan to contributing the youtube-dl integration part.

The readme has the required documentation on how to get it up and running. Any feedback is welcome

5 Comments

  1. What’s up to every one, for the reason that I am truly eager of reading
    this weblog’s post to be updated daily. It
    contains good data.

  2. I use Allavsoft to download Spotify Music songs as MP3
    It also helps to download from YouTube, and Deezer.

Leave a Reply

Your email address will not be published. Required fields are marked *