Skip to main content

A client for the Signal stickers API

Project description

NOTICE

This is a fork from https://github.com/signalstickers/signalstickers-client

This fork adds typing and remove dependencies version caps

Python client for Signal stickers

A client to interact with the Signal stickers API.

  • Fetch sticker packs
  • Get images files
  • Upload sticker packs
  • etc.

Note: despite its name, this client does not interacts with signalstickers.org, so information defined there (tags, etc.) will not be fetched.

This client connects to the Signal sticker API. Please do not flood it (you'll be blocked anyway).

Installation

pip3 install --user signalstickers-client

This module requires cryptography, protobuf, anyio, and httpx (but they should be installed with the previous command).

Usage

If you are not familiar with Signal stickers, read STICKERS_INTERNALS.md first.

Downloading a pack

The StickerPack object returned by await StickersClient().get_pack(<pack_id>, <pack_key>) exposes the following attributes:

  • id: str the pack id. Equals to pack_id;
  • key: str the pack key. Equals to pack_key;
  • title: str the title of the pack;
  • author: str the author of the pack;
  • nb_stickers: int the number of stickers in the pack;
  • cover: Sticker the cover sticker;
  • stickers: list[Sticker] the list of stickers in the pack

A Sticker object exposes the following attributes:

  • id: int the id of the sticker in the pack;
  • emoji: str the emoji mapped to this sticker;
  • image_data: bytes the webp image of the sticker.

Uploading a pack

Same thing, but use LocalStickerPack (that does not contains id and key) instead of StickerPack.

You will need your Signal credentials!

To obtain them, run the Signal Desktop app with the flag --enable-dev-tools, open the Developer Tools, change the JavaScript context from top to Electron Isolated Context (cf. video below), and type window.reduxStore.getState().items.uuid_id to get your USER, and window.reduxStore.getState().items.password to get your PASSWORD.

Video: how to set JavaScript context

https://github.com/signalstickers/signalstickers-client/assets/7778898/ca3f1fec-e908-49d9-88a8-e33d0ee9a453

Example usage

See examples/

Development

  • Create a pipenv with pipenv install --dev;
  • Edit the code you want;
  • Don't forget to launch tests with pipenv run py.test.

License

See LICENSE

Legal

This is not an official Signal project. This is an independant project.
Signal is a registered trademark in the United States and other countries.

Author

Romain Ricard contact+stickerclient@romainricard.fr

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file signalstickers_client_fork_laggykiller-3.3.post1.tar.gz.

File metadata

File hashes

Hashes for signalstickers_client_fork_laggykiller-3.3.post1.tar.gz
Algorithm Hash digest
SHA256 d274e67a7098915ac29c571ad127c2a1e3607c11a81724b232ab929035748bb2
MD5 5c6cd2628946aaa05cdccceab3d47213
BLAKE2b-256 f7945d3b4fabde46b8e6eca10a07bfad9ba73c4feadef3030ac43b0d14a8e3d4

See more details on using hashes here.

Provenance

File details

Details for the file signalstickers_client_fork_laggykiller-3.3.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for signalstickers_client_fork_laggykiller-3.3.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 287f3aa89ddea8849263db72835e85284312272ab039d0e95ff584824d3df838
MD5 21ce595a2e633a3845196e052e50a0ea
BLAKE2b-256 3cd4125cf220ad7e71c8d98493ef60be4a0c3cb3ece76f8c3afd74709d65c0b1

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page