Audiobookshelf
description
Install
docker-compose:
### docker-compose.yml ### services: audiobookshelf: container_name: audiobookshelf image: ghcr.io/advplyr/audiobookshelf:latest environment: - AUDIOBOOKSHELF_UID=99 - AUDIOBOOKSHELF_GID=100 ports: - 8076:80 volumes: - /mnt/nfs/books/_audiobookshelf/audiobooks:/audiobooks - /mnt/nfs/books/_audiobookshelf/podcasts:/podcasts - /mnt/docker/custom_config/audiobookshelf:/config - /mnt/nfs/books/_audiobookshelf/metadata:/metadata networks: - internal restart: unless-stopped networks: internal: external: name: internal
DNS: Created local DNS record on pihole:
| audibol.garlondindustries.com | 10.0.0.55 |
This allows users in LAN using public FQDN to reach the service, while traffic stays in LAN.
Reverse proxy: Created letsencrypt cert for audibol.garlondindustries.com.
In Audiobookshelf, got error “Socket Failed to Connect” - fixed by enabling WebSocket support on reverse proxy.
Config
Authelia
: oicd client and abs config
WebSockets support when using Authelia
Authelia's nginx snippets can break websockets connections - in the case of ABS a banner is shown in the browser “coult not connect socket”. The service seems to work fine otherwise, but the banner blocks the player's play/paus button.
To fix this, added proxy headers to NGINX config for audibol to upgrade the connection to websockets:
include /snippets/authelia-location.conf; location / { include /snippets/proxy.conf; include /snippets/authelia-authrequest.conf; proxy_pass $forward_scheme://$server:$port; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
To verify, look for “http 101” responses to requests to /socket.io/*, indicating a protocol switch from HTTPS to WebSockets.
Download And Convert Audible audiobooks
Can use e.g. OpenAudible to connect to Audible and download owned books. Books are stored along with cover and metadata in .aax format. Files are still encrypted and DRM protected though. Need paid license for OpenAudible to decrypt and convert. License is about $15. OpenAudible apparently was open source at one point, but stopped publishing source code when paid license was introduced.
Solution:
Tried AaxAudioConverter: Needs Audible activation code to do anything. Used to rely on some official Audible Manager to get that code, but that tools does not seem to be around anymore. Instead, AaxAudioConverter can run next to BookLibConnect (see below) to get the code and do its thing.
screenshots
…then BookLibConnect: Depencies section is a litte vague being all like “aah just…dotnet 64 someth….” - need dotNet Desktop Runtime x64 v5.0.16 (see #39).
screenshots
This can be set to export in AAX so it can be converted by AaxAudioConverter into M4A (no DRM, no bookmarks), but it also creates M4B files (DRM, bookmarks).
Findings:
- M4B files: might still have DRM but did play in 3rd party media player. Don't include chapter names. However, dropping .m4b files created by BookLibConnect, covers don't work, the title equals the raw file name instead of title in tags, and parts are not merged into a single title.
- M4A files should not contain any DRM and do show chapter names.
- AaxAudioConverter can be set to split up converted files based on chapters. Might be handy for some cases, but this causes audiobookshelf to not see chapter list.
- Dropping files into Audiobookshelf's library folder and then starting a library scan does
not seem towork. Alternatively, the files can be uploaded through the UI. - When converting books belonging to a series, AaxAudioConverter seems to like creating folders named “[n] <title>” whereas n is the number of the volume in the series. Audiobookshelf doesn't like this, as the numbers interfere with sorting an prevent it from matching books with most providers. Simply removing the [n] bit from the folder name before uploading resolves this.
Workflow:
- download using BookLibConnect, export AAX
- use AaxAudioConverter to convert to M4A
- upload M4A files to Audiobookshelf
So: M4B files: might still have DRM but did play in 3rd party media player.