Skip to content

feat: rename agent and add fallback API with custom host support#130

Open
binyaminyblatt wants to merge 11 commits intodjdembeck:developfrom
binyaminyblatt:backup-api
Open

feat: rename agent and add fallback API with custom host support#130
binyaminyblatt wants to merge 11 commits intodjdembeck:developfrom
binyaminyblatt:backup-api

Conversation

@binyaminyblatt
Copy link
Copy Markdown

  • Renamed from "Audnexus Agent" to "Audnexus Agent With Backup API"
  • Changed CFBundleIdentifier from com.plexapp.agents.audnexus to com.plexapp.agents.audnexuswithbackup
  • Default API is now https://audnex.us/, with fallback to https://audimeta.de/
  • Added support for custom API host configuration
  • Improved logging with more detailed output
  • Switched from from logging import Logging to from audnexuslogging import Logging to avoid conflicts with internal logging
  • Added type hints for improved clarity and tooling support
  • Enforced code style using flake8
  • Bumped version number

djdembeck and others added 3 commits August 25, 2023 12:47
- Renamed from "Audnexus Agent" to "Audnexus Agent With Backup API"
- Changed CFBundleIdentifier from `com.plexapp.agents.audnexus` to `com.plexapp.agents.audnexuswithbackup`
- Default API is now https://audnex.us/, with fallback to https://audimeta.de/
- Added support for custom API host configuration
- Improved logging with more detailed output
- Switched from `from logging import Logging` to `from audnexuslogging import Logging` to avoid conflicts with internal logging
- Added type hints for improved clarity and tooling support
- Enforced code style using flake8
- Bumped version number
@Vito0912
Copy link
Copy Markdown

If you are using AudiMeta, please include a meaningful User Agent. This will help me block traffic if there are any bugs in current or future versions that might cause too many requests from mmultiple sources at the same time.
I have set up rate limiting, but it would still be better if a User Agent is used and I know who I need to contact incase this happens.

- Added functionality to tag albums as explicit based on metadata from audnexus
- Implemented `set_metadata_adult` function in `AlbumUpdateTool` to add "Explicit" and "ADULT" labels to albums in Plex
- Uses `plexapi` to interact with the Plex server and add labels
- Requires `PLEXTOKEN` environment variable to be set but it should be set by Plex
- Added `PlexPluginCodePolicy` key to `Info.plist` with value `Elevated` to allow plugin to interact with the Plex server
- Updated version to 1.3.4
- PYTHON PACKAGES we can use plexapi and requests now unfortunately we nead  to include the packages in the repo
@binyaminyblatt
Copy link
Copy Markdown
Author

binyaminyblatt commented May 24, 2025

If you are using AudiMeta, please include a meaningful User Agent. This will help me block traffic if there are any bugs in current or future versions that might cause too many requests from multiple sources at the same time. I have set up rate limiting, but it would still be better if a User Agent is used and I know who I need to contact incase this happens.

@Vito0912 any suggestions of something that would be meaningful

Copy link
Copy Markdown

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarCloud found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@binyaminyblatt
Copy link
Copy Markdown
Author

i just added id3 tag support for the ASIN this should help with #123

@Vito0912
Copy link
Copy Markdown

See https://www.rfc-editor.org/rfc/rfc9110#name-user-agent
But basically AppName/Version (URL or/and contact info) [optional details] would be benefitial.

@binyaminyblatt
Copy link
Copy Markdown
Author

binyaminyblatt commented May 28, 2025

I set it to
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.6312.86 Safari/537.36; Plex-Audnexus/'+VERSION_NO+' (+https://github.com/binyaminyblatt/Audnexus.bundle/issues)'

See https://www.rfc-editor.org/rfc/rfc9110#name-user-agent But basically AppName/Version (URL or/and contact info) [optional details] would be benefitial.

@binyaminyblatt
Copy link
Copy Markdown
Author

@djdembeck would you be willing to review this pull

@djdembeck
Copy link
Copy Markdown
Owner

djdembeck commented Feb 10, 2026

Thanks for the comprehensive work on this, @binyaminyblatt! I appreciate the effort you've put into adding these features.

However, this PR has grown beyond a single feature and combines multiple concerns that need to be reviewed and released separately:

Breaking changes that need discussion:

  • Bundle identifier rename (com.plexapp.agents.audnexuscom.plexapp.agents.audnexuswithbackup) — This would break existing Plex libraries using the agent. What's the rationale for this change?

Features that should be separate PRs:

  1. Fallback API support — The original scope. This is valuable and I'd like to merge it.
  2. Custom API host configuration — Could be bundled or separate.
  3. audiobookcovers.com integration — New feature, needs independent review.
  4. Adult content labeling — Touches Plex API integration, needs careful review.
  5. ID3 ASIN extraction — Addresses Places to put ASIN (other than folder name)? #123, should be standalone.
  6. GraphicAudio support — New metadata source, separate concern.

Next steps:
Would you be willing to split this into focused PRs? I'd suggest starting with just the fallback API feature (commits related to that), then we can review the others individually. This makes it possible to give proper attention to each change and release them incrementally rather than all-or-nothing.
Also, regarding the bundle ID change — is there a technical reason this is necessary, or could we keep the existing identifier to avoid breaking existing installations?

@Vito0912
Copy link
Copy Markdown

@binyaminyblatt I discontinued the Audimeta provider. Please see the README. I would call it a lucky coincidence that Audnexus is being maintained again (well on the other hand idk, if AI PRs and even AI answers/comments are such a good inidcation), but neither Audnexus nor Audimeta are needed at all.

There is no scraping needed for any information Audnexus (or Audimeta) provides. The only benefit is that Audnexus (and Audimeta as well) may cache responses and do not hit Audible as often. But as this is the design of Audible and it caches itself, that makes up for nothing, especially since searching still has to be done outside of Audnexus.

So TL;DR, other than having a slightly more inconvenient way to get the data (because of a different structure), there is no need for such a proxy. It only adds delay and the risk of complete failure, which has already happened twice with Audnexus (and also Audimeta).

Thus I decided to stop working on my project altogether and also showed some few projects how to migrate to a way more response friendly design (basically everything can be done in one request [searching (with book data), series, author books etc. etc.]

While this is a software based/devolved by the same author it makes sense to be based on Audnexus, but I can just recommend to use the Audible API directly in such cases.

@binyaminyblatt
Copy link
Copy Markdown
Author

binyaminyblatt commented Feb 11, 2026

Also, regarding the bundle ID change — is there a technical reason this is necessary, or could we keep the existing identifier to avoid breaking existing installations?

it was done for testing so i could have both installed at the same time then when i asked ai to help me write the pr i forgot it was there I should change it back at this point. I just haven't had a chance to seeing as How the whole code bases is about to become useless. Seeing as how they're removing the feature

@binyaminyblatt
Copy link
Copy Markdown
Author

binyaminyblatt commented Feb 11, 2026

Some of the other features that I added in after I started the PR were

Personally, I'm a nut for type casting things. I cannot look at code without it so I added in type notes for almost every function in the code base as well as the whole Plexhint at the top.

I made it so The agent could actually label adult content as adult content by adding the ability to directly edit the content, the reason I did this is because you can only use tags for Plexs parental controls I was actually looking into basically integrating the collection system that is used by kometa directly into the agent. It should be possible at least with my fork because the agent now has the ability to access Plex's API and make real edits. To address security concerns, I recommend we move this feature to be optional a.k.a. add a preference that is by default, disabled and require it to be enabled manually by making the user type in to a preference box I consent or something like that
This is actually the feature that is probably the most interesting about this whole PR seeing as How the fallback url is being shut down the ability to make collections and possibly series's is the feature that's been missing from Plex and the only way to do it has been with external tools it would be very nice if it was self contained

The graphic audio part I do not believe I ever got finished. I seem to remember it never worked properly though it would probably be much easier to have a second crack at now because basically I have another repo which scrapes everything off of graphic audio and just stores it in a json file so all it would have to do is download it and look it up https://github.com/binyaminyblatt/graphicaudio_scraper

As far as reading the ID3 tags to try and figure out the ASIN it works fine. I've used it many times.

And if it's still works, I'm not 100% sure if it still works because their API is very flaky the audiobookcovers API was working last time I tested it. I don't use it personally, but I figured it'd be nice to implement.

I'd be very happy to break this into multiple PR's. The only reason I didn't was the original PR was done so long ago and there was no response so I just kept working on it and adding new things to the point where it ballooned to be this mess of code. But if you look at the comments, each feature is individually committed for the most part.

As for the fallback API seeing is how it's about to be shut down I don't know that it's a good place to start if I was going to try breaking this up

Oh yeah, I also added a couple on Settings to allow me to run local copies of both APIs especially since the public version hasn't been updated in a very long time

The code was actually written by me. I just had an AI spit out the original pull request, which is why we ended up with the changed name. I really should undo that at this point.
I think in some of my code notes at some point I actually put in a note that said this will need to be changed to when we're ready to merge it to the repository

@binyaminyblatt
Copy link
Copy Markdown
Author

binyaminyblatt commented Feb 11, 2026

@binyaminyblatt I discontinued the Audimeta provider. Please see the README. I would call it a lucky coincidence that Audnexus is being maintained again (well on the other hand idk, if AI PRs and even AI answers/comments are such a good inidcation), but neither Audnexus nor Audimeta are needed at all.

There is no scraping needed for any information Audnexus (or Audimeta) provides. The only benefit is that Audnexus (and Audimeta as well) may cache responses and do not hit Audible as often. But as this is the design of Audible and it caches itself, that makes up for nothing, especially since searching still has to be done outside of Audnexus.

So TL;DR, other than having a slightly more inconvenient way to get the data (because of a different structure), there is no need for such a proxy. It only adds delay and the risk of complete failure, which has already happened twice with Audnexus (and also Audimeta).

Thus I decided to stop working on my project altogether and also showed some few projects how to migrate to a way more response friendly design (basically everything can be done in one request [searching (with book data), series, author books etc. etc.]

While this is a software based/devolved by the same author it makes sense to be based on Audnexus, but I can just recommend to use the Audible API directly in such cases.

That's sad your API worked great for everything I did as well as had many more features that I used consistently than Audnexus and using Audible's API directly is a mess even still there are other parts of this PR, which make it still relevant though how we're gonna sort through the mess that this PR has become is going to be a little complicated

Can you point me in the direction of the list of URLs that I might need to make this work directly off of Audible I'm not looking forward to implementing audibles API. It's so complicated last time I looked at it. I've used it before, but it is a really annoying API to work with.

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

Successfully merging this pull request may close these issues.

3 participants