Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'NoneType' object is not subscriptable error #373

Open
hamman33 opened this issue Dec 15, 2022 · 13 comments
Open

'NoneType' object is not subscriptable error #373

hamman33 opened this issue Dec 15, 2022 · 13 comments

Comments

@hamman33
Copy link

Item no.: 1 --> Item name = weller_12 Bourbon whiskey
Evaluating...
Starting Download...
'NoneType' object is not subscriptable

Now receiving this error for each download I try

@dtozik
Copy link

dtozik commented Dec 16, 2022

in google-images-download.py:

if info is None: info = data[11]

change 11 to 22

@livan3li
Copy link

in google-images-download.py:

if info is None: info = data[11]

change 11 to 22

thank you very much! I love you.
i've been searching for a whole day to figure it out what's the problem. when i fix the problem i get a new error and i fix that, get another error. At the end of i could solve the problem by your help. As i see nobody take cares the repo for bug fixes..

@Dries-Fierens
Copy link

Are you able to get images? I'm also stuck with

in google-images-download.py:
if info is None: info = data[11]
change 11 to 22

thank you very much! I love you. i've been searching for a whole day to figure it out what's the problem. when i fix the problem i get a new error and i fix that, get another error. At the end of i could solve the problem by your help. As i see nobody take cares the repo for bug fixes..

Are you able to get images? I'm also stuck with this error.

@livan3li
Copy link

livan3li commented Dec 22, 2022

Are you able to get images? I'm also stuck with

in google-images-download.py:
if info is None: info = data[11]
change 11 to 22

thank you very much! I love you. i've been searching for a whole day to figure it out what's the problem. when i fix the problem i get a new error and i fix that, get another error. At the end of i could solve the problem by your help. As i see nobody take cares the repo for bug fixes..

Are you able to get images? I'm also stuck with this error.

Yes, i've just downloaded 250 images. Check this link out here i explained here how i solved.

@Dries-Fierens
Copy link

thank you it is finally working now as intended

JenkinsTR added a commit to JenkinsTR/JMD-PSP-Tools that referenced this issue Jan 1, 2023
@websonder
Copy link

its stop again, is there any solution so i can run it again?

@nnyj
Copy link

nnyj commented Jan 8, 2023

in google-images-download.py line 405:

info = data[9]

change 9 to 23

@marianoig4
Copy link

Same problem here, I had changed

  • 11 to 22 and 23 in 407 line
  • 9 to 23 in 405 line
    And stil not working for me.....

bulatnv added a commit to bulatnv/google-images-download-bugfix that referenced this issue Jan 20, 2023
@dtozik
Copy link

dtozik commented Feb 7, 2023

def lookupJsonKey(self, object, s):
    def lookupImpl(object, s):
        isDict = False
        if isinstance(object, dict):
            isDict = True
        elif not isinstance(object, list):
            return None
        for val in object:
            if isDict:
                if val == s:
                    return object[val]
                    
            obj = object[val] if isDict else val
            ret = lookupImpl(obj, s)
            if ret != None:
                return ret
        return None
    return lookupImpl(object, s)

# Format the object in readable format
def format_object(self, object):
    data = object[1]
    main = data[3]
    info = self.lookupJsonKey(data, '2003')
    formatted_object = {}
    try:
        formatted_object['image_height'] = main[2]
        formatted_object['image_width'] = main[1]
        formatted_object['image_link'] = main[0]
        formatted_object['image_format'] = main[0][-1 * (len(main[0]) - main[0].rfind(".") - 1):]
        formatted_object['image_description'] = info[3]
        formatted_object['image_host'] = info[17]
        formatted_object['image_source'] = info[2]
        formatted_object['image_thumbnail_url'] = data[2][0]
    except Exception as e:
        print(e)
        return None
    return formatted_object

find a function 'def format_object(self, object):' and put that code patch there.

@wkrkd273
Copy link

its stop again, is there any solution so i can run it again?

@nnyj
Copy link

nnyj commented Mar 23, 2023

in google-images-download.py line 407:

info = data[22]

change 22 to 25

@jocelin110
Copy link

in google-images-download.py line 407:

info = data[22]

change 22 to 25

I just can't help loving you, guy!!! You are the sweet angel who made my night!!

@Ali-NAIRDC
Copy link

nothing works for me i changed the values and still got the same results. My chrome version is 123.xxx.xxx.xx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

11 participants