diff --git a/voussoirkit/downloady.py b/voussoirkit/downloady.py index 558182f..1ad347f 100644 --- a/voussoirkit/downloady.py +++ b/voussoirkit/downloady.py @@ -8,6 +8,7 @@ import warnings from voussoirkit import bytestring from voussoirkit import ratelimiter from voussoirkit import clipext +from voussoirkit import safeprint warnings.simplefilter('ignore') @@ -53,8 +54,8 @@ def download_file( localname = os.path.abspath(localname) if verbose: - safeprint(' URL:', url) - safeprint('File:', localname) + safeprint.safeprint(f' URL: {url}') + safeprint.safeprint(f'File: {localname}') plan = prepare_plan( url, @@ -371,10 +372,6 @@ def request(method, url, stream=False, headers=None, timeout=TIMEOUT, verify_ssl req.raise_for_status() return req -def safeprint(*texts, **kwargs): - texts = [str(text).encode('ascii', 'replace').decode() for text in texts] - print(*texts, **kwargs) - def sanitize_filename(text, exclusions=''): to_remove = FILENAME_BADCHARS for exclude in exclusions: