From c05db9f8c5731351304ec01aec9d7ad3ce3cebf8 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Wed, 11 Aug 2021 09:38:39 -0400 Subject: [PATCH] Added a validation of existing credentials for opensubtitles.com provider. --- libs/subliminal_patch/providers/opensubtitlescom.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/subliminal_patch/providers/opensubtitlescom.py b/libs/subliminal_patch/providers/opensubtitlescom.py index fd4bb6684..7d04a6026 100644 --- a/libs/subliminal_patch/providers/opensubtitlescom.py +++ b/libs/subliminal_patch/providers/opensubtitlescom.py @@ -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')