Git Product home page Git Product logo

Comments (4)

eamonnkenny avatar eamonnkenny commented on August 12, 2024 1

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.

AdamNix avatar AdamNix commented on August 12, 2024

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.

eamonnkenny avatar eamonnkenny commented on August 12, 2024

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.

AdamNix avatar AdamNix commented on August 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.