luckyturtledev / mstickereditor Goto Github PK
View Code? Open in Web Editor NEWimport sticker packs from telegram, to be used at the Maunium sticker picker for Matrix
License: Apache License 2.0
import sticker packs from telegram, to be used at the Maunium sticker picker for Matrix
License: Apache License 2.0
Pull requests do not have access to TG_BOT_KEY. This let the ci fail on them.
Happen in #42
Consider wrapping it in a newtype struct like this:
#[derive(Deserialize, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize)]
#[serde(transparent)]
pub struct MediaHash(
#[serde(with = "serde_big_array::BigArray")] pub database::Hash
);
The CI needs a telegram token to complete the tests, which is not available in pull requests.
import of some stickerpacks fail:
ERROR failed to import sticker 2 from pack "TheLittleMole"
Caused by:
0: error sending request for url (https://matrix-client.matrix.org/_matrix/media/r0/upload?access_token=TOKEN&filename=stickers%2Ffile_3643.webp): http2 error: stream error received: unspecific protocol error detected
1: http2 error: stream error received: unspecific protocol error detected
2: stream error received: unspecific protocol error detected
ERROR failed to import sticker 7 from pack "TheLittleMole"
packs: https://t.me/addstickers/TheLittleMole, https://t.me/addstickers/ArcticFox
Animated stickers don't show up on github page too, but somehow work just fine on SchildiChat on Android. I previously used sticker picker to import Telegram sticker packs. After using mstickereditor I changed index.json and added other json files.
Am I doing something wrong?
use this for log + indicatif
https://docs.rs/env_logger/0.10.0/env_logger/struct.Builder.html#method.target
need to convert webm to webp
Since this project depends on more and more c libs.
It should be a good idea to split functionality into feature, to build a version with basic functionality easy.
The lottie2gif and lottie2webp crates have been deprecated in favor of the new lottieconv crate.
For example at the sticker pack https://t.me/addstickers/LANI_Kurumi_chan_2_ENG the import of the following stickers does fail:
ERROR failed to import sticker 0 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 708608) bytes as input buffer, got 720896 bytes
ERROR failed to import sticker 2 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 679936) bytes as input buffer, got 688128 bytes
ERROR failed to import sticker 6 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 724992) bytes as input buffer, got 737280 bytes
ERROR failed to import sticker 12 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 712704) bytes as input buffer, got 720896 bytes
ERROR failed to import sticker 13 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 667648) bytes as input buffer, got 671744 bytes
ERROR failed to import sticker 15 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 745472) bytes as input buffer, got 753664 bytes
ERROR failed to import sticker 16 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 712704) bytes as input buffer, got 720896 bytes
ERROR failed to import sticker 17 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 782336) bytes as input buffer, got 786432 bytes
ERROR failed to import sticker 18 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 839680) bytes as input buffer, got 851968 bytes
ERROR failed to import sticker 19 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 913408) bytes as input buffer, got 917504 bytes
ERROR failed to import sticker 28 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 1040384) bytes as input buffer, got 1048576 bytes
ERROR failed to import sticker 42 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 925696) bytes as input buffer, got 933888 bytes
ERROR failed to import sticker 43 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 1003520) bytes as input buffer, got 1015808 bytes
ERROR failed to import sticker 47 from pack "LANI_Kurumi_chan_2_ENG"
Caused by:
BufferSizeFailed: Expected (width * height * 4 = 757760) bytes as input buffer, got 770048 bytes
I tried it and compiled it but my stickers are not working (?) The media files appear to be there but nothing is showing, not even in Element.
https://0x416c69.github.io/stickerpicker/web/#pack-tg_name_MyQuby (latest pack)
My synapse server is up to date. Is it required to enable dynamic_thumbnails
in synapse for this to work? When trying to fetch those webp images, I'm getting this error 400:
{"errcode":"M_UNKNOWN","error":"Cannot find any thumbnails for the requested media ([b'ag5.ir', b'qAsAxJsWpWXAlGaJaeZrJwQC']). This might mean the media is not a supported_media_format=(image/jpeg, image/jpg, image/webp, image/gif, image/png) or that thumbnailing failed for some other reason. (Dynamic thumbnails are disabled on this server.)"}
Pack: https://t.me/addstickers/MyQuby
issue by @0x416c69 imported from maunium/stickerpicker#63 (comment)
allow also t.me/addstickers/packs
(without https)
I'm sorry for the stupid question, but I can't run it. How to use it? If I just run 'mstickereditor' terminal it won't work.
I use Garuda linux. I pre-installed sticker-picker.
sticker should be compressed, before uploaded to matrix.
For example pngs can be compressed with oxipng.
Todo:
see #28 (comment)
If the import of all stickers fail. As example if all stickers are video stickers. A empty pack will be created.
Currently only a warning will be shown.
The dependency ffmpeg-next
locked in Cargo.lock does not support FFmpeg 6.1, causing a build failure.
error[E0004]: non-exhaustive patterns: `sys::AVPixelFormat::AV_PIX_FMT_P212BE`, `sys::AVPixelFormat::AV_PIX_FMT_P212LE`, `sys::AVPixelFormat::AV_PIX_FMT_P412BE` and 3 more not covered
[[package]]
name = "ffmpeg-next"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8af03c47ad26832ab3aabc4cdbf210af3d3b878783edd5a7ba044ba33aab7a60"
dependencies = [
"bitflags 1.3.2",
"ffmpeg-sys-next",
"libc",
]
Upstream of ffmpeg-next
already fixed this issue in https://github.com/zmwangx/rust-ffmpeg-sys/pull/65
, and released the fix on crates.io (https://crates.io/crates/ffmpeg-next/versions).
import of some sticker failed
ERROR failed to import sticker 1 from pack "MrOlaf"
Caused by:
Telegram request was not successful: 400 Bad Request: wrong file_id or the file is temporarily unavailable
ERROR failed to import sticker 2 from pack "MrOlaf"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.