Telegram Bot that converts (for now) OPUS, MP3 and WebM files to voice messages, HEVC and MP4 (MPEG4, VP6 and VP8) to video messages or video notes (rounded ones), video messages to video notes (rounded ones), PDF files to photo messages (currently only the first page) and image files to stickers. It also tries to download videos from some websites and send them as video messages. The bot currently runs as @FileConvertBot.
Make sure you send the image as a file and know that the bot also works in groups!
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You need to install Homebrew by running:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Clone the project and install the dependencies by running:
cd /desired/location/path
git clone https://github.com/revolter/FileConvertBot.git
cd FileConvertBot
brew install pipenv
pipenv --three
pipenv shell
pipenv install
cd src
cp config_sample.cfg config.cfg
Then, edit the file named config.cfg
inside the src
folder with the correct values and run it using ./main.py -d
.
Use exit
to close the virtual environment.
You can easily deploy this to a cloud machine using Fabric:
cd /project/location/path
pipenv shell
pipenv install --dev
cp fabfile_sample.cfg fabfile.cfg
Then, edit the file named fabfile.cfg
inside the root folder with the correct values and run Fabric using:
fab setup
fab deploy
You can also deploy a single file using fab deploy --filename=main.py
or fab deploy --source=meta --filename=Pipfile
.
Currently, you have to manually install poppler
in order for PDF
to PNG
conversion to work:
- macOS:
brew install poppler
- Ubuntu:
sudo apt-get install poppler-utils