0

我正在构建一个 instagram 机器人,但我遇到了这个错误:

   Traceback (most recent call last):
  File "C:\Users\User\Desktop\instabot\insta.py", line 42, in <module>
    job()
  File "C:\Users\User\Desktop\instabot\insta.py", line 26, in job
    session.like_by_locations(["213359469/munich-germany/"], amount = 10)
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\instapy\instapy.py", line 1516, in like_by_locations
    inappropriate, user_name, is_video, reason, scope = check_link(
  File "C:\Users\User\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

这是我的代码:

from instapy import InstaPy

#headless_browser = True if you want to hide your browser
session = InstaPy(username = "-----", password = "----", headless_browser = False)
session.login()
session.like_by_tags(["bmw", "steam"], amount = 3, media="Photo")
session.end()
4

0 回答 0