Yooooomi / your_spotify

Self hosted Spotify tracking dashboard
GNU General Public License v3.0
2.82k stars 113 forks source link

Add Last.fm Support #102

Open carharv opened 2 years ago

carharv commented 2 years ago

I mainly stream music from Spotify, but there I occasionally play music from other sources on my phone too. In addition to other sources I would also like to track the local files that I play on Spotify too. There is an app on IOS called Trax Scrobbler that tracks any music that is played on my phone from any source and logs it on my Last.fm account for free.

Last.fm requires a premium subscription to view stats older than a week, though. Thankfully, they have an API that makes it really easy to query the tracks I have listened to and export them in an easy to work with format.

Here is the link to a tool that exports Last.fm listening history Here is the link to the Last.fm API docs

There is no API key or anything required, just the Last.fm user name. The data can be exported in CSV or JSON file. Here is a sample of the exports from my account in both CSV and JSON files

Screen Shot 2022-03-07 at 10 26 43 AM Screen Shot 2022-03-07 at 10 25 54 AM

If this is a feature you'd be able to add I'd be more than happy to donate on PayPal! Thanks

Yooooomi commented 2 years ago

One thing I can do is add an importer of your file. However, import occurs once and is done manually by you. Any later music will only get synced if you listen through Spotify. If I understand correctly, that's not exactly what you want right?

carharv commented 2 years ago

Correct. I'm thinking more along the lines of using Last.fm data to fill in the gaps in Spotify data.

samip5 commented 1 year ago

This would definitely be useful as Spotify can be configured to automatically push to Last.fm what you're listening and thus it has a better grasp of your listening history than what can be gathered from Spotify data.