summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2022-11-18 15:41:08 -0500
committermorpheus65535 <[email protected]>2022-11-18 15:41:08 -0500
commit118eb09db03f54cd371983653530d2c2c26da83e (patch)
treead21efa534f452f547327ad6d50b2ace852e96bb
parent0e8ac06e59d2181e9462eb975ed854279dad7f93 (diff)
downloadbazarr-118eb09db03f54cd371983653530d2c2c26da83e.tar.gz
bazarr-118eb09db03f54cd371983653530d2c2c26da83e.zip
Fixed some remaining issues with assrt. #1953v1.1.3-beta.20
-rw-r--r--libs/subliminal_patch/providers/assrt.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/libs/subliminal_patch/providers/assrt.py b/libs/subliminal_patch/providers/assrt.py
index 04662e2db..8058c57cb 100644
--- a/libs/subliminal_patch/providers/assrt.py
+++ b/libs/subliminal_patch/providers/assrt.py
@@ -142,7 +142,6 @@ class AssrtProvider(Provider):
raise ConfigurationError('Token must be specified')
self.token = token
self.session = Session()
- self.default_max_request_per_minute = 20
self.max_request_per_minute = None
def initialize(self):
@@ -154,16 +153,11 @@ class AssrtProvider(Provider):
if 'user' in result and 'quota' in result['user']:
self.max_request_per_minute = result['user']['quota']
- if not self.max_request_per_minute:
+ if not isinstance(self.max_request_per_minute, int):
raise ProviderError(f'Cannot get user request quota per minute from provider: {result}')
- try:
- int(self.max_request_per_minute)
- except ValueError:
- raise ProviderError(f'User request quota is not a valid integer: {self.max_request_per_minute}')
- else:
- if self.max_request_per_minute <= 0:
- raise ProviderError(f'User request quota is not a positive integer: {self.max_request_per_minute}')
+ if self.max_request_per_minute <= 0:
+ raise ProviderError(f'User request quota is not a positive integer: {self.max_request_per_minute}')
def terminate(self):
self.session.close()