NSplusthon
Asynchronous Python library for the Soroush Plus API
Built on Telethon and fully adapted for the Soroush Plus protocol.
Documentation • PyPI • GitHub • Soroush Plus
کتابخانه NSplusthon یک کتابخانه مدرن و قدرتمند برای Python 3.9+ است که بر پایه asyncio توسعه یافته و امکان تعامل مستقیم با API پیامرسان سروش پلاس را بهعنوان کاربر یا ربات فراهم میکند.
این پروژه بر پایه Telethon توسعه یافته و برای معماری اختصاصی سروش پلاس بازطراحی شده است. کتابخانه از TL Schema (Layer 182)، RSA Encryption، DC Routing و WebSocket Transport پشتیبانی میکند و تجربهای سریع، پایدار و نزدیک به کلاینت رسمی ارائه میدهد.
Note: لطفاً هنگام استفاده از این کتابخانه، قوانین و شرایط استفاده سروش پلاس را رعایت کنید. مسئولیت استفاده از این پروژه بر عهده کاربر است.
ویژگیها
- پشتیبانی کامل از حساب کاربری و ربات
- مبتنی بر asyncio با کارایی بالا
- امکان استفاده بهصورت Sync و Async
- پشتیبانی کامل از TL Schema اختصاصی سروش
- مدیریت Session و StringSession
- پشتیبانی از WebSocket
- پشتیبانی از DC Routing
- رمزنگاری RSA و AES
- بدون نیاز به API ID و API Hash
- API مشابه Telethon برای مهاجرت آسان
- مسیر OpenSSL سریعتر از SPlusthon / spluspy (AES-IGE)
- پکیج Typed (
py.typed) برای Pyright / Pylance / mypy
عملکرد
بنچمارک AES-IGE روی مسیر libssl (بدون cryptg)، ۲۵۶ کیلوبایت، Intel Xeon @ 2.60GHz، Python 3.13.14، بهترینِ ۹ اجرا. خروجی با مرجع C بیتبهبیت یکسان بود.
| کتابخانه | زمان رمز | سرعت |
|---|---|---|
| NSplusthon | 2.50 ms | 100.1 MiB/s |
| SPlusthon | 44.86 ms | 5.6 MiB/s |
| spluspy | 42.47 ms | 5.9 MiB/s |
NSplusthon روی این مسیر حدود ۱۸ برابر SPlusthon است
(from_buffer_copy بهجای کپی بایتبهبایت).
اسکریپت: benchmarks/aes_ige_bench.py
نصب
نیاز به Python 3.9 یا بالاتر.
از PyPI:
pip install nsplusthon
سریعترین نصب (cryptg + پروکسی + رسانه):
pip install "nsplusthon[fast]"
یا آخرین نسخه توسعه:
pip install git+https://github.com/Amogrotex/NSplusthon.git
شروع سریع
from nsplusthon import SoroushClient
from nsplusthon.sessions import StringSession
client = SoroushClient(StringSession())
client.start()
نمونه
from nsplusthon import SoroushClient, events
from nsplusthon.sessions import StringSession
client = SoroushClient(StringSession())
@client.on(events.NewMessage)
async def handler(event):
await event.reply("سلام 👋")
client.start()
client.run_until_disconnected()
ارسال پیام
client.send_message(
"username",
"سلام از NSplusthon ❤️"
)
ارسال فایل
client.send_file(
"username",
"/path/image.jpg"
)
دانلود رسانه
message = client.get_messages("username", limit=1)[0]
message.download_media()
Session ذخیرهشده
from nsplusthon import SoroushClient
from nsplusthon.sessions import StringSession
session = "1AwA..."
with SoroushClient(StringSession(session)) as client:
print(client.get_me())
وابستگیها
- aiohttp
- pyaes
- rsa
اختیاری:
- cryptg (افزایش سرعت رمزنگاری)
مستندات
مستندات کامل پروژه:
https://Amogrotex.github.io/NSplusthon/
مجوز
این پروژه تحت مجوز GNU GPL v3 منتشر شده است.
NSplusthon is maintained by AmoGrotex
Forked from SPlusthon by Shayan Heidari — which is itself based on Telethon.
Metadata
Release files for NSplusthon 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nsplusthon-1.2.0.tar.gz | 589.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nsplusthon-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.3 MB
Release files / nsplusthon-1.2.0.tar.gz
| Download URL | nsplusthon-1.2.0.tar.gz |
|---|---|
| Size | 589.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6da34a216bd76745947602f9f7356abbfec5e7551b54e84ac1b1d489ca548f5a
|
|
BLAKE2b-256 checksum How to use checksums |
ec574351aba527872bf524b8e8a207929fe9a3a561964ac1e3e8c1ba9b99eab8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / nsplusthon-1.2.0-py3-none-any.whl
| Download URL | nsplusthon-1.2.0-py3-none-any.whl |
|---|---|
| Size | 665.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e46f1597d7071d402f2cc42fcedd48c83d1de4248896f23a988dd09aba1774f
|
|
BLAKE2b-256 checksum How to use checksums |
de276d3ae59ee96fc9a26d1a96dce1f3f5d76b379b8edaed32ac6db02217ee89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|