From 16b50133afdeaa68c3226d5c1c391c82b0189542 Mon Sep 17 00:00:00 2001 From: nikitoshina <70635675+nikitoshina@users.noreply.github.com> Date: Thu, 5 Sep 2024 12:22:33 -0700 Subject: [PATCH] Fix for "Error:: URL can't contain control characters. (found at least ' ')" --- bing_image_downloader/bing.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bing_image_downloader/bing.py b/bing_image_downloader/bing.py index 39f5633..230b1d0 100644 --- a/bing_image_downloader/bing.py +++ b/bing_image_downloader/bing.py @@ -138,6 +138,7 @@ def run(self): print("[%] No more images are available") break links = re.findall('murl":"(.*?)"', html) + links = [link.replace(" ", "%20") for link in links] if self.verbose: print("[%] Indexed {} Images on Page {}.".format(len(links), self.page_counter + 1)) print("\n===============================================\n")