lorenzodifuccia/safaribooks là một trong những repo phía máy chủ mà TopGit theo dõi, hiện có 5.1k sao, viết chủ yếu bằng Python. Download and generate EPUB of your favorite books from O'Reilly Learning (aka Safari Books Online) library.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Download and generate EPUB of your favorite books from Safari Books Online library.
I'm not responsible for the use of this program, this is only for personal and educational purpose.
Before any usage please read the O'Reilly's Terms of Service.
✨✨ Attention needed ✨✨
This project is no longer actively maintained.
Login through safaribooks no longer works due to changes in ORLY APIs.
The program needs a major refactor to include new features and integrate new APIs.
However... it still work for downloading books.
(Use SSO hack: log in via browser, then copy cookies into cookies.json, see below and issues. Love ❤️)
Overview:
Requirements & Setup
Usage
Single Sign-On (SSO), Company, University Login
Calibre EPUB conversion
Example: Download Test-Driven Development with Python, 2nd Edition
Example: Use or not the --kindle option
Requirements & Setup:
First of all, it requires python3 and pip3 or pipenv to be installed.
$ git clone https://github.com/lorenzodifuccia/safaribooks.git
Cloning into 'safaribooks'...
$ cd safaribooks/
$ pip3 install -r requirements.txt
OR
$ pipenv install && pipenv shell
The program depends of only two Python 3 modules:
lxml>=4.1.1
requests>=2.20.0
Usage:
It's really simple to use, just choose a book from the library and replace in the following command:
The ID is the digits that you find in the URL of the book description page: https://www.safaribooksonline.com/library/view/book-name/XXXXXXXXXXXXX/
Like: https://www.safaribooksonline.com/library/view/test-driven-development-with/9781491958698/
Program options:
$ python3 safaribooks.py --help
usage: safaribooks.py [--cred <EMAIL:PASS> | --login] [--no-cookies]
[--kindle] [--preserve-log] [--help]
<BOOK ID>
Download and generate an EPUB of your favorite books from Safari Books Online.
positional arguments:
<BOOK ID> Book digits ID that you want to download. You can find
it in the URL (X-es):
`https://learning.oreilly.com/library/view/book-
name/XXXXXXXXXXXXX/`
optional arguments:
--cred <EMAIL:PASS> Credentials used to perform the auth login on Safari
Books Online. Es. ` --cred
"[email protected]:password01" `.
--login Prompt for credentials used to perform the auth login
on Safari Books Online.
--no-cookies Prevent your session data to be saved into
`cookies.json` file.
--kindle Add some CSS rules that block overflow on `table` and
`pre` elements. Use this option if you're going to
export the EPUB to E-Readers like Amazon Kindle.
--preserve-log Leave the `info_XXXXXXXXXXXXX.log` file even if there
isn't any error.
--help Show this help message.
The first time you use the program, you'll have to specify your Safari Books Online account credentials (look here for special character).
The next times you'll download a book, before session expires, you can omit the credential, because the program save your session cookies in a file called cookies.json.
For SSO, please use the sso_cookies.py program in order to create the cookies.json file from the SSO cookies retrieved by your browser session (please follow these steps).
Pay attention if you use a shared PC, because everyone that has access to your files can steal your session.
If you don't want to cache the cookies, just use the --no-cookies option and provide all time your credential through the --cred option or the more safe --login one: this will prompt you for credential during the script execution.
You can configure proxies by setting on your system the environment variable HTTPS_PROXY or using the USE_PROXY directive into the script.
Calibre EPUB conversion
Important: since the script only download HTML pages and create a raw EPUB, many of the CSS and XML/HTML directives are wrong for an E-Reader. To ensure best quality of the output, I suggest you to always convert the EPUB obtained by the script to standard-EPUB with Calibre.
You can also use the command-line version of Calibre with ebook-convert, e.g.:
$ ebook-convert "XXXX/safaribooks/Books/Test-Driven Development with Python 2nd Edition (9781491958698)/9781491958698.epub" "XXXX/safaribooks/Books/Test-Driven Development with Python 2nd Edition (9781491958698)/9781491958698_CLEAR.epub"
After the execution, you can read the 9781491958698_CLEAR.epub in every E-Reader and delete all other files.
The program offers also an option to ensure best compatibilities for who wants to export the EPUB to E-Readers like Amazon Kindle: --kindle, it blocks overflow on table and pre elements (see example).
In this case, I suggest you to convert the EPUB to AZW3 with Calibre or to MOBI, remember in this case to select Ignore margins in the conversion options:
Examples:
Download Test-Driven Development with Python, 2nd Edition:
lorenzodifuccia/safaribooks thuộc nhóm Backend trên TopGit, cùng 8 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về lorenzodifuccia/safaribooks ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/lorenzodifuccia/safaribooks là nguồn chính thức.
lorenzodifuccia/safaribooks có bao nhiêu sao?
lorenzodifuccia/safaribooks có 5.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/lorenzodifuccia/safaribooks. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
lorenzodifuccia/safaribooks có phải mã nguồn mở không?
Có — lorenzodifuccia/safaribooks phát hành theo license WTFPL, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/lorenzodifuccia/safaribooks.
lorenzodifuccia/safaribooks có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho lorenzodifuccia/safaribooks. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
lorenzodifuccia/safaribooks là gì?
lorenzodifuccia/safaribooks (lorenzodifuccia/safaribooks) là dự án Python trên GitHub. Theo mô tả gốc: Download and generate EPUB of your favorite books from O'Reilly Learning (aka Safari Books Online) library.
lorenzodifuccia/safaribooks so với các dự án Backend khác thế nào?
lorenzodifuccia/safaribooks được TopGit xếp vào nhóm Backend, với 5.1k sao GitHub và viết bằng Python. Xem trang chủ đề Backend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về safaribooks?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về safaribooks.