Skip to content

Commit

Permalink
For --extract_metadata, skip failed downloads and include saved filen…
Browse files Browse the repository at this point in the history
…ame (hardikvasa#104)

* For --extract_metadata, exclude failed downloads

* For --extract_metadata, include saved image filename
  • Loading branch information
buddydvd authored and hardikvasa committed Aug 11, 2018
1 parent d05d061 commit eff8aa8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions google_images_download/google_images_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,6 @@ def _get_all_items(self,page,main_directory,dir_name,limit,arguments):
if arguments['metadata']:
print("\nImage Metadata: " + str(object))

items.append(object) # Append all the links in the list named 'Links'

#download the images
download_status,download_message,return_image_name,absolute_path = self.download_image(object['image_link'],object['image_format'],main_directory,dir_name,count,arguments['print_urls'],arguments['socket_timeout'],arguments['prefix'],arguments['print_size'],arguments['no_numbering'])
print(download_message)
Expand All @@ -716,6 +714,8 @@ def _get_all_items(self,page,main_directory,dir_name,limit,arguments):
print(download_message_thumbnail)

count += 1
object['image_filename'] = return_image_name
items.append(object) # Append all the links in the list named 'Links'
abs_path.append(absolute_path)
else:
errorCount += 1
Expand Down

0 comments on commit eff8aa8

Please sign in to comment.