mopidy / mopidy-pandora

A Mopidy extension for playing music from Pandora.
https://mopidy.com/ext/pandora/
Apache License 2.0
27 stars 7 forks source link

Receiving Invalid Auth Token #82

Closed zonywhoop closed 2 years ago

zonywhoop commented 2 years ago

I haven't used the Pandora plugin in a week or so but after a restart of my machine I'm now receiving the error below in the logs from Mopidy-Pandora. The username and password are correct for Pandora so not sure what else may have changed on their side to cause this.

OS: Ubuntu 20.04 Python: 3.8.10 Mopidy Info:

Mopidy 3.2.0 Mopidy-Pandora 1.1.1

Log Output:

Dec 22 18:26:23 daplex mopidy[318526]: ERROR [PandoraBackend-7] pykka Unhandled exception in PandoraBackend (urn:uuid:a5ecfc09-df51-490e-bf31-bd95ee1b31d0): Dec 22 18:26:23 daplex mopidy[318526]: Traceback (most recent call last): Dec 22 18:26:23 daplex mopidy[318526]: File "/usr/lib/python3/dist-packages/pykka/_actor.py", line 186, in _actor_loop Dec 22 18:26:23 daplex mopidy[318526]: self.on_start() Dec 22 18:26:23 daplex mopidy[318526]: File "/usr/local/lib/python3.8/dist-packages/mopidy_pandora/backend.py", line 48, in on_start Dec 22 18:26:23 daplex mopidy[318526]: self.api.login(self.config["username"], self.config["password"]) Dec 22 18:26:23 daplex mopidy[318526]: File "/usr/local/lib/python3.8/dist-packages/pandora/client.py", line 64, in login Dec 22 18:26:23 daplex mopidy[318526]: return self._authenticate() Dec 22 18:26:23 daplex mopidy[318526]: File "/usr/local/lib/python3.8/dist-packages/pandora/client.py", line 70, in > _authenticate Dec 22 18:26:23 daplex mopidy[318526]: user = self.transport( Dec 22 18:26:23 daplex mopidy[318526]: File "/usr/local/lib/python3.8/dist-packages/pandora/transport.py", line 51, in function Dec 22 18:26:23 daplex mopidy[318526]: return func(*args, **kwargs) Dec 22 18:26:23 daplex mopidy[318526]: File "/usr/local/lib/python3.8/dist-packages/pandora/transport.py", line 243, in call Dec 22 18:26:23 daplex mopidy[318526]: return self._parse_response(result) Dec 22 18:26:23 daplex mopidy[318526]: File "/usr/local/lib/python3.8/dist-packages/pandora/transport.py", line 232, in _parse_response Dec 22 18:26:23 daplex mopidy[318526]: raise PandoraException.from_code(result["code"], result["message"]) Dec 22 18:26:23 daplex mopidy[318526]: pandora.errors.InvalidAuthToken: Invalid Auth Token Dec 22 18:26:23 daplex mopidy[318526]: ERROR [MainThread] mopidy.commands Actor died: PandoraBackend (urn:uuid:a5ecfc09-df51-490e-bf31-bd95ee1b31d0) stopped before handling the message

abates commented 2 years ago

I'll take a look at this over the next week or so, sorry I can't get to it sooner.

zonywhoop commented 2 years ago

Looks like it may be tied to issue 69 in pydora which may be linked back to an API thing with pandora..

kirkaholic commented 2 years ago

I had the same issue so I pulled Pydora stand-alone to see if I could troubleshoot the issue. Pydora ran just fine, so I assumed it was a credential issue. Change my Mopidy-pandora config to match Pydora and works fine now:

api_host = tuner.pandora.com/services/json/ partner_encryption_key = MCf5LjjV?Fr4cF4 partner_decryption_key = 2lSj00N1fKYfOk8x partner_username = android-gtv partner_password = ^bs2tzZAM47tvmAvV1GZS^TH1SBW?8o partner_device = gtv2-foster

zonywhoop commented 2 years ago

I tried the above settings and get the same error on mopidy startup:

Dec 24 23:48:52 dabox mopidy[1401616]:     raise PandoraException.from_code(result["code"], result["message"])
Dec 24 23:48:52 dabox mopidy[1401616]: pandora.errors.InvalidPartnerLogin: Invalid Partner Login
Dec 24 23:48:52 dabox mopidy[1401616]: ERROR    [MainThread] mopidy.commands Actor died: PandoraBackend (urn:uuid:73f5ac7f-0f78-4ffd-9973-e5e5762c349e) stopped before handling the message

What version of pydora are you using @kirkaholic? I'm on 2.1.1

mcrute commented 2 years ago

I left a more detailed comment on the pydora issue but the short version is to use the pandora one API key. It's possible the android one is turned-down now.

abates commented 2 years ago

I'm getting "Partner Not Authorized" with the "pandora one" key...

zonywhoop commented 2 years ago

Ran into the same thing but made 2 changes that fixed it;

abates commented 2 years ago

@zonywhoop thanks, I missed the tuner URL above the AIR username. The "pandora one" key works for me now.

abates commented 2 years ago

@zonywhoop can I close this issue? I'll monitor activity on pydora, hopefully we'll get an updated client at some point (see comments @mcrute posted in mcrute/pydora#69)

zonywhoop commented 2 years ago

Yes, I'll close it out..

photoangell commented 2 years ago

@zonywhoop thanks, I missed the tuner URL above the AIR username. The "pandora one" key works for me now.

requires a paid subscription to Pandora. until pydora is fixed, there appears to be no access for free, ad supported, accounts.

detroitgoose commented 2 years ago

Mcrute: "TL;DR: Use the AIR client ID, this is probably not going to be fixable any time soon. ...In-fact the only credential set that seems to work for me anymore is the one from the AIR client."

Same issue as thread topic, but AIR isn't working either. Is there something obviously wrong with my (Mopidy) config?

FWIW I have a Plus account, not Premium.

[pandora]
enabled = true
api_host = internal-tuner.pandora.com/services/json/
partner_encryption_key = 2%3WCL*JU$MP]4
partner_decryption_key = U#IO$RZPAB%VX2
partner_username = 'pandora one'
partner_password = TVCKIBGS9AO9TSYLNNFUML0743LH82D
partner_device = D01
username = xxxxx
password = xxxxx

Single or double quotes around partner_username produce the same error

pandora.errors.InvalidAuthToken: Invalid Auth Token

I really appreciate the work y'all put into this, so thanks for keeping on it.

abates commented 2 years ago

@detroitgoose AIR stopped working for me as well. I don't have a solution to this problem until mcrute/pydora#69 is resolved.