Skip to content

Telegram bot to send e-books to Kindle devices or to convert them between different formats.

License

Notifications You must be signed in to change notification settings

twisterrm/kindle-calibre-bot

 
 

Repository files navigation

Frame 1 (7)

🤖 Telegram bot to send e-books to Kindle devices or to convert them between different formats. More than 2,000 registered users and 4,000 documents converted weekly.


Allowed file formats

This bot uses Calibre under the hood to perform the conversions and supports the following extensions:

  • Input Formats: AZW, AZW3, AZW4, CBZ, CBR, CB7, CBC, CHM, DJVU, DOCX, EPUB, FB2, FBZ, HTML, HTMLZ, LIT, LRF, MOBI, ODT, PDF, PRC, PDB, PML, RB, RTF, SNB, TCR, TXT, TXTZ

  • Output Formats: AZW3, EPUB, DOCX, FB2, LRF, MOBI, PDF, RTF, TXT


Keep in mind that PDF documents are one of the worst formats to convert from. Best source formats in order of decreasing preference are:

LIT, MOBI, AZW, EPUB, AZW3, FB2, FBZ, DOCX, HTML, PRC, ODT, RTF, PDB, TXT, PDF


Limitations

  • Maximum file size per e-book: 20MB
  • e-books converted/sent per user per day: 10

Docker Image

A pre-built Docker image is available in the Docker Hub repository.

acamposcar/kindle-calibre-bot

Things you need (environment variables)

  • (TELEGRAM_TOKEN) Telegran Bot Authentication Token: create a Telegram Bot with Bot Father
  • (PG*) PostgreSQL database
  • (EMAIL*) Google email to send the e-books to the Kindle
  • (ADMIN_ID) Your Telegram ID

Usage

docker-compose

---
version: "2.1"
services:
  kindle-calibre-bot:
    image: acamposcar/kindle-calibre-bot:latest
    container_name: kindle-calibre-bot
    environment:
      - TZ=Europe/Madrid
      - ADMIN_ID=9999999
      - TELEGRAM_TOKEN=SuperLargeKey
      - TEST_TELEGRAM_TOKEN=Optional
      - [email protected]
      - EMAIL_PASSWORD=StrongPassword
      - PGHOST=postgresql
      - PGDATABASE=dbname
      - PGUSER=username
      - PGPASSWORD=StrongPassword
      - PGPORT=5623
      - ENV=prod
    restart: unless-stopped

docker cli

docker run -d \
  --name=kindle-calibre-bot \
  -e ADMIN_ID=9999999 \
  -e TELEGRAM_TOKEN=SuperLargeKey \
  -e TEST_TELEGRAM_TOKEN=Optional \
  -e [email protected] \
  -e EMAIL_PASSWORD=StrongPassword \
  -e PGHOST=postgresql \
  -e PGDATABASE=dbname \
  -e PGUSER=username \
  -e PGPASSWORD=StrongPassword \
  -e PGPORT=5623 \
  -e ENV=prod \
  --restart unless-stopped \
  acamposcar/kindle-calibre-bot:latest

Build your own image

  1. Clone the repository
git clone https://github.com/acamposcar/kindle-calibre-bot.git
  1. Start your PostgreSQL database

  2. Create a Telegram Bot with Bot Father

  3. Edit .example.env file with your credentials and rename to .env

  4. Building docker image

docker build -t kindle-calibre-bot .
  1. Running the docker container
docker run --env-file .env kindle-calibre-bot

Buy me a coffee

Help me to maintain this project and keep it free forever 🚀

Buy Me A Coffee

About

Telegram bot to send e-books to Kindle devices or to convert them between different formats.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.1%
  • Dockerfile 1.9%