Getting listens out of an existing music player app

I just heard about ListenBrainz recently and found it very interesting.

I faced the problem of importing my past listens. I used a Music player app for Android (Muzio Player) and saw that it offers a “recently played” section in its UI.

But how to get the data out?
The player has LastFM integration but i

  1. don’t have a LastFM account and don’t plan to create one
  2. don’t think that even if id’ create one, the player would export past listens to LastFM.

Thus, i tried to get the data and have been successful.

Experience Level: Advanced
Time Needed: Depends on if your music files are tagged or not (at least title and artist tags).
Programming Knowledge required: Python if you want to adapt it for other players

I described the procedure how i managed to get the data from the music player in this GitHub Gist

Short version:

  • Back Up the Music Player’s Data via adb (Android Debug Bridge)
  • Extract the Backup on PC and locate the data
  • Make the data compatible to ListenBrainz Format and bulk-upload

Maybe this procedure can also be slightly adapted for other music player apps (at least if they are primarily operating locally on the device and not storing the data in a proprietary cloud)