Skip to content

qcgzxw/ebook-sender-bot

Repository files navigation

English | 简体中文

ebook-sender-bot

Send E-Book to kindle with Telegram Bot.

Try it: https://t.me/e_book_send_bot

We wanted to let you know that starting August 2022, you’ll no longer be able to send MOBI (.mobi, .azw) files to your Kindle library. Any MOBI files already in your library will not be affected by this change. MOBI is an older file format and won’t support the newest Kindle features for documents. Any existing MOBI files you want to read with our most up-to-date features for documents will need to be re-sent in a compatible format.

Compatible formats now include EPUB (.epub), which you can send to your library using your Send to Kindle email address. We’ll also be adding EPUB support to the free Kindle app for iOS and Android devices and the Send to Kindle desktop app for PC and Mac.

Usage

  1. Open bot link:https://t.me/e_book_send_bot
  2. Send /email your-kindle-email@kindle.com to set your kindle email address.
  3. Add bot email to your Approved Personal Document E-mail.
  4. Send a supported document to this bot and check your Kindle.

Support document format

send directly

  • doc
  • docx
  • rtf
  • html
  • htm
  • pdf
  • epub

convert to epub and send

  • azw
  • azw1
  • azw3
  • azw4
  • fb2
  • lrf
  • kfx
  • pdb
  • lit
  • txt
  • mobi

Setup

[recommended] docker-compose install

docker-compose.yml

docker-compose up -d

[recommended] docker install

docker run -d \
    --restart unless-stopped \
    --name ebook-sender-bot \
    -e TZ=Asia/Shanghai \
    -e APP_MODE=prod \
    -e MAX_SEND_LIMIT=10 \
    -e FORMAT=epub \
    -e EMAIL_PROVIDER=config \
    -e SMTP_HOST={YOUR_SMTP_HOST} \
    -e SMTP_PORT={YOUR_SMTP_PORT} \
    -e SMTP_USERNAME={YOUR_SMTP_USERNAME} \
    -e SMTP_PASSWORD={YOUR_SMTP_PASSWORD} \
    -e BOT_TOKEN={YOUR_BOT_TOKEN} \
    -e DEVELOPER_CHAT_ID={YOUR_TELEGRAM_CHAT_ID} \
    -v `./ebooks/`:`/app/storage/` \
    -v `./default.log`:`/app/default.log` \
    qcgzxw/ebook-sender-bot

source install

  1. copy config.ini.example to config.ini
  2. install requirements
pip3 install -r requirments.txt
  1. install calibre
  2. run main.py
python3 main.py

config.ini

[default]
# mode: [dev] printf runtime log to console 
mode=dev
# Set a daily limit of e-mailing per user
email_send_limit=10
# database: sqlite,mysql,postgresql
database=sqlite
# email_provider: config,mailcow,mailcow_alias
email_provider=config

# when database is sqlite
[sqlite]
name=ebook-sender-bot

# when database is mysql
[mysql]
name=ebook-sender-bot
host=192.168.1.1
port=3306
user=root
password=root

# when database is postgresql
[postgresql]
name=ebook-sender-bot
host=192.168.1.1
port=5432
user=root
password=root

[smtp]
host=smtp.gmail.com
port=465
username=your_email_address
password=your_email_account_password

# when email_provider is mailcow or mailcow_alias
[provider]
mailcow_url=your_mailcow_url
mailcow_api_key=mailcow_admin_api_key
mailcow_mailbox_domain=mailcow_mailbox_domain

[telegram]
# telegram tg_bot token
bot_token=your_telegram_bot_token
# your telegram chat id
developer_chat_id=your_telegram_chat_id

Preview

telegram-bot kindle

Donate

👉Buy me a beer

👉Buy me a vps

👉Buy me a keyboard

Todo

  • docker
  • Send document to kindle email
  • mysql
  • document information
  • covert books with calibre
  • use configParse instead of os.getenv()
  • i18n
  • telegram MessageReply class
  • admin command
  • unique email
  • queue
  • test case