Audiobook Agent(audible).

scanner-agent-dev

#1

There is a new Audiobook Agent hosted here
https://github.com/macr0dev/Audiobooks.bundle

My fork of which is here.
https://github.com/dethrophes/Audiobooks.bundle

This gets the meta data from audible.com or if the language is French, German or Italian it gets the info from audible.fr, audible.de, or audible.it.


#2

Is this an addon for Plex?
Edit I see, a metadata agent. I got a little excited for a second. Was hoping for some (semi) native support of audiobooks in plex lol


#3

@JakeReindl said:
Is this an addon for Plex?
Edit I see, a metadata agent. I got a little excited for a second. Was hoping for some (semi) native support of audiobooks in plex lol

Well, it actually gives you (semi)native support of audiobooks in Plex, it allows you to create a library of audiobooks, it gets the metadata from audible and it lets you play the audiobook and keep track of the position when playing ... the only thing I miss is variable playback speed (1.2, 1.3, 1.x), but that is all!


#4

Good morning,

I have installed Version 1.5.7.4016 on a windows PC.

I am having problems with the plugin, I ma getting an exception in the update function when getting metadata 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
etworkkit.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


#5

Ok, I think I found the problem,

In line 314 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!

The problem is that just refreshing the metadata does not fix the metadata, I have to manualley Fix Match for every audiobook to get the right metadata ... or maybe recreate the library :(

Regards


#6

Change have been made to the main branch for the recent url changes. Additions have been made to allow users outside of north america to use the plugin. Thanks to dethrophes for working that one out.


#7

Hi - This is a great agent that I have been using but I am finding that a single tag includes multiple people. Picture attached. Is it possible that when the agent scrapes Audibles that it creates a individual tag for each entry? Thanks.


#8

Good catch. Hadn't really noticed since the vast majority of my books are single narrator. Shouldn't be too hard to parse that field, check for commas and separate them as different tags.

I've added it as an issue on github and to my list of things to do.


#9

Thanks for the fast response.


#10

Done. It's available in the unsupported appstore now also. You can update directly from there. Once the new version is in place, all you need to do is a quick metadata refresh on the titles that have multiple narrators. They'll update and re-tag correctly now.


#11

Just tested and working great. Thanks!


#12

Great addon but anyhow I have a small problem. As long as I have added this agent it also fetches data from last.fm? Is there a way to disable that behavior?


#13

Nope. Plex is doing this on its own. Perhaps when I get around to writing something for scraping author data from somewhere it will override what it's doing. But right now there is no known way to stop it. By all accounts it shouldn't be. But... there it is.


#14

I have observed a strange behavior but I am a bit unsure how to report it. I have added a test library with 51 audiobooks. They are all listed correctly but as soon as I start refreshing metadata some albums are getting lost and the library displays only 50 instead of 51. How does that happen?


#15

There's a lot of unknowns here. Are you saying that the library adds all the books, downloads metadata for each one - THEN you're clicking "refresh metadata"?

Do you know which book is disappearing? Is it similar in title to another book? Is it possible that the title isn't specific enough that both books are getting grouped together and being cataloged as one book?


#16

Thanks for the hint! I nailed it down and It looks like that the audiobook is grouped together with a similar one as two results are returned from audible during the search.


#17

Okham's razor wins again! :)


#18

I have tried to debug it and collected one example... -removed-
Just as a note, I have added some split to normalizedName to search for proper album name and had to modify AUD_SEARCH_URL to search for advsearchKeywords instead searchAuthor cause of my embedded tags.

Is there a way to disable that merging??


#19

That's a lot of log. Want to narrow it down with an example?

So you're using a modified version? I'm not sure how I can troubleshoot that for you. But I'll give it a shot. Gonna need a lot more specific details though.


#20

Also, which version did you modify? My current release? Or a past one? There's been a lot of changes in the last two weeks.