Как можно указать/узнать данные для авторизации ******? Создание ****** api.login() settings = Settings() sniffing = Sniffing(enabled=True) tcp_settings = { "acceptProxyProtocol": False, "header": {"type": "none"}, } stream_settings = StreamSettings(security="reality", network="tcp", tcp_settings=tcp_settings) inbound = Inbound( enable=True, port=13157, username = "123hnjdas", password = "asdhbasd123", protocol="socks", expiryTime="173565504000", settings=settings, stream_settings=stream_settings, sniffing=sniffing, remark="user_id", ) api.inbound.add(inbound) Python api.login() settings = Settings() sniffing = Sniffing(enabled=True) tcp_settings = { "acceptProxyProtocol": False, "header": {"type": "none"}, } stream_settings = StreamSettings(security="reality", network="tcp", tcp_settings=tcp_settings) inbound = Inbound( enable=True, port=13157, username = "123hnjdas", password = "asdhbasd123", protocol="socks", expiryTime="173565504000", settings=settings, stream_settings=stream_settings, sniffing=sniffing, remark="user_id", ) api.inbound.add(inbound) Получение данных api.login() inbounds: list[py3xui.Inbound] = api.inbound.get_list() print(inbounds) Python api.login() inbounds: list[py3xui.Inbound] = api.inbound.get_list() print(inbounds) В ответе получию [Inbound(enable=False, port=13157, protocol='socks', settings=Settings(clients=[], decryption='', fallbacks=[]), stream_settings=StreamSettings(security='reality', network='tcp', tcp_settings={'acceptProxyProtocol': False, 'header': {'type': 'none'}}, kcp_settings={}, external_proxy=[], reality_settings={}, xtls_settings={}, tls_settings={}), sniffing=Sniffing(enabled=True, dest_override=[], metadata_only=False, route_only=False), listen='', remark='user_id', id=35, up=0, down=0, total=0, expiry_time=173565504000, client_stats=[], tag='inbound-13157')] Code [Inbound(enable=False, port=13157, protocol='socks', settings=Settings(clients=[], decryption='', fallbacks=[]), stream_settings=StreamSettings(security='reality', network='tcp', tcp_settings={'acceptProxyProtocol': False, 'header': {'type': 'none'}}, kcp_settings={}, external_proxy=[], reality_settings={}, xtls_settings={}, tls_settings={}), sniffing=Sniffing(enabled=True, dest_override=[], metadata_only=False, route_only=False), listen='', remark='user_id', id=35, up=0, down=0, total=0, expiry_time=173565504000, client_stats=[], tag='inbound-13157')]
противоположник, выдаёт ошибку, добавляю ещё данные, не видит id settings = Settings(clients=[ { "user": "123hnjdas", "pass": "asdhbasd123", "email": "user@example.com", "enable": True, "id": 123, "client_id": 12909 } ]) Python settings = Settings(clients=[ { "user": "123hnjdas", "pass": "asdhbasd123", "email": "user@example.com", "enable": True, "id": 123, "client_id": 12909 } ]) Traceback (most recent call last): File "C:\Users\Admin\Desktop\INFERN PROXY\api\add_proxy.py", line 43, in <module> api.inbound.add(inbound) File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\py3xui\api\api_inbound.py", line 157, in add self._post(url, headers, data) File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\py3xui\api\api_base.py", line 307, in _post return self._request_with_retry(requests.post, url, headers, json=data, **kwargs) File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\py3xui\api\api_base.py", line 274, in _request_with_retry self._check_response(response) File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\py3xui\api\api_base.py", line 210, in _check_response raise ValueError(f"Response status is not successful, message: {message}") ValueError: Response status is not successful, message: Create Failed: empty client ID Python Traceback (most recent call last): File "C:\Users\Admin\Desktop\INFERN PROXY\api\add_proxy.py", line 43, in <module> api.inbound.add(inbound) File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\py3xui\api\api_inbound.py", line 157, in add self._post(url, headers, data) File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\py3xui\api\api_base.py", line 307, in _post return self._request_with_retry(requests.post, url, headers, json=data, **kwargs) File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\py3xui\api\api_base.py", line 274, in _request_with_retry self._check_response(response) File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\py3xui\api\api_base.py", line 210, in _check_response raise ValueError(f"Response status is not successful, message: {message}") ValueError: Response status is not successful, message: Create Failed: empty client ID