Your scrobbler might have decided to scrobble every song hundreds of times, and you can't really remove those scrobbles efficiently. Or you might have accidentally installed multiple scrobbler extensions at the same time - wondering why multiple scrobbles appear for every song played at a time - and you want to clear them after finding the issue.
Using this script still doesn't necessarily make the process quick since Last.fm only displays a limited number of scrobbles that can be removed on each page of your library. However unlike the implementation of @sk22 and its forks, this UserScript, which is derived from those scripts, is run once. The rest of the process is automated and the script will stop at the page you have set using the prompt.
You will need some form of UserScript interpreter/injector plugin and a compatible browser.
- For Google Chrome and Chromium-based browsers (e.g. Vivaldi, Opera or Brave), you need the Tampermonkey plugin. Just click on the link or search for it yourself on the Chrome Web Store and add the extension.
- Currently not supported: For Firefox, you also need the Tampermonkey plugin (or alternatively Greasemonkey). Just click on one of the desired links or search for it yourself on the Firefox Browser Add-Ons page.
Just click on the "Raw" button in the upper right-hand corner of the script file or by clicking here. Your extension should open an installation window where you confirm the installation of the UserScript. If that is not working, try to add the script manually to your extension by copying and pasting it.
- Open your Last.fm account's library while being logged in (https://www.last.fm/user/_/library). Navigate to the page from which you want to start removing duplicates by clicking through the pages at the bottom of the page or by entering the page number in the URL (e.g. https://www.last.fm/user/_/library?page=123).
- Alternatively, you can choose a specific date range instead and navigate to the last or desired page.
- Manually reload the page if the button doesn't appear.
- You have the option to change the behaviour of the comparison process. By unchecking the checkbox, you can make the script ignore timestamps and compare over n titles. You'll be prompted to enter a number after clicking the button.
- Click the button and enter the page number at which you want the script to stop.
- If you have unchecked the checkbox, you will be prompted to enter a number for how many tracks you want to compare.
- Now enjoy the purge :)
- You can continue with other tasks on your PC. Just leave the window active in the background. I advise you to run the script in a separate window while doing other work. Using the same browser in another window is also fine. Avoid activating another tab, though.
- It takes approximately 5 minutes to go through 100 pages (in my own case).
- If you want to stop the script, you can click the Cancel button on the left-hand side.
- When it reaches the page you have set at the prompt, the script will automatically stop.
You can set up the script to auto-update in the settings of the UserScript. Open up the plugin settings and select the "LastFM automated duplicate scrobble deletion script." Then, go to the script settings in the upper left-hand corner, check the "Search for updates" checkbox and save.
Alternatively, you can also update it manually by following the installation instructions above or searching for updates in the plugin overview.
- Ability to differentiate within days, hours or minutes (implemented on a different version here: https://gist.github.com/olphil99/161cd24cba9db74fc945f3ebf167a54a by @olphil99, currently not working though)
- Alternatively, since version 1.2.1, the script is able to only remove duplicates from the same timestamp.
Adding a button on the last.fm history page to initiate the script instead of activating and deactivating the Userscript.- added in v1.3
Implementing a "stop at page x" dialogue window.- added in v1.3
Implementing a "check x tracks for duplicates" dialogue window instead of editing "num" in the script- added in v1.3
Eliminate the need to manually edit the script by incorporating a checkbox or another method for configuring options.- added in v1.4
Based on https://gist.github.com/sk22/39cc280840f9d82df574c15d6eda6629#gistcomment-3046698 Thanks to previous contributors @CennoxX, @mattsson, @gms8994, @huw and @sk22 Thanks to new contributions from @Eiron
Feel free to post any problems, fixes, improvements and feedback. I will try to help in any form. To anyone having more experience in Javascript or OpenUserJS/UserScript: your help is also needed to improve the script by implementing the above-mentioned possible future updates as I do not have the necessary skills to contribute.
My library is 411 pages, must I run your script on ALL those pages? Or is it possible to run it against my library all at once?