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:
parent
bb842b92af
commit
7209bad0c4
1 changed files with 1 additions and 2 deletions
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue