From 2f2fd81b157e4aa72ef6b56d7140babbc3e6ce2e Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:08:47 +0300 Subject: [PATCH] [utils] bugfix _normalize_url() - replace space after unquote --- duckduckgo_search/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckduckgo_search/utils.py b/duckduckgo_search/utils.py index 6cdb0e1..78d48d7 100644 --- a/duckduckgo_search/utils.py +++ b/duckduckgo_search/utils.py @@ -132,7 +132,7 @@ def _normalize(raw_html: str) -> str: def _normalize_url(url: str) -> str: """Unquote URL and replace spaces with '+'.""" - return unquote(url.replace(" ", "+")) if url else "" + return unquote(url).replace(" ", "+") if url else "" def _calculate_distance(lat1: Decimal, lon1: Decimal, lat2: Decimal, lon2: Decimal) -> float: