Comments (4)
So, we are at the previous bug again... 3rd time fixing it. This now is a better fix, and would have fixed the code 3 times without having to definte which item gives the correct value of info:
if info is None:
# EK
#info = data[11]
for item in data:
if type( item ) == dict:
info = item
basically what I'm doing is looking at all values of data and seeing which one is the dictionary. When we find it this is what info is set to. It works. And it would have worked for data[22] which occurred about 6 months ago. This then changed to data[23] and now the issue is that info = data[25]. We should just use my new fix. At least if there is one available directory the code can find the value of info itself.
See issue #31 for the full path. Really this is a duplicate of #31
from google-images-download.
Thanks, Eamonn for the reply. I changed line 406 (info = data[25]) to fix a new bug:
hardikvasa#373
And it solved the new bug, but the existing problem I have remains.
I posted your code in line 407 after I hashtagged 406, and I get the same error.
For example: deqrz marvel returns images(it's made up gibberish).
marvunapp deqrz returns no images
"""
Item no.: 1 --> Item name = marvunapp deqrz
Evaluating...
-1
Image objects data unpacking failed. Please leave a comment with the above error at #26
"""
from google-images-download.
The error occurs because Google Images itself returns zero images. "Looks like there arenβt any matches for your search." Everything else works fine, but this has a sys.exit() (Line 251), and even if I remove that, it will still come back with an unpacking error at a different point. I clumsily tried to manually add new arguments(i.e. a query that Google definitely has images for e.g. Bugs Bunny) at this point(Line 252) but...trying to fix one problem creates three more.
@AdamNix I'm not sure what your issue is. I've tried "Bugs Bunny" and it works perfectly for me. What is the exact command line command you are running? And can you show a snippet of the code where you are having the problem?
from google-images-download.
Go to Google Images itself. i.e. the search engine not the Python program.
Type marvunapp deqrz as your search query.
Google Images returns zero results(Google images not Google search)
When I run the same search query in my python program using google_images_download as an import, the python program returns the above errors.
n.b. the code and google-images-download works fine for every other search i.e. ones in which Google images itself does return images.
And I am only looking for 7 images per search.
Then:
I went into google_images_download, the imported program.
Removed line 251.
Added new arguments in the imported code itself with "Bugs Bunny" as a type of go-to default search when original search has zero images. That did not work. Put line 251 back in.
All changes were made after updating line 406 (info = data[25]), and I tried your updated code.
What I was trying to do, in the imported code, was to have a Bugs Bunny default. If Google Images(the search engine) has no images for a search, rather than google-images-download returning an error and stopping the program, the program runs the search again with bugs bunny as the query. So if you have multiple independent searches, the code does not stop on one bad apple.
from google-images-download.
Related Issues (18)
- exact_size does not work. HOT 2
- Could not open URL HOT 1
- "Some images not downloadable" HOT 2
- Missing Error Handling for Limit equal or less than 0 when executed using from another Python file
- Missing Error handling for delay below 0 when running lib from another Python file
- Missing Error handling for when the offset is negative when using in another Python File
- Missing Error handling for when the offset is above the limit passed when running from another Python file
- json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) HOT 8
- Error when running...
- Can not download more than 98 images with chromedriver HOT 2
- list index out of range Image objects data unpacking failed. Please leave a comment with the above error at https://github.com/hardikvasa/google-images-download/pull/298
- Problem with data object info HOT 4
- JSON output of Google API changed again I think HOT 21
- ChromeDriver Fix (WebDriver object has no attribute 'find_element_by*')
- [I solved it by changing your code] Error of TypeError: 'NoneType' object is not subscriptable HOT 4
- Stopped working - Image objects data unpacking failed HOT 4
- Unfortunately all 20 could not be downloaded because some images were not downloadable. 0 is all we got for this search filter! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-images-download.