From 9a893d5e6d65a07f6c263c2054e2721b25e4ed19 Mon Sep 17 00:00:00 2001 From: SashegDev Date: Fri, 22 May 2026 05:48:15 +0000 Subject: [PATCH] fix: add Trojan protocol support in create_3xui_client (password instead of uuid) --- aggregator.py | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/aggregator.py b/aggregator.py index ca51314..213595a 100644 --- a/aggregator.py +++ b/aggregator.py @@ -947,15 +947,27 @@ def create_3xui_client(username: str, sub_id: str, inbound: dict, traffic_gb: in logger.info(f"Creating client: email={email}, total_bytes={total_bytes}, inbound={inbound_name}") from py3xui.client import Client - client = Client( - id=str(uuid.uuid4()), - email=email, - enable=True, - total_gb=total_bytes, - expiry_time=0, - limit_ip=0, - subId=sub_id - ) + if inbound.get("protocol") == "trojan": + client = Client( + id="", + password=str(uuid.uuid4()), + email=email, + enable=True, + total_gb=total_bytes, + expiry_time=0, + limit_ip=0, + subId=sub_id + ) + else: + client = Client( + id=str(uuid.uuid4()), + email=email, + enable=True, + total_gb=total_bytes, + expiry_time=0, + limit_ip=0, + subId=sub_id + ) try: existing = api.client.get_by_email(email)