Instagram个人资料图片是否具有完整分辨率?

编程入门 行业动态 更新时间:2024-10-20 03:26:43
本文介绍了Instagram个人资料图片是否具有完整分辨率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何获取完整分辨率的instagram个人资料的个人资料图片? (旧的URL方案今天停止工作.)

how do I get the profile picture of an instagram profile in full-res? (The old URL scheme stopped working today).

regex ='profile_pic_url_hd:"([[0-9a-zA-Z ._-/:] *),'

regex='profile_pic_url_hd":"([0-9a-zA-Z._-/:]*)",'

正在处理320像素的图片,但仅此而已. 150x150 img的前缀不同,但是带有jpg的URL的ID/结尾是相同的.

Is working for 320px pictures, but nothing else. The prefix to the 150x150 img is different, but the ID/ending of the url with jpg is the same.

谢谢

推荐答案

好的,我找到了最终解决方案:

Okay guys I found a final solution:

  • 使用此链接user_id noreferrer> www.instagram/{name}/?__ a = 1

  • Get the user_id of the account using this link www.instagram/{name}/?__a=1

    使用上面 i.instagram/api/v1/users/{user_id}/info/ 完整的个人资料图片链接可以在 [hd_profile_pic_url_info] [url]

    Visit this JSON-API with the user_id above i.instagram/api/v1/users/{user_id}/info/ The full size profile picture link can be found in [hd_profile_pic_url_info][url]

    就是这样! :)

    如果步骤 1 不起作用,我的PHP解决方案将获取用户ID :

    If step 1 doesn't work, my Php solution to get the user-id:

    $name = "{username}"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "www.instagram/$name/"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $result = curl_exec($ch); $http = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if($http=="200") { $doc = new DOMDocument(); $doc->loadHTML($result); $xpath = new DOMXPath($doc); $js = $xpath->query('//body/script[@type="text/javascript"]')->item(0)->nodeValue; $start = strpos($js, '{'); $end = strrpos($js, ';'); $json = substr($js, $start, $end - $start); $data = json_decode($json, true); $user_id = $data["entry_data"]["ProfilePage"][0]["graphql"]["user"]["id"]; }

    我正在HTML文档中搜索用户ID.

    I'm searching in the HTML document for user-id.

  • 更多推荐

    Instagram个人资料图片是否具有完整分辨率?

    本文发布于:2023-10-11 23:08:06,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1483097.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:分辨率   完整   个人资料   图片   Instagram

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!