Skip to content

Commit

Permalink
fixing the keyword error
Browse files Browse the repository at this point in the history
Double quotation mark helps to find keyword more accuracy. But folder name error occurs because of that.
  • Loading branch information
hajunho committed Jun 25, 2020
1 parent 8a85be3 commit f8f1731
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)

Expand Down

0 comments on commit f8f1731

Please sign in to comment.