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

Exception raised when scanning Angels and Demons (Dan Brown) #9

Closed
matthew-hodgins opened this issue Jul 17, 2017 · 8 comments
Closed

Comments

@matthew-hodgins
Copy link

I'm trying to match Angels and Demons (Dan Brown). The metadata agent ends up with this error:

2017-07-17 16:24:11,446 (270c) : DEBUG (networking:166) - Requesting 'http://127.0.0.1:32400/library/metadata/32841/tree' 2017-07-17 16:24:11,467 (270c) : DEBUG (networking:161) - Fetching 'http://www.audible.com/pd/Religion-Spirituality' from the HTTP cache 2017-07-17 16:24:11,477 (270c) : CRITICAL (core:574) - Exception in the update function of agent named 'Audiobooks', called with guid 'com.plexapp.agents.audiobooks://Religion-Spirituality?lang=xn' (most recent call last): File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-8fa494d15\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 1076, in _update agent.update(obj, media, lang, **kwargs) File "D:\AppData\Local\Plex Media Server\Plug-ins\Audiobooks.bundle\Contents\Code\__init__.py", line 405, in update metadata.posters[1] = Proxy.Media(HTTP.Request(thumb)) File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-8fa494d15\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\networkkit.py", line 177, in Request if url.find(':32400/') > -1 and self._sandbox.policy.elevated_execution == False: AttributeError: 'NoneType' object has no attribute 'find'

I have not seen this error when scanning other audio books.

OS: Windows 8.1
Plex version: 1.7.6.4058

@matthew-hodgins
Copy link
Author

I found a checkbox to enable some more debug logging:
2017-07-17 16:45:12,730 (ef8) : DEBUG (networking:166) - Requesting 'http://127.0.0.1:32400/library/metadata/32841/tree' 2017-07-17 16:45:12,744 (ef8) : INFO (logkit:16) - ***** UPDATING "Angels and Demons" ID: Mysteries-Thrillers - AUDIBLE v.1.2017.03.05.1 ***** 2017-07-17 16:45:12,767 (ef8) : DEBUG (networking:161) - Fetching 'http://www.audible.com/pd/Mysteries-Thrillers' from the HTTP cache 2017-07-17 16:45:12,780 (ef8) : INFO (logkit:16) - ---------------------------------------XPATH SEARCH HIT----------------------------------------------- 2017-07-17 16:45:12,780 (ef8) : INFO (logkit:16) - date: None 2017-07-17 16:45:12,782 (ef8) : INFO (logkit:16) - title: 2017-07-17 16:45:12,782 (ef8) : INFO (logkit:16) - author: 2017-07-17 16:45:12,782 (ef8) : INFO (logkit:16) - series: 2017-07-17 16:45:12,782 (ef8) : INFO (logkit:16) - narrator: 2017-07-17 16:45:12,782 (ef8) : INFO (logkit:16) - studio: 2017-07-17 16:45:12,782 (ef8) : INFO (logkit:16) - thumb: None 2017-07-17 16:45:12,783 (ef8) : INFO (logkit:16) - genres: , 2017-07-17 16:45:12,783 (ef8) : INFO (logkit:16) - synopsis: 2017-07-17 16:45:12,783 (ef8) : CRITICAL (core:574) - Exception in the update function of agent named 'Audiobooks', called with guid 'com.plexapp.agents.audiobooks://Mysteries-Thrillers?lang=xn' (most recent call last): File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-8fa494d15\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 1076, in _update agent.update(obj, media, lang, **kwargs) File "D:\AppData\Local\Plex Media Server\Plug-ins\Audiobooks.bundle\Contents\Code\__init__.py", line 405, in update metadata.posters[1] = Proxy.Media(HTTP.Request(thumb)) File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-8fa494d15\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\networkkit.py", line 177, in Request if url.find(':32400/') > -1 and self._sandbox.policy.elevated_execution == False: AttributeError: 'NoneType' object has no attribute 'find'

@cheveguerra
Copy link

cheveguerra commented Jul 18, 2017

I am getting the same problem, but with the metada of any book:

2017-07-18 10:21:40,709 (16f8) : DEBUG (networking:161) - Fetching 'http://www.audible.com/pd/Health-Fitness' from the HTTP cache
2017-07-18 10:21:40,763 (16f8) : INFO (logkit:16) - ---------------------------------------XPATH SEARCH HIT-----------------------------------------------
2017-07-18 10:21:40,765 (16f8) : INFO (logkit:16) - date: None
2017-07-18 10:21:40,766 (16f8) : INFO (logkit:16) - title:
2017-07-18 10:21:40,766 (16f8) : INFO (logkit:16) - author:
2017-07-18 10:21:40,769 (16f8) : INFO (logkit:16) - series:
2017-07-18 10:21:40,769 (16f8) : INFO (logkit:16) - narrator:
2017-07-18 10:21:40,772 (16f8) : INFO (logkit:16) - studio:
2017-07-18 10:21:40,773 (16f8) : INFO (logkit:16) - thumb: None
2017-07-18 10:21:40,773 (16f8) : INFO (logkit:16) - genres: ,
2017-07-18 10:21:40,776 (16f8) : INFO (logkit:16) - synopsis:
2017-07-18 10:21:40,776 (16f8) : CRITICAL (core:574) - Exception in the update function of agent named 'Audiobooks', called with guid 'com.plexapp.agents.audiobooks://Health-Fitness?lang=xn' (most recent call last):
File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-25d94bad9\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 1076, in update
agent.update(obj, media, lang, **kwargs)
File "C:\Users\Cheve\AppData\Local\Plex Media Server\Plug-ins\Audiobooks.bundle\Contents\Code__init
_.py", line 405, in update
metadata.posters[1] = Proxy.Media(HTTP.Request(thumb))
File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-25d94bad9\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\networkkit.py", line 177, in Request
if url.find(':32400/') > -1 and self._sandbox.policy.elevated_execution == False:
AttributeError: 'NoneType' object has no attribute 'find'
2017-07-18 10:21:40,779 (16f8) : DEBUG (model:229) - Serializing to C:\Users\Cheve\AppData\Local\Plex Media Server\Metadata\Albums\5\2a65eca4d8d5050fadf02c0c26f541bb1d32703.bundle\Contents\com.plexapp.agents.audiobooks\Info.xml
2017-07-18 10:21:40,785 (16f8) : DEBUG (runtime:88) - Sending packed state data (110 bytes)
2017-07-18 10:21:40,785 (16f8) : DEBUG (runtime:924) - Response: [200] str, 16 bytes
I tried with a lot of different audiobooks and always get the same error, it doesn't update any metadata.

Maybe audible changed something in their page that broke the parser!

Best Regards

@cheveguerra
Copy link

cheveguerra commented Jul 18, 2017

Ok, I think I found the problem,
In line 275 of _init_.py we have: " itemId = url.split('/', 5)[4]"
I changed it to: ""itemId = url.split('/', 7)[6]"
I guess Audible changed the format of its URLs and it broke the code!

But just refreshing the metadata does NOT fix the problem, you have to Fix Match for every audiobook to get the right metadata ... or maybe recreate the Library.

Regards

@revelous
Copy link

Yep, cheveguerra is correct. I just figured out the same thing...
It's too much trouble to fix match everything, rebuilding the library now...

@macr0dev
Copy link
Owner

It looks like audible has changed something in their site in the last couple of days. My own server loaded a book fine last week, but a quick test this afternoon gives a couple of errors and doesn't load all the data.

I'll dig in and make some corrections.

@macr0dev
Copy link
Owner

macr0dev commented Jul 18, 2017

OK. The url split change has been committed to the master branch. All is right with the world. Thanks to cheveguerra for spotting that so quickly.

@cheveguerra
Copy link

cheveguerra commented Jul 18, 2017

After changing the line 275, the descriptions load, but only if unmatch/rematch or fix matching, or new audiobook!

@macr0dev
Copy link
Owner

Yeah. No fix for that. That's a "this is how plex works" issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants