Aedial / novelai-api

Python API for the NovelAI REST API
https://aedial.github.io/novelai-api/
MIT License
132 stars 15 forks source link

Access Key from novelai_api.utils.get_access_key Failing to Authenticate #39

Closed YILING0013 closed 5 days ago

YILING0013 commented 5 days ago

Description: When using the novelai_api.utils.get_access_key method, the generated access_key was working correctly in previous attempts, but today, the generated key is failing to authenticate. The API returns a 401 error: "Incorrect access key."

Steps to Reproduce:

  1. Call the novelai_api.utils.get_access_key method with valid email and password.
  2. Use the generated access_key in an API request.
  3. The request returns a 401 error with the message "Incorrect access key."

Expected Behavior: The generated access_key should work and allow successful API authentication.

Actual Behavior: The generated access_key is no longer valid, and API requests return a 401 error: "Incorrect access key."

Additional Information:

Aedial commented 5 days ago

Invalid access key means the email or password is wrong. Nothing has changed since yesterday, so double check you are providing the right ones (including required string escapes). If you have changed your password, make sure to update the provided password accordingly. I'll check locally on my side when I get home, but I do not expect any irregularity from the API.

YILING0013 commented 5 days ago

Apologies for the confusion, and thank you for your assistance. After reviewing the issue, it seems that the problem was caused by incorrect handling of special characters in the password when reading it from the YAML file. The special characters in the password were not correctly converted, which led to the authentication failure.

Once I replaced the YAML file with an older version, the program executed correctly, and the access_key was generated as expected.

Thank you again for your patience and support!