diff --git a/spcd/util.py b/spcd/util.py index 161cc37..0996c06 100644 --- a/spcd/util.py +++ b/spcd/util.py @@ -1,11 +1,18 @@ import os from pathlib import Path +from urllib import urlparse, urlunparse import env from rwx import fs from rwx.log import stream as log +def add_url_path(url: str, extra_path: str) -> str: + parts = urlparse(url) + parts._replace(path=Path(parts.path) / extra_path) + return urlunparse(parts) + + def browse(root: str) -> None: paths = [] for directory, _, files in os.walk(root):