简体   繁体   English

Python 模块 INSTABOT 登录出现问题

[英]Problem with Python module INSTABOT login

Instabot登录错误

I tried the code for last two days, i got the message from my VS code editor, can please anyone help me to solve the problem.我最近两天尝试了代码,我从我的 VS 代码编辑器收到了消息,请任何人帮助我解决问题。

Code代码

from instabot import Bot
bot = Bot()
bot.login(username="the_username_hidden" , password="password_hidden")
print("done")

Message Get消息获取

2021-04-26 06:38:18,970 - INFO - Instabot version: 0.117.0 Started
2021-04-26 06:38:18,971 - INFO - Not yet logged in starting: PRE-LOGIN FLOW!
2021-04-26 06:38:19,434 - ERROR - Request returns 429 error!
2021-04-26 06:38:19,434 - WARNING - That means 'too many requests'. I'll go to sleep for 5 minutes.
2021-04-26 06:43:20,237 - ERROR - Request returns 429 error!
2021-04-26 06:43:20,237 - WARNING - That means 'too many requests'. I'll go to sleep for 10 minutes.
2021-04-26 06:53:21,001 - ERROR - Request returns 429 error!
2021-04-26 06:53:21,001 - WARNING - That means 'too many requests'. I'll go to sleep for 15 minutes.

#With the sleep this will not work. #与睡眠这将不起作用。 This error occurs because you make too many requests.发生此错误是因为您发出的请求过多。 bot = Bot()机器人 = 机器人()

bot.login(...)

Try this and let me know if it works.试试这个,让我知道它是否有效。 Could be a fluke.可能是侥幸。

Facebook has banned all bots and APIs. Facebook 已禁止所有机器人和 API。 You need to register at the Facebook developer website.您需要在 Facebook 开发者网站上注册。 https://developers.facebook.com/ https://developers.facebook.com/

Instagram API: https://developers.facebook.com/docs/instagram-basic-display-api/overview/#authorization-window Instagram API: https://developers.facebook.com/docs/instagram-basic-display-api/overview/#authorization-window

I'm also having this problem - I have tried using the time.sleep() to delay the login call by 5 minutes but I'm getting the same error message saying too many requests.我也遇到了这个问题 - 我尝试使用 time.sleep() 将登录调用延迟 5 分钟,但我收到相同的错误消息,说请求太多。

Have also tried deleting the.json file in the config folder before running the login request, which worked for a while but is now failing.还尝试在运行登录请求之前删除 config 文件夹中的 .json 文件,这工作了一段时间,但现在失败了。 I also tried changing my Instagram password.我还尝试更改我的 Instagram 密码。

See if deleting the.json file works for you.看看删除 .json 文件是否适合您。 I do this with我这样做

import os
if os.path.exists("config/*cookie.json"):
    os.remove("config/*cookie.json")
else:
    print("The json file does not exist")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM