Opensubtitles detected that the plugin sends a lot of bad requests, after some investigation the following was determined:
Currently, when the user sets up the login credentials/API key in the plugin settings page, the plugin stores the credentials and uses them for API requests. If the user changes their opensubtitles credentials (or deletes the API key), the plugin will try (and fail) to log in every time a subtitle search is attempted, which means that the plugin will spam the opensubtitles API with bad login attempts during the "download missing subtitles" task.
This PR adds automatic credentials invalidation by checking if the login attempt resulted in HTTP 400/401/403 (invalid api key), if yes it sets the CredentialsInvalid field to true and all further login attempts are ignored, until the user enters new credentials.
EDIT: draft because I'm waiting for the opensubtitles API to come back online to test this thoroughlyEDIT 2: draft because I'm waiting for some info about possible 400s on login
Opensubtitles detected that the plugin sends a lot of bad requests, after some investigation the following was determined:
Currently, when the user sets up the login credentials/API key in the plugin settings page, the plugin stores the credentials and uses them for API requests. If the user changes their opensubtitles credentials (or deletes the API key), the plugin will try (and fail) to log in every time a subtitle search is attempted, which means that the plugin will spam the opensubtitles API with bad login attempts during the "download missing subtitles" task.
This PR adds automatic credentials invalidation by checking if the login attempt resulted in HTTP 400/401/403 (invalid api key), if yes it sets the
CredentialsInvalid
field to true and all further login attempts are ignored, until the user enters new credentials.EDIT: draft because I'm waiting for the opensubtitles API to come back online to test this thoroughlyEDIT 2: draft because I'm waiting for some info about possible 400s on loginCloses #127