From 2f6e521d75739d5ce61520974900f3c20bea3258 Mon Sep 17 00:00:00 2001 From: chu23465 <130033130+chu23465@users.noreply.github.com> Date: Thu, 10 Apr 2025 01:03:28 +0530 Subject: [PATCH] Added Cache path clear for AMZN --- vinetrimmer/services/amazon.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vinetrimmer/services/amazon.py b/vinetrimmer/services/amazon.py index 97517c0..9f86e9e 100644 --- a/vinetrimmer/services/amazon.py +++ b/vinetrimmer/services/amazon.py @@ -1192,8 +1192,8 @@ class Amazon(BaseService): cookies[cookie['Name']] = cookie['Value'] else: error = response.json()['response']["error"] - #self.cache_path.unlink(missing_ok=True) - self.log.warn(f"Error when refreshing cookies: {error['message']} [{error['code']}]") + self.cache_path.unlink(missing_ok=True) + raise self.log.exit(f"Error when refreshing cookies: {error['message']} [{error['code']}]") # Create a new cookies object to be used with requsts. @@ -1227,7 +1227,7 @@ class Amazon(BaseService): response_json = response.json() if response.status_code != 200 or "error" in response_json: - #self.cache_path.unlink(missing_ok=True) # Remove the cached device as its tokens have expired + self.cache_path.unlink(missing_ok=True) # Remove the cached device as its tokens have expired raise self.log.exit( f"Failed to refresh device token -> {response_json['error_description']} [{response_json['error']}]" )