https://github.com/jenni/obooks
O'Books :books::sparkles: Download books from O'Reilly | Safaribooks
https://github.com/jenni/obooks
ebooks epub hacktoberfest oreilly oreilly-books oreilly-books-downloader safaribooks safaribooksonline
Last synced: 8 months ago
JSON representation
O'Books :books::sparkles: Download books from O'Reilly | Safaribooks
- Host: GitHub
- URL: https://github.com/jenni/obooks
- Owner: jenni
- Created: 2019-10-19T11:00:51.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-30T18:15:36.000Z (about 1 year ago)
- Last Synced: 2025-03-29T02:06:04.540Z (8 months ago)
- Topics: ebooks, epub, hacktoberfest, oreilly, oreilly-books, oreilly-books-downloader, safaribooks, safaribooksonline
- Language: JavaScript
- Homepage:
- Size: 181 KB
- Stars: 132
- Watchers: 6
- Forks: 21
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# O'BOOKS :books::sparkles:
CLI to download and generate books from [O'Reilly](https://www.oreilly.com/) | Safaribooks.
_This package is exclusively intended for personal use. Its purpose is to complement your O'Reilly membership facilitating content in the format of `.epub` to read on your e-reader._
# USAGE
You need to hold an active account in [O'Reilly](https://www.oreilly.com/) | Safaribooks to be able to download books.
## DOCKER
```
$ docker pull jennyfive/obooks
$ docker run -it --rm -v "$(pwd)/obooks/:/usr/app/books/" jennyfive/obooks -b "" -c ""
```
The book will be available in the new `obooks` folder in the current directory.
## CLI
$ ./cli.js -b "" -c ""
The downloaded books will be stored in the folder `obooks/books` inside the cloned project.
After the first successful login/book download through **obooks**, a `session.json` file containing auth cookies will be written in the root of the project. Any future downloads will not require passing the cookies to the command.
$ ./cli.js -b ""
### **HOW TO**
The first time you're using obooks, you'll need to pass your logged in cookies in the command. Check the chrome developer tools while logged in to O'Reilly, you'll see a 'cookie' header sent in the 'Request Headers', this is the long string you should pass in in the **obooks** cookie flag `-c "`:
`$ ./cli.js -b "9781788623872" -c "LONG STRING OF COOKIES HERE"`
note: if using Windows, run it under *nodejs*:
`$ node cli.js -b "9781492077992" -c "LONG STRING OF COOKIES HERE"`
## **CLI flags explained**
- **`-b `**: This is the book identification in O'Reilly. You can find it in the url of the book you'd like to download. For [this example](https://learning.oreilly.com/library/view/java-the-complete/9781260440249/), the book id would be: **9781260440249**.
- **`-c `**: O'Reilly session cookie.