InstaPy / InstaPy

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

Like by tags #6271

Open RaspberryPiZero opened 3 years ago

RaspberryPiZero commented 3 years ago

I saw that there was a pull request about this but I'm actually not sure how to fix the like by tags error. I get a message like this in the terminal:

Traceback (most recent call last): File "C:\Users\-\Desktop\Instagram Bot\instagram.py", line 21, in <module> session.like_by_tags(['pcmasterrace', 'nvidia'], amount=10, media='Photo') File "C:\Users\-\AppData\Local\Programs\Python\Python39\lib\site-packages\instapy\instapy.py", line 1957, in like_by_tags inappropriate, user_name, is_video, reason, scope = check_link( File "C:\Users\-\AppData\Local\Programs\Python\Python39\lib\site-packages\instapy\like_util.py", line 633, in check_link media = post_page[0]["shortcode_media"] KeyError: 0

What files should I change to solve this and with what code? The software works with the follow/unfollow, I just have this issue when I try liking the photos with the tags I select. Thank you very much.

rimager commented 3 years ago

Traceback (most recent call last): File "/Users/rimagerhard/Downloads/instapy-quickstart-master/quickstart.py", line 32, in session.like_by_tags(["americangirldoll"], amount=50) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/instapy/instapy.py", line 1957, in like_by_tags inappropriate, user_name, is_video, reason, scope = check_link( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/instapy/like_util.py", line 633, in check_link media = post_page[0]["shortcode_media"] KeyError: 0

Same here

xerZV commented 3 years ago

same here

Traceback (most recent call last):
  File "quickstart.py", line 65, in <module>
    session.like_by_tags(my_hashtags, amount=30, interact=True, media=None)
  File "/home/pi/.local/lib/python3.7/site-packages/instapy/instapy.py", line 1967, in like_by_tags
    self.logger,
  File "/home/pi/.local/lib/python3.7/site-packages/instapy/like_util.py", line 633, in check_link
    media = post_page[0]["shortcode_media"]
KeyError: 0

Tried also with media=Photo

rimager commented 3 years ago

Install the latest from Github, not pip python3 -m pip install git+https://github.com/timgrossmann/InstaPy

xerZV commented 3 years ago

Install the latest from Github, not pip python3 -m pip install git+https://github.com/timgrossmann/InstaPy

Just tried that - its working. It gives the error for some of the posts.

Thanks @rimager!

Sirman13 commented 3 years ago

Same here.. image

rogersillyface commented 2 years ago

Install the latest from Github, not pip python3 -m pip install git+https://github.com/timgrossmann/InstaPy

Would it be a good idea to put this into the guide on the Instapy homepage?