InstaPy / InstaPy

📷 Instagram Bot - Tool for automated Instagram interactions
GNU General Public License v3.0
16.72k stars 3.77k forks source link

Tuple index out of range #3182

Closed alexsmedile closed 5 years ago

alexsmedile commented 5 years ago

Current Behavior

When I try to run my code it seems to go fine for a while, and then I get this error:

Traceback (most recent call last):
  File "InstaBot_v4.py", line 267, in like_by_place
    bot.like_by_locations(selected_places, amount=like_amount, skip_top_posts=False)
  File "/home/pi/instapy/instapy/instapy.py", line 1208, in like_by_locations
    self.logfolder)
  File "/home/pi/instapy/instapy/comment_util.py", line 56, in comment_image
    rand_comment = (choice(comments).format(username))
IndexError: tuple index out of range

What does this mean? Did I go out of comments? Is something wrong with my comments? They seem to be read fine, I don't know what I'm doing wrong.

InstaPy configuration

def like_by_place(selected_places,var_amount,like_amount,selected_comments,percentage):
    try:
        InstaBot_login() # my setting function
        # comment
        bot.set_comments(selected_comments)
        bot.set_do_comment(enabled=True, percentage=percentage)
        # like
        selected_places = sample(selected_places, var_amount)
        bot.like_by_locations(selected_places, amount=like_amount, skip_top_posts=False)
        # end
        InstaBot_logout() # my logout function
    except:
        import traceback
        print(traceback.format_exc())

All my variables are from an imported speardsheet (tags, comments, and so on) and they look like this:

Beautiful! :blush:
Beautiful! :rainbow:
Beautiful! :two_hearts:

And sometimes I have comments like this:

I love your stuff. @{} :punch::heart:
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this problem still occurs, please open a new issue

AyouBaws commented 4 years ago

I have the same problem here! Any fix?

rafo commented 3 years ago

Same problem with newest version