Update README.md
This commit is contained in:
parent
b70173eef1
commit
4b923792a2
1 changed files with 27 additions and 11 deletions
38
README.md
38
README.md
|
|
@ -1,8 +1,13 @@
|
||||||
# SafariBooks
|
# SafariBooks
|
||||||
Download and generate an EPUB of your favorite books from [Safari Books Online](https://www.safaribooksonline.com) library.
|
Download and generate an *EPUB* of your favorite books from [*Safari Books Online*](https://www.safaribooksonline.com) library.
|
||||||
Use this program only for personal and/or educational purpose.
|
Use this program only for *personal* and/or *educational* purpose.
|
||||||
|
|
||||||
## Requirements & setup:
|
## Overview:
|
||||||
|
* [Requirements & Setup]()
|
||||||
|
* [Usage]()
|
||||||
|
* [Examples]()
|
||||||
|
|
||||||
|
## Requirements & Setup:
|
||||||
```shell
|
```shell
|
||||||
$ git clone https://github.com/lorenzodifuccia/safaribooks.git
|
$ git clone https://github.com/lorenzodifuccia/safaribooks.git
|
||||||
Cloning into 'safaribooks'...
|
Cloning into 'safaribooks'...
|
||||||
|
|
@ -11,7 +16,7 @@ $ cd safaribooks/
|
||||||
$ pip3 install -r requirements.txt
|
$ pip3 install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
The program depends of only two Python 3 modules:
|
The program depends of only two **Python 3** modules:
|
||||||
```python3
|
```python3
|
||||||
lxml>=4.1.1
|
lxml>=4.1.1
|
||||||
requests>=2.18.4
|
requests>=2.18.4
|
||||||
|
|
@ -20,13 +25,13 @@ requests>=2.18.4
|
||||||
## Usage:
|
## Usage:
|
||||||
It's really simple to use, just choose a book from the library and replace in the following command:
|
It's really simple to use, just choose a book from the library and replace in the following command:
|
||||||
* X-es with its ID,
|
* X-es with its ID,
|
||||||
* `email:password` with your own.
|
* `email:password` with your own.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ python3 safaribooks.py --cred "account_mail@mail.com:password01" XXXXXXXXXXXXX
|
$ python3 safaribooks.py --cred "account_mail@mail.com:password01" XXXXXXXXXXXXX
|
||||||
```
|
```
|
||||||
|
|
||||||
The ID are the digits that you can find in the URL of the book description page:
|
The ID are the digits that you find in the URL of the book description page:
|
||||||
`https://www.safaribooksonline.com/library/view/book-name/XXXXXXXXXXXXX/`
|
`https://www.safaribooksonline.com/library/view/book-name/XXXXXXXXXXXXX/`
|
||||||
Like: `https://www.safaribooksonline.com/library/view/test-driven-development-with/9781491958698/`
|
Like: `https://www.safaribooksonline.com/library/view/test-driven-development-with/9781491958698/`
|
||||||
|
|
||||||
|
|
@ -37,12 +42,14 @@ Pay attention if you use a shared PC, because everyone that has access to your f
|
||||||
If you don't want to cache the cookies, just use the `--no-cookies` option and provide all the time your `--cred`.
|
If you don't want to cache the cookies, just use the `--no-cookies` option and provide all the time your `--cred`.
|
||||||
|
|
||||||
The program default options are thought for ensure best compatibilities for who want to export the `EPUB` to E-Readers like Amazon Kindle.
|
The program default options are thought for ensure best compatibilities for who want to export the `EPUB` to E-Readers like Amazon Kindle.
|
||||||
If you want to do it, I suggest you to convert the `EPUB` to `AZW3` file with [Calibre](https://calibre-ebook.com/).
|
If you want to do it, I suggest you to convert the `EPUB` to `AZW3` with [Calibre](https://calibre-ebook.com/).
|
||||||
You can also convert the book to `MOBI` and if you'll do it with Calibre be sure to select `Ignore margins`:
|
You can also convert the book to `MOBI` and if you'll do it with Calibre be sure to select `Ignore margins` in the conversion options:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
In the other hand, if you're not going to export the `EPUB`, you can use the `--no-kindle` option to remove the CSS that blocks overflow on `table` and `pre` elements, see below in the examples.
|
||||||
|
|
||||||
### Program options:
|
#### Program options:
|
||||||
```shell
|
```shell
|
||||||
$ python3 safaribooks.py --help
|
$ python3 safaribooks.py --help
|
||||||
usage: safaribooks.py [--cred <EMAIL:PASS>] [--no-cookies] [--no-kindle]
|
usage: safaribooks.py [--cred <EMAIL:PASS>] [--no-cookies] [--no-kindle]
|
||||||
|
|
@ -71,7 +78,8 @@ optional arguments:
|
||||||
--help Show this help message.
|
--help Show this help message.
|
||||||
```
|
```
|
||||||
|
|
||||||
* ## Example: [Test-Driven Development with Python, 2nd Edition](https://www.safaribooksonline.com/library/view/test-driven-development-with/9781491958698/)
|
## Examples:
|
||||||
|
* ## Download [Test-Driven Development with Python, 2nd Edition](https://www.safaribooksonline.com/library/view/test-driven-development-with/9781491958698/):
|
||||||
```shell
|
```shell
|
||||||
$ python3 safaribooks.py --cred "XXXX@gmail.com:XXXXX" 9781491958698
|
$ python3 safaribooks.py --cred "XXXX@gmail.com:XXXXX" 9781491958698
|
||||||
|
|
||||||
|
|
@ -113,8 +121,16 @@ optional arguments:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
* ## Example: `--no-kindle` option
|
* ## Use or not the `--no-kindle` option:
|
||||||
```bash
|
```bash
|
||||||
$ python3 safaribooks.py --no-kindle 9781491958698
|
$ python3 safaribooks.py --no-kindle 9781491958698
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Thanks!!
|
||||||
|
For any kind of problem, please don't hesitate to open an issue here on *GitHub*.
|
||||||
|
|
||||||
|
*Lorenzo Di Fuccia*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue