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.71k stars 1.47k forks source link

bug on see_reels function #938

Closed elmissouri16 closed 5 years ago

elmissouri16 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:

Code:

# Example code that will produce the error reported
from instabot import Bot

bot = Bot()
bot.login(username="user", password="pass")
user_id = bot.get_user_id_from_username('inna')
stories = bot.api.get_users_reel([user_id])
bot.api.see_reels(stories)

Error/Debug Log:

Traceback (most recent call last):
  File "bot.py", line 8, in <module>
    bot.api.see_reels(stories)
  File "C:\Users\elmis\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instabot\api\api.py", line 905, in see_reels
    for i, story in enumerate(sorted(reels, key=lambda m: m['taken_at'], reverse=True)):
  File "C:\Users\elmis\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instabot\api\api.py", line 905, in <lambda>
    for i, story in enumerate(sorted(reels, key=lambda m: m['taken_at'], reverse=True)):
KeyError: 'taken_at'

Describe your issue

I was just checking the API functions and I find this problem

EightShift commented 5 years ago

Similar error ... Only I have a list of id instead of a single id.

bot = Bot()

bot.login(username=username,
          password=password)
random_hashtag_file = utils.file(HASHTAGS_FILE)
while True:
    random_hashtag = random_hashtag_file.random()
    print (random_hashtag)

    users_list = bot.get_hashtag_users(random_hashtag)
    print (users_list)

    reels = bot.api.get_users_reel(users_list)
    print (reels)

    bot.api.see_reels(reels)

    time.sleep(1)
elmissouri16 commented 5 years ago

929