Calibre

From Indie IT Wiki

Calibre is a free and open source ebook library management application developed by users of e-books for users of e-books. It has a cornucopia of features divided into the following main categories:

  • Library Management
  • E-book conversion
  • Syncing to e-book reader devices
  • Downloading news from the web and converting it into e-book form
  • Comprehensive e-book viewer
  • Content server for online access to your book collection

Complete Docker Installation and Format Auto Conversion

https://academy.pointtosource.com/containers/ebooks-calibre-readarr/

Calibre Headless Server

Transmission > FileBot > Calibre > Kindle, Phone, Tablet

Create a directory for the Book Library...

mkdir ~/"Calibre Library"

Create a directory for Calibre to add books from...

mkdir ~/Downloads/Calibre

Download a book to test...

cd ~/Downloads/Calibre
wget http://www.gutenberg.org/ebooks/1342.kindle.noimages -O pride.mobi

Add the downloaded book to your Calibre Library...

calibredb add ~/Downloads/Calibre/pride.mobi --library-path ~/"Calibre Library"

Check to make sure it has added the book to the database...

calibredb list --library-path ~/"Calibre Library"

Now, run the Calibre Server for the first time to test things work...

calibre-server --daemonize --log=/dev/null --port 8282 ~/"Calibre Library"

Access the Libary web page in your favourite web browser at...

http://ip.address.of.server:8282

This is the simple No Javascript version...

http://ip.address.of.server:8282/mobile/

Create a Cron job to add books every hour...

crontab -e
@hourly calibredb add /home/user/Downloads/Calibre/ -r --with-library "http://ip.address.of.server:8282#Calibre_Library" && rm -rf /home/user/Downloads/Calibre/*

Now create a SystemD script for Debian to launch Calibre when the server boots...

sudo nano /etc/systemd/system/calibre-server.service

[Unit]
Description=calibre content server
After=network.target

[Service]
Type=simple
User=user
Group=user
ExecStart=/opt/calibre/calibre-server --log=/dev/null --port 8282 --enable-local-write "/home/user/Calibre Library"

[Install]
WantedBy=multi-user.target

Then, enable the script and start the server...

sudo systemctl enable calibre-server.service
sudo systemctl start calibre-server.service
sudo systemctl status calibre-server.service

.


OLD - Upstart script for Debian to launch Calibre when the server boots...

sudo nano /etc/init/calibre-server.conf

description "Calibre (ebook manager) content server"

start on runlevel [2345]
stop on runlevel [^2345]

respawn

env LIBRARY_PATH="/home/user/Calibre Library"
env MAX_COVER='300x400'
env PORT='8282'

script
    exec /usr/bin/calibre-server --with-library "$LIBRARY_PATH" --max-cover $MAX_COVER --auto-reload --port $PORT
end script

Stop and restart the server...

sudo stop calibre-server
sudo start calibre-server

If you use Transmission, you can add these lines to the end of your automated script when a torrent completes...

find ~/Downloads/transmission/ -type f -iname '*.epub' -exec cp -f '{}' ~/Downloads/Books/ \;
find ~/Downloads/transmission/ -type f -iname '*.epub' -exec cp -f '{}' ~/Downloads/Calibre/ \;
find ~/Downloads/transmission/ -type f -iname '*.mobi' -exec cp -f '{}' ~/Downloads/Books/ \;
find ~/Downloads/transmission/ -type f -iname '*.mobi' -exec cp -f '{}' ~/Downloads/Calibre/ \;

Enjoy :-)

Thanks - https://www.digitalocean.com/community/tutorials/how-to-create-a-calibre-ebook-server-on-ubuntu-14-04

NOTES

http://www.mobileread.com/forums/showthread.php?p=3340493#post3340493

ID=$(calibredb list --separator=';' | sed '/^$/d' | tail -n1 | awk -F';' '{ print $1 }'); echo ${ID}
TITLE=$(calibredb list --separator=';' | sed '/^$/d' | tail -n1 | awk -F';' '{ print $2 }'); echo ${TITLE}
AUTHOR=$(calibredb list --separator=';' | sed '/^$/d' | tail -n1 | awk -F';' '{ print $3 }'); echo ${AUTHOR}

Android Apps

Moon+ Reader

Start App > Net Library > Menu 3 Dots > Add New Catalog > Local Calibre > IP Address + Port > OK

It doesn't get any easier.

Adding Books Using Kindle Web Browser

About

Your Kindle includes an experimental web browser that enables you to surf the web and view most Amazon web pages. Web Browser supports JavaScript, SSL, and cookies, but does not support media plug-ins. You must have a Wi-Fi connection to access most websites.

To launch Web Browser, tap the Menu button, then select Experimental Browser. The first time you access this page, you will find a list of default bookmarks for commonly used sites. You can access these bookmarks later, by selecting Bookmarks from the Web Browser menu.

To enter a URL, tap the search field at the top of the screen. Use the onscreen keyboard to enter the web address. A .com key is added to the keyboard when you are entering URLs. The address field will retain the last URL you entered.

Bookmarks

To bookmark a web page, tap the Menu button and select Bookmark this Page. To delete a bookmark, tap the Menu button and select Bookmarks. Tap the Remove button at the bottom of the page, tap to select the checkbox next to the URL(s) you want to remove, then tap the Remove button.

Downloading Files

Some websites may have books or documents that you want to download and read on your Kindle. You will be asked to confirm if you want to download these items to your Kindle Home screen. Supported file types for download include Kindle content (.AZW, .AZW1, .AZW2, and .AZW3), unprotected Mobipocket books (.MOBI, .PRC), and text files (.TXT).

Just point the web browser on your device to the computer running the Content Server and you will be able to browse your book collection. For example, if the computer running the server has IP address 192.168.1.252 on port 8181, in the browser, you would type:

http://192.168.1.252:8181

You can then browse the Calibre Library on the Content Server, download the .MOBI file and then open it to read.

Latest Changes

http://calibre-ebook.com/whats-new

Manual

https://manual.calibre-ebook.com

Installing (and Updating)

sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin

Command Line Interface

https://manual.calibre-ebook.com/generated/en/cli-index.html

Converting From EPUB To Kindle MOBI

ebook-convert book_name.epub book_name.mobi

https://manual.calibre-ebook.com/generated/en/ebook-convert.html

Fixing Broken Ebooks

epub-fix --epubcheck --unmanifested file.epub

How to make e-books show up under "Books" on the Kindle Fire

http://howto.cnet.com/8301-11310_39-57349056-285/how-to-make-e-books-show-up-under-books-on-the-kindle-fire/

Wireless Sync Books

Calibre Companion Android is an app that can be used to transfer books wirelessly to your Android device. The app is maintained by a core calibre developer and allows Calibre to connect to your Android device wirelessly, just browse files on the device in Calibre and use the Send to device button to transfer files to your device wirelessly.

Calibre also has a builtin web server, the Content Server. You can browse your calibre collection on your Android device is by using the calibre content server, which makes your collection available over the net. First perform the following steps in calibre:-

  1. Set the Preferred Output Format in calibre to EPUB for normal Android devices or MOBI for Kindles (The output format can be set under Preferences->Interface->Behavior)
  2. Convert the books you want to read on your device to EPUB/MOBI format by selecting them and clicking the Convert button.
  3. Turn on the Content Server in calibre’s preferences and leave calibre running.

Now on your Android device, open the browser and browse to http://192.168.1.2:8080/

Replace 192.168.1.2 with the local IP address of the computer running calibre. If your local network supports the use of computer names, you can replace the IP address with the network name of the computer. If you have changed the port the calibre content server is running on, you will have to change 8080 as well to the new port.

The local IP address is the IP address you computer is assigned on your home network. A quick Google search will tell you how to find out your local IP address. You can now browse your book collection and download books from calibre to your device to open with whatever ebook reading software you have on your android device.

Some reading programs support browsing the calibre library directly. For example, in Aldiko, click My Catalogs, then + to add a catalog, then give the catalog a title such as “calibre” and provide the URL listed above. You can now browse the calibre library and download directly into the reading software.

The above was shamelessly ripped from the Calibre FAQ Page.

Headless Server Install

http://www.mobileread.com/forums/showthread.php?t=225535

http://linuxphilia.blogspot.co.uk/2012/06/my-wife-and-i-like-to-read-books-on-go.html

http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce/Turn-Raspberry-Pi-into-an-Ebook-Server-with-Calibre

http://www.mobileread.com/forums/showthread.php?t=159421