如何使用 Python 删除我自己的 Instagram 关注者?

How to remove my own instagram followers with Python?

我想删除我自己的 Instagram 关注者而不阻止他们,使用 python。

我在网上看到 many, many, many, many instagram python 图书馆可以让你停止或开始关注一个人,但这不是我要找的;我不想删除我正在关注的人或开始关注某人,我想删除正在关注我的人。

我调查了 the official documentation of Instagram's HTTP API 试图制定自己的解决方案,但我无法在任何端点下找到此操作的文档(我认为它应该在 /friends/ 下)。

我依稀记得曾经有一些图书馆曾经这样做过,但我找不到了。有谁知道实现此目的的好方法,最好是通过为我想要的关注者传递 inclusion/exclusion 列表?

我在 an old library 中找到了类似的解决方案。你不能通过大多数工具直接删除关注者,但是如果你拉黑然后再拉黑一个用户,你想要的效果就达到了。示例代码:

# https://instagram-private-api.readthedocs.io/en/latest/_modules/instagram_private_api/endpoints/friendships.html
import instagramPrivateApi
# ...
# Implement a Client class that inherits FriendshipMixin
api = new Client()
api.friendships_block(uid)
api.friendships_unblock(uid)

这是移除关注者的API终点https://www.instagram.com/web/friendships/{user_id}/remove_follower/

您可以使用适当的 headers 对此 URL 执行 post 请求,这样就可以完成工作。