Python Tweepy Block用户返回401未经授权
我正在尝试使用Python脚本和Tweepy API阻止Twitter用户。我可以毫无问题地提取用户,ID,关注者和推文。当我尝试调用api.create_block(screat_name ='<某些人我不喜欢>')
我有例外 401未经授权
(并且该用户没有被阻止)。我一直在谷歌搜索,但只发现旧帖子指的是我的Windows时间不同步。我同步时间,没有改进。我还尝试通过ID阻止,但没有运气。 有人可以帮忙吗?
I am trying to block a Twitter user using Python scripting and the Tweepy API. I am able to extract users, IDs, followers and tweets with no problem. When I try to call api.create_block(screen_name = '<some person I don't like>')
I get an exception401 Unauthorized
(and that user is not blocked). I have been googling but only found old posts referring to my Windows time being not in sync. I synced the time and no improvement. I also tried blocking by ID but no luck.
Can anybody help ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
https://tweepy.readthedocs.io/en/en/v4.8.0/faq.html#why-am-mi----- and ermi-en-a-401-unauthorized-erauthorized-error-带有-403-forbidden-error-with-client
https://tweepy.readthedocs.io/en/v4.8.0/faq.html#why-am-i-encountering-a-401-unauthorized-error-with-api-or-403-forbidden-error-with-client
我正在使用OAuth 2.0,该2.0不允许单独读取或写入权限。我尝试了刷新的凭证,但仍然相同。
我确实启用了Oauth 1.0A并再次再生凭证(再次),现在我可以阻止用户,谢谢!
I am using OAuth 2.0 which does not allow separate read or write permissions. I tried with refreshed credentials but still the same.
I did enable OAuth 1.0a and regenerated credentials (again) and now I can block users, Thanks !