Added Cache path clear for AMZN

This commit is contained in:
chu23465 2025-04-10 01:03:28 +05:30
parent 8a08433ff8
commit 2f6e521d75

View File

@ -1192,8 +1192,8 @@ class Amazon(BaseService):
cookies[cookie['Name']] = cookie['Value'] cookies[cookie['Name']] = cookie['Value']
else: else:
error = response.json()['response']["error"] error = response.json()['response']["error"]
#self.cache_path.unlink(missing_ok=True) self.cache_path.unlink(missing_ok=True)
self.log.warn(f"Error when refreshing cookies: {error['message']} [{error['code']}]") raise self.log.exit(f"Error when refreshing cookies: {error['message']} [{error['code']}]")
# Create a new cookies object to be used with requsts. # Create a new cookies object to be used with requsts.
@ -1227,7 +1227,7 @@ class Amazon(BaseService):
response_json = response.json() response_json = response.json()
if response.status_code != 200 or "error" in 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( raise self.log.exit(
f"Failed to refresh device token -> {response_json['error_description']} [{response_json['error']}]" f"Failed to refresh device token -> {response_json['error_description']} [{response_json['error']}]"
) )