【问题标题】:Instagram profile_picture secure urlInstagram profile_picture 安全网址
【发布时间】:2014-03-27 22:59:20
【问题描述】:

我正在构建一个通过 api 检索的混搭

从 instagram/twitter/facebook 调用 feed

标签的api。

获取安全网址没有任何问题

用于 twitter 和

的个人资料图片

facebook,但我喜欢 instagram。

我试过了:

http://images.ak.instagram.com/profiles/profile_251686283_75sq_1352714126.jpg https://images.ak.instagram.com/profiles/profile_251686283_75sq_1352714126.jpg

但它不起作用:(

更新 我使用 api 调用

https://api.instagram.com/v1/tags/mycoolhashtag/media/recent?count=100&access_token=my_access_token

我明白了

http://images.ak.instagram.com/profiles/profile_251686283_75sq_1352714126.jpg

但我需要一个安全的网址和这个

https://images.ak.instagram.com/profiles/profile_251686283_75sq_1352714126.jpg

没用

我需要一个安全的网址,因为所有内容都在 Facebook 应用程序中运行 因此使用 https 协议,我找不到获取它的方法!

【问题讨论】:

    标签: instagram


    【解决方案1】:

    您可以使用他们的 S3 存储桶 - 酒厂。它不是 CDN 的一部分,但会提供有效的 SSL 功能

    https://distillery.s3.amazonaws.com/profiles/profile_183641024_75sq_1372016363.jpg

    【讨论】:

    • 是的,我同意它不再有效。看起来 Instagram 关闭了对其 S3 存储桶的公共访问。有趣的是,酒桶仍在他们的文档中:instagram.com/developer/endpoints/users
    • 几天前我给 Instagram 发了电子邮件询问此事,但到目前为止我还没有收到回复。建议其他人也就此联系 Instagram,以便他们看到对此有需求。
    【解决方案2】:

    你可以获得头像的https url,给定API给你的http,如下:

    profile_picture.sub(%r{http://photos-([a-z]).ak.instagram.com}, 'https://igcdn-photos-\1-a.akamaihd.net')
    

    例如: http://photos-h.ak.instagram.com/hphotos-ak-xaf1/t51.2885-19/11325003_523023611188279_332538806_a.jpg

    被映射到: https://igcdn-photos-h-a.akamaihd.net/hphotos-ak-xaf1/t51.2885-19/11325003_523023611188279_332538806_a.jpg

    【讨论】:

      【解决方案3】:

      截至 2015 年 9 月,Instagram 的 /v1/users/{user-id} 端点默认为用户的 profile_picture 返回 HTTPS URL,从 https://scontent.cdninstagram.com 提供服务。你应该很高兴!

      【讨论】:

        【解决方案4】:

        更新答案:如果另一端的服务器不支持它,你不能只是决定开始使用 HTTPS 并确保一切安全,在这种情况下,它看起来像 Instagram不会(除了与帐户相关的操作,例如登录和编辑个人资料)。

        看来你必须找到另一种方法从你的 Facebook 应用程序中拨打这个电话,我一点也不熟悉,抱歉

        老答案:不太清楚你在问什么,但当我从 Instagram 取回数据时,个人资料图片始终是 HTTP URL。

        例如:

        "user": {
                "username": "theserv",
                "website": "",
                "profile_picture": "http://images.ak.instagram.com/profiles/profile_239265119_75sq_1387243654.jpg",
                "full_name": "Diane Alexandra",
                "bio": "",
                "id": "239265119"
              }
        

        您是说您无法访问您发布的任何一个网址吗?两者都对我有用,但 https 会发出关于不安全内容的警告,这是可以理解的

        【讨论】:

        • 我已经更新了你同意它不是很清楚的帖子:)
        猜你喜欢
        • 1970-01-01
        • 2020-01-05
        • 2012-06-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-09
        • 1970-01-01
        相关资源
        最近更新 更多