All Projects → yshalsager → ebook-converter-bot

yshalsager / ebook-converter-bot

Licence: MIT license
Convert ebooks with few clicks on Telegram!

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects
Makefile
30231 projects

Projects that are alternatives of or similar to ebook-converter-bot

Natsuki
❤️ Hi There Im Natsuki A next gen powerful telegram group manager bot for manage your groups and have fun with other cool modules @TeamNatsuki
Stars: ✭ 49 (+4.26%)
Mutual labels:  telethon, telethon-bot
SpamBot
First Spam Bot repo ever made for telegram bots. Powerful spambot for telegram made with python and telethon.
Stars: ✭ 67 (+42.55%)
Mutual labels:  telethon, telethon-bot
acsm-calibre-plugin
Calibre plugin for ACSM->EPUB and ACSM->PDF conversion.
Stars: ✭ 118 (+151.06%)
Mutual labels:  calibre
One4uBot
Telegram Userbot Project to helping your Telegram experience based on PaperplaneExtended - Our Support https://t.me/userbotindo,
Stars: ✭ 51 (+8.51%)
Mutual labels:  telethon
anyfesto
Low cost Raspberry Pi /Linux based access point with audio, education and communications local content server. Inspired by the ideas of sharing with others. Anyfesto - a platform from which to speak.
Stars: ✭ 66 (+40.43%)
Mutual labels:  calibre
build-calibre
Build the calibre installers, including all dependencies from scratch
Stars: ✭ 29 (-38.3%)
Mutual labels:  calibre
MashaRoBot
MashaRoBot : 📑Editor's choice
Stars: ✭ 39 (-17.02%)
Mutual labels:  telethon
geckoboard
Receive Calibre snapshot webhooks, push to Geckoboard datasets.
Stars: ✭ 23 (-51.06%)
Mutual labels:  calibre
tgmount
Mount Telegram dialogs and channels as a Virtual File System.
Stars: ✭ 52 (+10.64%)
Mutual labels:  telethon
Safaribooks
Download and generate EPUB of your favorite books from O'Reilly Learning (aka Safari Books Online) library.
Stars: ✭ 3,208 (+6725.53%)
Mutual labels:  calibre
AntiDeletedAccountsBot
Automatically kick deleted accounts
Stars: ✭ 36 (-23.4%)
Mutual labels:  telethon
Calibre
The official source code repository for the calibre ebook manager
Stars: ✭ 11,221 (+23774.47%)
Mutual labels:  calibre
ebook-converter
Commandline tool for converting between several e-books formats, based on Calibre project.
Stars: ✭ 21 (-55.32%)
Mutual labels:  calibre
doujinshi metadata plugins
the calibre metadata plugins for doujinshi
Stars: ✭ 55 (+17.02%)
Mutual labels:  calibre
douban-book-api
第三方豆瓣读书 api 接口
Stars: ✭ 44 (-6.38%)
Mutual labels:  calibre
StringSessionBot
Pyrogram and Telethon String Session Generator
Stars: ✭ 63 (+34.04%)
Mutual labels:  telethon
kobo-book-downloader
A tool to download and remove DRM from your purchased Kobo.com ebooks and audiobooks.
Stars: ✭ 171 (+263.83%)
Mutual labels:  calibre
Calibre Web
📚 Web app for browsing, reading and downloading eBooks stored in a Calibre database
Stars: ✭ 5,616 (+11848.94%)
Mutual labels:  calibre
DevelopersUserbot
Telegram Userbot Made for Developers by Developers
Stars: ✭ 25 (-46.81%)
Mutual labels:  telethon
LEGEND-BOT
#LEGENDBOT telethon based userbot with assistant added and 280+ modules and best experience made with love🔥⚡
Stars: ✭ 52 (+10.64%)
Mutual labels:  telethon

E-Book Converter Bot

Telegram Badge

Open Source Love made-with-python

PayPal Patreon Liberapay

A bot that converts e-books to various formats, powered by calibre! It currently supports 34 input formats and 19 output formats.

You can start using it or adding it to your group here on Telegram.

About the code:

This project is a modular bot, made using Python 3 and the following:

Bot features:

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', 'pmlz', 'rb', 'rtf', 'snb', 'tcr', 'txt', 'txtz', 'zip']

Some more features of the bot:

  • Force book direction to be RTL
  • Multilingual support, you can contribute and add your own languages if you want :).

Usage

  • Forward any supported file to the bot and choose the required format to convert to, and in few seconds the bot will reply you with the converted file.
  • The bot works in groups too. Reply with /convert to any file then do the same steps as in private.
  • You can change the preferences of the bot such as language using /settings or /preferences commands.

Before setting up the bot

  • Copy 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
      ]
    }
  • Compile the translation files using the following command:
    make i18n-compile 

Setting up the bot

Before all, clone this repository.

Using Docker

  • Simply, run the following command:
docker-compose up --build -d

Without Docker [NOT RECOMMENDED]

Python dependencies

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:

Using poetry
poetry install
Using Pip
pip install .

Database

The bot depends on sqlite database. Make sure that your system has it installed.

Other requirements

You can go through the Dockerfile to see how the bot requirements are being installed.

  • The conversion process is done by utilizing Calibre and its ebook-convert, so make sure you have it installed.
  • To convert from and to KFX, you need to install KFX Input and KFX Output plugins in calibre, this can be done from the command line by using the following commands:
    # 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
  • Also, KFX Output plugin requires Kindle Previewer 3, which can run on linux under Wine.

Running the bot

If you finally managed to get all pieces in its place without using docker, run the bot using:

python3 -m ebook_converter_bot

Internationalization (i18n)

The bot uses gettext for internationalization and makefile for running i18n tasks easily.

  • First, generate .pot template using make i18n-generate-messages.
  • Update the current translation files using make i18n-merge, then edit the translation strings.
  • Compile the translation files using 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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].