Giter Club home page Giter Club logo

audnexus.bundle's Introduction

Hello, I'm David Dembeck ๐Ÿ‘‹

GitHub โ€ข LinkedIn

About Me

I'm a passionate software engineer with 2.5 years of experience at Laxamentum Technologies. I've honed my skills in Typescript, C#, Python, and Ruby on Rails. I started my journey in tech with Bash, and I'm constantly seeking innovative solutions to complex problems.

In my spare time, I'm not just a developer, but also a dedicated volunteer at SPCA of Texas, where I've achieved the rank of "Orange" in dog handling. I find immense joy in giving back and making a positive impact on the lives of our furry friends.

I also contribute as a volunteer tester at Plex (Plex Ninja), helping test upcoming features and ensure a stable user experience.

When I'm not coding or volunteering, you'll find me enjoying quality time with my furry companion, Leah ๐Ÿถ, and diving into the immersive world of audiobooks ๐ŸŽง.

My Projects

Here are some of my key projects:

  • Audnexus - An audiobook data aggregation API, combining multiple sources of data into one consistent source.
  • AudiobookDB - A user-contributed metadata database for audiobooks, built on SvelteKit.
  • Bragi Books - An audiobook library cleanup and management tool.

Feel free to explore my repositories to see my coding journey unfold.

Get in Touch

I'm always open to new opportunities and collaborations. If you'd like to connect, feel free to reach out through the email on my profile or connect on LinkedIn.

Let's innovate and create together! ๐Ÿš€

djdembeck's GitHub stats

Top Langs

stats

audnexus.bundle's People

Contributors

csandman avatar djdembeck avatar rabelux avatar xuvatilavv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audnexus.bundle's Issues

Won't appear in plex?

Hi All,

I've been trying to several hours now to have Audnexus appear in Plex under "Plugins" but it won't appear.

I've got it in the correct Plugins folder and it is a .Bundle.

Not sure what I'm doing wrong?

I've installed plenty of other plugins without issues.

Thanks

Issues with multiple series

it looks like there are some issues when a book is in more than one series. for example Men at Arms is the 15th book in the Discworld series but the 2nd book in the City Watch sub series and the scraper has put it as discworld book 3 in the sort title.
image
i assume this is because of how Audible has it on their page.
image
is there a way to say have a setting to always use the larger number (most likely to be the main series and not a sub series)?

Covers not downloading

Screenshot 2023-01-01 at 10-59-43 Plex

I had added new books to my Audiobook library on Plex and the new books do not download covers, but they'll download other metadata. Attached is what the poster page looks like.
Things I have tried:

  1. Refreshing Metadata
  2. deleting the library and adding it again
  3. clearing plugin cache
  4. removing and reinstalling audnexus.bundle

I also use Prologue for the audiobooks and they don't pull the covers since there's none in the plex Metadata

Storytel

First and foremost, thank you for this amazing bundle. Great work!

Will Audnexus support Storytel in the near future?

Cheers

Critical Error during search

I'm having to match manually a lot of my books sadly (I'm not totally sure why as it gets some really well), but I'm seeing if I can figure it out.

What I'm noticing is the plugin gets unloaded every so often. I'm looking at the logs and this is the only one I think could cause it - but it this error is fairly frequent so I'm pretty sure this isn't causing the plugin to be unloaded. I'll keep searching!

2022-01-24 14:05:56,703 (2c98) : CRITICAL (core:574) - Exception in the search function of agent named 'Audnexus Agent', called with keyword arguments {'openSubtitlesHash': 'd2f03a5c14a32630', 'plexHash': '57545da557512216e42cb09d76996b51bca0c771', 'filename': 'D%3A%5CBackups%5CAudible%5CMurderbot%20Diaries%5C3%20-%20Rogue%20Protocol%5CRogue%20Protocol_%20The%20Murderbot%20Diaries%2C%20Book%203%20-%201%20-%20Opening%20Credits%2Emp3', 'parentGUID': 'com.plexapp.agents.audnexus://B000APZA1O?lang=en', 'parentID': '382160', 'duration': '14367', 'id': '382182'} (most recent call last):
File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-f11334058\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 1011, in search
agent.search(*f_args, **f_kwargs)
File "F:\Plex\Plex Media Server\Plug-ins\Audnexus.bundle\Contents\Code_init
.py", line 300, in search
info = self.process_results(search_helper, result)
File "F:\Plex\Plex Media Server\Plug-ins\Audnexus.bundle\Contents\Code_init_.py", line 436, in process_results
score_helper.run_score_book()
File "F:\Plex\Plex Media Server\Plug-ins\Audnexus.bundle\Contents\Code\search_tools.py", line 405, in run_score_book
return self.score_result()
File "F:\Plex\Plex Media Server\Plug-ins\Audnexus.bundle\Contents\Code\search_tools.py", line 413, in score_result
title_score = self.score_album(self.title)
File "F:\Plex\Plex Media Server\Plug-ins\Audnexus.bundle\Contents\Code\search_tools.py", line 476, in score_album
self.reduce_string(scorebase1),
File "F:\Plex\Plex Media Server\Plug-ins\Audnexus.bundle\Contents\Code\search_tools.py", line 382, in reduce_string
.replace(',', '')
AttributeError: 'NoneType' object has no attribute 'lower'

Guide for setting up automatic series collections

Like you've already stated, this agent does not have the ability to generate collections for series' that books are a part of. However, I have found a workaround using Plex-Meta-Manager, which will automatically create smart collections for you based on a variety of criteria, one of those being mood tags.

I wrote a guide on how I finally managed to get this set up to work right and figured I'd share it here.

https://github.com/book-tools/audnexus-pmm-series

If you want, you could include this guide in your project, or simply link to it, but I'm not going to push for either. I just figured other users of this package might be interested in a way to automatically generate collections for their series'.

One side note, my PR #71 was prompted by trying to get rid of authors from mood tags in order to make this process work. I was discussing with another user of this package about how to set up PMM for it, and he was having the same issue.

API is down

Seems to be a cloudflare issue, spitting out 522 errors.

2022-01-29 17:42:45,284 (7f3485898b38) : DEBUG (networking:143) - Requesting 'http://127.0.0.1:32400/library/metadata/67681/tree' 2022-01-29 17:42:45,297 (7f3485898b38) : DEBUG (networking:143) - Requesting 'https://api.audnex.us/books/B07FSNSLZ1' 2022-01-29 17:43:00,643 (7f3485898b38) : ERROR (networking:196) - Error opening URL 'https://api.audnex.us/books/B07FSNSLZ1' 2022-01-29 17:43:00,644 (7f3485898b38) : CRITICAL (agentkit:1095) - Exception in the update function of agent named 'Audnexus Agent', called with guid 'com.plexapp.agents.audnexus://B07FSNSLZ1?lang=en' (most recent call last): File "/usr/lib/plexmediaserver/Resources/Plug-ins-f11334058/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1093, in _update agent.update(obj, media, lang, **kwargs) File "/config/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/__init__.py", line 374, in update self.call_item_api(update_helper) File "/config/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/__init__.py", line 451, in call_item_api helper.UPDATE_URL + helper.metadata.id File "/usr/lib/plexmediaserver/Resources/Plug-ins-f11334058/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 220, in __str__ self.load() File "/usr/lib/plexmediaserver/Resources/Plug-ins-f11334058/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 158, in load f = self._opener.open(req, timeout=self._timeout) File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 435, in open response = meth(req, response) File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 473, in error return self._call_chain(*args) File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 407, in _call_chain result = func(*args) File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) HTTPError: HTTP Error 522:

Plugin doesnt show

I am trying to add the l;=plugin but it doesn't show in plex. I am curious if this could be due to plex no longer supporting plugins or if I did something wrong?

Screenshot 2022-03-27 at 22 31 13

Screenshot 2022-03-27 at 22 31 53

TypeError: None object cannot be quoted

2021-10-05 10:22:30,411 (15225a8b1b38) :  DEBUG (networking:143) - Requesting 'http://127.0.0.1:32400/library/metadata/642932/tree'
2021-10-05 10:22:30,432 (15225a78fb38) :  DEBUG (model:32) - Loading model with GUID com.plexapp.agents.audnexus://B00BHU47C4?lang=en
2021-10-05 10:22:30,434 (15225a78fb38) :  DEBUG (model:234) - Deserializing from /config/Library/Application Support/Plex Media Server/Metadata/Artists/2/adbe34015986de88c1a861f98130838a3498490.bundle/Contents/com.plexapp.agents.audnexus/Info.xml
2021-10-05 10:22:30,441 (15225a8b1b38) :  CRITICAL (agentkit:1018) - Exception in the search function of agent named 'Audnexus Agent', called with keyword arguments {'album': "The Gentleman's Guide to Vice and Virtue", 'index': '1', 'openSubtitlesHash': 'ff89d343351bbab6', 'name': "The Gentleman's Guide to Vice and Virtue", 'artist': '[Unknown Artist]', 'title': None, 'filename': '%2Fdata%2Fmusic%2FAudiobooks%2FMackenzi%20Lee%2FThe%20Gentleman%27s%20Guide%20to%20Vice%20and%20Virtue%2FThe%20Gentleman%27s%20Guide%20to%20Vice%20and%20Virtue%2Em4b', 'plexHash': '012f52f9c7e35119957f4cb32454b275256da243', 'duration': '38845915', 'id': '642932'} (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1011, in _search
    agent.search(*f_args, **f_kwargs)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/__init__.py", line 68, in search
    result = self.call_search_api(search_helper)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/__init__.py", line 168, in call_search_api
    search_url = helper.build_url()
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/search_tools.py", line 187, in build_url
    artist_param = '?name=' + urllib.quote(self.media.artist)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/utils.py", line 54, in quote
    return _urllib_quote(unistr(s), *args, **kwargs)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib.py", line 1287, in quote
    raise TypeError('None object cannot be quoted')
TypeError: None object cannot be quoted

HTTP problems

Due to the lack of internal rate limiting, the Audible search API can start returning blank:

2021-10-03 16:13:07,931 (14674c05fb38) :  DEBUG (networking:143) - Requesting 'https://api.audnex.us/books/1774245442'
2021-10-03 16:13:07,932 (14674c60bb38) :  CRITICAL (runtime:1128) - Exception in thread named '_handle_request' (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 1126, in _start_thread
    f(*args, **kwargs)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/interfaces/socketinterface.py", line 126, in _handle_request
    self.finish()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/tornado/web.py", line 553, in finish
    self.request.finish()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/tornado/httpserver.py", line 432, in finish
    self.connection.finish()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/tornado/httpserver.py", line 262, in finish
    self._finish_request()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/tornado/httpserver.py", line 272, in _finish_request
    connection_header = self._request.headers.get("Connection")
AttributeError: 'NoneType' object has no attribute 'headers'

Artist Matching

I keep running into a weird issue for Artist matching. There are some instances where the artist has an audible entry, but no combination of the name actually pulls it up when searching from the match window. Since authors have an ASIN also I have even tried using it in combination with the name.

Example:

Craig Schrader
www.audible.com/author/Craig-Schrader/B09K4JPXP5
(Book that populated the artist) https://www.audible.com/pd/SuperDrunk-Audiobook/B09QKS71CR

The only match it finds has a score of 46
Craig Schaefer
www.audible.com/author/Craig-Schaefer/B00JYJPVG6

Issue with titles with a colon in them.

I'm using a great tool to extract my audiobooks but it puts the album title as the "book title" + ":" + "sub title". This means this book for example:

https://www.audible.co.uk/pd/That-Which-Other-Men-Cannot-Do-Audiobook/B01D978VII?qid=1643122324&sr=1-1&ref=a_search_c3_lProduct_1_1&pf_rd_p=c6e316b8-14da-418d-8f91-b3cad83c5183&pf_rd_r=62SZTNEB67PAF04W2W96

has the album title of "That Which Other Men Cannot Do: Frontiers Saga, Book 15 (Unabridged)". This doesn't match correctly. If I rename the title to "That Which Other Men Cannot Do" then it works fine.

Looking at the logs I can see the following network request is made from the plugin:
https://api.audible.com/1.0/catalog/products?response_groups=contributors,product_desc,product_attrs&num_results=25&products_sort_by=Relevance&title=That%20Which%20Other%20Men%20Cannot%20Do%3A%20Frontiers%20Saga%2C%20Book%2015&author=Ryk%20Brown

What I don't understand is that the request made does return the book correctly. I must be missing something! Any pointers would be amazing!

New audiobooks match, but fail to fetch metadata (HTTP Error 522?)

Newly added audiobooks appear to automatically match with the correct Author & Title, however it is not able to get any metadata about the book.

Ubuntu Linux
Plex Version 1.27.2.5929

2022-07-18 06:49:49,514 (7f566b512b38) : DEBUG (model:32) - Loading model with GUID com.plexapp.agents.audnexus://1980021341?lang=en 2022-07-18 06:49:49,514 (7f566b512b38) : DEBUG (model:234) - Deserializing from /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Metadata/Albums/5/604d94dae0be5048395d5bf4bdd1c9241881849.bundle/Contents/com.plexapp.agents.audnexus/Info.xml 2022-07-18 06:49:49,518 (7f566b512b38) : DEBUG (networking:143) - Requesting 'http://127.0.0.1:32400/library/metadata/66179/tree' 2022-07-18 06:49:49,524 (7f566b512b38) : DEBUG (networking:143) - Requesting 'https://api.audnex.us/books/1980021341' 2022-07-18 06:49:51,522 (7f566b3e1b38) : ERROR (networking:196) - Error opening URL 'https://api.audnex.us/books/0062853945' 2022-07-18 06:49:51,522 (7f566b3e1b38) : CRITICAL (agentkit:1095) - Exception in the update function of agent named 'Audnexus Agent', called with guid 'com.plexapp.agents.audnexus://0062853945?lang=en' (most recent call last): File "/usr/lib/plexmediaserver/Resources/Plug-ins-a806c5905/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1093, in _update agent.update(obj, media, lang, **kwargs) File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/__init__.py", line 388, in update self.call_item_api(update_helper) File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/__init__.py", line 465, in call_item_api helper.UPDATE_URL + helper.metadata.id File "/usr/lib/plexmediaserver/Resources/Plug-ins-a806c5905/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 220, in __str__ self.load() File "/usr/lib/plexmediaserver/Resources/Plug-ins-a806c5905/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 158, in load f = self._opener.open(req, timeout=self._timeout) File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 435, in open response = meth(req, response) File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 473, in error return self._call_chain(*args) File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 407, in _call_chain result = func(*args) File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) HTTPError: HTTP Error 522:

Chapter bookmarks?

Is there a way to have this plugin fetch chapter timestamps? That would be extremely useful

Improve upon asin force matching

Currently, unlisted items such as the original The Martian, cannot be matched sine they cannot be searched. Yet they're in the API. Need to find a way to short circuit search or search audnexus:
B00B5HZGUG

Album art and metadata keeps changing when I have everything set to local tags

I don't get why this keeps happening to me for starters.

I have followed both your guide and seanaps guide on modifying audiobook meta data to my liking, creating the library, and adding audiobooks to my library.

Using mp3tag I add the data that I want: album cover, artist, book name and album. I have it formatted to a specific way. I upload it to my gdrive and have plex scan it in. I have the library set to settings I have listed below.

artist agent
image
image

album agent
image
image

Library setting
image
image
image
image

My metadata changes constantly. I have a set album art that I want, formatted a specific way and it keeps changing. I am losing my mind as to why my audiobook metadata changes and what is causing the issue. Plex pulls in album art that is not apart of the metadata of the mp3/m4b file that I set in mp3tag. I don't get where it's getting this 2nd album art and why it trys to default to that over the album art that I have set. From my understanding of plex settings that I have it should prioritize my local metadata first before trying to match with audnexus audible data. Has anyone else had this where they add their own metadata from mp3tag and upload and plex just changes the metadata of my albums?

image
image

Not getting agent to show on Unraid or Windows 10

HI,
n00b alert , I've been trying to get audnexus agent to show up without much success .

On Unraid , I'm putting the file inside
/mnt/user/appdata/binhex-plexpass/Plex Media Server/Plug-ins

Owner is Root with -rw-r--r-- permission but to no avail

I then did a server install in Windows & installed the audnexus.bundle inside windows
%LOCALAPPDATA%\Plex Media Server\Plug-ins

I also did library -> advance and restarted my server couple of times , any help would be appreciated.

HTTPError: HTTP Error 404: Not Found

Experiencing several PMScanner crashes and noticed this error in the plug-in logs.

2022-06-15 21:53:04,100 (7f9669c9e808) :  ERROR (networking:196) - Error opening URL 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/resourceHashes'
2022-06-15 21:53:04,100 (7f9669c9e808) :  CRITICAL (runtime:1299) - Exception getting hosted resource hashes (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-3940636f2/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 1293, in get_resource_hashes
    json = self._core.networking.http_request("http://127.0.0.1:32400/:/plugins/com.plexapp.system/resourceHashes", timeout=10).content
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-3940636f2/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 242, in content
    return self.__str__()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-3940636f2/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 220, in __str__
    self.load()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-3940636f2/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 158, in load
    f = self._opener.open(req, timeout=self._timeout)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found

Thought: score album based on name array

Currently author score is based on the first author in the API response, against the media artist field.

In cases of multiple authors, this means scoring is hindered. Since it is comparing a full list of names against one name, the score deduction can fall below the approved threshold of 80. For example:

2021-10-01 12:31:53,331 (1467c0c74b38) :  INFO (sandbox:19) - -----------------------------------ALBUM SEARCH-----------------------------------
2021-10-01 12:31:53,332 (1467c0c74b38) :  INFO (sandbox:19) - Title               Hit Job
2021-10-01 12:31:53,332 (1467c0c74b38) :  INFO (sandbox:19) - Album               Hit Job
2021-10-01 12:31:53,332 (1467c0c74b38) :  INFO (sandbox:19) - Artist              Eric Cunningham, Achilles Stamatelaky, Lauren Gurganous
2021-10-01 12:31:53,336 (1467c0c74b38) :  INFO (sandbox:19) - -----------------------------------Search results-----------------------------------
2021-10-01 12:31:53,337 (1467c0c74b38) :  DEBUG (sandbox:19) - Score deduction from album: 0
2021-10-01 12:31:53,338 (1467c0c74b38) :  DEBUG (sandbox:19) - Score deduction from author: 38
2021-10-01 12:31:53,338 (1467c0c74b38) :  INFO (sandbox:19) - Result #1
2021-10-01 12:31:53,338 (1467c0c74b38) :  INFO (sandbox:19) - ID is               B091ZH3RCM
2021-10-01 12:31:53,338 (1467c0c74b38) :  INFO (sandbox:19) - Title is            Hit Job
2021-10-01 12:31:53,339 (1467c0c74b38) :  INFO (sandbox:19) - Author is           Eric Cunningham
2021-10-01 12:31:53,339 (1467c0c74b38) :  INFO (sandbox:19) - Narrator is         Keke Palmer
2021-10-01 12:31:53,339 (1467c0c74b38) :  INFO (sandbox:19) - Date is             2021-04-09
2021-10-01 12:31:53,339 (1467c0c74b38) :  INFO (sandbox:19) - Score is            62

Refresh Metadata Doesn't Update Artist After Metadata Update

I have several audiobooks that have incorrect metadata. After initial import, I used Picard to update the incorrect metadata so it would match properly. After a "Refresh Metadata" in Plex, the book correctly matches but leaves the author field untouched (and incorrect).

If I remove the file(s) from Plex and place them back in, the book and author correctly match.

Is this a bug, or is there something I can do to make the authors match correctly on refresh?

using length to pick between abridged or not

i have had a few files be incorrectly matched as abridged and i was thinking that maybe you could use the length to help match to the right format. not sure if legacy plugins have access the right data about the media but if so it could help matching.

Supply collection Metadata

Is it possible to supply the series into the collection field instead of mood? This would work with audiobook players like prologue for example

Multiple authors

Hi, I am having a couple of issues with author data.

  1. In the description for this tool, it says "Combines books with multiple authors into the first author, reducing duplicate author entries/pages". But I am getting multiple authors displayed in Plex like this: "H.H. the Dalai Lama; Guy Newland - editor and translator". So several audiobooks by, for example, H.H. the Dalai Lama are showing up as different authors because they each have different co-authors or editors. Is there a way to prevent this from happening? Here's a screenshot:

Screen Shot 2022-09-27 at 3 44 53 pm

  1. Also, even where there is a single author on a book, the name of this author is inconsistent it seems: I have books with the following author names for the same person: H.H. the Dalai Lama, His Holiness the Dalai Lama, Tenzin Gyatso the Fourteenth Dalai Lama. This seems to be a problem with the quality of data retrieved from the API. Can I get this tool to get the author from the tag data instead? What is the best way around this problem?

Many thanks in advance for any help.
Also thanks a lot for providing this great tool.

Colon in filename not working well

The guide says that the files should be named in this schema:

Book Name: Subtitle.m4b

But in some systems this is causing problems:

MacOS
Screenshot 2023-01-01 at 16 51 48

Synology NAS
Screenshot 2023-01-01 at 16 51 16

ASIN extraction can fail

2021-10-14 17:45:18,298 (151c30d4cb38) :  CRITICAL (agentkit:1018) - Exception in the search function of agent named 'Audnexus Agent', called with keyword arguments {'album': 'Training the Samurai Mind', 'openSubtitlesHash': 'dc5a1a661291dc1e', 'name': 'Training the Samurai Mind - A Bushido Sourcebook', 'artist': 'Thomas Cleary - translator/editor', 'title': None, 'filename': '%2Fdata%2Fmusic%2FAudiobooks%2FThomas%20Cleary%20-%20translatoreditor%2FTraining%20the%20Samurai%20Mind%2FTraining%20the%20Samurai%20Mind%20-%20A%20Bushido%20Sourcebook%2Em4b', 'plexHash': 'd3c40d24e4b3d7ae90e1178727c77f142d2599a5', 'duration': '29766296', 'id': '654615'} (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1011, in _search
    agent.search(*f_args, **f_kwargs)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/__init__.py", line 71, in search
    result = self.call_search_api(search_helper)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/__init__.py", line 160, in call_search_api
    search_url = helper.build_url()
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/search_tools.py", line 223, in build_url
    match_asin = re.search(asin_regex, self.media.artist)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/re.py", line 146, in search
    return _compile(pattern, flags).search(string)
TypeError: expected string or buffer

Author Image being used as book cover

Author's image is also being applied as book cover.

Files are named and tagged as per seanap's guide.

Running Version 1.24.3.5033 of Plex and v0.2.3 of the plugin.

Cover issue

Manual search displays author and narrator names incorrectly

When doing a manual match, the search results incorectly display the author initials.
Example:

Recursion by Blake Crouch and narrated by Jon Lindstrom

Is displayed as
"Recursion" by B.C.Crouch w/ J.L.Lindstrom

Expected
"Recursion" by B. Crouch w/ J. Lindstrom

This is probably a straightforward fix, if a string split is done on ' ', to isolate the surname from the given name/initials/etc., before doing the string manipulation to work on authors that use initials instead of a given name. I may do a PR if I'm feeling ambitious, though Python isn't my normal comfort zone.

Matching but no Metadata?

Hi, I think I am doing something wrong :D
I have a test Audio Book I am trying to get info on and struggling. It matches, and if I do Fix Match and search via the agent it finds the book (I'm assuming it is this agent finding it as the result name matches the doc "TITLE" by AUTHOR_FIRSTINITIAL.AUTHOR_LASTNAME w/ NARRATOR_FIRSTINITIAL.NARRATOR_LASTNAME @ 100%".

When I select it on fix, or refesh meta data it goes off and spins the spinner for a while. Basic info such as author/title come back (In my instance "Foxglove Summer" by B.Aaronovitch w/ K.Holdbrook-Smith) but there's nothing else. no cover, description, tags etc.

I am not sure where to look for information to diagnose, I downloaded my plex server logs but couldn't find any entry to do with this particular agent.

Agent does not show up in list of agents

I have installed the plugin into my plugins folder by using git.
Screen Shot 2022-01-14 at 7 55 36 PM

I have noticed that for some reason the file permissions do look different than other plugins, do I need to fix this? what commands should i use to fix these permisisions?
eg this is another plugin, permissions slightly different:
Screen Shot 2022-01-14 at 7 56 36 PM

I also have error in my logs:

./Plex Media Server.1.log:Jan 14, 2022 19:26:52.271 [0x70000ab9e000] WARN - Request for plug-in [com.plexapp.agents.audnexus] but it doesn't exist.
./Plex Media Server.log:Jan 14, 2022 19:27:02.386 [0x7000022f2000] WARN - Request for plug-in [com.plexapp.agents.audnexus] but it doesn't exist.
./com.plexapp.system.log:2022-01-14 19:27:02,382 (70001016a000) :  INFO (agentservice:167) - Agents in com.plexapp.agents.audnexus not in info dictionary - pinging!
./com.plexapp.system.log:2022-01-14 19:27:02,382 (70001016a000) :  DEBUG (networking:143) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.agents.audnexus'
./com.plexapp.system.log:2022-01-14 19:27:02,394 (70001016a000) :  ERROR (networking:196) - Error opening URL 'http://127.0.0.1:32400/:/plugins/com.plexapp.agents.audnexus'
./com.plexapp.system.log:2022-01-14 19:27:02,940 (70000e555000) :  DEBUG (runtime:717) - Handling request GET /system/messaging/clear_events/com.plexapp.agents.audnexus
./com.plexapp.system.log:2022-01-14 19:27:02,952 (70000e555000) :  DEBUG (runtime:814) - Found route matching /system/messaging/clear_events/com.plexapp.agents.audnexus
./com.plexapp.system.log:2022-01-14 19:27:03,575 (70000e555000) :  INFO (agentservice:175) - Receiving agent info from com.plexapp.agents.audnexus: [{'media_types': ['Artist'], 'primary_provider': True, 'fallback_agent': None, 'contributes_to': None, 'languages': ['en', 'de', 'fr', 'it'], 'persist_stored_files': True, 'version': 0, 'accepts_from': ['com.plexapp.agents.localmedia'], 'prefs': True, 'name': 'Audnexus Agent'}]
./com.plexapp.system.log:2022-01-14 19:27:03,589 (70000e555000) :  INFO (agentservice:175) - Receiving agent info from com.plexapp.agents.audnexus: [{'media_types': ['Artist'], 'primary_provider': True, 'fallback_agent': None, 'contributes_to': None, 'languages': ['en', 'de', 'fr', 'it'], 'persist_stored_files': True, 'version': 0, 'accepts_from': ['com.plexapp.agents.localmedia'], 'prefs': True, 'name': 'Audnexus Agent'}, {'media_types': ['Album'], 'primary_provider': True, 'fallback_agent': None, 'contributes_to': None, 'languages': ['en', 'de', 'fr', 'it'], 'persist_stored_files': True, 'version': 0, 'accepts_from': ['com.plexapp.agents.localmedia'], 'prefs': True, 'name': 'Audnexus Agent'}]
./com.plexapp.system.log.1:2022-01-14 19:26:52,266 (700009f27000) :  INFO (agentservice:167) - Agents in com.plexapp.agents.audnexus not in info dictionary - pinging!
./com.plexapp.system.log.1:2022-01-14 19:26:52,267 (700009f27000) :  DEBUG (networking:143) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.agents.audnexus'
./com.plexapp.system.log.1:2022-01-14 19:26:52,271 (700009f27000) :  ERROR (networking:196) - Error opening URL 'http://127.0.0.1:32400/:/plugins/com.plexapp.agents.audnexus'
./com.plexapp.system.log.1:2022-01-14 19:26:52,759 (700009b24000) :  DEBUG (runtime:717) - Handling request GET /system/messaging/clear_events/com.plexapp.agents.audnexus
./com.plexapp.system.log.1:2022-01-14 19:26:52,760 (700009b24000) :  DEBUG (runtime:814) - Found route matching /system/messaging/clear_events/com.plexapp.agents.audnexus
./com.plexapp.system.log.1:2022-01-14 19:26:53,049 (700009b24000) :  INFO (agentservice:175) - Receiving agent info from com.plexapp.agents.audnexus: [{'media_types': ['Artist'], 'primary_provider': True, 'fallback_agent': None, 'contributes_to': None, 'languages': ['en', 'de', 'fr', 'it'], 'persist_stored_files': True, 'version': 0, 'accepts_from': ['com.plexapp.agents.localmedia'], 'prefs': True, 'name': 'Audnexus Agent'}]
./com.plexapp.system.log.1:2022-01-14 19:26:53,059 (700009b24000) :  INFO (agentservice:175) - Receiving agent info from com.plexapp.agents.audnexus: [{'media_types': ['Artist'], 'primary_provider': True, 'fallback_agent': None, 'contributes_to': None, 'languages': ['en', 'de', 'fr', 'it'], 'persist_stored_files': True, 'version': 0, 'accepts_from': ['com.plexapp.agents.localmedia'], 'prefs': True, 'name': 'Audnexus Agent'}, {'media_types': ['Album'], 'primary_provider': True, 'fallback_agent': None, 'contributes_to': None, 'languages': ['en', 'de', 'fr', 'it'], 'persist_stored_files': True, 'version': 0, 'accepts_from': ['com.plexapp.agents.localmedia'], 'prefs': True, 'name': 'Audnexus Agent'}]

Only have option for other plugin, no Audnexus option:
Screen Shot 2022-01-14 at 7 54 57 PM

Please help, I know its something stupid i'm overlooking but i'm stumped.

Supported languages

Does the new plugin support other sites than audible.com? Like audible.de, .fr, ...

Exception getting hosted resource hashes

I installed the plugin and set everything up according to the instructions. I can select Audnexus as agent, but no information is updated in the library and matching is also not working.
I am running plex as a jail on TrueNAS

Errors in logfile:
2022-05-15 15:03:49,626 (8011c3000) : ERROR (networking:196) - Error opening URL 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/resourceHashes' 2022-05-15 15:03:49,628 (8011c3000) : CRITICAL (runtime:1299) - Exception getting hosted resource hashes (most recent call last): File "/usr/local/share/plexmediaserver/Resources/Plug-ins-8cf78dab3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 1293, in get_resource_hashes json = self._core.networking.http_request("http://127.0.0.1:32400/:/plugins/com.plexapp.system/resourceHashes", timeout=10).content File "/usr/local/share/plexmediaserver/Resources/Plug-ins-8cf78dab3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 242, in content return self.__str__() File "/usr/local/share/plexmediaserver/Resources/Plug-ins-8cf78dab3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 220, in __str__ self.load() File "/usr/local/share/plexmediaserver/Resources/Plug-ins-8cf78dab3/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 158, in load f = self._opener.open(req, timeout=self._timeout) File "/usr/local/share/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 435, in open response = meth(req, response) File "/usr/local/share/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/usr/local/share/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 473, in error return self._call_chain(*args) File "/usr/local/share/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 407, in _call_chain result = func(*args) File "/usr/local/share/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) HTTPError: HTTP Error 404: Not Found

Plex version: 1.26.0.5715
TrueNAS version: 12.0

Log FIle: com.plexapp.agents.audnexus.log

Bug? Wrong language fetched, when selecting language from Plex "Fix Match" Pulldown

Hello,

*I have read this issue and understand, that no other language support than english works atm,
but the current bundle's behaviour is kind of cumbersome for the user, because it forced more manual work to change the language back to english from the wrong fetched language.

In Plex, the sumary for artist "Franz Kafka" was fetched in english language. I wanted to change this to german* languange, so I choosed "fix match" and selected "german" as language of my choice. After that, the sumary was fetched in spanish language.

If there exists no german sumary, I'd prefer english language over any other language,
can we have the bundle have fall-back to english language, if the choosen language is not available for sumary?

Having a language like spanish (or french...) might not be understandable by all users, so it might be better to fall back to english language.

EDIT: I tried fixing the artist sumary to english language again, but Plex is fetching spanish language again, so I can not get it back to english.

ASIN quick matching book (album) fails

I am not having luck with the ASIN in the book's folder name. Looking at the logs it looks like the ASIN matching gets altered

My setup:
File path on linux: .../Audiobooks/Andrzej Sapkowski/Sword of Destiny B017WP4D6C/....

The attached log is what happens when I have:

  1. cleaned out my plex audiobooks
  2. move the folder "Sword of Destiny B017WP4D6C" into place.
  3. tell the plex library to scan files

and the attached screen shot is what shows up in plex.

com.plexapp.agents.audnexus-B017WP4D6C.log

Screenshot 2022-06-04 163330

In the log lines below you can see there is the correct ASIN of B017WP4D6C in the file name but it does a quick search on 20B017WP4D which isn't right.

2022-06-04 16:26:32,255 (7fd3293eab38) :  INFO (agentkit:961) - Searching for matches for {'album': 'Sword of Destiny (Unabridged)', 'openSubtitlesHash': 'a033ae7dd9bc6727', 'artist': 'Andrzej Sapkowski', 'title': None, 'filename': '%2Fexports%2Faudiobooks%2FAudiobooks%2FAndrzej%20Sapkowski%2FSword%20of%20Destiny%20B017WP4D6C%2FSword%20of%20Destiny%20%28Unabridged%29%2Em4b', 'plexHash': '0f21a5af6327fe7d51789b7cfda068e015674f32', 'parentGUID': 'com.plexapp.agents.audnexus://B001ICAMAW?lang=en', 'parentID': '693334', 'duration': '46005836', 'id': '693335'}
2022-06-04 16:26:32,256 (7fd3293eab38) :  DEBUG (networking:143) - Requesting 'http://127.0.0.1:32400/library/metadata/693335/tree'
2022-06-04 16:26:32,258 (7fd3293eab38) :  DEBUG (model:32) - Loading model with GUID com.plexapp.agents.audnexus://B001ICAMAW?lang=en
2022-06-04 16:26:32,258 (7fd3293eab38) :  DEBUG (model:234) - Deserializing from /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Metadata/Artists/9/7323b7bed6f8174de0e7cbb5340f500417e8fe2.bundle/Contents/com.plexapp.agents.audnexus/Info.xml
2022-06-04 16:26:32,259 (7fd3293eab38) :  INFO (sandbox:19) - -----------------------------------ALBUM SEARCH-----------------------------------
2022-06-04 16:26:32,259 (7fd3293eab38) :  INFO (sandbox:19) - ID                  B001ICAMAW
2022-06-04 16:26:32,260 (7fd3293eab38) :  INFO (sandbox:19) - Title               Sword of Destiny (Unabridged)
2022-06-04 16:26:32,260 (7fd3293eab38) :  INFO (sandbox:19) - Album               Sword of Destiny (Unabridged)
2022-06-04 16:26:32,260 (7fd3293eab38) :  INFO (sandbox:19) - Artist              Andrzej Sapkowski
2022-06-04 16:26:32,260 (7fd3293eab38) :  INFO (sandbox:19) - ----------------------------------------------------------------------
2022-06-04 16:26:32,260 (7fd3293eab38) :  INFO (sandbox:19) - Using quick match based on asin: 20B017WP4D
2022-06-04 16:26:32,260 (7fd3293eab38) :  DEBUG (runtime:88) - Sending packed state data (108 bytes)

If I fix match with "B017WP4D6C" things correct themselves but that defeats putting the ASIN in the directory name.

Fail to show up the agent

After a reinstall off windows and then plex I tried to get the agent to show up again in plex but it does not work anymore

unknown
unknown (1)
)

I have followed the exact steps of the guides and it always worked until now, any idea what I am doing wrong ?

I restarted plex after the install

I run on the latest Plex Media server (as off today) and the latest W11 build

Genre add can fail

2021-10-03 16:13:14,448 (14674c60bb38) :  DEBUG (networking:143) - Requesting 'https://api.audnex.us/books/B002V9ZA1M'
2021-10-03 16:13:14,550 (14674c031b38) :  CRITICAL (agentkit:1095) - Exception in the update function of agent named 'Audnexus Agent', called with guid 'com.plexapp.agents.audnexus://B002V1NT6I?lang=en' (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1093, in _update
    agent.update(obj, media, lang, **kwargs)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/__init__.py", line 467, in update
    genre['name'] for genre in update_helper.genres
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 107, in <lambda>
    _getiter_           = lambda x: x.__iter__(),
AttributeError: 'NoneType' object has no attribute '__iter__'

2021-10-03 16:13:14,557 (14674c60bb38) :  CRITICAL (agentkit:1095) - Exception in the update function of agent named 'Audnexus Agent', called with guid 'com.plexapp.agents.audnexus://B002V9ZA1M?lang=en' (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1093, in _update
    agent.update(obj, media, lang, **kwargs)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Audnexus.bundle/Contents/Code/__init__.py", line 467, in update
    genre['name'] for genre in update_helper.genres
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-e362dc1ee/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 107, in <lambda>
    _getiter_           = lambda x: x.__iter__(),
AttributeError: 'NoneType' object has no attribute '__iter__'

Updating

If i use git clone https://github.com/djdembeck/Audnexus.bundle.git in my plex folder plugin, the version it downloads is from 30.08.2021, what i am doing wrong?

imagem

Audnexus not showing up in Artists Agents

Installing this for the first time and followed your directions as well as seanap's for setting this plugin up.
After restarting the plex server, the Audnexus Agent is found under Albums/AudNexus Agent, but not Artists.
Tested with both versions .27 and .28. Version .27 works and .28 does not.

Update covers

Any way to get audnexus API to update book covers?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.