PromyLOPh / pianobar

Console-based pandora.com player
http://6xq.net/pianobar/
Other
1.73k stars 323 forks source link

Login fails (Invalid username and/or password) #721

Closed fengshaun closed 3 months ago

fengshaun commented 2 years ago

Subject of the issue

Briefly describe your issue here.

When trying to login, I get the error "Auth token invalid". Turning on debug, I see the response is "Invalid username and/or password". I use the same username and password to login to pandora's website and use the Pandora app on my phone.

Your environment

pianobar-git as of today 2021-11-20

Raspbian 10 (buster)

ffmpeg 4.1.8

empty

Steps to reproduce

Tell us how to reproduce this issue.

Attempt to login, enter email and password (copy paste from password manager to ensure no typos).

Expected behaviour

Tell us what should happen.

Login successfully.

Actual behaviour

Tell us what happens instead, including a copy of all error messages.

pi@pando:~ $ PIANOBAR_DEBUG=1 ./pianobar-git/pianobar
Welcome to pianobar (2020.11.28-dev)! Press ? for a list of commands.
(i) Control fifo at /home/pi/.config/pianobar/ctl opened
[?] Email: redacted
[?] Password: redacted
(i) Login... ← https://tuner.pandora.com:443/services/json/?method=auth.partnerLogin
→ {"stat":"ok","result":{"stationSkipLimit":6,"partnerId":"42","partnerAuthToken":"VAI+vKUfyXtPdsbrHCETrIscpfjtWrvBUu","urls":{"autoComplete":"http://autocomplete-sc.pandora.com/search"},"syncTime":"9f9ffee492a660bd188e12bb6e6b7c60","stationSkipUnit":"hour"}}
← https://tuner.pandora.com:443/services/json/?method=auth.userLogin&auth_token=VAI%2BvKUfyXtPdsbrHCETrIscpfjtWrvBUu&partner_id=42
→ {"stat":"fail","code":1001,"message":"Invalid username and/or password"}
Error: Invalid auth token.
PromyLOPh commented 2 years ago

I can’t reproduce the issue. Is it still happening?

fengshaun commented 2 years ago

Unfortunately yes. How would I be able to further debug this issue? It's happening with latest release and git versions.

PromyLOPh commented 2 years ago

Hard to say. I doubt your username/password combination is the problem. I get a different error code (1002) when using a wrong username/password combination. You could try to apply a patch like this to make sure the request looks good too:

diff --git a/src/libpiano/request.c b/src/libpiano/request.c
index 69e49a1..d980a43 100644
--- a/src/libpiano/request.c
+++ b/src/libpiano/request.c
@@ -529,6 +529,7 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req,

        /* json to string */
        jsonSendBuf = json_object_to_json_string (j);
+       printf ("send data: %s\n", jsonSendBuf);
        if (encrypted) {
                if ((req->postData = PianoEncryptString (ph->partner.out,
                                jsonSendBuf)) == NULL) {

What’s your libcurl/json-c version?

fengshaun commented 2 years ago

Thank you for the update.

It's sending the correct username and password. I have masked theme here.

Welcome to pianobar (2020.11.28-dev)! Press ? for a list of commands.
(i) Control fifo at /home/pi/.config/pianobar/ctl opened
(i) Login... send data: { "username": "android", "password": "partnerpassword", "deviceModel": "android-generic", "version": "5", "includeUrls": true }
← https://tuner.pandora.com:443/services/json/?method=auth.partnerLogin
→ {"stat":"ok","result":{"stationSkipLimit":6,"partnerId":"42","partnerAuthToken":"VAI+vKUfyXtPfsIy+7EiaEZt+NVsL+GoDg","urls":{"autoComplete":"http://autocomplete-sc.pandora.com/search"},"syncTime":"5df8dd6638bf8b6ffee96b490dbb264b","stationSkipUnit":"hour"}}
send data: { "loginType": "user", "username": "email@example.com", "password": "pandorapassword", "partnerAuthToken": "VAI+vKUfyXtPfsIy+7EiaEZt+NVsL+GoDg", "syncTime": 1637787276 }
← https://tuner.pandora.com:443/services/json/?method=auth.userLogin&auth_token=VAI%2BvKUfyXtPfsIy%2B7EiaEZt%2BNVsL%2BGoDg&partner_id=42
→ {"stat":"fail","code":1001,"message":"Invalid username and/or password"}
Error: Invalid auth token.

libcurl4 7.64.0 libjson-c-dev 0.12.1

PromyLOPh commented 2 years ago

And partnerpassword is AC7IBG09A3DTSYM4R41UJWL07VLN8JI7 (see https://6xq.net/pandora-apidoc/json/partners/#android)?

You could try to dump the communication of the app on your phone and compare it with what pianobar is doing. To me there’s no obvious reason why auth.userLogin is not working.

fengshaun commented 2 years ago

Yup.

Alright, I'll try and see what I can find. Hopefully something shows up!

governor22 commented 10 months ago

I just updated my MacOS to Catalina and now pianobar gives me the same error:

Login... Error: Invalid auth token.

Pandora website works fine. Pandora iOS app works fine. Using VPN

Basically pianobar & Hermes app both stopped working.

Did anyone figure this out ?

UPDATE: Changed my VPN to another part of USA and it's working now. All good!

bonelifer commented 9 months ago

Mine was working. I've been trying to get a lastfm scrobbler working and then all of a sudden I get this same error. The fact that your VPN worked might mean you had too many streams going and that IP temporarily got banned. At least that's what I read at this link: https://amplipi.discourse.group/t/pandora-stopped-working-recently-auth-token-issue/217/2 Hopefully it'll start working tomorrow for me.