sxiii

Fetch all LastFM user tracks

Dec 3rd, 2020 (edited)
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

How to fetch any LastFM user track history without API key

Requirements:

  • Linux (tested on Manjaro, might work as well on others)
  • git (ubuntu/debian: sudo apt install git arch/manjaro: sudo pacman -S git fedora/centos: sudo dnf install git alpine: apk add git)
  • Any recent browser (Tested on Google Chrome Version 85.0.4183.121 (Official Build) (64-bit))

Process

  1. Clone the benfoxall/lastfm-to-csv github repo:
    git clone https://github.com/benfoxall/lastfm-to-csv
  2. Enter the folder:
    cd lastfm-to-csv
  3. Open your browser with index.html:
    google-chrome-stable index.html
  4. On the page, type-in the lastfm user name and press "Fetch tracks"
  5. Wait for the fetch to complete and click on "Save"
  6. Done!

Notes

  • In the HTML file (index.html) it says that ideally you'll have to use your own API key. However, I've tried with the default one and it worked flawlessly.
  • Warning: users with a lot of tracks will take a lot of time to fetch (can be several hours) and resulting file will be pretty large (might be 100 mb or more)
  • On average, 500 pages of data = ~ 5 mb file

What to do with this data?

  • Find the most frequently played tracks!
  • Build some statistics on user, it's favourite tracks or genres
Add Comment
Please, Sign In to add comment