Instagram API 申请 Mac

Instagram API for a Mac Application

我浏览了 Instagram 身份验证文档,发现除了将用户带到 Instagram 指定的 URL 之外,没有其他直接的身份验证方法。

这是 Instagram 文档所说的。

In order to receive an access_token, you must do the following:
  1. 将用户引导至我们的授权 url。如果用户未登录 在,他们将被要求登录。 系统将询问用户是否愿意授予您的应用程序访问她的 Instagram 数据的权限。

    The server will redirect the user in one of two ways that you choose:
    
    • 服务器端流程(推荐):将用户重定向到您的 URI 选择。获取提供的代码参数并将其交换为 access_token 通过将代码发布到我们的 access_token url.

      隐式流程:我们不处理代码,而是包含 access_token 作为 URL 中的片段 (#)。这种方法比较少 安全,但允许没有任何服务器组件的应用程序 收到 access_token.


看到我们应该将用户带到特定的 URL。 Instagram 使用 OAuth 2.0。 但问题是有一个名为 Flume 的 Mac 应用程序不会将用户带到 URL。它简单地让用户输入他们的 usernamepassword,然后 Flume 连接到 Instagram API,用户成功登录并能够看到他的媒体内容。

我想知道 Flume 是怎么做到的?我对文档的理解有误吗?

请帮忙。提前致谢。

您没有正确阅读文档。

Flume 不使用 Instagram API,因此不受其限制的影响。相反,它可能会通过在不可见的浏览器实例中打开 Instagram 网站来使用网络抓取,代表用户输入用户数据和命令,然后从下一个不可见的浏览器页面抓取结果等。

在 OS X 中有不同的方法来实现这一点,起点可以是 Web scraping in Objective C. For a conceptual overview, you could have a look at RoboBrowser,这是一个 Python 库,但可以让您了解这是如何实现的作品。

Instead, it will likely use web scraping by opening the Instagram website in an invisible browser instance, there entering the user data and commands on the behalf of the user, then scraping the results from the next invisible browser page etc.

这实际上是错误的。 Flume 找到了使用 Instagram 内部 API 显示内容的方法。使用中间人代理客户端,如 Charles 将显示 Flume 应用程序发出的网络请求与 Instagram 的不同原生应用程序发出的网络请求非常相似。 Flume 模仿 Instagram 的网络请求,以便将 HTTP headers/cookies/auth 数据设置为 retrieve/post 信息。

我很乐意 post pictures/files 为可能希望进一步证明这一点的任何人验证这一点。