Skip to main content

fastsub

Официальный Python SDK FastSub — монетизация Telegram-ботов на обязательной подписке.

pip install fastsub

Быстрый старт

from fastsub import FastSub

async with FastSub(api_key="fsp_live_...") as fs:
    answer = await fs.request_op(user_id=123456789)
    for task in answer.tasks:
        print(task.title, task.link)

Ключа ещё нет? Его можно получить, не открывая бота:

async with FastSub.bootstrap(confirm_key="fsc_...", bot_token="123:ABC") as fs:
    print(fs.api_key)

Синхронный бот

from fastsub import FastSubSync

with FastSubSync(api_key="fsp_live_...") as fs:
    answer = fs.request_op(user_id=123456789)

aiogram — три строки вместо вызова в каждом хендлере

dp.message.middleware(FastSubMiddleware(fs))
dp.callback_query.middleware(FastSubMiddleware(fs))
dp.include_router(fastsub_check_router(fs))

Вебхуки

from fastsub import fastsub_webhook_router

app.include_router(fastsub_webhook_router(SECRET, on_event))

Подпись проверяется до вызова обработчика. Вручную — verify_webhook(secret, body, signature).

Рекламодателю

from fastsub import FastSubAdvertiser

async with FastSubAdvertiser(api_key="fsa_live_...") as adv:
    order = await adv.order(123)
    print(order["forecast"]["text"], order["retention"]["summary"])

Документация: https://fastsub.org/docs

Metadata

Release files for fastsub 1.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastsub 1.6.1
File Size Uploaded Provenance Actions
fastsub-1.6.1.tar.gz 18.5 kB Without provenance Details for fastsub-1.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastsub 1.6.1
File Interpreter ABI Platform Actions
fastsub-1.6.1-py3-none-any.whl Python 3 none any Details for fastsub-1.6.1-py3-none-any.whl

Total release size: 36.3 kB

Release files / fastsub-1.6.1.tar.gz

Download URL fastsub-1.6.1.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2358ccb596afca7c5c3c0b2d1178011dffc100bf687155e3cf4ff3e5946cd319
BLAKE2b-256 checksum
How to use checksums
bd1709fd10a0e25653febf8774b6183f211a6b4d676fd122210a730411a551ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / fastsub-1.6.1-py3-none-any.whl

Download URL fastsub-1.6.1-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
574b27e623fbcfe143a50795cc650452ab2e398fb506d0d217df65b2a2df5f6b
BLAKE2b-256 checksum
How to use checksums
2103d0c32618de464a4ebb93558621858769177e2c62ab20b51e655451d1e7af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for fastsub 1.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page