Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spotify_player asking for a username and password #201

Closed
mariano-daniel opened this issue May 22, 2023 · 23 comments
Closed

spotify_player asking for a username and password #201

mariano-daniel opened this issue May 22, 2023 · 23 comments
Labels
bug Something isn't working

Comments

@mariano-daniel
Copy link

I looked up the main page and documentation page and nowhere this is mentioned.

I tried the API client_id, my email username, the username that shows on my profile, none of them work.

What am I supposed to enter when it's asking for my username? 🤷🏻‍♂️

spotify_player
No cached credentials found, please authenticate the application first.
Username: xxxxx@icloud.com
Password for xxxxx@icloud.com: 
Failed to authenticate, 2 tries left
Username (default: xxxxxx@icloud.com): al3dtskdslj3b35s40
Password for al3dtskdslj3b35s40: 
Failed to authenticate, 1 tries left
Username (default: al3dtskdslj3b35s40): 
@mariano-daniel mariano-daniel added the bug Something isn't working label May 22, 2023
@aome510
Copy link
Owner

aome510 commented May 22, 2023

I'm not sure if you have the same thing but in my case, Spotify username should be able to find on the Account Overview website. Here is mine for reference (username is the first one and email is the second one):

Screenshot 2023-05-22 at 2 27 38 PM

@mariano-daniel
Copy link
Author

mariano-daniel commented May 22, 2023 via email

@aome510
Copy link
Owner

aome510 commented May 22, 2023

Hello Thang Pham! Yep, that’s the one I’ve used and it did not work. Did it
work for you?

Just tried and it still works for me. Can you also provide the logs in ~/.cache/spotify_player` if any?

@mariano-daniel
Copy link
Author

spotify-player-23-05-22-02-05.log

Hello @aome510 ! Logs attached. unfortunately they don't seem to be very verbose, just say bad credentials. But i'm entering the same info when I'm login into my spotify profile, but using the username you mentioned on your screenshot (but for me, of course)

@aome510
Copy link
Owner

aome510 commented May 23, 2023

hmmm, that's really weird. At this point, I actually don't know the cause. Can you double check if the same combination of username and password works in the official Spotify website?

@mariano-daniel
Copy link
Author

hmmm, that's really weird. At this point, I actually don't know the cause. Can you double check if the same combination of username and password works in the official Spotify website?

Yep, it works when I login to the site, not when I try the program. I can email you a video with tests.

Thanks!

@adworacz
Copy link

adworacz commented May 24, 2023

I'm running into this as well - I created a new client ID in my spotify account (although I have no idea what to set the redirect URL to, and there's nothing mentioned in the config.md documentation about what to use), so I just used http://localhost:8080/.

I've tried twice now to enter my credentials, and I'm getting timeouts of some kind:

2023-05-24T16:55:26.147375Z  INFO spotify_player::auth: Creating a new session with new authentication credentials
2023-05-24T16:57:49.906749Z  WARN spotify_player::auth: Failed to authenticate: Cannot create session: Connection timed out (os error 110)

@aome510
Copy link
Owner

aome510 commented May 24, 2023

Yep, it works when I login to the site, not when I try the program. I can email you a video with tests.

Can u email me an email if possible?

I created a new client ID in my spotify account (although I have no idea what to set the redirect URL to, and there's nothing mentioned in the config.md documentation about what to use), so I just used http://localhost:8080/.

Did u put client_id = "http://localhost:8080/"? You don't need a redirect URL for spotify_player unlike spotify-tui. spotify-player relies on username/password to authenticate. client_id is only needed if you want to use https://github.com/aome510/spotify-player#spotify-connect.

It's recommended to specify your own Client ID to avoid possible rate limits and to allow a full Spotify connect support.

From config.md document, it's not required to specify your own client ID though.

@adworacz
Copy link

Spotify requires that you specify a redirect URL when creating the client ID, otherwise it errors:

2023-05-24_17:41:39_maim

Did u put client_id = "http://localhost:8080/"?

No I didn't. I put the client ID generated via the Spotify Developer website. And I only tried to generate a client ID after the first attempt at using username/password failed.

The same timeout occurs if I comment out the client_id entry in app.toml.

@aome510
Copy link
Owner

aome510 commented May 25, 2023

@adworacz thanks for the clarification. Can you try running RUST_LOG=debug spotify_player and send me a corresponding log?

Related issue: librespot-org/librespot#1010. Look like this happens because librespot couldn't connect to a specific AP.

@adworacz
Copy link

I'd wager you're correct on that linked issue.

Here's the pertinent logs I see when using RUST_LOG=debug

2023-05-25T16:25:31.793573Z  INFO spotify_player::auth: Creating a new session with new authentication credentials
2023-05-25T16:25:46.650291Z DEBUG hyper::client::connect::dns: resolving host="apresolve.spotify.com"
2023-05-25T16:25:46.691555Z DEBUG hyper::client::connect::http: connecting to 34.98.74.57:80
2023-05-25T16:25:46.736232Z DEBUG hyper::client::connect::http: connected to 34.98.74.57:80
2023-05-25T16:25:46.736799Z DEBUG hyper::proto::h1::io: flushed 47 bytes
2023-05-25T16:25:46.829042Z DEBUG hyper::proto::h1::io: parsed 5 headers
2023-05-25T16:25:46.829083Z DEBUG hyper::proto::h1::conn: incoming body is content-length (169 bytes)
2023-05-25T16:25:46.829113Z DEBUG hyper::proto::h1::conn: incoming body completed
2023-05-25T16:25:46.829175Z DEBUG hyper::client::pool: pooling idle connection for ("http", apresolve.spotify.com:80)
2023-05-25T16:25:46.829266Z  WARN librespot_core::apresolve: Ignoring blacklisted access point ap-gue1.spotify.com:4070
2023-05-25T16:25:46.829273Z  WARN librespot_core::apresolve: Ignoring blacklisted access point ap-gew4.spotify.com:80
2023-05-25T16:25:46.829280Z  INFO librespot_core::session: Connecting to AP "ap-guc3.spotify.com:4070"
2023-05-25T16:27:57.722605Z  WARN spotify_player::auth: Failed to authenticate: Cannot create session: Connection timed out (os error 110)

@adworacz
Copy link

Ahhhh now this is interesting - it seems to be related to my work VPN.

If I'm off VPN, I can login just fine and start playing music. If I'm on VPN, I can't start spotify-player at all, even after having successfully authenticated while off VPN.

This is interesting, since I don't have these issues with spotify-tui + spotifyd while on VPN.

@aome510
Copy link
Owner

aome510 commented May 25, 2023

I also guess that it's a VPN issue or something related.

This is interesting, since I don't have these issues with spotify-tui + spotifyd while on VPN.

I think spotify_player uses the same setup as spotifyd to create a session so I don't know how spotifyd works but spotify_player does not.

@aome510
Copy link
Owner

aome510 commented May 25, 2023

Look like the only difference I can find is that spotifyd specifies a default ap_port=443: https://github.com/Spotifyd/spotifyd/blob/1c149822b13ba0b542f27aca353ee85fd78f97d4/src/config.rs#L855-L860.

Can you try if specifying ap_port = 443 in app.toml works?

@adworacz
Copy link

adworacz commented May 25, 2023

Can you try if specifying ap_port = 443 in app.toml works?

Worked like a charm!!

I can login, listen to music, the whole nine yards!

@mariano-daniel
Copy link
Author

Yep, it works when I login to the site, not when I try the program. I can email you a video with tests.

Can u email me an email if possible?

I didn't quite get this request. What should I put in the email?

@aome510
Copy link
Owner

aome510 commented May 26, 2023

I didn't quite get this request. What should I put in the email?

I thought you're going to send an email with the video. FYI, my email: phamducthang1234@gmail.com

@mariano-daniel
Copy link
Author

I didn't quite get this request. What should I put in the email?

I thought you're going to send an email with the video. FYI, my email: phamducthang1234@gmail.com

Email sent! Thank you.

@aome510
Copy link
Owner

aome510 commented May 28, 2023

@mariano-daniel thanks for the video. Look like the login is failed because you're not in premium account. A premium account is required to use spotify_player.

@mariano-daniel
Copy link
Author

@mariano-daniel thanks for the video. Look like the login is failed because you're not in premium account. A premium account is required to use spotify_player.

But why would it throw bad credentials though? Shouldn't at least me log me in and then throw an error?

@aome510
Copy link
Owner

aome510 commented May 28, 2023

But why would it throw bad credentials though?

Exactly =)). It used to throw a better error: #29 (comment)

This seems to change because I updated the printing mechanism for error from debug to normal.

The reason is that the third-party library that spotify_player relies mostly for handling Spotify stuff doesn't support it: librespot-org/librespot#862

I'll close this issue for now. Feel free to re-open it if you encounter similar issues.

@yashrajbains
Copy link

yashrajbains commented Aug 14, 2024

Hey there! Following through this thread as I am encountering the same exact issue. Though my issue isn't resolved after specifying ap_port = 443 in app.toml

Any ideas?

@ManiArasteh
Copy link
Contributor

@yashrajbains Read README.md

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants