# Audiobook Agent(audible).

**URL:** <https://forums.plex.tv/t/audiobook-agent-audible/197419>\
**Category:** Dev/API Corner\
**Tags:** scanner-agent-dev\
**Created:** [June 29, 2017, 5:06pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419 "2017-06-29T17:06:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dethrophes](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@dethrophes](https://forums.plex.tv/u/dethrophes)\
**Post date:** [June 29, 2017, 5:06pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/1 "2017-06-29T17:06:20Z")

</div>

There is a new Audiobook Agent hosted here

> **[macr0dev/Audiobooks.bundle](https://github.com/macr0dev/Audiobooks.bundle)**
>
> Plex metadata scraper for Audiobooks. Contribute to macr0dev/Audiobooks.bundle development by creating an account on GitHub.

My fork of which is here.

> **[dethrophes/Audiobooks.bundle](https://github.com/dethrophes/Audiobooks.bundle)**
>
> Plex metadata scraper for Audiobooks. Contribute to dethrophes/Audiobooks.bundle development by creating an account on GitHub.

This gets the meta data from [audible.com](http://audible.com) or if the language is French, German or Italian it gets the info from [audible.fr](http://audible.fr), [audible.de](http://audible.de), or audible.it.

---

<div class="post-metadata">

**Author:** ![Jakesparrow](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jakesparrow/32/83875_2.png) [@Jakesparrow](https://forums.plex.tv/u/Jakesparrow)\
**Post date:** [July 6, 2017, 2:28pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/2 "2017-07-06T14:28:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cheveguerra](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@cheveguerra](https://forums.plex.tv/u/cheveguerra)\
**Post date:** [July 17, 2017, 11:21pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/3 "2017-07-17T23:21:43Z")

</div>

> @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!

---

<div class="post-metadata">

**Author:** ![cheveguerra](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@cheveguerra](https://forums.plex.tv/u/cheveguerra)\
**Post date:** [July 18, 2017, 3:35pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/4 "2017-07-18T15:35:14Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![cheveguerra](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@cheveguerra](https://forums.plex.tv/u/cheveguerra)\
**Post date:** [July 18, 2017, 6:16pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/5 "2017-07-18T18:16:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![macr0dev](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/macr0dev/32/83401_2.png) [@macr0dev](https://forums.plex.tv/u/macr0dev)\
**Post date:** [July 19, 2017, 5:32pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/6 "2017-07-19T17:32:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Silverlin](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@Silverlin](https://forums.plex.tv/u/Silverlin)\
**Post date:** [July 22, 2017, 9:42pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/7 "2017-07-22T21:42:09Z")

</div>

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.

 ![](https://sea1.discourse-cdn.com/plex/uploads/default/original/3X/d/0/d0366f942f7c72786b2a795a04a13b9d411132cb.png)

---

<div class="post-metadata">

**Author:** ![macr0dev](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/macr0dev/32/83401_2.png) [@macr0dev](https://forums.plex.tv/u/macr0dev)\
**Post date:** [July 22, 2017, 11:01pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/8 "2017-07-22T23:01:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Silverlin](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@Silverlin](https://forums.plex.tv/u/Silverlin)\
**Post date:** [July 22, 2017, 11:14pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/9 "2017-07-22T23:14:17Z")

</div>

Thanks for the fast response.

---

<div class="post-metadata">

**Author:** ![macr0dev](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/macr0dev/32/83401_2.png) [@macr0dev](https://forums.plex.tv/u/macr0dev)\
**Post date:** [July 23, 2017, 2:34am UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/10 "2017-07-23T02:34:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Silverlin](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@Silverlin](https://forums.plex.tv/u/Silverlin)\
**Post date:** [July 23, 2017, 5:02pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/11 "2017-07-23T17:02:33Z")

</div>

Just tested and working great. Thanks!

---

<div class="post-metadata">

**Author:** ![daeks](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/daeks/32/17467_2.png) [@daeks](https://forums.plex.tv/u/daeks)\
**Post date:** [July 27, 2017, 5:18am UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/12 "2017-07-27T05:18:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![macr0dev](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/macr0dev/32/83401_2.png) [@macr0dev](https://forums.plex.tv/u/macr0dev)\
**Post date:** [July 27, 2017, 1:22pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/13 "2017-07-27T13:22:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![daeks](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/daeks/32/17467_2.png) [@daeks](https://forums.plex.tv/u/daeks)\
**Post date:** [July 27, 2017, 7:12pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/14 "2017-07-27T19:12:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![macr0dev](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/macr0dev/32/83401_2.png) [@macr0dev](https://forums.plex.tv/u/macr0dev)\
**Post date:** [July 27, 2017, 7:19pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/15 "2017-07-27T19:19:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![daeks](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/daeks/32/17467_2.png) [@daeks](https://forums.plex.tv/u/daeks)\
**Post date:** [July 27, 2017, 7:31pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/16 "2017-07-27T19:31:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![macr0dev](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/macr0dev/32/83401_2.png) [@macr0dev](https://forums.plex.tv/u/macr0dev)\
**Post date:** [July 27, 2017, 7:48pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/17 "2017-07-27T19:48:46Z")

</div>

Okham’s razor wins again! 🙂

---

<div class="post-metadata">

**Author:** ![daeks](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/daeks/32/17467_2.png) [@daeks](https://forums.plex.tv/u/daeks)\
**Post date:** [July 27, 2017, 8:01pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/18 "2017-07-27T20:01:09Z")

</div>

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??

---

<div class="post-metadata">

**Author:** ![macr0dev](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/macr0dev/32/83401_2.png) [@macr0dev](https://forums.plex.tv/u/macr0dev)\
**Post date:** [July 27, 2017, 8:29pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/19 "2017-07-27T20:29:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![macr0dev](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/macr0dev/32/83401_2.png) [@macr0dev](https://forums.plex.tv/u/macr0dev)\
**Post date:** [July 27, 2017, 8:29pm UTC](https://forums.plex.tv/t/audiobook-agent-audible/197419/20 "2017-07-27T20:29:53Z")

</div>

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.

[Next page](https://forums.plex.tv/t/audiobook-agent-audible/197419.md?page=2)
