From a4e4060d8d8f6b8ff9c9cd2ebc73ad5a9a39c263 Mon Sep 17 00:00:00 2001 From: Bernat Arlandis Date: Thu, 29 Jun 2023 20:05:13 +0200 Subject: [PATCH] Fix for newer requests-cache --- tvdb_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tvdb_api.py b/tvdb_api.py index 624abd2..bca9943 100644 --- a/tvdb_api.py +++ b/tvdb_api.py @@ -528,7 +528,7 @@ def __repr__(self): return "" % self.get("name") -def create_key(self, request): +def create_key(self, request, **kwargs): """A new cache_key algo is required as the authentication token changes with each run. Also there are other header params which also change with each request (e.g. timestamp). Excluding all @@ -544,7 +544,7 @@ def create_key(self, request): cache is to be used thus saving host and network traffic. """ - if self._ignored_parameters: + if self.ignored_parameters: url, body = self._remove_ignored_parameters(request) else: url, body = request.url, request.body @@ -554,7 +554,7 @@ def create_key(self, request): if request.body: key.update(_to_bytes(body)) else: - if self._include_get_headers and request.headers != _DEFAULT_HEADERS: + if self.match_headers and request.headers != _DEFAULT_HEADERS: for name, value in sorted(request.headers.items()): # include only Accept-Language as it is important for context if name in ['Accept-Language']: