rustfm-scaper is a command-line application that will download your listening history from Last.fm and store it locally on your computer.
Install via cargo:
cargo
cargo install rustfm-scraper