# anyflip-downloader rebuilds a flipbook as a PDF from its page images

> anyflip-downloader is a GPL-3.0 Go tool that takes an AnyFlip book URL and produces a PDF from the page images the flipbook serves, and the engineering in it is less about the download than about the knobs it exposes for memory, parallelism and politeness towards the server.

**Lofter1/anyflip-downloader** — Download anyflip books as PDF

- Repository: https://github.com/Lofter1/anyflip-downloader
- Stars: 602 · Forks: 99
- Language: Go
- License: GPL-3.0
- Published: 2026-10-22 · Updated: 2026-10-22 · Language: en
- Canonical page: https://hysenlabs.com/projects/lofter1-anyflip-downloader

## A Go tool that turns pages into a PDF

anyflip-downloader does one thing: it takes the URL of an AnyFlip book and downloads it as a PDF. The project description is that short, and the repository matches it, with a main.go and an anyflip.go at the root, a configjs.go, a Dockerfile, a scripts/ directory for the install scripts, a go.mod and a go.sum, plus a build workflow and a goreleaser workflow for the release binaries.

The file named configjs.go is the clue to how it works. AnyFlip serves a flipbook as a set of page images plus a JavaScript configuration object that describes the book, and reading that configuration is how the tool finds the page list in the first place. So this is not a screenshotter that captures whatever the reader displays. It parses the site's own description of the book and then fetches the page images it points at, which is a materially better result than a rendered capture and a materially more site-specific implementation.

The PDF itself is assembled by a library rather than written by hand, and the dependency list in go.mod says which. The module requires github.com/pdfcpu/pdfcpu at v0.13.0, which is the PDF manipulation and generation library, and github.com/schollz/progressbar/v3 at v3.19.1, which is the progress bar you see while a long book converts. There is also github.com/asaskevich/govalidator, which is a validation library, and the natural place to use it is checking that the argument the user passed really is a URL before doing anything with it.

The project requires Go 1.25.0, and the module path is github.com/Lofter1/anyflip-downloader.

## Two install routes, one of them a piped script

The README says you can install the tool in multiple ways, using the installation script or the go install command, and that the install scripts are the suggested installation method for most users.

For Linux and macOS the command pipes a script straight into a shell:

```sh
curl -L https://raw.githubusercontent.com/Lofter1/anyflip-downloader/main/scripts/install.sh | /usr/bin/env bash
```

For Windows it is the PowerShell equivalent:

```PowerShell
. { iwr -useb https://raw.githubusercontent.com/Lofter1/anyflip-downloader/main/scripts/install.ps1 } | iex;
```

The alternative, for people who already have the Go tools installed, is:

```sh
go install github.com/Lofter1/anyflip-downloader@latest
```

The README also handles the most common failure of the script route, which is that a freshly installed binary is not on the path. When you hit the error Command not found, you have to make sure your path variable contains $HOME/.local/bin, edited in your .zshrc or .bashrc depending on your editor. That is the location the script installs into, and it is not one of the directories a shell looks in by default on many systems.

It is worth being explicit about the trade in the first two options. Piping a downloaded script into a shell is convenient and it means the user never has to know where a binary went, and it also means the script is executed with whatever privileges the shell has, from a URL that can change. The go install route is slower to set up and pins the version you fetch, and for anyone who reviews what they run, that is the better habit.

## The flags that decide how the book is rebuilt

The basic usage takes the URL of the book:

```sh
anyflip-downloader <url to book>
```

Three flags change what the tool does with the result.

The -title flag overrides the title taken from the site, for when you do not want to use the book title from AnyFlip. The -temp-download-folder flag changes the temporary download folder, which by default is the title of the book, and the README notes that this folder is deleted after a successful download, so it is a work area rather than a place to keep the output.

The third is the one with the most interesting trade-off, and it is -chunksize. By default the downloader converts ten images at a time, and the README spells out both directions of the trade. A lower number results in less memory usage but more writes to the drive, and therefore might increase the time to convert. A higher number results in more memory usage but fewer writes, and might increase converting speed. And if the number is higher than the total amount of pages, the amount of pages currently being converted is automatically taken instead.

```sh
anyflip-downloader -chunksize <chunkzise> <url to book>
```

So the default of ten is a compromise, and the flag exists because the right value depends on the machine and on the book. On a laptop with a slow disk and plenty of memory, a larger chunk is faster. On a small machine converting a long book, a smaller chunk is the difference between completing and running out of memory.

## Parallel fetching, retries and a delay between them

The advanced download options are the ones that decide how the tool behaves towards the server it is fetching from.

By default downloads are performed in a single thread, and the -threads flag controls the number of parallel jobs to improve performance:

```sh
anyflip-downloader -threads <number of parallel jobs> <url to book>
```

Retries handle the ordinary failure. Occasionally a request may fail due to temporary issues such as timeouts, and the -retries flag specifies how many times a failed page should be retried before giving up:

```sh
anyflip-downloader -retires <number of attempts> <url to book>
```

The flag in that example is spelled -retires in the README, while the prose calls it -retries, which is worth checking in the source before you rely on it.

The delay between attempts is the politeness control. To avoid overwhelming the server or triggering rate limits, you can introduce a delay between retry attempts, and the -waitretry flag accepts any valid Go duration format, with 500ms, 2s and 1m given as examples:

```sh
anyflip-downloader -waitretry <duration> <url to book>
```

Those three flags together are a coherent design. Parallelism makes a long book finish in reasonable time, retries absorb a flaky connection, and the delay stops the combination from turning a slow server into a hammered one. A tool that fetches a page per request from a public service is only as good as its manners, and here the manners are a flag rather than a hope.

## Docker, and a two stage image that ships one binary

For people who are familiar with Docker, the README gives a build and a run:

```sh
docker build -t anyflip-downloader .
```

```sh
docker run --rm -v "$(pwd)":/data anyflip-downloader <url to book>
```

The volume mount is the point. The image's working directory is /data, so mounting the current directory there puts the finished PDF in the place you ran the command, and the --rm flag means the container is removed afterwards. The same pattern composes with the other flags, for example:

```sh
docker run --rm -v "$(pwd)":/data anyflip-downloader -title <your book title> <url to book>
```

The Dockerfile in the repository is a small, well behaved multi stage build:

```
FROM golang:1.24-alpine AS build

WORKDIR /app
COPY . .

ENV CGO_ENABLED=0
RUN go build -o anyflip-downloader .

FROM alpine:latest
COPY --from=build /app/anyflip-downloader /usr/local/bin/anyflip-downloader

WORKDIR /data
ENTRYPOINT ["anyflip-downloader"]
CMD ["--help"]
```

The compiler stage is a Go image on Alpine with CGO disabled, so the result is a static binary, and the runtime stage copies just that binary into a plain Alpine image. Nothing from the build stage survives except the executable, which keeps the final image small. The entry point is the tool itself and the default command is --help, so running the image with no arguments prints the usage rather than failing.

## GPL-3.0, a 0.1 line, and the disclaimer that matters

The licence is GPL-3.0, with the LICENSE file at the repository root, and the project ships a CONTRIBUTING.md and a changelog with each release.

The release history is short and unhurried. The recent tags are v0.1.14 published on 2026-07-06, v0.1.13 on 2026-02-12 and v0.1.12 on 2025-04-19, so the version is still in the 0.1 range and the releases are months apart rather than weekly. The repository is not archived and the last push was on 2026-10-19, so the code is still being touched between releases, which is what a small single maintainer tool looks like.

The disclaimer is short and it is the most important line in the README. Only use this tool to download books that officially allow PDFs to be downloaded.

That constraint is not a technical one, and it should shape how the tool is described. The tool works on a public flipbook site, and a flipbook site hosts whatever its users upload, which means the tool can be pointed at content that the rightsholder did not intend to be distributable as a PDF. The disclaimer puts that responsibility on the user, and a reviewer or a team deploying this in an automated pipeline should treat that line as a constraint on the deployment rather than as a formality.

The alternative approaches differ in what they lose. The site's own reader shows the book as a flipbook, which is not a file you can keep. A general purpose capture tool will render and print the pages, and it will produce a PDF that is a set of screenshots of a reader, which is worse for a book with text. This tool reads the book's own configuration, fetches the page images and assembles them, so the output quality is higher, and it is also the approach that depends on the site not changing its page structure.

## Conclusion

anyflip-downloader fits someone who has a book that the site explicitly allows to be downloaded as a PDF and wants the file locally in one command, with controllable memory use and retry behaviour. It does not fit a user who needs a page faithful to the original file, since the output is rebuilt from rendered page images, and the README asks users to restrict themselves to books that officially allow PDF download. Before running it, read that disclaimer and check the terms of the site whose pages you are fetching, and set the thread count and retry delay deliberately, since those flags are the difference between a polite client and an unwelcome one.

## FAQ

### How do I install anyflip-downloader?

The README suggests the install scripts, curl piping install.sh into bash on Linux and macOS, or the PowerShell equivalent on Windows, and notes that the binary lands in $HOME/.local/bin which you may need to add to your path. The alternative is go install github.com/Lofter1/anyflip-downloader@latest, which needs the Go tools.

### What does the -chunksize flag control?

It sets how many images are converted at a time, ten by default. A lower number uses less memory and writes to the drive more often, a higher number uses more memory and converts faster, and if it exceeds the page count the number of pages present is used instead.

### How do I control how the tool fetches pages?

The -threads flag sets the number of parallel download jobs, the retries flag says how many times a failed page is tried again, and the -waitretry flag sets a delay between attempts in any valid Go duration format to avoid triggering rate limits.

### Where does the finished PDF end up in the Docker run?

The image sets its working directory to /data, and the documented run mounts the current directory at that path with -v "$(pwd)":/data, so the result is written into the directory you ran the command from.

### What does the README say about which books to download?

The disclaimer says to only use the tool to download books that officially allow PDFs to be downloaded. The project is released under the GPL-3.0 licence, with the most recent release v0.1.14 published on 2026-07-06.

## Sources

- [Issues](https://github.com/Lofter1/anyflip-downloader/issues)
- [License: GPL-3.0](https://github.com/Lofter1/anyflip-downloader/blob/main/LICENSE)
- [Lofter1/anyflip-downloader on GitHub](https://github.com/Lofter1/anyflip-downloader)
- [README](https://github.com/Lofter1/anyflip-downloader/blob/main/README.md)
- [Releases](https://github.com/Lofter1/anyflip-downloader/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/lofter1-anyflip-downloader
