Google Play/Music with Last.fm

Google Music Player with Last.fm Screenshot
This script allows you to add Last.fm scrobbling support to Google Play/Music. Keep in mind this is a growing project, and there may be bugs introduced by future updated of the Google Play/Music player. If you experience any issues or would like additional features added, please let me know in the comments.

Software Requirements

Installation Directions

  1. If you’re using Firefox you’ll fist need to install Greasemonkey and in Chrome you’ll need to first install Tampermonkey. These extensions allow for user scripts to be installed (which is what this script is).
  2. Download/Install my script* into Greasemonkey or Tampermonkey by following the simple prompts (You may need to restart your browser!).
  3. Go to your Google Music Player.
  4. In the top right next to Settings, Sign out, and Help you should now see “Last.fm Requires Authentication.” Click on this and grant access to my script to Scrobble for you from Last.fm. You should then be redirected back to your Google Music Player.
  5. You’re done! Enjoy. :)

* In Downloading and/or Installing my script you agree to its Privacy Notice and Terms of Use.

Sponsor Future Development

Future Improvements

  • The option for thumbs up clicks to represent a “love” on Last.fm, with the option to turn this feature off.
  • Support for Safari and Opera
  • Have an idea? Post a comment below.

Change Log

June 5, 2014

  • Fixed a cosmetic bug introduced by an update from Google. (Thank you Charlie C.)

March 10, 2014

  • Google changed the DOM structure, updated script to accommodate.
  • Fixed a bug preventing the Super Secret Setting from working.

October 18, 2013

  • Google changed the DOM structure, which required a quick update to the script so the Last.fm option box would show up again.

October 12, 2013

  • Updated the script so it wont float the settings over the new Google header. It should be backwards compatible in the event not everyone has gotten the new update.

August 23, 2013

  • Fixed a bug where disabling scrobbling would still scrobble.
  • Fixed a bug where an artist with an ampersand (&) wouldn’t post to Last.fm.

July 31, 2013

  • Fixed another bug causing duplicate scrobbles; that should be the last of them.
  • Fixed a bug where some people were not seeing the love/unlove heart icon.
  • Fixed a bug where a song with an ampersand (&) wouldn’t post to Last.fm.

July 11, 2013

  • Fixed a bug where duplicate scrobbles would randomly occur for the same song. 

July 3, 2013

  • Complete rewrite of the script from the ground up to handle the recently introduced (and long outstanding) bugs. If you experience anything strange, please let me know ASAP.

May 15, 2013

  • Google released a new player today (it’s pretty neat), but it broke the script. This update primarily fixes that issue (Thank you everyone who reported this bug).
  • Added the ability for a single-song repeat to continuously scrobble every time it is listened to. This update was rolled back in a previous version of the script as it was causing some duplicate scrobbles when it shouldn’t have. If anyone experiences duplicate scrobbling in a row, please let me know (Thank you Onur, Gabor, and everyone else who helped test it).
  • Added album to the scrobbling data passed to Last.fm, so now you should see album art work and album data. This feature was made available in the update released by Google (Thanks you Google).

March 9, 2013

  • Fixed a bug which was preventing scrobbling. Google updated the DOM of the player, causing Last.fm to not accept scrobbles as the album artist was incorrect. Scrobbles should work again now.

November 27, 2012

  • A quick patch put into place to fix a problem with people without Google+ accounts from seeing the settings pane and the ability to authenticate.
  • When the player would load it wouldn’t show the settings unless you navigated to another page and then back again. This has been fixed, but I had to disable scrobbling of the album name (it was flukey anyways) until the next release.

June 5, 2012

  • Added an option to the Super Secret Setting to play nice with one of the new Labs. But I can’t talk about it, because it’s a secret. (Thank you Cory)

May 14, 2012

  • Rolled back the source code to November’s version as it seems the March-May version of the code has a bug I haven’t been able to fix. Until I have a working solution do keep in mind the script will no longer scrobble what album you’re listening to, or allow you to listen to the same song on repeat. I plan on having most of this back in place (after a full re-write) in the next few weeks. If the November script seems to be causing any issues please let me know.

May 12, 2012

  • Fixed a bug where songs would stop scrobbling once the album changed for some people. If your player is still having issues with this let me know. (Thank you Daniel)

March 18, 2012

  • You can now listen to a single song on repeat until your heart explodes with joy and the script will Scrobble every listen.
  • Scrobbling albums now works much better and doesn’t require the script to navigate to the album page on load, but may cause performance issues. In the event you’re experiencing performance issues I’ve added an option in the settings pane to turn off album Scrobbling. Personally with 1335 tracks I’m not seeing any issues in either Firefox or Chrome, but there could be some if you were near the 20,000 maximum. If you are someone who is seeing performance issues please do let me know so I can work with you to get a better optimized release in the future.

March 6, 2012

  • Added play.google.com to the list of domains/websites the script runs on, fixing the new update from “Google Music” to “Google Play.” This will require you to update the script to the latest client from this project page. (Thank you Blake)

November 28, 2011

  • The new Google+ strip caused display issues for people without Google+ accounts. This bug has been fixed and everyone without a Google+ account should now be able to scrobble and/or authorize their account again.

November 23, 2011

  • Google updated the top strip to match the Google+ layout with a black background. I’ve updated the color of the Last.fm text to contrast and match the rest of the Google+ color scheme so the text is readable again. (Thank you Shawn B and Jacob G)

October 7, 2011

  • Fixed a bug in Firefox/Greasemonkey where the script would not load the first time you logged into Google Music Beta. Firefox users will need to re-download the script from this project page and install it for the bug to be fixed. Chrome users need not update to the new client script. (Thank you Josh and Nick)

September 28, 2011

  • Corrected a compatibility issue which caused the script to fail at loading in Firefox 3.5/3.6 with older versions of Greasemonkey. (Thank you Marcos and Holly)

September 27, 2011

  • Changed the way album data is stored locally to optimize the script for users with tens-of-thousands of songs.

September 26, 2011

  • Updated the client script to run over HTTPS properly in newer versions of Greasemonkey/Firefox. This change will not require Chrome users to update their script, but it will not hurt if they do. (Thank you Josh)
  • Updated the server script to run the Scrobbling commands over whatever HTTP/HTTPS you have accessed Google Music from instead of defaulting to HTTP. This was only causing an issue for some Chrome/Firefox users who typed in “HTTPS” when accessing their Google Music Players. (Thank you Josh and Chris)

September 24, 2011

  • Adding Scrobbling of album name. Yay!
  • Fixed a bug where multiple Scrobbles could occur in a row under very rare circumstances.
  • Increased the speed in which the script looks up rather you’ve previously loved the song by 20x (now 1/4 of a second).
  • My server no longer acts as a proxy for Scrobbles, Loves, or Play data allowing for your Last.fm to get updated even faster, and my server not to crash from the large quantity of unexpected users.

July 31, 2011

  • Added a “Super Secret Awesomely Helpful Setting” for anyone who has donated towards the efforts of the script’s development. What is the Super Secret Awesomely Helpful Setting? Well, I can assure you it’s very fancy, but telling you wouldn’t make it Super Secret or Awesome would it? :)

July 28, 2011

  • Fixed a bug causing duplicate scrobbling issues, and server slowdown. I’m sorry for anyone who was affected by this. (Thank you Mike)

July 27, 2011

  • Added a long awaited settings drop-down menu! Hooray!
  • Added “When to Scrobble” as a setting which allows you to specify when during the song it Scrobbles. Defaults to 50%, and has the options: 50, 60, 70, 80, 90.
  • Added “Scrobbling: Yes/No” as a setting which allows you to stop Scrobbling until you re-enable it.
  • Added the ability to un-authenticate your Last.fm account with the script in the event you want to change it, or for whatever reason.
  • Added helpful links to: Donate (hint hint), Contact me (email), Project’s Homepage, and Terms of Service.
  • Have other awesome ideas for additional settings? Yes? Well, then try out the “Contact me” link. :)

June 9, 2011

  • Fixed a bug where “Loving” tracks didn’t work sometimes. (Thank you Caleb)
  • Fixed a bug where songs or artists containing special characters wouldn’t Scrobble. (Thank you Bryan, Caleb)
  • Fixed a bug where the non-existing album art (see: Future Improvements) was pushing to Last.fm as “null” and messing up statistics. Now the album title just isn’t provided, and no statistics on album listens are recorded. Hopefully I’ll find a solution to this soon. (Thank you Doug)

Requirements for a Scrobble

Because I know someone is going to ask, I’m going to put this here. These are the requirements set forth by Last.fm when posting to their servers with a Scrobble. If you don’t see your song marked as being played right away, it’s probably because you haven’t listened to it long enough.

A track should only be scrobbled when the following conditions have been met:

  • The track must be longer than 30 seconds.
  • And the track has been played for at least half its duration, or for 4 minutes (whichever occurs earlier.)

860 Responses to “Google Play/Music with Last.fm”

  • sarble Says:

    Daniel,

    The UI elements are now non-visible for me in Firefox (30 and 31 beta). The scrobbling is still working though :)

  • Gloria Says:

    Hi Daniel, “last.fm requires authentication” doesn’t appear to me. I followed the steps of installation, closed Firefox several times and even tried to re-install Greasemonkey and your script. I’m using Windows 8 and Firefox 29.0.1. Thanks in advance!

  • Jon Says:

    No longer loads or works.
    Chrome Version 35.0.1916.153
    (Donated)

    • calex Says:

      Same here. Except, at least in my case, all I can say is that none of the UI of the userscript is visible. Tampermonkey indicates that the script applies to the current page (via a “1″ overlayed over its icon), which would make me think that it’s loaded. If it’s working or not, I wouldn’t know, because I haven’t been able to set it up yet (a little hard to do with no UI).

      Please let me know if this is fixed. I used to like this extension and was hoping to use it for the first time in a while today.

      Google Chrome version 35.0.1916.153 m
      Tampermonkey version 3.7.48
      (on Win 8.1 x64)

    • by_tor Says:

      Yes, not working for me as well unfortunately. Has Google changed their page layout again or something?

  • Daniel C. Says:

    As of today, my windows7 chrome has decided to block all non store extensions, making your extension non-functional.

    Are you considering setting the extension up in the chrome store? or is this the end of this chrome extension? =(

  • Obedi Ferreira Says:

    Hi dude, your script stopped working for me. I saw on the changelog that a new version was released yesterday, but I uninstalled the previous one and tried to install again but, I’m still getting version 7/31/2013.

    • Daniel Slaughter Says:

      Hello Obedi – There are two version of the script, one being the client and the other being the server. The current client version is 7/31/2013 which should be the one you have installed. The other version is the server, which is what the change log is showing. If you have any other questions please let me know.

  • Charlie Callow Says:

    I really like this script and I have donated! One suggestion I do have though is changing the player name and icon on Last.fm.

    When scrobbling to Last.fm the now playing status lists the player as “Google Music Player” with the old Google Music icon. Could this be updated to the new icon and the new name: “Google Play Music”? Clicking on it also takes you to music.google.com which does redirect but it should really point straight to play.google.com/music

  • by_tor Says:

    hi Daniel, has google changed things around on the Music page again? It has stopped working for me again now…

    • by_tor Says:

      Update: It still works on my Windows 7 laptop, but doesn’t work on my Windows 8 device. I am pretty sure that it was previously working on the Win 8 device but I’m not 100% certain.

      The version of Chrome on the Win 8 device is 34.0.1847.131 m

      This appears to be the same as the version that works OK on the Win 7 laptop.

      ???? :(

    • by_tor Says:

      OK further update:

      The script seems to work on the Win 8 device when Chrome is launched in Windows 8 mode, but not when in “desktop mode”. I don’t really understand the technical differences so I am afraid I can’t be of any further help.

  • Tyler Says:

    This is probably a dumb question, but will this script scrobble Google Music plays from the GM Android app? Or does it only scrobble activity originating from the GM browser client?

  • Kirill Says:

    Hi Daniel, thanks for the great extension! Does exactly what I need. However I’be been experiencing the following issue lately: random scrobbles end up missing. It has happened on two different machines. Have you encountered this before?

    • Daniel Slaughter Says:

      Hello Kirill – Sometimes if Last.fm doesn’t recognize the song (sometimes based on character encoding) it will skip them. I haven’t been able to find a great way to fix that, sadly. Whenever Last.fm doesn’t recognize the song the heart will turn yellow with an exclamation mark. Are you seeing that on those songs?

      • Kirill Says:

        In my case repeatedly scrobbling the track which wasn’t submitted before will most likely succeed. And I don’t have the heart icon — I’ve just learned about its existence from this page.

  • kryksyh Says:

    Is it possible to support Opera (legacy presto version)? I am understand that it is a “dead” piece of software now, but I am use it and it is the only browser that fulfill my needs except support by developers.

    It is already support greasemonkey scripts in a some way, so I guess it is possible to get this script running.

    In any way, thank you for your work.

  • Fred Says:

    Thanks Daniel for the script. Very useful.

    Do you know of any way to import Last.FM Loved Tracks into a playlist for Google Music?

  • Deb Morrissey Says:

    I’ve tried to install this in Firefox several times today, and I am just not seeing the Last.fm authentication button. Any advice? I’ve restarted Firefox twice. And I already had Greasemonkey, so I know that part is fine.

    • Deb Morrissey Says:

      Nevermind, I just restarted one more time and it showed. Odd. Evidently it wanted me to start the browser *without* a Google Music tab already open from the last session.

    • Daniel Slaughter Says:

      Hello Deb – I just released an update moments ago. You’ll need to restart your browser to get the update. If you have any other questions or it still doesn’t work please let me know.

  • by_tor Says:

    Hi, for me the icons at the top right of the Google Music page are no longer displaying, but it still seems to actually scrobble OK (at least it appears so from the Last.fm page!) Not sure if this is only since the last update on 10th March since not used it for a week or so.

  • Jan Says:

    I see in the changelog that you’ve updated the script, but in the js it still says July 31.
    That version isn’t working now :(

    • Daniel Slaughter Says:

      Hello Jan – There’s two version of the script, one being the client and one being the server. The update only altered the server, and so the version in the script itself is still listed as July 31. To get the latest server update you’ll simply have to restart your browser. If that doesn’t fix it, please let me know.

      • Alex Says:

        Hello, Daniel! The script stopped working few days ago. It’s button doesn’t appear in Google Music and no scrobbling is going… I restarted my browser several times, I even tried to re-install Tampermonkey and the script itself but with no success…

      • Daniel Slaughter Says:

        Hello Alex – I just released an update moments ago. You’ll need to restart your browser to get the update. If you have any other questions or it still doesn’t work please let me know.

  • Markus Says:

    I don’t know if this is problem on my end but lately the plugin is not properly aligned with the other icons anymore.
    http://i.imgur.com/SkjnBl6.png

  • blch Says:

    Very nice. Works like a charm. I might even donate after further testing. Cheers.

  • Morvan Says:

    Thanks a lot for your script, it works well, and is very useful.

  • Michael Says:

    Is the lyrics panel not working for anyone else? I know from my Google Search history that it’s searching for it but it never appears. I’ve disabled AdBlock and it’s still not showing up. Any suggestions?

  • mgnrm Says:

    No lastfm hearts here, current browser is Chrome, I thought maybe because of all “adblock/disable trackers etc” it didnt work, so I tried it with Firefox. No luck there. :/
    Either way superb job!

  • Sean Says:

    I’m using the 7/31/2013 client, and I don’t see any love/unlove heart icons. Any suggestions for troubleshooting/fixing?

    • Daniel Slaughter Says:

      Hello Sean – This has been a sporadic problem with others as well. I’ve looked into it but I cannot seem to reproduce the problem. I may just have to re-write that part of the code in the near future.

      • j wu Says:

        This is happening to me as well. One thing I’m using is the google music labs feature to use 5 stars instead thumbs up and down as ratings. Don’t know if that helps or not.

      • Sean Says:

        Daniel – where *should* they appear? Can you post/link a screenshot of what it looks like when everything is working properly?

      • Sean Says:

        Hey, not sure why, but my hearts magically showed up today. :)

  • Clemens Says:

    Hi Daniel,
    great work with this script!! Love it! Everybody should donate at bug to get the super secret awesomely setting! ;-)

    I have a feature request: Google Music gives you suggestions on tracks meta data, album name and such, but you can use the suggestion only on one song at a time. Is their a way to get you script to change a lot of songs to Google’s suggestions as a batch job? Would be helpful if a album you copied from you personal CD collection was not correctly recognizes by the CDDB.
    Anyway, awesome script! Thanks for all your work!
    Love the latest update and the design!

    • Daniel Slaughter Says:

      Hello Clemens – That’s a good suggestion, but I’ve tried fetching track meta data through Google Play before in hopes to use it as the Last.fm data without any luck. If I ever figure out where in the DOM/source Google is storing that, it’s possible I could do something with what you want. However, digging through their source code is very tedious.

  • Dan Says:

    Looks great, but will current Google Music playcounts be synced to last.fm as well when installed? If not, maybe this could be an additional feature in an update. I missed out for awhile on scrobbling and want to keep the statistics together :D

    Thanks

  • Shaqm Says:

    Hey Daniel!
    Great work on the new look/position of the lastfm button :D
    Just noticed it today and it looks amazing!

  • Timothy Nott Says:

    Nicely done! Was baffled as to why it wasn’t showing up, but now all is well. Thanks for the fix! Can I buy you a coke?

  • Maisy Says:

    I can’t get the script to work. It’s enabled in Tampermonkey … I had uninstalled chrome due to something else, reinstalled it, now I add the script to tampermonkey and on my Google Music pages tampermonkey is running the script but nothing shows up anywhere on the page for last.fm. Nothing. Restarting browser and such hasn’t solved it.

    • Maisy Says:

      OK, well I unistalled tampermonkey and reinstalled it and your script. Played something, it’s scrobbling, but there’s NOTHING on my Google Music Page to indicated anything about it.

      • Maisy Says:

        I don’t know what happened, but I tried it on my laptop and it worked flawlessly, and then later on my desktop it was working correctly so …

  • Alexander Says:

    Latest update is broken for me. There is no “Last.fm” button in my Google Apps account.
    Here is how it looks in “regular” google account – http://pix.impa.me/yr14m.png
    And here is how it looks in Google Apps account – http://pix.impa.me/bmfn5.png

  • sarble Says:

    I like your latest update, the new look fits in well with the latest Google redesign.

Leave a Reply