diff --git a/.dockerignore b/.dockerignore index a6bcdbd..59e07e9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,3 +7,4 @@ sessions.json progress*.json *.tmp README.md +tools diff --git a/Dockerfile b/Dockerfile index ae65231..1cd4b22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM python:3.13-slim ENV PYTHONUNBUFFERED=1 DATA_DIR=/data PORT=8080 RUN useradd --system --uid 10001 --home /app app && mkdir /data && chown app /data WORKDIR /app -COPY server.py index.html admin.html manifest.webmanifest sw.js icon-180.png icon-192.png icon-512.png ./ +COPY server.py index.html admin.html manifest.webmanifest sw.js icon-*.png ./ USER app VOLUME /data EXPOSE 8080 diff --git a/README.md b/README.md index 0332d54..6e70569 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,23 @@ Tap the ↓ on a book (or "Download" in the player) to save it on the device. Do - **To open the app itself offline, serve it over HTTPS.** Browsers only allow the service worker (`sw.js`) on secure origins. Put a reverse proxy with a certificate in front of port 8080 (and a domain name). Over plain HTTP, downloads still play but the page can't load without a connection. + +## Troubleshooting playback + +Run this on the player server (or `docker exec -it audiobook-player python server.py check`): + +```bash +python3 server.py check +``` + +It logs in to OpenAudible, lists a few books' files, and tests whether each file can stream to a phone. iPhones will +only play audio from a server that answers byte-range requests; if OpenAudible doesn't, the player server emulates +them (seeking in very large books is slower). The container's log (`docker logs audiobook-player`) notes when that happens +and records any upstream errors. + +The player also recovers by itself from dropped connections and stalls (it reloads from the same spot, up to four times), +and your position is saved every few seconds, on pause, and when the page is closed or backgrounded. + +## Icons + +`python3 tools/make_icons.py` regenerates the app icons (needs Pillow). diff --git a/icon-180.png b/icon-180.png index 6b60086..4e989f5 100644 Binary files a/icon-180.png and b/icon-180.png differ diff --git a/icon-192.png b/icon-192.png index 3a5f3ab..5048300 100644 Binary files a/icon-192.png and b/icon-192.png differ diff --git a/icon-32.png b/icon-32.png new file mode 100644 index 0000000..ac9a5bc Binary files /dev/null and b/icon-32.png differ diff --git a/icon-512.png b/icon-512.png index a8fa484..e67428c 100644 Binary files a/icon-512.png and b/icon-512.png differ diff --git a/icon-maskable-512.png b/icon-maskable-512.png new file mode 100644 index 0000000..11a099d Binary files /dev/null and b/icon-maskable-512.png differ diff --git a/index.html b/index.html index aff5377..5d0b8fe 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,7 @@ + Audiobook Player