Extra simple throw-away importer for your last.fm loved favourites as a Spotify playlist. You need Last.fm as well as Spotify developer accounts.
Create an 'application.properties' with the corresponding credentials: spotify.clientid= spotify.clientsecret= lastfm.apikey=
With the jar+libs when downloaded from the release:
- extract the release (JAR + lib directory)
- place the application.properties in a
config
subdirectory (beside lib) - run
java -jar lastfm2spotify-1.0-SNAPSHOT-runner.jar
... or ...
In development mode (e.g. from you IDE)
mvn quarkus:dev -f pom.xml
Fire up http://localhost:8080/start in a brower to start the Spotify authentication. You will be redirected to the Spotify authentication service where you'll need to approve that the app is allowed to access your Spotify data. Once this is done, you will be redirected to the app (it should report "true" if authentication flow was finished successfully).
Start the import by visiting (replace <last.fm username> and obviously)
http://localhost:8080/sync?lastfmuser=<last.fm username>&spotifyuser= e.g.
http://localhost:8080/sync?lastfmuser=sherlock&spotifyuser=watson
Be patient:
- Due to the fact that last.fm doesn't offer an API method to retrieve all loved tracks ALL tracks need to be scraped page by page.
- Due to the fact that Spotify doesn't offer an API method for searching multiple tracks at once or adding items to playlists by name, we have to search track by track.
The last.fm request will be sent in parallel. Spotify has a rate limit in place, which will kick in from time to time (already does when importing a few hundred tracks). Requests will be throttled automatically.
A little front end ;-)