hardikvasa / google-images-download

Python Script to download hundreds of images from 'Google Images'. It is a ready-to-run code!
MIT License
8.56k stars 2.1k forks source link

Download Error #307

Open BurnerDiamond opened 4 years ago

BurnerDiamond commented 4 years ago

I've not screwed around with anything and am just recently getting these new issues.

Traceback (most recent call last): File "C:\Users\Max\Downloads\Python\image_downloader.py", line 22, in <module> download = r.download(args) File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\site-packages\google_images_download\google_images_download.py", line 838, in download paths, errors = self.download_executor(arguments) File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\site-packages\google_images_download\google_images_download.py", line 965, in download_executor items,errorCount,abs_path = self._get_all_items(raw_html,main_directory,dir_name,limit,arguments) #get all image items and download images File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\site-packages\google_images_download\google_images_download.py", line 768, in _get_all_items image_objects = self._get_image_objects(page) File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\site-packages\google_images_download\google_images_download.py", line 758, in _get_image_objects image_objects = json.loads(object_decode)[31][0][12][2] File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\json\__init__.py", line 357, in loads return _default_decoder.decode(s) File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Not certain what is causing this issue.

doubleLLL3 commented 4 years ago

298

BurnerDiamond commented 4 years ago

298

https://gyazo.com/53ddd38715bebe54b00e4a3fd05199b5

I've done it seem to still have the same error.

Wow Traceback (most recent call last): File "C:\Users\Max\Downloads\Python\image_downloader.py", line 22, in <module> download = r.download(args) File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\site-packages\google_images_download\google_images_download.py", line 839, in download paths, errors = self.download_executor(arguments) File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\site-packages\google_images_download\google_images_download.py", line 966, in download_executor items,errorCount,abs_path = self._get_all_items(raw_html,main_directory,dir_name,limit,arguments) #get all image items and download images File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\site-packages\google_images_download\google_images_download.py", line 769, in _get_all_items image_objects = self._get_image_objects(page) File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\site-packages\google_images_download\google_images_download.py", line 759, in _get_image_objects image_objects = json.loads(object_decode)[31][0][12][2] File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\json\__init__.py", line 357, in loads return _default_decoder.decode(s) File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\Max\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

bertainsikt commented 4 years ago

I get this error Unfortunately all 100 could not be downloaded because some images were not downloadable. 0 is all we got for this search filter! How can I solve it?

Rookie00NOT7 commented 4 years ago

Unfortunately, i got the same error as you @bertainsikt . Any solutions found ? Would be great ! TiA.

bertainsikt commented 4 years ago

Hi @Rookie00NOT7 , This alternative is working very well for me, it uses bing instead of google: https://github.com/ultralytics/google-images-download

sczhengyabin commented 4 years ago

Try this alternative, works with Google, Bing, Baidu https://github.com/sczhengyabin/Image-Downloader

cdfrdmn commented 4 years ago

@BurnerDiamond I have the same error as you. I did not change anything!

Nestak2 commented 4 years ago

See this quick and dirty fix, it solved the problem for me! I just erased the pre-existing code in the file google_images_download.py and substituted it with the provided code by the user