tomahawk-player / tomahawk

Tomahawk, the multi-source music player
http://tomahawk-player.org
GNU General Public License v3.0
2.97k stars 367 forks source link

LastFM Scrobbler doesn't work. #435

Open interpol-kun opened 8 years ago

interpol-kun commented 8 years ago

Hello! Plugin with LastFM scrobbler doesn't work. It's not private mode or smth. I just logged in my LFM account successfully, but it doesn't scrobble my music.

Ubuntu 15.10.

Here is some useful data from logs:

13 2016 - 20:30:20 [0]: void Tomahawk::InfoSystem::LastFmInfoPlugin::createScrobbler() Session key is empty 

13 2016 - 20:30:21 [9]: "<?xml version="1.0" encoding="utf-8"?>
<lfm status="failed">
  <error code="4">Authentication Failed - You do not have permissions to access the service</error>
</lfm>
"

13 2016 - 20:30:21 [0]: void Tomahawk::InfoSystem::LastFmInfoPlugin::onAuthenticated() "Got error in Last.fm authentication job: Authentication Failed - You do not have permissions to access the service" 
muesli commented 8 years ago

I'm afraid this is Last.fm blocking your account for third-party scrobblers. You will have to get in touch with their support to unblock it :-(

scubbx commented 8 years ago

Could it be because of an API change at last.fm? -> https://getsatisfaction.com/lastfm/topics/api-known-issues

Exactly this error is also mentioned in the linked thread.

EvilAaron commented 8 years ago

Wondering this myself. Have a multitude of 3rd party scrobblers working on PC and mobile. Only 3rd party scrobbling I have not working is Tomahawk desktop on windows 10.

If it actually is being blocked, anyone have experience contacting Last.FM support to fix this couldnt find a support email etc, just community support forums lol

Not sure if these api change similar issues are related,

https://getsatisfaction.com/lastfm/topics/authentication-of-3rd-party-apps-should-not-be-marked-off-as-plex-is-still-erroring-out-which-i-assume-means?

"Plex should be fixed from today. One of our users found a workaround, just removing the empty cb parameter we used to send in the URL in the first request. It used to be like this: http://www.last.fm/api/auth?api_key=XXXX&cb= Notice the empty cb (callback) param at the end. Just removing that bit (it was working perfectly before the redesign) fixed the problem._

https://getsatisfaction.com/lastfm/topics/cant-sign-in-to-api-account

ghost commented 8 years ago

The reason this is failing is because the code Tomahawk is using for the Last.fm auth.getMobileSession method is making use of the authToken parameter which is now obsolete. You'll see this if you expand this text on the linked page: This method has other parameters which are now deprecated and should not be used. Although it says "support will be dropped in future", it was actually dropped some months ago.

muesli commented 8 years ago

That's strange, because it sure still has been working for me a few days ago - and as far as i know still does. I'll get in touch with Last.fm's devs.

ghost commented 8 years ago

Are you sure you're not confusing authenticating with scrobbling? If you already have a session key generated before this change, then scrobbling will work just fine.

muesli commented 8 years ago

Just for reference, here are some Tomahawk scrobbles from 23h ago: http://www.last.fm/user/muesli

ghost commented 8 years ago

Oh flip, I just dug out some old code which uses authToken and it works?? Ignore everything I said and sorry for wasting your time!! I know it did stop working but I guess it was only temporary??? I just ended up here following a last.fm forum thread and I really should have double checked what I was saying first.

theli-ua commented 8 years ago

FWIW still wotks fine for me

pXlor commented 8 years ago

Hi, not working for me either, I'm on Ubuntu 14.04 x64, Tomahawk 0.8.4.

pXlor commented 8 years ago

If that can help, here's the term output after doing a "test login":

09:26:33 [1]: virtual void Tomahawk::Accounts::LocalConfigStorage::save(const QString&, const Tomahawk::Accounts::Account::Configuration&) about to save configuration for "lastfmaccount_*****" 09:26:33 [0]: void Tomahawk::InfoSystem::LastFmInfoPlugin::createScrobbler() Session key is empty 09:26:34 [0]: void Tomahawk::InfoSystem::LastFmInfoPlugin::onAuthenticated() "Got error in Last.fm authentication job: Authentication Failed - You do not have permissions to access the service"

EvilAaron commented 8 years ago

^^^ Same thing I am seeing, I even revo uninstalled Tomahawk and did a fresh install of latest nightly same problems :/

ghaspias commented 8 years ago

Hello,

just want to say I also have this problem. I can authenticate ok, but then I can't scrobble or sync history or loved tracks. My log contains this:

Tue May 10 2016 - 13:02:43 [9]: "Last.fm" "resolveraccount_448ac3aa" Tue May 10 2016 - 13:02:43 [9]: Resolver is left over: "Last.fm" "resolveraccount_448ac3aa" Tue May 10 2016 - 13:02:50 [0]: QLayout: Attempting to add QLayout "" to DelegateConfigWrapper "", which already has a layout Tue May 10 2016 - 13:02:56 [0]: QObject::connect: Cannot connect (null)::stateChanged(QNetworkSession::State) to QNetworkReplyHttpImpl::_q_networkSessionStateChanged(QNetworkSession::State) Tue May 10 2016 - 13:02:56 [9]: "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<lfm status=\"failed\">\n <error code=\"9\">Invalid session key - Please re-authenticate</error>\n</lfm>\n" Tue May 10 2016 - 13:02:56 [0]: QMetaObject::invokeMethod: No such method TomahawkApp::onWsError(lastfm::ws::Error) Tue May 10 2016 - 13:02:59 [0]: QObject::connect: Cannot connect (null)::stateChanged(QNetworkSession::State) to QNetworkReplyHttpImpl::_q_networkSessionStateChanged(QNetworkSession::State) Tue May 10 2016 - 13:02:59 [8]: Enqueueing command to thread: Tomahawk::DatabaseWorker(0x7ae31e8) 0 "loadsocialactions" Tue May 10 2016 - 13:02:59 [9]: virtual void Tomahawk::DatabaseCommand_LoadSocialActions::exec(Tomahawk::DatabaseImpl*) Tue May 10 2016 - 13:02:59 [9]: "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<lfm status=\"failed\">\n <error code=\"9\">Invalid session key - Please re-authenticate</error>\n</lfm>\n" Tue May 10 2016 - 13:02:59 [0]: QMetaObject::invokeMethod: No such method TomahawkApp::onWsError(lastfm::ws::Error) Tue May 10 2016 - 13:03:01 [8]: Got status message with login info: false "" Tue May 10 2016 - 13:03:04 [0]: void DelegateConfigWrapper::onConfigTestResult(Tomahawk::Accounts::ConfigTestResultType) 1 Tue May 10 2016 - 13:03:04 [1]: virtual void Tomahawk::Accounts::LocalConfigStorage::save(const QString&, const Tomahawk::Accounts::Account::Configuration&) about to save configuration for "lastfmaccount_8eb3eee3"

I have tried several times disabling, re-enabling lastfm plugin, always with the same results. I am using tomahawk 0.8.99. I can scrobble to lastfm perfectly from a few different apps.

ghost commented 8 years ago

:+1: It is not working for me too :(

Lykos153 commented 8 years ago

Same problem here. Just installed Tomahawk and it's a really decent player. Would love to use it, but not being able to scrobble is a real showstopper for me :/ How can I help do debug it?

It reports success connecting to my account, I can even sync favourites. The history, however, does not show up after importing it.

muesli commented 8 years ago

You'll have to get in touch with Last.fm support. It's not something that broke on our side, as far as we can tell.

ghost commented 8 years ago

Its probably not an issue with Tomahawk player because after i did format on my computer and then installed Tomahawk again it's working perfectly.

Lykos153 commented 8 years ago

That's strange, because it's working perfectly fine on the same machine with Rhythmbox and on Android, too. Does Tomahawk produce any log files I could provide to the last.fm support?

Lykos153 commented 8 years ago

Does Tomahawk use the scrobbling protocol version 2.0? According to the last.fm support, this should afford an authentication in the browser. At least for me, this didn't happen.

Still, it's working fine with every other player on the same device.

The log says:

sex out 7 2016 - 02:03:51 [1]: virtual void Tomahawk::Accounts::LocalConfigStorage::save(const QString&, const Tomahawk::Accounts::Account::Configuration&) about to save configuration for "lastfmaccount_0bb73051" 
sex out 7 2016 - 02:03:51 [1]: void Tomahawk::Accounts::CredentialsManager::setCredentials(const Tomahawk::Accounts::CredentialsStorageKey&, const QVariant&, bool) About to write credentials for key "lastfmaccount_0bb73051" 
sex out 7 2016 - 02:03:51 [1]: void Tomahawk::Accounts::CredentialsManager::setCredentials(const Tomahawk::Accounts::CredentialsStorageKey&, const QVariant&, bool) launched QKeychain::WritePasswordJob for service "Tomahawk" 
sex out 7 2016 - 02:03:51 [0]: void Tomahawk::InfoSystem::LastFmInfoPlugin::createScrobbler() Session key is empty 
sex out 7 2016 - 02:03:51 [0]: void Tomahawk::Accounts::CredentialsManager::keychainJobFinished(QKeychain::Job*) QtKeychain writeJob for "Tomahawk" / "lastfmaccount_0bb73051" finished "without error" 
sex out 7 2016 - 02:03:52 [9]: "<?xml version="1.0" encoding="utf-8"?>
<lfm status="failed">
  <error code="4">Authentication Failed - You do not have permissions to access the service</error>
</lfm>
" 
sex out 7 2016 - 02:03:52 [0]: void Tomahawk::InfoSystem::LastFmInfoPlugin::onAuthenticated() "Got error in Last.fm authentication job: Authentication Failed - You do not have permissions to access the service" 
sex out 7 2016 - 02:03:53 [8]: void Tomahawk::Accounts::AccountManager::enableAccount(Tomahawk::Accounts::Account*) 
sex out 7 2016 - 02:03:53 [1]: virtual void Tomahawk::Accounts::LocalConfigStorage::save(const QString&, const Tomahawk::Accounts::Account::Configuration&) about to save configuration for "lastfmaccount_0bb73051" 
sex out 7 2016 - 02:03:53 [1]: void Tomahawk::Accounts::CredentialsManager::setCredentials(const Tomahawk::Accounts::CredentialsStorageKey&, const QVariant&, bool) About to write credentials for key "lastfmaccount_0bb73051" 
sex out 7 2016 - 02:03:53 [1]: void Tomahawk::Accounts::CredentialsManager::setCredentials(const Tomahawk::Accounts::CredentialsStorageKey&, const QVariant&, bool) launched QKeychain::WritePasswordJob for service "Tomahawk" 
sex out 7 2016 - 02:03:53 [0]: void Tomahawk::Accounts::CredentialsManager::keychainJobFinished(QKeychain::Job*) QtKeychain writeJob for "Tomahawk" / "lastfmaccount_0bb73051" finished "without error" 

and

02:04:06 [0]: void Tomahawk::InfoSystem::LastFmInfoPlugin::nowPlaying(const QVariant&) LastFmInfoPlugin::nowPlaying no m_scrobbler, or cannot convert input! 
02:04:06 [0]: void Tomahawk::InfoSystem::LastFmInfoPlugin::nowPlaying(const QVariant&) No scrobbler! 
ben-xo commented 7 years ago

Hi there, Ben from Last.fm here. Most of these notes are for @muesli, but some are for @interpol-kun.

First of all, perhaps @interpol-kun can try changing their password on the site (feel free to subsequently change it back again) to resynchronise their auth.getMobileSession authToken. We sometimes find that a user's authToken can get out of sync, due to the fact that it's a bit of a hack, and not really supported any more (it's mainly left in place for owners of hardware devices that cannot get their firmware updated, such as Sonos).

More notes, for @muesli:

More notes, for the thread in general:

One final thing to note: we recently expanded the list of characters which can appear in a token or session key, so if you are parsing XML using regexes like a bad person, you might need to update your regexes.