From f8f1731ad938e6c98944ff9a4db785963bb22210 Mon Sep 17 00:00:00 2001 From: hajunho Date: Thu, 25 Jun 2020 21:24:01 +0900 Subject: [PATCH] fixing the keyword error Double quotation mark helps to find keyword more accuracy. But folder name error occurs because of that. --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 42f6a91..a62cdc0 100644 --- a/main.py +++ b/main.py @@ -157,7 +157,7 @@ def base64_to_object(src): return data def download_images(self, keyword, links, site_name): - self.make_dir('{}/{}'.format(self.download_path, keyword)) + self.make_dir('{}/{}'.format(self.download_path, keyword.replace('"', ''))) total = len(links) for index, link in enumerate(links): @@ -177,7 +177,7 @@ def download_images(self, keyword, links, site_name): ext = self.get_extension_from_link(link) is_base64 = False - no_ext_path = '{}/{}/{}_{}'.format(self.download_path, keyword, site_name, str(index).zfill(4)) + no_ext_path = '{}/{}/{}_{}'.format(self.download_path.replace('"', ''), keyword, site_name, str(index).zfill(4)) path = no_ext_path + '.' + ext self.save_object_to_file(response, path, is_base64=is_base64)