Giter Site home page Giter Site logo

jenni / obooks Goto Github PK

View Code? Open in Web Editor NEW
108.0 6.0 14.0 850 KB

O'Books :books::sparkles: Download books from O'Reilly | Safaribooks

JavaScript 98.60% Dockerfile 1.40%
safaribooks oreilly oreilly-books oreilly-books-downloader safaribooksonline ebooks epub hacktoberfest

obooks's Introduction

O'BOOKS ๐Ÿ“šโœจ

CLI to download and generate books from O'Reilly | 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 | 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 "<BOOK ID>" -c "<COOKIES>"

The book will be available in the new obooks folder in the current directory.

CLI

$ ./cli.js -b "<BOOKID>" -c "<OREILLY_COOKIE>"

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 "<BOOKID>"

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 "<cookie>:

$ ./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 <bookid>: 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, the book id would be: 9781260440249.

  • -c <cookie>: O'Reilly session cookie.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.