我正在制作我的第一个 Instagram 机器人,但它并没有完全工作。它在喜欢该帖子之前停止工作。
这是错误。
Traceback (most recent call last):
File "C:\Users\Aniket\PycharmProjects\insta_bot1\main.py", line 9, in <module>
session.like_by_tags(['photography', 'lighting', 'nature'], amount = 3)
File "C:\Python3.9\lib\site-packages\instapy\instapy.py", line 1957, in like_by_tags
inappropriate, user_name, is_video, reason, scope = check_link(
File "C:\Python3.9\lib\site-packages\instapy\like_util.py", line 633, in check_link
media = post_page[0]["shortcode_media"]
KeyError: 0
Process finished with exit code 1
这是我的代码。
from instapy import InstaPy
session = InstaPy(username = 'insta_bot._1', password = '####')
session.login()
session.set_relationship_bounds(enabled = True, max_followers = 150)
session.set_do_follow(True, percentage = 100)
session.like_by_tags(['photography', 'lighting', 'nature'], amount = 3)
session.end()
请帮助我解决错误。