Kodi Community Forum
[OBSOLETE] Pandora Radio (Script) Music Addon - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Music Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=148)
+---- Thread: [OBSOLETE] Pandora Radio (Script) Music Addon (/showthread.php?tid=70471)



- htpc guy - 2011-08-29

Just pulled from git. I made sure I deleted the userdata folder for Pandora before firing up XBMC. Just like before I can open the addon, enter my login info and play music. If I try to open it again I get a script failed error.

Here is the pastebin. Debug Log

Sorry, I haven't had time to look through this myself yet.


- garbear - 2011-08-29

toymachine2009 Wrote:Okay I see on Aug 22nd there was a fix on the back navigation... How would I go about updating this on my Pandora? uninstall add-on and reinstall?

Hey toymachine, you can find the most up-to-date files here: https://gitorious.org/xbmc-pandora/xbmc-pandora/trees/master. On the right is a link to download all files.

These files get placed in your addons folder (for example, my Pandora addon is C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora). If you want to uninstall Pandora, delete the script.xbmc.pandora folder.

For future reference, any addon settings you save are stored in your userdata\addon_data folder. For my Pandora addon, this folder is C:\Users\Garrett\AppData\Roaming\XBMC\userdata\addon_data\script.xbmc.pandora.


- toymachine2009 - 2011-08-29

garbear Wrote:Hey toymachine, you can find the most up-to-date files here: https://gitorious.org/xbmc-pandora/xbmc-pandora/trees/master. On the right is a link to download all files.

These files get placed in your addons folder (for example, my Pandora addon is C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora). If you want to uninstall Pandora, delete the script.xbmc.pandora folder.

For future reference, any addon settings you save are stored in your userdata\addon_data folder. For my Pandora addon, this folder is C:\Users\Garrett\AppData\Roaming\XBMC\userdata\addon_data\script.xbmc.pandora.

Thank you! Appreciate the help will try this now thanks so much for the help!

Edit: So I downloaded "Master as tar.gz" Deleted all files in the addon folder and replaced it with those.. and well I still cant back out of it Sad


- garbear - 2011-08-30

toymachine2009 Wrote:Thank you! Appreciate the help will try this now thanks so much for the help!

Edit: So I downloaded "Master as tar.gz" Deleted all files in the addon folder and replaced it with those.. and well I still cant back out of it Sad

Haha well I guess that wasn't it then. What version/nightly of xbmc are you using? there was some activity concerning this on August 9 and (circa) August 6 in the git repo.

(mostly towards spbogie): I don't know what the root cause is, or how to fix it (not a big python programmer), but pull request 336 might offer some helpful information on how to fix/improve this.


- toymachine2009 - 2011-08-30

garbear Wrote:Haha well I guess that wasn't it then. What version/nightly of xbmc are you using? there was some activity concerning this on August 9 and (circa) August 6 in the git repo.

(mostly towards spbogie): I don't know what the root cause is, or how to fix it (not a big python programmer), but pull request 336 might offer some helpful information on how to fix/improve this.

I'm using 10.1 Dharma


- spbogie - 2011-08-31

Sorry I've been a bit quiet, work has been crazy lately. I'm looking into the various issues right now and will post an update shortly.


- spbogie - 2011-08-31

V1.2.5 is up. Should hopefully fix most of the issues. I changed the way the key files are stored so if it errors try forcing a re-fetch.


- garbear - 2011-08-31

Hey spbogie,

Basically, you rock for making this extension. I isolated the crash-on-second-start problem. The keys are pickled with Windows line endings \0d0a on my Windows system. Reading them back crashes the script (see error report below). I converted the files to Unix \0d and Pandora no longer crashes.

I found another minor error-handling problem too, see my next post.

Code:
PANDORA: Loading key from file "C:\Users\Garrett\AppData\Roaming\XBMC\userdata\addon_data\script.xbmc.pandora\key_in"
PANDORA: Unexpected error:<type 'exceptions.ValueError'>:insecure string pickle
-->Python script returned the following error<--
Error Type: <type 'exceptions.ValueError'>
Error Contents: insecure string pickle
Traceback (most recent call last):
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\default.py", line 235, in <module>
    panda = Panda()
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\default.py", line 60, in __init__
    self.pandora = Pandora( dataDir, fmt )
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\libpandora\pandora.py", line 33, in __init__
    if not self.keys.loadKeys():
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\libpandora\keys.py", line 39, in loadKeys
    "key_in" ) )
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\libpandora\keys.py", line 103, in _loadKeyFromFile
    tmp = pickle.load( f )
  File "C:\Users\Garrett\Documents\XBMC\system\python\Lib\pickle.py", line 1370, in load
    return Unpickler(file).load()
  File "C:\Users\Garrett\Documents\XBMC\system\python\Lib\pickle.py", line 858, in load
    dispatch[key](self)
  File "C:\Users\Garrett\Documents\XBMC\system\python\Lib\pickle.py", line 966, in load_string
    raise ValueError, "insecure string pickle"
ValueError: insecure string pickle
-->End of Python script error report<--



- Shalun - 2011-08-31

spbogie Wrote:V1.2.5 is up. Should hopefully fix most of the issues. I changed the way the key files are stored so if it errors try forcing a re-fetch.

I admit it, been far too long away from xbmc. How do I obtain the logging/debug information for spbogie?

Installing via the 1.2.5 zip, no change in behavior. Refetch doesn't change behavior. Deletion of C:\Users\user\AppData\Roaming\XBMC\userdata\addon_data\script.xbmc.pandora fixes it until next exit.

Also, am I going blind? Using nightlies, I am not finding the pandora plugin under the xbmc.org add repository.

Sorry spbogie.

Thank you.


- garbear - 2011-08-31

Here's another bug report. Steps to reproduce: Start Pandora for the first time and hit cancel on the settings (I don't know, maybe someone is chronically indecisive Smile ) Instead of aborting, Pandora saves the invalid settings, tries to log in, fails, and asks if you want to return to settings. If you choose no, Pandora crashes (see traceback below).

If you start Pandora a second time, it tries to use the invalid settings to log in and shows the same prompt to return to settings. If you choose no again, the same crash occurs.

Expected behavior: Clean exit with no crash on invalid login. Also, if you hit cancel, abort the login attempt instead of saving invalid settings and proceeding with login.

Code:
(answered no to to DialogYesNo)
------ Window Deinit (DialogYesNo.xml) ------
-->Python script returned the following error<--
Error Type: <type 'exceptions.AttributeError'>
Error Contents: Panda instance has no attribute 'player'
Traceback (most recent call last):
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\default.py", line 235, in <module>
    panda = Panda()
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\default.py", line 87, in __init__
    self.quit()
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\default.py", line 227, in quit
    if self.player and self.player.timer\
AttributeError: Panda instance has no attribute 'player'
-->End of Python script error report<--
------ Window Init (DialogKaiToast.xml) ------
(DialogKaiToast saying that the script crashed)



- toymachine2009 - 2011-08-31

Hopefully 1.2.5 update fixes the backout issue I'll try it tonight..


- toymachine2009 - 2011-08-31

toymachine2009 Wrote:Hopefully 1.2.5 update fixes the backout issue I'll try it tonight..

updated version works awesome 0 problems! Backs out no problem and no more restarting xbmc!

Great work and don't change a thing!

Love this add-on!


- spbogie - 2011-08-31

Nice catch garbear, seems we may have had a few overlapping issues with the key saving on non-*nix systems. I've set it to use the highest available pickle protocol, so it should save the files in binary instead of ascii now. Hopefully that will clear up this error then. I've also fixed it so it should fail more gracefully if the user doesn't enter a username/password.

Changes are up on git. Give them a test.

Edit: Also @All, just a note because I've seen a few notifications about it recently. Unless you intend to develop against the script, there is no need to create a clone of the repository on gitorious. If you want to keep up and be notified of changes use the Watch button instead.


- garbear - 2011-08-31

Something is still screwball with the object serializer. I can tell it's using binary because the size of the key files has gone from 16kb to 7kb. Pandora still can't load the serialized keys! Looking in my hex editor, there is still 27 occurrences of \x0d0a. Shooting in the dark here, I changed all to \x0d but it just corrupted the file and auth always failed (even if I chose to Re-Fetch Keys).

If I delete just the key files, Pandora uses my email and password saved in the settings to generate new keys and starts playing music like nothing's wrong.

It looks like pickle is being slain by a null character \x00 somewhere. The error is being thrown within the pickle lib itself, so there may be little your code can do to circumvent this error (maybe pickle lib is out of date..?)

Code:
PANDORA: Loading key from file "C:\Users\Garrett\AppData\Roaming\XBMC\userdata\addon_data\script.xbmc.pandora\key_in"
PANDORA: Unexpected error:<type 'exceptions.KeyError'>:'\x00'
-->Python script returned the following error<--
Error Type: <type 'exceptions.KeyError'>
Error Contents: '\x00'
Traceback (most recent call last):
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\default.py", line 242, in <module>
    panda = Panda()
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\default.py", line 61, in __init__
    self.pandora = Pandora( dataDir, fmt )
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\libpandora\pandora.py", line 33, in __init__
    if not self.keys.loadKeys():
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\libpandora\keys.py", line 39, in loadKeys
    "key_in" ) )
  File "C:\Users\Garrett\AppData\Roaming\XBMC\addons\script.xbmc.pandora\libpandora\keys.py", line 103, in _loadKeyFromFile
    tmp = pickle.load( f )
  File "C:\Users\Garrett\Documents\XBMC\system\python\Lib\pickle.py", line 1370, in load
    return Unpickler(file).load()
  File "C:\Users\Garrett\Documents\XBMC\system\python\Lib\pickle.py", line 858, in load
    dispatch[key](self)
KeyError: '\x00'
-->End of Python script error report<--



- spbogie - 2011-08-31

Doh, try that.