Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samfun75/bookdlbot
A Telegram bot to search and download books from Libgen.rs using an asynchronous libgen api wrapper called libgenesis
https://github.com/samfun75/bookdlbot
async books bot downloader heroku libgen pyrogram python telegram telegram-bot uploader
Last synced: about 2 months ago
JSON representation
A Telegram bot to search and download books from Libgen.rs using an asynchronous libgen api wrapper called libgenesis
- Host: GitHub
- URL: https://github.com/samfun75/bookdlbot
- Owner: Samfun75
- License: mit
- Created: 2021-02-09T13:50:18.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-17T11:04:22.000Z (over 2 years ago)
- Last Synced: 2024-10-18T23:19:27.434Z (3 months ago)
- Topics: async, books, bot, downloader, heroku, libgen, pyrogram, python, telegram, telegram-bot, uploader
- Language: Python
- Homepage:
- Size: 73.2 KB
- Stars: 15
- Watchers: 4
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bookdl Bot
This is a working example to integrate [libgenesis](https://github.com/Samfun75/libgenesis) (an api for Libgen.rs) with a telegram bot.
## Requirments
- libgenesis [View](https://github.com/Samfun75/libgenesis)
- Pyrogram [View](https://github.com/pyrogram/pyrogram)
- Pymongo## Installation
### Docker
Guide for installation using docker:
Use the below button to deploy.
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/Samfun75/BookdlBot)
### Other systems
Clone repository
```bash
git clone https://github.com/Samfun75/BookdlBot
```Change to repository directory
```bash
cd BookdlBot
```Install requirements and dependencies
```python
pip3 install -r requirements.txt
```Create a new `config.ini` using the sample available at `bookdl/working_dir/config.ini.sample` in `bookdl/working_dir/`.
```ini
# Here is a sample of config file and what it should include:# More info on API_ID and API_HASH can be found here: https://docs.pyrogram.org/intro/setup#api-keys
[pyrogram]
api_id = 1234567
api_hash = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx# More info on Bot API Key/token can be found here: https://core.telegram.org/bots#6-botfather
[bot-configuration]
bot_token = 123456789:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
session = BookdlBot
dustbin = -100xxxxxxxxx # Used to store uploaded book. id of a channel where the bot is admin
allowed_users = [123456789, 987654321] # Telegram id of users allowed to use the bot. If the bot is open to all put empty array like this []# Mongodb Credentials
[database]
db_host = xxxxxxxxxx.xxxxx.mongodb.net or localhost # In this section db_host is the address of the machine where the MongoDB is running
db_username = username
db_password = password
db_name = BookdlBot
db_type = Mongo_Atlas (or Mongo_Community)# ConvertAPI secret
[convert]
convert_api = secretkey
```Run bot with
`python -m bookdl`
stop with CTRL+C
## Usage
- Send /start and press Search 🔍 and on the open inline query type the book name
- Send a book's MD5 like 'MD5:a382109f7fdde3be5b2cb4f82d97443b'
- Send a book link from 'library.lol, libgen.lc, libgen.gs or b-ok.cc'After performing one of the above seteps a book detail with 'Download' button is returned and press the button to download and upload the book to telegram.
For books other that PDF, a 🔃 Convert to PDF button is included and it uses converapi to convert the ebook to pdf