A CLI to download O'Reilly books as EPUB for offline reading. Uses cookie-based authentication to access your subscription content and generates clean EPUBs with images, cover art, and proper chapter structure.
pip install -e .- Log into https://learning.oreilly.com in your browser
- Open Developer Tools (Cmd+Option+I)
- Go to Console and run:
JSON.stringify(Object.fromEntries(document.cookie.split('; ').map(c => c.split('='))))
- Save the output to
cookies.json
# By book ID
oreilly-dl 9781098166298 -c cookies.json
# By URL
oreilly-dl "https://learning.oreilly.com/library/view/ai-engineering/9781098166298/" -c cookies.json
# Custom output path
oreilly-dl 9781098166298 -c cookies.json -o "My Book.epub"Example output:
Books are saved to ./downloads/ by default.
The book ID is the number in the O'Reilly URL:
- URL:
https://learning.oreilly.com/library/view/ai-engineering/9781098166298/ - Book ID:
9781098166298
Cookies expire periodically. When downloads fail, re-export cookies from your browser.
- Python 3.11+
- Active O'Reilly Learning subscription
