Convert ebooks with few clicks on Telegram!
MIT License
A bot that converts e-books to various formats, powered by calibre! It currently supports 34 input formats and 20 output formats.
You can start using it or adding it to your group here on Telegram.
Thanks to JetBrains for providing us with open-source free license!
This project is a modular bot, made using Python 3 and the following:
This bot aims to provide an easy way for telegram users to convert e-books from and to different formats.
It supports converting from the following formats:
['azw', 'azw3', 'azw4', 'azw8', 'cb7', 'cbc', 'cbr', 'cbz', 'chm', 'djvu', 'docx',
'doc', 'epub', 'fb2', 'fbz', 'html', 'htmlz', 'kfx', 'kfx-zip', 'kpf', 'lit',
'lrf', 'mobi', 'odt', 'opf', 'pdb', 'pml', 'prc', 'rb', 'rtf', 'snb', 'tcr',
'txt', 'txtz']
To the following formats:
['azw3', 'docx', 'epub', 'fb2', 'htmlz', 'kfx', 'lit', 'lrf', 'mobi', 'oeb',
'pdb', 'pdf', 'pmlz', 'rb', 'rtf', 'snb', 'tcr', 'txt', 'txtz', 'zip']
Some more features of the bot:
/convert
to any file then do the same steps as in private./settings
or /preferences
commands.config.json.example
file to config.json
and fill the required information:
{
"tg_bot_token": "11111111:xxxxxxxxxxxxxxxxxx",
"tg_bot_id": 111111111,
"api_key": 1121221,
"api_hash": "xxxxxxxxxxxxxxxxxxxx",
"tg_bot_admins": [
2222222
]
}
make i18n-compile
Before all, clone this repository.
docker-compose up --build -d
It requires Python 3.7 with pip v19+ installed or poetry if you use it.
Clone the repository and run any of the following commands:
poetry install
pip install .
The bot depends on sqlite database. Make sure that your system has it installed.
You can go through the Dockerfile to see how the bot requirements are being installed.
# KFX Input
wget https://plugins.calibre-ebook.com/291290.zip
calibre-customize -a 291290.zip
# KFX Output
wget https://plugins.calibre-ebook.com/272407.zip
calibre-customize -a 272407.zip
If you finally managed to get all pieces in its place without using docker, run the bot using:
python3 -m ebook_converter_bot
The bot uses gettext for internationalization and makefile for running i18n tasks easily.
make i18n-generate-messages
.make i18n-merge
, then edit the translation strings.make i18n-compile
.To add a new language to the bot, run the following command (change 'ar' to your language code) then edit the new language file with translation and compile.
LANG=ar make i18n-init-lang