No description
Find a file
2025-04-18 12:48:37 +02:00
.github/workflows Update notify.yml 2025-04-17 14:41:32 +02:00
bot fixes #3 2025-04-17 10:19:01 +02:00
cookies Init 2025-04-14 13:05:43 +02:00
database fixes some lint errors 2025-04-16 17:03:16 +02:00
enums Init 2025-04-14 13:05:43 +02:00
ext 9gag: new extractor 2025-04-18 12:48:37 +02:00
models use host matching instead of regex (desc) 2025-04-16 14:11:55 +02:00
plugins Init 2025-04-14 13:05:43 +02:00
util util: impersonate chrome TLS fingerprint 2025-04-18 12:46:26 +02:00
.env.example misc: adds option to enable pprof 2025-04-16 13:03:05 +02:00
.gitignore Init 2025-04-14 13:05:43 +02:00
build.sh Init 2025-04-14 13:05:43 +02:00
docker-compose.yaml add docker support (#1) 2025-04-15 21:12:27 +02:00
Dockerfile Update Dockerfile 2025-04-17 16:48:26 +02:00
go.mod 9gag: new extractor 2025-04-18 12:48:37 +02:00
go.sum 9gag: new extractor 2025-04-18 12:48:37 +02:00
LICENSE Init 2025-04-14 13:05:43 +02:00
main.go fixes some lint errors 2025-04-16 17:03:16 +02:00
README.md implement sonic for json + remove some TODOs from readme + fix go version requirement (#5) 2025-04-17 14:16:30 +02:00

govd

a telegram bot for downloading media from various platforms

this project was born after the discontinuation of a highly popular bot known as UVD, and draws significant inspiration from yt-dlp

features

  • download media from various platforms
  • download videos, photos, and audio
  • inline mode support
  • group chat support with customizable settings
  • media caption support

dependencies

  • ffmpeg >= 6.1.1
  • libheif >= 1.19.7
  • pkg-config
  • mysql or mariadb

installation

git clone https://github.com/govdbot/govd.git
cd govd
# edit .env file with your bot token and database credentials
sh build.sh

installation with docker

first build the image using the dockerfile

docker build -t govd-bot .

next, update the .env file to ensure the database properties match the environment variables defined for the MariaDB service in the docker-compose.yml file (while the default environment variables defined for the MariaDB service are acceptable, it is recommended to change the MYSQL_PASSWORD property in the docker-compose.yaml file for enhanced security and ensure that you also modify the the DB_PASSWORD property in the .env file to reflect this change)

the following line in the .env file MUST be set as shown below

DB_HOST=db

finally run the compose to start all services

docker compose up -d

env variables

variable description default
DB_HOST database host localhost
DB_PORT database port 3306
DB_NAME database name govd
DB_USER database user govd
DB_PASSWORD database password password
BOT_API_URL* telegram bot api url https://api.telegram.org
BOT_TOKEN telegram bot token 12345678:ABC-DEF1234ghIkl-zyx57W2P0s
CONCURRENT_UPDATES max concurrent updates handled by the bot 50
LOG_DISPATCHER_ERRORS log dispatcher errors 0
DOWNLOADS_DIR directory for downloaded files downloads
HTTP_PROXY http proxy (optional)
HTTPS_PROXY http proxy (optional)
NO_PROXY no proxy domains (optional)
REPO_URL project repository url https://github.com/govdbot/govd
PROFILER_PORT port for profiler http server (pprof) 0 (disabled)

note: to avoid limits on files, you should host your own telegram botapi. public bot instance is currently running under a botapi fork, tdlight-telegram-bot-api, but you can use the official botapi client too.

cookies

some extractors require cookies for download. to add your cookies, just insert a txt file in cookies folder (netscape format)

todo

  • add more extractors
  • switch to native libav
  • add tests
  • improve error handling
  • add support for telegram wehbhooks
  • switch to pgsql (?)
  • better API (?)
  • better docs with multiple README