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

Audible audiobook provider #1842

Open
wants to merge 21 commits into
base: dev
Choose a base branch
from

Conversation

ztripez
Copy link
Contributor

@ztripez ztripez commented Jan 8, 2025

Initial Support for Audible

This PR introduces initial support for the Audible service. With these changes, users can:

  • List their Audible library
  • Populate most metadata for their audiobooks
  • Resume playback from the last position reported by Audible
  • Navigate through chapters

The implementation has been tested with the US market, but it should work with all other markets as well.

Future Improvements

  • Enhance browsing capabilities by adding the ability to browse by author, narrator, series, etc.
  • Implement search functionality (currently not supported in this PR)

Known Issues

  • Last playback position is not currently reported back to Audible. The on_streamed event is not fired, so the last position cannot be communicated to Audible at this time.

@OzGav
Copy link
Contributor

OzGav commented Jan 9, 2025

@ztripez can you provide some text for the docs? We have the following headings. You don’t need text for all of them. Please see the other providers for ideas of what to add. I could extract most of this from your opening post in the PR but I am conscious of the improvements you have made since then. Just the text is fine I will do the actual PR for the docs as a number of things need to be done.

FEATURES
CONFIGURATION
KNOWN ISSUES/ NOTES
NOT YET SUPPORTED

@ztripez
Copy link
Contributor Author

ztripez commented Jan 9, 2025

updated with device registration info.

FEATURES

  • List Audible library
  • Populate metadata for audiobooks
  • Resume playback from the last position reported by Audible
  • Navigate through chapters

CONFIGURATION

To set up the Audible provider, follow these steps:

  1. Select the appropriate marketplace for your Audible account from the available options.
  2. Click the "Authenticate with Audible" button to start the authentication process. This will open a new window redirecting you to Audible for authentication. Make sure to disable any popup blockers.
  3. After successful login, you will see a "page not found" message. This is expected. Copy the URL from the address bar and paste it into the "Post Login Url" textbox.
  4. Click the "Verify Audible URL" button to check the URL and register the provider.

Note: If you need to re-authenticate or change the marketplace, you will have to go through the authentication process again.

KNOWN ISSUES/NOTES

  • Last playback position is not currently reported back to Audible. The on_streamed event is not fired, so the last position cannot be communicated to Audible at this time.
  • Switching marketplaces requires re-authentication.
  • The provider will be registered as a device on Audible. If you remove the provider, it will deregister the device. While there haven't been any issues with the number of registered devices during development, it's worth noting that Audible has various content licenses. If a user has certain material, having many registered devices might potentially cause issues.

NOT YET SUPPORTED

  • Browsing capabilities by author, narrator, series, etc.
  • Search functionality
  • Podcasts, attached files, and other services not directly related to audiobooks.

Please note that this implementation has been tested with the US market, but it should work with all other markets as well. Future improvements include enhancing browsing capabilities and implementing search functionality.

Copy link
Contributor

@Jc2k Jc2k left a comment

Choose a reason for hiding this comment

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

I think if you run mypy -p music_assistant.providers.audible you should see any typing errors just for your provider. This isn't enabled on CI yet, but will be soon.

@ztripez
Copy link
Contributor Author

ztripez commented Jan 9, 2025

I'm thinking that I perhaps should rename the provider from audible_audiobooks to just audible since they have podcasts and I should probably implement it in the future.

@ztripez ztripez requested a review from Jc2k January 9, 2025 21:57
@marcelveldt
Copy link
Member

Are you 100% sure about the on_streamed callback ? Because I did a couple of tests today and it worked fine.
Note that it gets called here https://github.com/music-assistant/server/blob/dev/music_assistant/controllers/player_queues.py#L1026

So basically when playback stops or the queue transitioned to the next track you should get that callback.

@ztripez
Copy link
Contributor Author

ztripez commented Jan 9, 2025

Are you 100% sure about the on_streamed callback ? Because I did a couple of tests today and it worked fine. Note that it gets called here https://github.com/music-assistant/server/blob/dev/music_assistant/controllers/player_queues.py#L1026

So basically when playback stops or the queue transitioned to the next track you should get that callback.

Hm that's strange, I'll take a look again.

@marcelveldt
Copy link
Member

just a handful of small linter/typing issues (dont forget to import cast from the typing package)

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

Successfully merging this pull request may close these issues.

4 participants