No description
Find a file
2025-04-23 02:00:15 +02:00
.github/workflows Update notify.yml 2025-04-17 14:41:32 +02:00
bot fixed typo 2025-04-22 12:12:42 +02:00
config fixes config 2025-04-20 12:54:20 +02:00
cookies Init 2025-04-14 13:05:43 +02:00
database db: connection retry logic 2025-04-22 00:22:27 +02:00
enums Init 2025-04-14 13:05:43 +02:00
ext reddit: prevent infinite loop on error 2025-04-22 12:06:13 +02:00
models fixes config 2025-04-20 12:54:20 +02:00
plugins fixes (desc) 2025-04-23 01:44:25 +02:00
util fixes (desc) 2025-04-23 01:44:25 +02:00
.env.example misc: adds option to enable pprof 2025-04-16 13:03:05 +02:00
.gitignore set configuration for each extractor 2025-04-20 12:19:14 +02:00
AUTHENTICATION.md Update AUTHENTICATION.md 2025-04-23 02:00:15 +02:00
build.sh Init 2025-04-14 13:05:43 +02:00
docker-compose.yaml fix docker build (#7) 2025-04-22 12:14:39 +02:00
Dockerfile fix docker build (#7) 2025-04-22 12:14:39 +02:00
ext-cfg-example.yaml fix typo 2025-04-20 12:19:54 +02:00
go.mod set configuration for each extractor 2025-04-20 12:19:14 +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 set configuration for each extractor 2025-04-20 12:19:14 +02:00
README.md readme updated 2025-04-23 01:57:20 +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


dependencies

  • ffmpeg >= 7.x (*)
  • libheif >= 1.19.7
  • pkg-config
  • mysql or mariadb

note: libav shared libraries must be installed on the system in order to build the bot.

installation

build

this method only works on linux and macos, if you want to build the bot on windows, check docker installation instead.

  1. clone the repository

    git clone https://github.com/govdbot/govd.git && cd govd
    
  2. edit the .env file to set the database properties.
    for enhanced security, it is recommended to change the DB_PASSWORD property in the .env file.

  3. make sure your database is up and running.

  4. build and run the bot:

    sh build.sh && ./govd
    
  1. build the image using the dockerfile:

    docker build -t govd-bot .
    
  2. update the .env file to ensure the database properties match the environment variables defined for the mariadb service in the docker-compose.yml file.
    for enhanced security, it is recommended to change the MYSQL_PASSWORD property in docker-compose.yaml and ensure DB_PASSWORD in .env matches it.

    the following line in the .env file must be set as:

    DB_HOST=db
    
  3. run the compose to start all services:

    docker compose up -d
    

options

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 50
LOG_DISPATCHER_ERRORS log dispatcher errors 0
DOWNLOADS_DIR directory for downloaded files downloads
HTTP_PROXY (?) http proxy (optional)
HTTPS_PROXY (?) https 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)

you can configure specific extractors options with ext-cfg.yaml file. documentation is not available yet, but you can check the source code for more information.

Important

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

proxying

there are two types of proxying available: http and edge.

  • http proxy: this is a standard http proxy that can be used to route requests through a proxy server. you can set the HTTP_PROXY and HTTPS_PROXY environment variables to use this feature. (SOCKS5 is supported too)
  • edge proxy: this is a custom proxy that is used to route requests through a specific url. currenrly, you can only set this proxy with ext-cfg.yaml file. this is useful for routing requests through a specific server or service. however, this feature is not totally implemented yet.

note: by settings NO_PROXY environment variable, you can specify domains that should not be proxied.

authentication

some extractors require cookies to access the content. please refer to this page for more information on how to set up authentication for each extractor.

todo

  • add tests
  • add support for telegram webhooks
  • switch to pgsql (maybe)
  • better api
  • better docs