You can download an acsm file for the book after borrowing it by loading https://archive.org/services/loans/loan/?action=media_url&format=pdf&redirect=1&identifier=BOOK_ID
I recommend knock or DeDRM Tools for downloading and decrypting from the acsm file.
I have made a script for automating some of the process.