【发布时间】:2017-08-30 04:45:02
【问题描述】:
我正在尝试访问 Instagram Stories 端点,如 here 和 here 所述,但使用 PHP - 发送通过 Spy HTTP Chrome 扩展获得的 user_id 和 sessionid。
我收到响应/错误:string(105) "5xx Server Error" ¿ 它可能是什么?
此外,当我将用户代理更改为 Instagram 10.8.0 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US 时,我得到 string(67) "{"message": "login_required", "logout_reason": 2, "status": "fail"}"
function Geturl($url){
$process = curl_init($url);
curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($process, CURLOPT_COOKIE, "ds_user_id=XXXXXX; sessionid=XXXXXX");
curl_setopt($process, CURLOPT_USERAGENT, "Instagram 9.5.1 (iPhone9,2; iOS 10_0_2; en_US; en-US; scale=2.61; 1080x1920) AppleWebKit/420+");
$return = curl_exec($process);
if(curl_error($process))
{
return 'error:' . curl_error($process);
}
curl_close($process);
return $return;
}
var_dump(Geturl("https://i.instagram.com/api/v1/feed/reels_tray/"));
【问题讨论】:
标签: php curl instagram instagram-api