From f63bacdcf54074ef324d290eecb636b54fd74525 Mon Sep 17 00:00:00 2001 From: Larkin_Wang Date: Thu, 14 Nov 2024 02:46:32 +0000 Subject: [PATCH] fix anthor --- PyCookieCloud/PyCookieCloud.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PyCookieCloud/PyCookieCloud.py b/PyCookieCloud/PyCookieCloud.py index 210e3a1..bdd31ba 100644 --- a/PyCookieCloud/PyCookieCloud.py +++ b/PyCookieCloud/PyCookieCloud.py @@ -3,7 +3,7 @@ import json from typing import Optional, Dict, List, Any from urllib.parse import urljoin,urlparse -from pathlib import Path +from pathlib import PurePosixPath import requests @@ -15,7 +15,7 @@ def __init__(self, url: str, uuid: str, password: str): self.url: str = url self.uuid: str = uuid self.password: str = password - self.api_root: str = urlparse(url).path if urlparse(url).path else None + self.api_root: str = urlparse(url).path if urlparse(url).path else '/' def check_connection(self) -> bool: """ @@ -39,7 +39,7 @@ def get_encrypted_data(self) -> Optional[str]: :return: The encrypted data if the connection is successful, None otherwise. """ if self.check_connection(): - path = str(Path(self.api_root, 'get/', self.uuid)) + path = str(PurePosixPath(self.api_root, 'get/', self.uuid)) cookie_cloud_request = requests.get(urljoin(self.url, path)) if cookie_cloud_request.status_code == 200: cookie_cloud_response = cookie_cloud_request.json()