tizonia / tizonia-openmax-il

Command-line cloud music player for Linux with support for Spotify, Google Play Music, YouTube, SoundCloud, TuneIn, iHeartRadio, Plex servers and Chromecast devices.
https://tizonia.org
GNU Lesser General Public License v3.0
1.69k stars 87 forks source link

Spotify: "unable to login offline: no such user" #531

Closed atzorvas closed 5 years ago

atzorvas commented 5 years ago

First of all, gratz for the project!!

Description

Can't use spotify integration

Steps to Reproduce

  1. tizonia --spotify-user atzorvas --spotify-password "XXX" --spotify-track "Can't stop"
  2. 
    tizonia 0.15.0. Copyright (C) 2018 Juan A. Rubio
    This software is part of the Tizonia project <http://tizonia.org>

[Spotify] [Connecting] : 'atzorvas'. [Spotify] [Track search] 'Can't stop'. [Spotify] [Track] 'Can't Stop' [Red Hot Chili Peppers]. [Spotify] [Track] 'We Can't Stop' [Miley Cyrus]. [Spotify] [Track] 'CAN'T STOP THE FEELING! (Original Song from DreamWorks Animation's "TROLLS")' [Justin Timberlake]. [Spotify] [Track] 'Can't Stop At All' [Yella Beezy]. [Spotify] [Track] 'CAN'T STOP THE FEELING! - Film Version' [Justin Timberlake]. [Spotify] [Track] 'I Can't Stop' [Flux Pavilion]. [Spotify] [Track] 'Can't Stop' [Red Hot Chili Peppers]. [Spotify] [Track] 'We Can't Stop' [Bea Miller]. [Spotify] [Track] 'Can't Stop The Feeling' [Piano Pianissimo]. [Spotify] [Track] 'You Can't Stop the Beat' [Elijah Kelley]. [Spotify] [Track] 'Can't Stop' [Dave Matthews Band]. [Spotify] [Track] 'Can't Stop Me Now' [Oh The Larceny]. [Spotify] [Track] 'Steal My Sunshine' [Len]. [Spotify] [Track] 'I Can't Stop Loving You' [Kem]. [Spotify] [Track] 'Can't Stop Dancin'' [Becky G]. [Spotify] [Track] 'I Can't Stop Drinking About You - Chainsmokers Remix' [Bebe Rexha]. [Spotify] [Track] 'I Still Can't Stop' [Flux Pavilion]. [Spotify] [Track] 'Cant Stop' [OneRepublic]. [Spotify] [Track] 'Whatever You Want' [Sports]. [Spotify] [Track] 'Cant Stop' [NxWorries]. [Spotify] [Tracks in queue] '20'. [Spotify] : Spotify cache location: '/home/atzorvas/snap/tizonia/common/tizonia-atzorvas-spotify-atzorvas' [Spotify] : 07:52:32.290 I [offline_authorizer.cpp:297] Unable to login offline: no such user [Spotify] : 07:52:32.299 I [ap:1752] Connecting to AP ap.spotify.com:4070 [Spotify] : 07:52:32.394 I [ap:1226] Connected to AP: 104.199.65.145:4070 [Spotify] : 07:52:32.573 E [ap:3915] Connection error: 410


**Expected behavior:** Be able to listen to some music :)

**Actual behaviour:** 

[Spotify] : 07:52:32.290 I [offline_authorizer.cpp:297] Unable to login offline: no such user [Spotify] : 07:52:32.299 I [ap:1752] Connecting to AP ap.spotify.com:4070 [Spotify] : 07:52:32.394 I [ap:1226] Connected to AP: 104.199.65.145:4070 [Spotify] : 07:52:32.573 E [ap:3915] Connection error: 410


**Reproduces how often:** Always (for me at least..)

### Versions

```tizonia 0.15.0. Copyright (C) 2018 Juan A. Rubio
This software is part of the Tizonia project <http://tizonia.org>

Debug Info:
            * [Boost 1_58]
            * [TagLib 1.9.1]
            * [MediaInfoLib - v0.7.82]
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"

Installation Method Used

Snap package

tizonia commented 5 years ago

Hi!, thanks for taking the time.

I am pretty sure this is the error you get when the credentials used are incorrect. Please check your username and password. Also, note that you need Spotify Premium to stream audio from Spotify using Tizonia.

juanrubio commented 5 years ago

I've created an issue to make sure Tizonia exists with an error message explaining that the login attempt has failed due to incorrect credentials. See #533.

tizonia commented 5 years ago

Closing this question now (note that #533 is now closed).

LazyBoot commented 5 years ago

I'm having the same issue, and I've double and triple checked that the credentials I have provided are correct. Literally copy+pasted from my password manager.

tizonia commented 5 years ago

Is Tizonia outputting this error?

[Spotify] [FATAL] Login attempt failed. Please check the username and password.

If that is the case, then Spotify is the one preventing the login of the user with those credentials. Are you sure you can use those same credentials from another browser?

tizonia commented 5 years ago

@LazyBoot

Is this something that could be happening to you? https://github.com/tizonia/tizonia-openmax-il/issues/468

Also, any non-ascii characters in username or pass?

FrenchieSmalls commented 5 years ago

I get the same error as well. I have triple-checked the credentials against my Spotify application, and they are correct.

No non-ascii characters in either the username or password. I have tried removing all white spaces from those two lines of the config file. Same error.

I have also tried bypassing the config file and entering the credentials directly as input arguments, but I get the same error.

[Spotify] [ERROR] 15:17:03.433 I [offline_authorizer.cpp:297] Unable to login offline: no such user
[Spotify] [FATAL] Login attempt failed. Please check the username and password.
tizonia commented 5 years ago

Really strange. I can't really figure out what is going on.

@atzorvas @LazyBoot @FrenchieSmalls

I suppose you guys are all Premium users, correct? if so, for how long?

Any chances that any of you could temporarily change your password and try with something else? (running out of useful ideas really..)

FrenchieSmalls commented 5 years ago

Yes, Premium account on my end. I've had it for at least a couple of years now.

I probably shouldn't change the password, because my wife uses the account as well.

I thought that there might have been an issue with other open clients, so I made sure that Spotify was closed on my two computers and phone. It may be open on my wife's phone, but she's currently at a conference and won't be actively using the app.

SabataMartin commented 5 years ago

Hello, i got a same problem. TIZONIA without any problem can list the playlist, but can't play them. ??

Spotify] [Track] 'Planet Of New Orleans' [Dire Straits]. [Spotify] [Track] 'How Long' [Dire Straits]. [Spotify] [Track] 'Export Import' [Tosca]. [Spotify] [Tracks in queue] '14'.

[Spotify] [ERROR] 15:49:21.806 I [offline_authorizer.cpp:297] Unable to login offline: no such user [Spotify] [FATAL] Login attempt failed. Please check the username and password. tizonia exiting (OMX_ErrorInsufficientResources).

[OMX.Aratelia.audio_source.spotify.pcm:port:0] [OMX_ErrorInsufficientResources]

tizonia commented 5 years ago

@SabataMartin

Yes, public playlists and in general any other Spotify metadata is accessible without credentials; see

but a Premium account is required to stream the tracks.

Would any of you be able to go to this location with a browser that hasn't got your credentials stored and see if they work in there (I assume they will)?

FrenchieSmalls commented 5 years ago

Would any of you be able to go to this location with a browser that hasn't got your credentials stored and see if they work in there (I assume they will)?

* https://open.spotify.com

My credentials work at that link.

SabataMartin commented 5 years ago

Would any of you be able to go to this location with a browser that hasn't got your credentials stored and see if they work in there (I assume they will)?

* https://open.spotify.com

My credentials work at that link. The same - my login without any problem.

SabataMartin commented 5 years ago

@tizonia

[Spotify] [Connecting] : 'USERNAME'. /usr/local/lib/python2.7/dist-packages/fuzzywuzzy/fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')

BojanZelic commented 5 years ago
[Spotify] [ERROR] 16:14:59.940 I [offline_authorizer.cpp:297] Unable to login offline: no such user
[Spotify] [FATAL] Login attempt failed. Please check the username and password.

Getting the same error. Credentials work at that link...not via tizonia. Not sure if it matters or not but I'm on a Premium Family Plan

tizonia commented 5 years ago

@SabataMartin

That is unrelated. It is just a reminder to install a faster fuzzy matcher. You can do it like this:

sudo -H pip2 install python-Levenshtein
SabataMartin commented 5 years ago

That is unrelated. It is just a reminder to install a faster fuzzy matcher. You can do it like this:

@tizonia OK, thnx :)

tizonia commented 5 years ago

@BojanZelic

Premium Family Plan

My account is the regular Premium account...

LazyBoot commented 5 years ago

Really strange. I can't really figure out what is going on.

I suppose you guys are all Premium users, correct? if so, for how long?

Any chances that any of you could temporarily change your password and try with something else? (running out of useful ideas really..)

I tried changing my password, it didn't help. I've been a premium user since 2009.

tizonia commented 5 years ago

@LazyBoot Thanks for that. I'm located in the UK, and I've just tried through a VPN with US access and in that case, I still can play normally with my account.

I'll keep investigating.

FrenchieSmalls commented 5 years ago

@LazyBoot Thanks for that. I'm located in the UK, and I've just tried through a VPN with US access and in that case, I still can play normally with my account.

I'll keep investigating.

If it helps: I'm located in Germany, but I logged into my VPN with US access and I still get the error.

d1X0n commented 5 years ago

Same problem here, tried Spotify username and e-mail (both are working via open.spotify.com), no special characters, same error when using credentials via tizonia config file and via command parameters. Active Spotify Premium account, Linux Mint 19 Tara, all system and python packages updated. Tizonia installed via shell script and all dependencies are fulfilled.

...
[Spotify] [Cache]: '/var/tmp/tizonia-LOGIN-spotify-USERNAME'
[Spotify] [ERROR] 21:21:09.039 I [offline_authorizer.cpp:297] Unable to login offline: no such user
[Spotify] [FATAL] Login attempt failed. Please check the username and password.
tizonia exiting (OMX_ErrorInsufficientResources).

 [OMX.Aratelia.audio_source.spotify.pcm:port:0]
 [OMX_ErrorInsufficientResources]
tizonia commented 5 years ago

@d1X0n thanks for your feedback.

Unfortunately, I have no idea yet why this is working for some people and not for others. But this is obviously high in my priority list.

fasolens commented 5 years ago

I have exactly the same issue and I use also Premium Family Plan.

atzorvas commented 5 years ago

I do have premium family as well! Do all of us have premium family?

On Sat, Dec 8, 2018, 01:13 Bartłomiej Zieliński <notifications@github.com wrote:

I have exactly the same issue and I use also Premium Family Plan.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tizonia/tizonia-openmax-il/issues/531#issuecomment-445394126, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgMvi_J_lAidhASP8lKoUuQPczgvJ7kks5u2vYggaJpZM4Y7L03 .

tizonia commented 5 years ago

Just a reminder that the Spotify login name currently has to be provided to Tizonia as

'username'

i.e., without the '@domain' part.

I noticed that some of you tried both forms, without luck, but just in case.

LazyBoot commented 5 years ago

Well, my username doesn't have an @domain part anyway.

BojanZelic commented 5 years ago

I just want to add additional steps that I'm taking to make sure that my account doesn't differ in a major way.

Python modules 'spotifyapi' or 'fuzzywuzzy' not found. Please make sure these are installed correctly.


^ that error went away after I `pip install spotipy` but even after this I'm still getting the original error.. as the OP.
tizonia commented 5 years ago

@BojanZelic

Thanks for the summary. This is very useful.

The username that I'm using is the one that's defined here: https://www.spotify.com/us/account/set-device-password/ - username is a series of numbers spotify account is associated with my facebook

This could be the root of the problem. Tizonia and any other open-source application out there that can stream Spotify tracks are based on the old 'libspotify' C library. libspotify requires a non-Facebook username and password. I think my account works perfectly fine because is a regular non-Facebook login account.

Users of the mopidy-spotify extension seem to be reporting this same problem: https://github.com/mopidy/mopidy-spotify/issues/179

Perhaps migration to a non-Facebook login account might be the only option?. Before that, it might be worth going through the instructions on the mopidy-spotify README. There is something about generating app-specific passwords. https://github.com/mopidy/mopidy-spotify/blob/develop/README.rst

tizonia commented 5 years ago

Added a new issue to better document the Spotify login options : #539

@BojanZelic Would you mind filing the docker issue in https://github.com/tizonia/docker-tizonia?. Thanks!

LazyBoot commented 5 years ago

My account is a non-facebook login.

d1X0n commented 5 years ago

To clarify, I also have a non-facebook login (registered via standard Gmail email address). I do not have Spotify account linked or associated with my Facebook account in any way. And as I mentioned before, I have active Spotify Premium subscription (not the family one), password is normal letter & number combination (no special symbols), I'm located outside the US (in Slovakia) and I'm also using the username displayed on this page https://www.spotify.com/sk/account/overview/, altough I get the same error when I use my email address as my login in Tizonia. Hope this info helps in any way. Fingers crossed. And thank you.

juanrubio commented 5 years ago

Would this be of help to anyone?

https://github.com/mopidy/mopidy-spotify/issues/202#issuecomment-446742675

augustpemberton commented 5 years ago

Ive just created a new premium account from scratch, no facebook integration, and this doesn't work. It's a part of a family plan so I don't know if thats the problem but seeing others have had this issue too i doubt it is.

lenarddome commented 5 years ago

@juanrubio Sorry, but that didn't work either. I reinstalled mopidy with the spotify extensions, but still getting the error.

I have the problem on Ubuntu 18.10, tizonia installed via snap, regular premium user.

d1X0n commented 5 years ago

@juanrubio tried to generate mopidy client-id and client-secret credentials on https://www.mopidy.com/authenticate/ and used that as my username and password in tizonia, but unfortunately it didn't work either :(

ElvisExMachina commented 5 years ago

Same login issue, snap install:

[Spotify] [Tracks in queue] '35'.

[Spotify] [ERROR] 19:23:30.173 I [offline_authorizer.cpp:297] Unable to login offline: no such user [Spotify] [FATAL] Login attempt failed. Please check the username and password. tizonia exiting (OMX_ErrorInsufficientResources).

[OMX.Aratelia.audio_source.spotify.pcm:port:0] [OMX_ErrorInsufficientResources]

ElvisExMachina commented 5 years ago

Removed the snap and built from source, same errors:

[Spotify] [ERROR] 20:05:55.136 I [offline_authorizer.cpp:297] Unable to login offline: no such user [Spotify] [FATAL] Login attempt failed. Please check the username and password. tizonia exiting (OMX_ErrorInsufficientResources).

[OMX.Aratelia.audio_source.spotify.pcm:port:0] [OMX_ErrorInsufficientResources]

Interestingly enough it was working on my Kubuntu install as recently as Friday Dec 14 2018. But some drunken disk reorganization messed up that install.

ilp0 commented 5 years ago

Same login issue here, clean install from AUR (latest stable release). I have student spotify premium (should not matter) registered with email.

Same behavior on two different machines, one running Manjaro and other Arch.

GijsVermarien commented 5 years ago

I am getting the same login error, putting username and password in "" did not resolve the issue either. both are defined in the config file. The error:

[Spotify] [Track] 'All I Wanna Do' [Martin Jensen].
[Spotify] [Track] 'Snakker For Meget' [Katie Keller].
[Spotify] [Track] 'Make My Love Go' [Jay Sean].
[Spotify] [Track] 'Don't Let Me Down' [The Chainsmokers].
[Spotify] [Track] 'True Meaning Of Cruel' [Mendoza].
[Spotify] [Track] 'Hallelujah' [Alexander Brown].
[Spotify] [Track] 'For Evigt - Radio Edit' [Volbeat].
[Spotify] [Tracks in queue] '396'.
[Spotify] [Cache]: '/var/tmp/tizonia-user-spotify-USERNAME'
[Spotify] [ERROR] 20:26:10.979 I [offline_authorizer.cpp:297] Unable to login offline: no such user
[Spotify] [FATAL] Login attempt failed. Please check the username and password.
tizonia exiting (OMX_ErrorInsufficientResources).

 [OMX.Aratelia.audio_source.spotify.pcm:port:0]
 [OMX_ErrorInsufficientResources]

The relevant part of the configuration file:

# Spotify configuration
# -------------------------------------------------------------------------
# To avoid passing this information on the command line, uncomment
# and configure accordingly

spotify.user     =USERNAME
spotify.password =PASSWORD
# spotify.recover_lost_token = false (set to true to continue playback after
#                                     the token has been [spuriously?] lost)

The project looks great, shame the logging in does not work

gcanzalo commented 5 years ago

Exact same problem on Debian Stretch.

[Spotify] [Tracks in queue] '30'.

[Spotify] [ERROR] 21:18:17.364 I [offline_authorizer.cpp:297] Unable to login offline: no such user [Spotify] [FATAL] Login attempt failed. Please check the username and password. tizonia exiting (OMX_ErrorInsufficientResources).

[OMX.Aratelia.audio_source.spotify.pcm:port:0] [OMX_ErrorInsufficientResources]

tizonia commented 5 years ago

Hey, thanks everyone for the feedback. It has been very useful.

Here is some more information. I've created a new premium account (non-family, non-facebook login) and I can confirm that the new account does not work with Tizonia (i.e. libspotify), whereas my old account continues to work perfectly fine without any issues.

One obvious difference between the new account and my old account is that the username is not related anymore to the email address and instead it is now a random string of around 25 characters allocated by Spotify.

However, the interesting detail is this one (screenshot from my old account): screenshot from 2018-12-19 23-01-56

Tizonia was registered a long time ago as a Spotify client (required in order to use libspotify); However a user of Tizonia has never needed to explicitly authorize Tizonia to use his/her account. I.e. giving your Spotify credentials to Tizonia was enough to implicitly authorize Tizonia to use your account (I think this is what Spotify calls 'Implicit Grant Flow'). This is what I believe has changed in recent times. So any old users of Tizonia (like me) that already have Tizonia as an authorized app in their account should be able to use Tizonia as normal. But the Implicit Grant Flow seems to be disabled now for libspotify-based clients.

The solution that I believe might work is to implement one of the other authorization flows, like the Authorization Code Flow: https://developer.spotify.com/documentation/general/guides/authorization-guide/#authorization-code-flow

I believe this is what mopidy-spotify does and I suspect still works: https://www.mopidy.com/authenticate/

Tizonia had this for SoundCloud, but not for Spotify, since it has not been required (until now).

I will investigate how to add this new authorization flow for Tizonia.

ElvisExMachina commented 5 years ago

Thanks for investigating. I've been running the heavy spotify client like some kind peasant.

GijsVermarien commented 5 years ago

@tizonia I indeed have a 25 char account name, any help I can provide?

ilp0 commented 5 years ago

I too have 25 char account name. I tried to use both email and the long account name for my username in the config but both give the same error.

tizonia commented 5 years ago

Just another piece of info.

I received last week an email from Spotify asking me to reset my password. Sounds like my attempts to access Spotify from other countries using various VPNs triggered the reset on their end. So I had to change my password and after that, I can no longer access Spotify with Tizonia, even though Tizonia still is displayed in my account as an authorized app.

Maybe I'll have some time to implement the new auth flow this coming weekend.

codeKonami commented 5 years ago

I've created a new premium account today (with a new email address). Try to use it with the latest 0.16.0 version but I'm getting the same error as everybody.

[Spotify] [Cache]: '/var/tmp/tizonia-ubuntu-spotify-_____'
[Spotify] [ERROR] 00:28:09.036 I [offline_authorizer.cpp:297] Unable to login offline: no such user
[Spotify] [FATAL] Login attempt failed. Please check the username and password.

But strangely, if I use the exact same command on an older Tizonia installation (which is on 0.15.0) it does work with the exact same account. Here are the logs

[Spotify] : Spotify cache location: '/var/tmp/tizonia-ubuntu-spotify-_____'
[Spotify] : 00:27:03.490 I [offline_authorizer.cpp:297] Unable to login offline: no such user
[Spotify] : 00:27:03.501 I [ap:1752] Connecting to AP ap.spotify.com:4070
[Spotify] : 00:27:03.563 I [ap:1226] Connected to AP: 104.199.65.2:4070
[Spotify] : 00:27:03.695 I [user_cache:135] UserCache::initiateGetUsers() will query for 1 users
[Spotify] : '[HERE IS DISPLAYED MY 25 CHAR USERNAME]' logged in.

... and then the music plays

I don't know if it's a useful info.

gcanzalo commented 5 years ago

Spotifyd (https://github.com/Spotifyd/spotifyd) works great if all you want is a spotify client.

tizonia commented 5 years ago

Thanks, @codeKonami

I don't know if it's a useful info.

Most useful indeed.

Pretty unfortunate, but a regression was introduced in 0.16.0. Just realized after comparing 0.15.0 and 0.16.0. The fix is now in the develop branch (96074c2).

It looks like an already populated cache (e.g. /var/tmp/tizonia-me-spotify-my) would hide this regression for an existing user of the software (like me). However new users, (or people changing their Spotify passwords, or people installing the software on another machine, where the cache would not be populated yet) would see this problem.

I am spinning a new release now. Version 0.17.0 will be in the repos in the next 2-3 days.

SabataMartin commented 5 years ago

Great,

thnx.

M.

čt 17. 1. 2019 v 0:52 odesílatel Tizonia notifications@github.com napsal:

Thanks, @codeKonami https://github.com/codeKonami

I don't know if it's a useful info.

Most useful indeed.

Pretty unfortunate, but a regression was introduced in 0.16.0. Just realized after comparing 0.15.0 and 0.16.0. The fix is now in the develop branch (96074c2 https://github.com/tizonia/tizonia-openmax-il/commit/96074c2352e7a6b2c676cf25d8c5284f58f4b83f ).

It looks like an already populated cache (e.g. /var/tmp/tizonia-me-spotify-my) would hide this regression for an existing user of the software (like me). However new users, (or people changing their Spotify passwords, or people installing the software on another machine, where the cache would not be populated yet) would see this problem.

I am spinning a new release now. Version 0.17.0 will be in the repos in the next 2-3 days.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tizonia/tizonia-openmax-il/issues/531#issuecomment-454988689, or mute the thread https://github.com/notifications/unsubscribe-auth/ArhRuVXelTyRUHlfnkIIbmqqyg_OClhUks5vD7szgaJpZM4Y7L03 .