The Last.fm Scrobble Deletion Script is a Node.js script that allows you to delete scrobbles from your Last.fm library for a list of artists. It uses the Last.fm API to perform the deletion, and you can specify the list of artists in a text file called artists.txt
.
Before running the script, make sure you have the following:
-
Node.js installed on your system. You can download it from the official website: https://nodejs.org/
-
Last.fm account with scrobbles you want to delete.
-
The necessary environment variables to be set in the
.env
file. You can find these variables in your browser cookies after logging in to Last.fm:USERNAME
: Your Last.fm usernameCSRF_TOKEN
: The CSRF token from your Last.fm cookiesSESSION_ID
: The session ID from your Last.fm cookies
-
Clone this repository to your local machine.
-
Copy
.env-example
to.env
in the root directory and update the environment variables with your Last.fm account information. The file should look like this:
USERNAME=your_lastfm_username
CSRF_TOKEN=your_csrf_token
SESSION_ID=your_session_id
- Create a
artists.txt
file in the root directory and add the list of artists you want to delete scrobbles for. Each artist should be on a new line, like this:
Artist
Artist+2
Artist+3
... (add more artists as needed)
- Install the required dependencies by running the following command in the terminal:
npm install
- Run the script using the following command:
npm run start
-
The script reads the list of artists from the
artists.txt
file. -
For each artist in the list, it sends an HTTP POST request to Last.fm API to delete scrobbles for that artist.
-
If scrobbles are found for the artist, it will delete them and display the number of scrobbles deleted.
-
If no scrobbles are found for the artist, it will log a message saying that there is nothing to delete.
-
The script will pause for a random time between 12000 and 13000 milliseconds (12 to 13 seconds) after each request to prevent any potential rate limiting or ban from Last.fm.
-
After processing all the artists, the script will display the total number of scrobbles deleted.
-
If there are any errors during the process, the script will log the error details.
Please use this script responsibly and only delete scrobbles that you want to remove. Deleting scrobbles is irreversible, and the script should be used with caution.