1
0
Fork 0
mirror of https://github.com/EDeev/circlechek.git synced 2026-10-07 20:49:51 +03:00
Telegram-бот: квадратное видео → кружочек и кружочек → видео с размытым или градиентным фоном в углах. aiogram 3, MoviePy, Pillow https://t.me/circlechek_bot
Find a file
2026-10-06 17:04:00 +03:00
.github/workflows Образы на git.deev.su вместо dcr.deev.su: реестр zot выведен из работы, копию из GHCR делает синхронизатор 2026-10-06 17:04:00 +03:00
code Исправлены ошибки обработки кружочков 2026-10-05 19:16:13 +00:00
data v. 1.0 2025-06-30 23:59:17 +03:00
docs README на русском и английском с иллюстрацией фонов 2026-10-05 19:16:14 +00:00
.env.example Docker, CI и лицензия MIT 2026-10-05 19:16:13 +00:00
.gitattributes Переводы строк приведены к LF 2026-10-05 19:11:25 +00:00
.gitignore Docker, CI и лицензия MIT 2026-10-05 19:16:13 +00:00
compose.yaml Docker, CI и лицензия MIT 2026-10-05 19:16:13 +00:00
Dockerfile Docker, CI и лицензия MIT 2026-10-05 19:16:13 +00:00
LICENSE Docker, CI и лицензия MIT 2026-10-05 19:16:13 +00:00
README.en.md Образы на git.deev.su вместо dcr.deev.su: реестр zot выведен из работы, копию из GHCR делает синхронизатор 2026-10-06 17:04:00 +03:00
README.md Образы на git.deev.su вместо dcr.deev.su: реестр zot выведен из работы, копию из GHCR делает синхронизатор 2026-10-06 17:04:00 +03:00
requirements.txt Исправлены ошибки обработки кружочков 2026-10-05 19:16:13 +00:00

Circlechek

Русский · English

CI Docker License

A Telegram bot for video notes ("circles"): turns a square video into a round video note, and turns a video note back into a regular video with the corners filled by a blurred frame or a gradient matching the picture. The bot speaks Russian.

Status: personal project, completed · bot @circlechek_bot

A video note and two background options

Stack: Python 3.12 · aiogram 3 · MoviePy 2 · Pillow · NumPy · Docker

Features

  • Video → video note. A square video up to one minute comes back as a circle.
  • Video note → video. The bot splits the circle into frames, fills the corners and reassembles the video with sound. Background options:
    • blur — a blurred center of the frame;
    • gradient — based on the frame's average color.
  • Heavy processing runs in a separate thread, so the bot keeps answering others while one circle is processed. Each job gets its own temporary folder, cleaned up even on errors.

Note

Some Telegram video notes have broken metadata; processing then fails or the video has artifacts. The bot warns about this, so check the result.

Running

git clone https://github.com/EDeev/circlechek.git && cd circlechek
cp .env.example .env      # BOT_TOKEN from @BotFather
docker compose up -d

Prebuilt image: docker pull ghcr.io/edeev/circlechek or docker pull git.deev.su/edeev/circlechek.

Without Docker: Python 3.12, pip install -r requirements.txt, then cd code && BOT_TOKEN=… python bot.py (FFmpeg comes with MoviePy).

Structure

code/bot.py         entry point
code/handlers.py    commands, receiving videos and video notes, background buttons
code/scripts.py     Movie — frames and audio via MoviePy; Frame — background and circle mask via Pillow and NumPy
data/               temporary processing files

Development

pip install ruff -r requirements.txt
ruff check --select E9,F code

CI checks the code on every push and processes test video notes (with and without sound, both backgrounds). The Docker image is built on v* tags and published to GitHub Packages and git.deev.su.

License

MIT — see LICENSE.

Author

Egor Deev — GitHub · Telegram · egor@deev.space


⭐ If you find this project useful, give it a star on GitHub!

Made with ❤️ — deev.space