-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import from spotify extended streaming history #1800
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll be able to test this locally once I get my files with ms precision from Spotify.
I've been thinking we'll want to make it easier for users to request their info from Spotify, and so we could have a button that will have a precomposed email to send to the Spotify support address, maybe with a bit of a blurb about timestamp precision (not sure if this is necessary; perhaps for users who are already tracking their listens to avoid duplicates?).
Then we can see how to link to that on a "getting started" page to help onboard new users.
You no longer need to email spotify, they have a link to request your extended history at https://www.spotify.com/us/account/privacy/ |
de9479a
to
8e5022a
Compare
8e5022a
to
6eb0cc0
Compare
@amCap1712 Let me know if you need some help with testing or with the front-end side of things |
Hey there! I am quite interested in this feature and was about to build something myself using the API, until I saw this pull request. Are there any particular reasons, why this pull request was not merged yet? |
I have written a small importer script. |
const listens = streams | ||
.filter( | ||
(stream) => | ||
stream.ms_played > 30000 && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the ListenBrainz documentation a listen should only be submitted if it was played for more than half the track or for at least 4 minutes.
I think I had already mentioned this on IRC, but there are a few caveats with the data from Spotify. For some of them I have found workarounds while implementing my own parser, feel free to integrate them into the official importer. |
It is possible to get one's entire streaming history from Spotify, the import on their website has the timestamps rounded to minutes but they mention in their policy that one can mail them to get an extended history. I asked for it and got the necessary data after 3 weeks. The zip file sent by spotify has a bunch of json files of those one is
endsong.json
. This contains the spotify stream data. (There's also aendvideo.json
, for me there wasn't anything useful in it but maybe there is for others so may want to look into it as well.)Here's what one spotify stream looks in it,
The stream contains actual IP address of the user, there's also country and platform but ip address is probably the most sensitive info there. So we might want to handle processing of this stream file client side. This is what the PR does currently.
I have also put it in the last fm importer page for now. We'll probably need to overhaul the page a bit to make space for spotify importer. Plus we should also put documentation for how people can get their streaming history from spotify.