Sadly, if they tried your first suggestion, Spotify would almost certainly lock down developer access like Twitter has for their new API, requiring an application and manual approval.
Login/password and scraping is a more interesting alternative, but then Spotify would presumedly block any server-side scraping. Really, best option I can come up with is browser automation that is entirely client-side (whether a browser extension or maybe wrapping Puppeteer).
Even better, make a tool that accepts your login and password and does that for you.
It's quite funny that tools like Deemix[1] let you download songs from Spotify[2], but there's no way to actually export them.
[1] I won't provide a link because of piracy.
[2] Deemix internally converts to Deezer, and then downloads from that.