ohld / igbot

🐙 Free scripts, bots and Python API wrapper. Get free followers with our auto like, auto follow and other scripts!
https://hikerapi.com/p/N2P6iqiM
Apache License 2.0
4.69k stars 1.47k forks source link

KeyError: 'items' when trying to like timeline #686

Closed TiasTias closed 5 years ago

TiasTias commented 5 years ago

Please follow the guide below


Before submitting an issue, make sure you have:

Purpose of your issue?


The following sections requests more details for particular types of issues, you can remove any section (the contents between the triple ---) not applicable to your issue.


For a bug report, you must include the Python version used, code that will reproduce the error, and the error log/traceback.

Paste the output of python -V here: Python 2.7.10

Code:

def get_timeline_medias(self, filtration=True):
    if not self.api.get_timeline_feed():
        self.logger.warning("Error while getting timeline feed.")
        return []
    return self.filter_medias(self.api.last_json["items"], filtration)

Error/Debug Log:

Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "ultimate.py", line 44, in like_timeline
    bot.like_timeline(amount=300 // 24)
  File "build/bdist.macosx-10.13-intel/egg/instabot/bot/bot.py", line 422, in like_timeline
    return like_timeline(self, amount)
  File "build/bdist.macosx-10.13-intel/egg/instabot/bot/bot_like.py", line 61, in like_timeline
    medias = self.get_timeline_medias()[:amount]
  File "build/bdist.macosx-10.13-intel/egg/instabot/bot/bot.py", line 309, in get_timeline_medias
    return get_timeline_medias(self)
  File "build/bdist.macosx-10.13-intel/egg/instabot/bot/bot_get.py", line 46, in get_timeline_medias
    return self.filter_medias(self.api.last_json["items"], filtration)
KeyError: 'items'

Describe your issue

Since the beginning of today I have been getting this error. I did not add any code. I just simply ... $python setup.py build... Then $Python setup.py install ... In the code root dir because my instabot was not taking into account the updated values for max_followers_to_follow=10000 and filter_business_accounts=False when I was running the ultimate schedule script. I recloned the repo and installed via pip but it still producers this error.

Tried another fresh install and even running the multi_script_CLI.py it crashes because of KeyError: 'items' when trying to like timeline. It appears to like from hashtag but is super buggy. See screenshot.

screen shot 2018-10-18 at 11 33 03
aferook commented 5 years ago

I had the same error, #689 solves my problem

TiasTias commented 5 years ago

I had the same error, #689 solves my problem

Okay, so I changed that one line 46 to

   return self.filter_medias(self.api.last_json["feed_items"], filtration)

and restarted the bot but it still doesn't work. Is there an extra step I am missing?

aferook commented 5 years ago

Is there any error message?

TiasTias commented 5 years ago

Yes, the KeyError: 'items' .

I think there may be something wrong with my environment though since I am getting these other strange behaviours such as this unnecessary filtering of medias for instance (see the image in the original post). I don't know how to reset it other than deleting the files and re-downloaded the repo but that didn't change anything.

sudoguy commented 5 years ago

Fixed #689 . Thanks to @aferook