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)