{"id":13988679,"url":"https://github.com/yshalsager/ebook-converter-bot","last_synced_at":"2025-04-05T13:05:48.658Z","repository":{"id":38454622,"uuid":"399931170","full_name":"yshalsager/ebook-converter-bot","owner":"yshalsager","description":"Convert ebooks with few clicks on Telegram!","archived":false,"fork":false,"pushed_at":"2024-10-22T03:56:18.000Z","size":1011,"stargazers_count":107,"open_issues_count":3,"forks_count":23,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-22T16:38:03.646Z","etag":null,"topics":["calibre","convert-ebooks","ebook-convert","python","telegram","telegram-bot","telethon","telethon-bot"],"latest_commit_sha":null,"homepage":"https://t.me/ebook_converter_bot","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yshalsager.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"XiaomiFirmwareUpdater","liberapay":"yshalsager","custom":["https://paypal.me/yshalsager"]}},"created_at":"2021-08-25T19:12:12.000Z","updated_at":"2024-10-22T04:56:52.000Z","dependencies_parsed_at":"2024-02-20T00:22:39.224Z","dependency_job_id":"ffcfdf87-f279-4162-804a-ab5c0fc87902","html_url":"https://github.com/yshalsager/ebook-converter-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yshalsager%2Febook-converter-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yshalsager%2Febook-converter-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yshalsager%2Febook-converter-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yshalsager%2Febook-converter-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yshalsager","download_url":"https://codeload.github.com/yshalsager/ebook-converter-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339155,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calibre","convert-ebooks","ebook-convert","python","telegram","telegram-bot","telethon","telethon-bot"],"created_at":"2024-08-09T13:01:18.327Z","updated_at":"2025-04-05T13:05:48.639Z","avatar_url":"https://github.com/yshalsager.png","language":"Python","funding_links":["https://patreon.com/XiaomiFirmwareUpdater","https://liberapay.com/yshalsager","https://paypal.me/yshalsager","https://img.shields.io/badge/PayPal-Donate-00457C?style=flat\u0026labelColor=00457C\u0026logo=PayPal\u0026logoColor=white\u0026link=https://www.paypal.me/yshalsager","https://www.paypal.me/yshalsager","https://img.shields.io/badge/Patreon-Support-F96854?style=flat\u0026labelColor=F96854\u0026logo=Patreon\u0026logoColor=white\u0026link=https://www.patreon.com/XiaomiFirmwareUpdater","https://www.patreon.com/XiaomiFirmwareUpdater","https://img.shields.io/badge/Liberapay-Support-F6C915?style=flat\u0026labelColor=F6C915\u0026logo=Liberapay\u0026logoColor=white\u0026link=https://liberapay.com/yshalsager"],"categories":["Python"],"sub_categories":[],"readme":"# E-Book Converter Bot\n\n[![Telegram Badge](https://img.shields.io/badge/Telegram-Use%20Now!-2CA5E0?style=flat\u0026labelColor=2CA5E0\u0026logo=Telegram\u0026logoColor=white\u0026link=https://t.me/ebook_converter_bot)](https://t.me/ebook_converter_bot)\n\n[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.png?v=103)](https://github.com/ellerbrock/open-source-badges/)\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/yshalsager/ebook-converter-bot/master.svg)](https://results.pre-commit.ci/latest/github/yshalsager/ebook-converter-bot/master)\n\n\n[![PayPal](https://img.shields.io/badge/PayPal-Donate-00457C?style=flat\u0026labelColor=00457C\u0026logo=PayPal\u0026logoColor=white\u0026link=https://www.paypal.me/yshalsager)](https://www.paypal.me/yshalsager)\n[![Patreon](https://img.shields.io/badge/Patreon-Support-F96854?style=flat\u0026labelColor=F96854\u0026logo=Patreon\u0026logoColor=white\u0026link=https://www.patreon.com/XiaomiFirmwareUpdater)](https://www.patreon.com/XiaomiFirmwareUpdater)\n[![Liberapay](https://img.shields.io/badge/Liberapay-Support-F6C915?style=flat\u0026labelColor=F6C915\u0026logo=Liberapay\u0026logoColor=white\u0026link=https://liberapay.com/yshalsager)](https://liberapay.com/yshalsager)\n\nA bot that converts e-books to various formats, powered by [calibre](https://calibre-ebook.com/)!\nIt currently supports 34 input formats and 20 output formats.\n\nYou can start using it or adding it to your group [here on Telegram](https://t.me/ebook_converter_bot).\n\n## About the code:\n\nThis project is a modular bot, made using Python 3 and the following:\n\n- [Telethon Library](https://github.com/LonamiWebs/Telethon/)\n- [Calibre](https://calibre-ebook.com/)\n\n## Bot features:\n\nThis bot aims to provide an easy way for telegram users to convert e-books from and to different formats.\n\nIt supports converting from the following formats:\n\n```python\n['azw', 'azw3', 'azw4', 'azw8', 'cb7', 'cbc', 'cbr', 'cbz', 'chm', 'djvu', 'docx',\n 'doc', 'epub', 'fb2', 'fbz', 'html', 'htmlz', 'kfx', 'kfx-zip', 'kpf', 'lit',\n 'lrf', 'mobi', 'odt', 'opf', 'pdb', 'pml', 'prc', 'rb', 'rtf', 'snb', 'tcr',\n 'txt', 'txtz']\n```\n\nTo the following formats:\n\n```python\n['azw3', 'docx', 'epub', 'fb2', 'htmlz', 'kfx', 'lit', 'lrf', 'mobi', 'oeb',\n 'pdb', 'pdf', 'pmlz', 'rb', 'rtf', 'snb', 'tcr', 'txt', 'txtz', 'zip']\n```\n\nSome more features of the bot:\n\n- Force book direction to be RTL\n- Multilingual support, you can contribute and add your own languages if you want :).\n- Flatten book's table of contents.\n\n## Usage\n\n- Forward any supported file to the bot and choose the required format to convert to, and in few seconds the bot will\n  reply you with the converted file.\n- The bot works in groups too. Reply with `/convert` to any file then do the same steps as in private.\n- You can change the preferences of the bot such as language using `/settings` or `/preferences` commands.\n\n## Before setting up the bot\n\n- Copy `config.json.example` file to `config.json` and fill the required information:\n  ```json\n  {\n    \"tg_bot_token\": \"11111111:xxxxxxxxxxxxxxxxxx\",\n    \"tg_bot_id\": 111111111,\n    \"api_key\": 1121221,\n    \"api_hash\": \"xxxxxxxxxxxxxxxxxxxx\",\n    \"tg_bot_admins\": [\n      2222222\n    ]\n  }\n  ```\n- Compile the translation files using the following command:\n  ```bash\n  make i18n-compile \n  ```\n\n## Setting up the bot\n\nBefore all, clone this repository.\n\n### Using Docker\n\n- Simply, run the following command:\n\n```bash\ndocker-compose up --build -d\n```\n\n### Without Docker [NOT RECOMMENDED]\n\n#### Python dependencies\n\nIt requires Python 3.7 with pip v19+ installed or poetry if you use it.\n\nClone the repository and run any of the following commands:\n\n##### Using poetry\n\n```bash\npoetry install\n```\n\n##### Using Pip\n\n```bash\npip install .\n```\n\n#### Database\n\nThe bot depends on sqlite database. Make sure that your system has it installed.\n\n#### Other requirements\n\nYou can go through the Dockerfile to see how the bot requirements are being installed.\n\n- The conversion process is done by utilizing [Calibre](https://calibre-ebook.com/) and its ebook-convert, so make sure\n  you have it installed.\n- To convert from and to KFX, you need to install [KFX Input](https://www.mobileread.com/forums/showthread.php?t=291290)\n  and [KFX Output](https://www.mobileread.com/forums/showthread.php?t=272407) plugins in calibre, this can be done from\n  the command line by using the following commands:\n  ```bash\n  # KFX Input\n  wget https://plugins.calibre-ebook.com/291290.zip \n  calibre-customize -a 291290.zip\n  # KFX Output\n  wget https://plugins.calibre-ebook.com/272407.zip\n  calibre-customize -a 272407.zip\n  ```\n- Also, KFX Output plugin requires [Kindle Previewer 3](https://kdp.amazon.com/en_US/help/topic/G202131170), which can\n  run on linux under [Wine](https://appdb.winehq.org/objectManager.php?sClass=application\u0026iId=18012).\n\n#### Running the bot\n\nIf you finally managed to get all pieces in its place without using docker, run the bot using:\n\n```bash\npython3 -m ebook_converter_bot\n```\n\n### Internationalization (i18n)\n\nThe bot uses gettext for internationalization and makefile for running i18n tasks easily.\n\n- First, generate .pot template using `make i18n-generate-messages`.\n- Update the current translation files using `make i18n-merge`, then edit the translation strings.\n- Compile the translation files using `make i18n-compile`.\n\nTo add a new language to the bot, run the following command (change 'ar' to your language code) then edit the new\nlanguage file with translation and compile.\n\n```bash\nLANG=ar make i18n-init-lang\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyshalsager%2Febook-converter-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyshalsager%2Febook-converter-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyshalsager%2Febook-converter-bot/lists"}