From 7209bad0c4ca2ae090c239b0b72a349ef2fcf8bd Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Thu, 27 May 2021 11:17:20 -0400 Subject: [PATCH] Improved Opensubtitles.com provider caching of token --- libs/subliminal_patch/providers/opensubtitlescom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/subliminal_patch/providers/opensubtitlescom.py b/libs/subliminal_patch/providers/opensubtitlescom.py index 69e874ec4..30418d022 100644 --- a/libs/subliminal_patch/providers/opensubtitlescom.py +++ b/libs/subliminal_patch/providers/opensubtitlescom.py @@ -145,14 +145,13 @@ class OpenSubtitlesComProvider(ProviderRetryMixin, Provider): self.use_hash = use_hash def initialize(self): - self.token = region.get("oscom_token") + self.token = region.get("oscom_token", expiration_time=TOKEN_EXPIRATION_TIME) if self.token is NO_VALUE: self.login() def terminate(self): self.session.close() - @region.cache_on_arguments(expiration_time=TOKEN_EXPIRATION_TIME) def login(self): try: r = self.session.post(self.server_url + 'login',