- Python 92.1%
- Jinja 5.9%
- Dockerfile 2%
|
All checks were successful
Build container image / Build oci image (push) Successful in 1m42s
Reviewed-on: #18 |
||
|---|---|---|
| .forgejo/workflows | ||
| .idea | ||
| docs | ||
| src | ||
| agpl-3.0.md | ||
| Dockerfile | ||
| LICENSE.md | ||
| README.md | ||
| renovate.json5 | ||
Audible downloader and podcast feed generator
AudiblePodcastFeed serves two related functions, it:
- downloads books from one connected audible library and decrypts the audio files.
- provides an RSS podcast feeds organized by book series.
I created AudiblePodcastFeed to allow me to easily listen to my purchased audiobooks using the overcast podcast app. The RSS podcast feeds generated should be compatible with other podcast players, but I have not tested that.
AudiblePodcastFeed is desinged to run in a docker container. Other deployment methods are not supported.
About this documentation
This documentation assumes you are familiar with:
- docker
- docker compose
- the linux command line interface
- reverse proxies
Quick start
Setup
- Create a directory with the following
docker-compose.yaml:
services:
audible-podcasts:
build: ./build
volumes:
- metadata:/app/metadata_files
- audio:/app/audio_files
environment:
PODCAST_FEED_IMAGE: "{{ url for cover image }}"
PODCAST_HASH_SALT: "{{ random string }}"
AUTH_ENABLED: True
HTTP_USERNAME: "{{ user }}"
HTTP_PASSWORD: "{{ password }}"
restart: unless-stopped
ports:
- 8080:8080
audible-podcasts-downloader:
build: ./build
volumes:
- ./audible_auth:/app/audible_auth
- metadata:/app/metadata_files
- audio:/app/audio_files
command: python library_downloader.py download
restart: no
volumes:
audio:
metadata:
Important
Replace all the placeholders including the double curly braces.
- Clone this repository into the build subdirectory:
git clone https://github.com/usbpc/AudiblePodcastFeed.git build
- Create a audible authentication file:
touch audible_auth
docker compose run -i audible-podcasts-downloader python generate_audible_auth.py --locale DE
Important
Replace the locale
DEwith the marketplace country code of your audible account.
- Start the docker compose services
- Optional: Configure a reverse proxy for https (see the docs)
- Optional: Set up a sheduled job for automatic downloading (see the docs)
Note
By default the audiobooks are only downloaded once on initial startup. To download and decrypted audiobooks added to the connected audible library after initial startup, start the
audible-podcasts-downloaderservice again.
Usage
- Open the overview page on the root of the
audible-podcastsweb server. http://localhost:8080/, if running on your local machine using the docker compose configuration from above. - Copy any of the RSS feed links and add to your podcast app.
Configuration
| Environment variable | Default value | Description |
|---|---|---|
PODCAST_FEED_IMAGE |
None, reqired to be set | URL of cover image used for podcast feeds. |
PODCAST_HASH_SALT |
Random 16 character string | Hash salt used to obfuscate download links for audio files. Required since overcast dosen't send http basic auth for downloads. |
AUTH_ENABLED |
True |
Used to disable authentication handling in the starlette application. Set to False when handeling authentication in an external reverse proxy. |
HTTP_USERNAME |
user |
Username for http basic auth for the podcast feeds. Should also be set if external auth is used. The overview page uses this value to generate links with authentication to the individual RSS feeds. |
HTTP_PASSWORD |
Random 8 character string | Password for http basic auth for the podcast feeds. Should also be set if external auth is used. |
Technical details
The project is written in python and uses the following packages:
audiblefor listing and downloading the audiobooks from the connected audible library.starlettefor providing the api for the podcast feeds and overview webpage.jinja2as the templating engine for the RSS podcast feeds and overview webpage.uvicornas the ASGI web server for running the starlette application.
In addition to the python packages, library_downloader.py uses ffmpeg
to decrypt the downloaded audio files.