They also have all the data in a set of torrent files.
I've actually been working on an AA client + Readarr (yes yes I know the main project is dead, I meant for generally book-related Arr stack projects) provider.
The idea is pretty straightforward:
- the client connects to the current AA instance and grabs the torrents
- each torrent is added to a built-in client, with all files set to "don't download" (so at the moment it does nothing beyond peer discovery)
- each torrent is now versioned and provides a metadata batch of all files and paths included
- metadata is matched to paths during lookup
- provider interface allows upstream software (e.g. Readarr, Chaptarr, etc.) to search for a specific release with some extra parameters (language, format, date added, etc.), uses AA approach of hash to path matching
- path is matched to torrent, within that torrent, that path is set to be downloaded
- upon download the file path is softlinked to destination provided for download
- upstream picks up new file and parses it (then it gets passed to CWA, AudioBookShelf, Kavita or whatever other frontend you use)
- the client also automatically selects 500MB worth of files with low availability. This 500MB is separate from what the user has actually downloaded, and is used to contribute back to the P2P net