Skip to content

Commit

Permalink
fix anthor
Browse files Browse the repository at this point in the history
  • Loading branch information
LarkinZero committed Nov 14, 2024
1 parent b94280e commit f63bacd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PyCookieCloud/PyCookieCloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
"""
Expand All @@ -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()
Expand Down

0 comments on commit f63bacd

Please sign in to comment.