A Telegram Web-Screenshot Bot Based on Playwright
Telegram Bot that creates screenshot PNG/JPEG or PDF of a given link. Can be combined with a number of additional parameters, such as resolution, partial or full-page rendering. The bot is currently accessible through in @BetterWebShotBot.
- Image [PNG/JPEG]
- 800x600
- 1280x720
- 1920x1080
- 2560x1440
- PDF
- Letter
- Legal
- A4
- A5
Splitting of long pages are available for png and jpeg.
Note: the bot requires a Chromium browser binary to render websites.
The bundled image already ships a matching Chromium build, so there is nothing else to install:
git clone https://github.com/alenpaulvarghese/Web-Screenshot-Bot.git
cd Web-Screenshot-Bot
cp config.env.sample config.env # then fill in your values
docker compose up -d
docker compose logs -fYour Telegram session is stored in a named volume (webshotbot-session), so it survives
container rebuilds. Stop with docker compose down; add -v only if you want to log out and
authenticate again.
Requires Python 3.9+.
git clone https://github.com/alenpaulvarghese/Web-Screenshot-Bot.git
cd Web-Screenshot-Bot
python3 -m pip install -r requirements.txt
# Download the Chromium build that matches the pinned playwright version
playwright install chromium
# <Create config.env appropriately>
python3 __main__.pyUse
playwright install chromium(notchrome) — the bot launches the browser Chromium that ships with Playwright. Installing Chrome instead can cause a version mismatch at startup.
BOT_TOKEN=12345:49dc3eeb1aehda3cI2TesHNHc
API_ID=256123
API_HASH=eb06d4abfb49dc3eeb1aeb98ae0f581e
### OPTIONAL ###
LOG_GROUP=-123990002
REQUEST_TIMEOUT=30
SUPPORT_GROUP=https://t.me/bytessupport- Copyright (C) 2023-2026 by AlenPaulVarghese
- Licensed under the terms of the GNU AGPL Version 3.0