Added a validation of existing credentials for opensubtitles.com provider.

This commit is contained in:
morpheus65535 2021-08-11 09:38:39 -04:00
parent c2059584db
commit c05db9f8c5
1 changed files with 3 additions and 0 deletions

View File

@ -124,6 +124,9 @@ class OpenSubtitlesComProvider(ProviderRetryMixin, Provider):
languages.update(set(Language.rebuild(l, forced=True) for l in languages))
def __init__(self, username=None, password=None, use_hash=True, api_key=None):
if not all((username, password)):
raise ConfigurationError('Username and password must be specified')
if not api_key:
raise ConfigurationError('Api_key must be specified')