Python Version 3.11 | pyvts version 0.3.3 I was using the pyvts pip package to interact with VTStudio but even after i take into account the documentation and the exmaples, they dont seem to work... I already checked the authentication status and connection status using the build in functions and they all returned ok (connected or working). here is the shrunked down version of the code that i was testing with | python:
async def VTSConnectorEngine():
"""Handles connection and authentication with VTube Studio."""
config = VTSConfig()
vtStudio = vts(plugin_info=config.definitions())
if not vtStudio.get_connection_status():
await vtStudio.connect()
for attempt in range(3):
if vtStudio.get_authentic_status() == 1:
print("Requesting Authentication...")
await vtStudio.request_authenticate()
print("Authenticated Successfully!")
if vtStudio.get_authentic_status() == 2:
return
print(f"Attempt {attempt + 1}: Authentication failed, retrying...")
time.sleep(3)
await vtStudio.request_authenticate_token()
print("Authentication failed after 3 attempts.")
Im very certain that the issue is not with the VTSConfig class which just contains a classmethod and deatails. For the authentication token (which i already have and used before) its just in a text file without anything else like indentation at alt_auth_token_path:str = r'.\config\vtsToken.txt' which is included in the plugin_information and returns properly when called as such: plugin_information = config.definitions() print(plugin_information)
When the code is run i get in the Console Log: Attempt 1: Authentication failed, retrying... None Attempt 2: Authentication failed, retrying... None Attempt 3: Authentication failed, retrying... None Authentication failed after 3 attempts.
Also, when the for loop is removed in place for just the vtStudio.request_authenticate()
it asserts this: assert responese_dict["data"]["authenticated"], "Authentication Failed"
as a KeyError
I want this code to connect to VTStudio so that i can modify and control the avatar using a function. but this dosent connect and after 3/2 hours of troubleshooting , AI , reading the documentation and guides several times i really have absolutely no idea... I doubt the token is expired but nonetheless, Any help will be greatly appeciated.