Home
Softono
oreilly-epub-downloader

oreilly-epub-downloader

Open source MIT Python
15
Stars
2
Forks
1
Issues
0
Watchers
6 months
Last Commit

About oreilly-epub-downloader

Download O'Reilly books as EPUB with images for offline reading

Platforms

Web Self-hosted

Languages

Python

Links

O'Reilly EPUB Downloader

Python 3.11+ License: MIT

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.

Installation

pip install -e .

Usage

1. Export cookies from O'Reilly

  1. Log into https://learning.oreilly.com in your browser
  2. Open Developer Tools (Cmd+Option+I)
  3. Go to Console and run:
    JSON.stringify(Object.fromEntries(document.cookie.split('; ').map(c => c.split('='))))
  4. Save the output to cookies.json

2. Download books

# 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:

Example output

Books are saved to ./downloads/ by default.

Finding Book IDs

The book ID is the number in the O'Reilly URL:

  • URL: https://learning.oreilly.com/library/view/ai-engineering/9781098166298/
  • Book ID: 9781098166298

Refreshing Cookies

Cookies expire periodically. When downloads fail, re-export cookies from your browser.

Requirements

  • Python 3.11+
  • Active O'Reilly Learning subscription