mirror of
https://github.com/arabianq/yndx-disk.git
synced 2026-04-28 06:31:23 +00:00
httpx -> aiohttp;
fixed sync Client
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
DEFAULT_HEADERS = {
|
||||
"Accept": "application/json",
|
||||
"Authorization": "OAuth {token}",
|
||||
}
|
||||
|
||||
|
||||
|
||||
def generate_headers(token: str) -> dict:
|
||||
headers = DEFAULT_HEADERS.copy()
|
||||
|
||||
@@ -17,7 +15,7 @@ def generate_headers(token: str) -> dict:
|
||||
|
||||
|
||||
def parse_path(path: str, prefix: str = "disk:/") -> str:
|
||||
path = str(Path(path)) # Some kind of check is path valid or not =P
|
||||
path = str(Path(path)) # Some kind of check is path valid or not =P
|
||||
|
||||
if path.startswith("/"):
|
||||
path = prefix + path[1:]
|
||||
@@ -25,5 +23,3 @@ def parse_path(path: str, prefix: str = "disk:/") -> str:
|
||||
path = prefix + path
|
||||
|
||||
return path
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user