Telegram WebM Converter
This project started off as a shell script for my own personal needs , so please do expect some rough edges.
If you find any bugs or have suggestions, please open an issue. Thank you for your feedback!
Convert images to Telegram WebM stickers.
Features
- Convert an image to 100x100 WebM icon (max 32KB)
- Convert images to 512x512 WebM stickers (max 256KB)
- Batch processing support
- Automatic size optimization
Requirements
- Python 3.8+
- FFmpeg
This application requires FFmpeg to be installed on your system. FFmpeg is open-source software licensed under the LGPLv2.1/GPLv2 (or later). Please refer to the FFmpeg website for more details on its licensing.
Installation
pip install tg-webm-converter
Usage
# Convert all images in current directory
tg-webm-converter
# Convert specific file to icon, others to stickers
tg-webm-converter -i icon.png
# Convert only one file to sticker
tg-webm-converter -f image.jpg
# Convert only one file to icon
tg-webm-converter --icon-file icon.png
Build from Source
Prerequisites
- Python 3.8+
- Poetry:
curl -sSL https://install.python-poetry.org | python3 - - FFmpeg: As mentioned above, FFmpeg is a core dependency. Ensure it's installed and accessible in your system's PATH.
Setup
-
Clone the repository
git clone https://github.com/7591yj/tg-webm-converter.git cd tg-webm-converter
-
Install Dependencies with Poetry
Poetry will automatically create a virtual environment for the project and install all required dependencies.
poetry install
Running from Source
Once the development environment is set up, you can run the tg-webm-converter command directly using Poetry's run command:
# Run the application (same as `tg-webm-converter` if installed via pip)
poetry run tg-webm-converter
# Example: Convert all images in current directory
poetry run tg-webm-converter
# Example: Convert specific file to icon
poetry run tg-webm-converter --icon-file icon.png
# Run tests
poetry run pytest
Future Plans
- Consider a GUI version for easier use.
- Optimize performance for large batch conversions.
- Explore options for even smaller file sizes.
License
MIT License
Metadata
Release files for tg-webm-converter 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tg_webm_converter-0.1.1.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tg_webm_converter-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.3 kB
Release files / tg_webm_converter-0.1.1.tar.gz
| Download URL | tg_webm_converter-0.1.1.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f6925d520aca3acb44f7245037744c5184cfca84bc8860b1593a0b37ef13bef
|
|
BLAKE2b-256 checksum How to use checksums |
cb2282e61e91c7d639928f76a1c0d357e9598852bf710a6938001db50d156f20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / tg_webm_converter-0.1.1-py3-none-any.whl
| Download URL | tg_webm_converter-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53ac2c05bd6f4de2531e5fabb9a46377e428cf2225b309ad196509e31b9b3b81
|
|
BLAKE2b-256 checksum How to use checksums |
3b6c2abcdcbb84d8dd3212531630664e42f8e9dbd0d9f68262d129695e1d9917
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|