HermesApp / Hermes

Compact macOS Pandora client that doesn’t use Flash
http://hermesapp.org/
MIT License
381 stars 99 forks source link

Partner not authorized error #182

Closed bartzy closed 10 years ago

bartzy commented 10 years ago

Hi,

I've been using the Hermes app for some time now without issues, but lately I cannot listen due to an error after the app initializes and tries to login: Partner not authorized.

This is a screenshot of the error: Error screenshot

I'm using Hermes 1.2.1 downloaded from the Hermes website.

Would be great to get some input on this since using the Pandora website is awful ;)

winny- commented 10 years ago

Hi @Bartzy

Are you a Pandora One subscriber? Do you use a proxy and where do you use Hermes from (USA or outside)?

You can get more information about what's happening by launching Hermes in debug mode: Hold down ⌥ (Option key) after launching Hermes. You should see a  (ladybug emoji) in the window's title. You can then view the logging information in Console.app:

  1. Under FILES on the sidebar,
  2. Expand ~/Library/Logs
  3. Expand Hermes
  4. Select the latest log created by Hermes
  5. Select all, copy, then paste into a GitHub comment.

Let me know if you need any help with the instructions.

Winston

bartzy commented 10 years ago

Hi @winny- ,

Thanks so much for the quick reply.

I am a Pandora One subscriber and I'm using a proxy (ibDNS, which is ibVPN's service). I'm outside of USA but am able to use pandora.com without issues with the same ibDNS "proxy" service.

Hermes log:

HermesAppDelegate.m:159 -[HermesAppDelegate applicationDidFinishLaunching:] Starting in debug mode. Log file: /Users/bar/Library/Logs/Hermes/HermesLog_2014-06-12_16:26:20_+0300.log
Pandora.m:281 -[Pandora doPartnerLogin:] Getting partner ID...
Pandora.m:805 -[Pandora sendRequest:] https://tuner.pandora.com/services/json/?method=auth.partnerLogin&partner_id=&auth_token=&user_id=
Pandora.m:805 -[Pandora sendRequest:] https://tuner.pandora.com/services/json/?method=auth.userLogin&partner_id=42&auth_token=VAlqpJUq5XbzM2B%2FGVPLdwDF5HA63B1nFA&user_id=
Pandora.m:308 -[Pandora checkSubscriberStatus:] Checking subscriber status...
Pandora.m:805 -[Pandora sendRequest:] https://tuner.pandora.com/services/json/?method=user.canSubscribe&partner_id=42&auth_token=VIJ4MBgLwOE0o9%2BNuxK6hIRKKj%2BRgrvlA86ZdP3u3fi0T2QgQ517xq3A%3D%3D&user_id=619403374
Pandora.m:319 __33-[Pandora checkSubscriberStatus:]_block_invoke Subscriber status: 1
Pandora.m:805 -[Pandora sendRequest:] https://tuner.pandora.com/services/json/?method=auth.userLogin&partner_id=42&auth_token=VAlqpJUq5XbzM2B%2FGVPLdwDF5HA63B1nFA&user_id=
Pandora.m:266 __41-[Pandora doUserLogin:password:callback:]_block_invoke257 Subscriber detected, re-logging-in...
Pandora.m:281 -[Pandora doPartnerLogin:] Getting partner ID...
Pandora.m:805 -[Pandora sendRequest:] https://internal-tuner.pandora.com/services/json/?method=auth.partnerLogin&partner_id=&auth_token=&user_id=
HermesAppDelegate.m:328 -[HermesAppDelegate handlePandoraError:] error received {
    code = 1010;
    error = "An unexpected error occurred";
    request = "<PandoraRequest 0x60800009e960 auth.partnerLogin>";
}
Pandora.m:805 -[Pandora sendRequest:] https://internal-tuner.pandora.com/services/json/?method=auth.partnerLogin&partner_id=&auth_token=&user_id=
HermesAppDelegate.m:328 -[HermesAppDelegate handlePandoraError:] error received {
    code = 1010;
    error = "An unexpected error occurred";
    request = "<PandoraRequest 0x60800009e960 auth.partnerLogin>";
}
winny- commented 10 years ago

The partner login logic has changed significantly from v1.2.0, do you currently experience this error with the previous version of Hermes? Download link: https://s3.amazonaws.com/alexcrichton-hermes/Hermes-1.2.0.zip

If older versions of Hermes currently does not work for you either, can you try pianobar? Basically you'd need to install Homebrew then run brew install pianobar and run the program from the command line.

If any of the above is true, this may be an issue with Pandora and ibDNS; maybe Pandora is blacklisting API calls from ibDNS? The pandora.com website uses a separate API that doesn't resemble the API used by Pandora apps, Hermes, and pianobar so this could be possible.

bartzy commented 10 years ago

I installed pianobar and it works, and Hermes 1.2.0 that you provided works as well!

Does that mean that 1.2.1 has bugs in its partner login logic?

Thanks!

winny- commented 10 years ago

I recommend using Hermes 1.2.0 for the time being; I'm going to try ibDNS for myself. I hope I can reproduce the problem conditions. Can I ask what country you are using ibDNS from?

Hermes 1.2.1 uses a different partner login for Pandora One subscribers so this may indicate that the Pandora One desktop client's partner login credentials are bad in certain situations.

Pandora's API has been known to treat different locations and logins differently. There are a few open bug reports on pithos/pithos and PromyLOPh/pianobar issue trackers documenting ways the API appears to change in relation to unofficial clients.

So bottom line it could be a bug in Hermes, but it sounds like Pandora is doing something a little odd with ibDNS users.

bartzy commented 10 years ago

I'll be happy to provide you with ibDNS for your IP address if you need to test stuff - contact me at bartzy at gmail dot com.

When using Hermes 1.2.0, I'm getting the "You're using Pandora on multiple devices" error from issue #162. I also got the threatening email. Anything that can be done with this problem?

Thanks!

winny- commented 10 years ago

Those nastygrams appear to be harmless, so far. I'd wouldn't worry about your account. Not certain when that issue will be resolved, however.

Sent an email with the IP address I'd like to test ibDNS from.

Thanks again.

winny- commented 10 years ago

Didn't get a chance to test it before I left the physical location with that IP, but I think I know what's going on.

Below is a chart of what Pandora client uses what API domain for Pandora One users:

Pandora Client the API domain it uses
pianobar tuner.pandora.com(piano.h) unless rpc_host is set in ~/.config/pianobar/config(pianobar/config example)
Pithos tuner.pandora.com unless user checks the "Pandora One Subscriber" preference(pithos.py)
Hermes Using user.canSubscriber API method,(pan-do-ra-api user.canSubscribe) we use internal-tuner.pandora.com for Pandora One users and tuner.pandora.com for regular users(Pandora.m) since v1.2.1
Elpis tuner.pandora.com only(PandoraSharp/Misc.cs)

Summing the data up, only Hermes uses the internal-tuner.pandora.com API domain for Pandora One members by default. So, I am thinking that Hermes v1.2.0 worked because it used the tuner.pandora.com domain, and ibDNS does not redirect internal-tuner.pandora.com DNS queries.

So what we need to do now is contact ibVPN and ask them to support the internal-tuner.pandora.com with their ibDNS service. I suggest you open a ticket and I will write an email.

For the time being here is a modified Hermes from 0986aeff75e95340e800d8af506566403d597a7c (HEAD): https://www.dropbox.com/s/f7vm0t5a4bn8psk/Hermes-1.2.1%20Bartzy.zip


Diff as follows:

diff --git a/Resources/Hermes-Info.plist b/Resources/Hermes-Info.plist
index ec327d3..d309ac2 100644
--- a/Resources/Hermes-Info.plist
+++ b/Resources/Hermes-Info.plist
@@ -19,11 +19,11 @@
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
-   <string>1.2.1</string>
+   <string>1.2.1 Bartzy</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
-   <string>2010</string>
+   <string>2011</string>
    <key>LSApplicationCategoryType</key>
    <string>public.app-category.music</string>
    <key>LSMinimumSystemVersion</key>
diff --git a/Sources/Pandora/Pandora.m b/Sources/Pandora/Pandora.m
index f2a7318..208d0ab 100644
--- a/Sources/Pandora/Pandora.m
+++ b/Sources/Pandora/Pandora.m
@@ -260,14 +260,9 @@ static NSString *hierrs[] = {
         [self doUserLogin:username password:password callback:callback];
       }];
       return;
-    } else if (self.cachedSubscriberStatus.boolValue &&
-               ![self.device[kPandoraDeviceUsername] isEqualToString:@"pandora one"]) {
-      // Change our device to the desktop client, logout, then reinvoke this method
-      NSLogd(@"Subscriber detected, re-logging-in...");
-      self.device = [PandoraDevice desktop];
-      [self logoutNoNotify];
-      [self doUserLogin:username password:password callback:callback];
-      return;
+    } else if (self.cachedSubscriberStatus.boolValue) {
+      // Fix for Bartzy :)
+      NSLogd(@"Subscriber detected, but re-login is diabled...");
     }
     NSLogd(@"Logged in as %@.", username);
     callback(respDict);
bartzy commented 10 years ago

Thanks for all the support!

I opened a ticket with the ibVPN service and am going to try the patched version now, thanks!

winny- commented 10 years ago

Thanks! Please let me know if the patched version works as expected.

bartzy commented 10 years ago

Hi Winny,

I just tried it and it works great! Thanks again for this patch. Is this going to be added to an official version, or we'll wait for ibDNS to work it out?

Thanks.

winny- commented 10 years ago

I think ibDNS will work this out because this limitation on their service affects the official Pandora One client as well as Hermes. Hopefully :octocat:

bartzy commented 10 years ago

OK, thanks ! Now I have my own version ;)

bartzy commented 10 years ago

ibVPN got back to me and fixed the problem. internal-tuner.pandora.com now uses their proxy service as well when using their ibDNS service.

Thanks for all the support Winny! Much appreciated.

winny- commented 10 years ago

Thank you for your patience! :-)