Telegram bot for expanding external media links
Project description
warp_beacon
Telegram bot for external social networks media links expanding. Works with a links in personal messages and also with group chats.
Just send a media link to the chat with bot and get a video or audio reply.
Yotube Video usage example | Youtube Music usage example | Instagram Reels usage example |
Instagram Photo post usage example | Instagram Photo Carousel usage example | Instagram Photo bulk Strories download usage example |
Instagram specific Story download usage example | Group chat usage example |
In order to setup your own instance, you will need:
- Obtain your own brand new
TG_TOKEN
. To do that, write to @BotFather. - Obtain
TG_API_ID
,TG_API_HASH
,TG_BOT_NAME
. Learn more here.
All bot configuration stored in warp_beacon.conf file.
Configuration example
TG_TOKEN="you telegram token received from @BotFather"
# these 3 settings should be obtained at https://my.telegram.org/apps
# learn more: https://core.telegram.org/api/obtaining_api_id
###
TG_API_ID=""
TG_API_HASH=""
TG_BOT_NAME=""
# bot admin username, e.g.: @BelisariusCawl
# Used for communication between the bot and the administrator.
# For example, if authorization is required for YouTube, bot can send an authorization code via message to this address.
TG_BOT_ADMIN_USERNAME=""
###
INSTAGRAM_LOGIN="instagram login (email or cell phone)"
INSTAGRAM_PASSWORD="instgram password"
INSTAGRAM_VERIFICATION_CODE="instagram 2FA if required, default empty"
MONGODB_HOST="mongodb"
MONGODB_PORT="27017"
MONGODB_USER="root"
MONGODB_PASSWORD="changeme"
VIDEO_STORAGE_DIR="/var/warp_beacon/videos"
# workers settings
# default: min(32, os.cpu_count() + 4)
#TG_WORKERS_POOL_SIZE=3
#UPLOAD_POOL_SIZE=3
#WORKERS_POOL_SIZE=3
ENABLE_DONATES=true
DONATE_LINK="your donate link which will be shown if ENABLE_DONATES where set"
Deployed example bot
How to run
Any Linux machine will suit in.
Install docker and git
sudo apt update
# uninstall old docker packages
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
sudo apt install ca-certificates curl git
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin git
Download sources
git clone https://github.com/sb0y/warp_beacon.git
Go to sources directory
cd warp_beacon
Run app
sudo docker compose up -d
Check logs
sudo docker compose logs warp_beacon -f
Upgrading
If you are using image-prod
(set in docker-compose.yml
by default), just rebuild your image:
cd your_warp_beacon_sources_directory/
sudo docker compose build --no-cache
Recreate existing container:
sudo docker compose up -d
How to install from PIP
sudo apt update
sudo apt install python3-pip
sudo pip install warp-beacon
Your configuration file will be located at /usr/local/lib/python3.10/dist-packages/etc/warp_beacon/warp_beacon.conf
.
For convenience, we will copy it to a common directory:
mkdir /etc/warp_beacon
cp /usr/local/lib/python3.10/dist-packages/etc/warp_beacon/warp_beacon.conf /etc/warp_beacon/warp_beacon.conf
Run the app
source /etc/warp_beacon/warp_beacon.conf && /usr/local/bin/warp_beacon
Most likely you will need a systemd service so that you don't have to start the service manually and don't have to worry about service start on server reboot.
cp /usr/local/lib/python3.10/dist-packages/lib/systemd/system/warp_beacon.service /lib/systemd/system
systemctl unmask warp_beacon.service
systemctl enable warp_beacon.service
# start the service app
systemctl start warp_beacon.service
How to build Python whl package
sudo apt install python3-pip python3-build python3-virtualenv dh-virtualenv
# If you are getting build errors you probably need the latest version of python3-build
sudo python3 -m pip install --upgrade build
python3 -m build
How to build Ubuntu deb package
sudo apt update
sudo apt install debhelper python3-pip python3-build python3-virtualenv dh-virtualenv dh-python
# If you are getting build errors you probably need the latest version of python3-build
sudo python3 -m pip install --upgrade build
build deb file
dpkg-buildpackage -us -uc -b
Support Warp Beacon project
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file warp_beacon-2.2.56.tar.gz
.
File metadata
- Download URL: warp_beacon-2.2.56.tar.gz
- Upload date:
- Size: 53.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df6bded1624bb9270263a79316657fab35e9a6a67493c31bb1fe2450ca55f162 |
|
MD5 | a5d5cbda60456eaecfbf9f9f7979d08e |
|
BLAKE2b-256 | f7b3e97f02f55d99c55b579c4bb04ad776c0cd1d8340b29a80379a59e20e06de |
Provenance
File details
Details for the file warp_beacon-2.2.56-py3-none-any.whl
.
File metadata
- Download URL: warp_beacon-2.2.56-py3-none-any.whl
- Upload date:
- Size: 59.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c3ca648247c62ad6a4e2a00eebe5a95cb7f9cae6a5daca799ebaf5874365ef1 |
|
MD5 | bea2bf96c103a5a8fed27b7ce0c9a29f |
|
BLAKE2b-256 | eddd6c63f7410f9ece24d413c6a76ab53eeb6787f6e209e76e77993998e8b35a |