Skip to content

Tired to manually download every single book from your Leanpub library to your e-reader? I got you covered.

License

Notifications You must be signed in to change notification settings

EpocDotFr/leanpub-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leanpub library synchronization

Tired to manually download every single book from your Leanpub library to your e-reader? I got you covered.

Prerequisites

Python 3. May eventually works with Python 2 (not tested).

Installation

Clone this repo, and then the usual pip install -r requirements.txt.

Configuration

Copy the .env.example file to .env and fill in the configuration parameters.

Available configuration parameters are:

  • LEANPUB_EMAIL Leanpub account email
  • LEANPUB_PASSWORD Leanpub account password
  • PREFERED_FORMAT Format of the books to download. Will automatically download an alternative version if your prefered one isn't available. May be one of:
    • epub (for reading on phones and tablets)
    • pdf (for reading on a computer)
    • mobi (for reading on a Kindle)
  • OUTPUT_DIR Directory in which to download the books (relative or absolute)

Usage

python run.py

How it works

Leanpub provide an API, but unfortunately it is only useful for book writers. I suggested in December, 2016 that it would be cool to also provide something for book readers, however this will obviously not be available right now.

In the meantime we'll have to scrape their website - the good ol' way - and use what it seems to be an unofficial JSON API used by their frontend Javascript framework (React).

Please refer to the script itself (run.py) for detailed information.

About

Tired to manually download every single book from your Leanpub library to your e-reader? I got you covered.

Topics

Resources

License

Stars

Watchers

Forks

Languages