You can download from Spotify using Zotify. Albums, playlists, if you set it to Artist unfortunately you will get a bunch of singles and EPs that you have to clean up.
If you have Premium you can download at high bitrates, otherwise you get Ogg Vorbis at around 150 ABR. You can automatically transcode to whatever format you want, then I feed it to beets to catalogue and deliver it with Ampache.
I like the moderate bitrate OGGs myself, as I often stream from Ampache to my phone and our mobile service is quite slow. So this system works great for me.