Skip to main content

Telegram bot for expanding external media links

Project description

warp_beacon Upload Python Package Docker Image CI Build DEB package

Telegram bot for external social networks media scrapling. Works with links in personal messages and also with group chats.

Just send to bot media link and get video.

All bot configuration stored in warp_beacon.conf file.

Configuration example

TG_TOKEN="you telegram token received from @BotFather"
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_POOL_SIZE=3

Deployed example bot

Try it 🚀

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

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

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

warp_beacon-1.0.4.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

warp_beacon-1.0.4-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file warp_beacon-1.0.4.tar.gz.

File metadata

  • Download URL: warp_beacon-1.0.4.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for warp_beacon-1.0.4.tar.gz
Algorithm Hash digest
SHA256 81e9eb84b9b825cf9c9dfeca174824eb2a4cf7b49b9ca77a5149e0928869bf63
MD5 ed7fc5f7d17bad858cb6ac2f860e2653
BLAKE2b-256 d966a0a516a35b4fd628d12dcf4b6fa8c6ac306c2ce035e341a3be9412cd5376

See more details on using hashes here.

Provenance

File details

Details for the file warp_beacon-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: warp_beacon-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for warp_beacon-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f1ce6945c8df398ebf07044e13b9e3116f7658a7251d4e8b8d93139324603383
MD5 5d30ef46625d9deabaebb86a26ceee6b
BLAKE2b-256 7d63d02dcbba178ef6bf3c7c169c85609ea509af6f563acc7151678b3c9c552b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page