1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-25 17:17:12 +00:00

Improved Opensubtitles.com provider caching of token

This commit is contained in:
morpheus65535 2021-05-27 11:17:20 -04:00
parent bb842b92af
commit 7209bad0c4

View file

@ -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',