|
|
|
@ -23,7 +23,7 @@ use InstagramAPI\Response\Model\Item; |
|
|
|
class InstagramService |
|
|
|
{ |
|
|
|
private $username = "nicksxs"; |
|
|
|
private $password = '949sxs949@Sxs'; |
|
|
|
private $password = '949sxs949@IN'; |
|
|
|
// private $password = 'mff@5201314';
|
|
|
|
// private $username = "sili1024";
|
|
|
|
// private $password = 'Qwer2020';
|
|
|
|
@ -131,7 +131,7 @@ class InstagramService |
|
|
|
"naughty_rabbit_" => 533122832, |
|
|
|
"sejinming" => 5877651933, |
|
|
|
"na0912mi" => 1200529361, |
|
|
|
"ling.lingerie" => 32000498374, |
|
|
|
"ling.lingerie" => 49122819171, |
|
|
|
"samiaowu" => 13288296956, |
|
|
|
"janed_404" => 25532050868, |
|
|
|
]; |
|
|
|
@ -247,7 +247,7 @@ class InstagramService |
|
|
|
"ivykuang21" => 191755326, |
|
|
|
"nanshiiyahh" => 11577330755, |
|
|
|
"suyue233" => 6196235525, |
|
|
|
"lxx.baby" => 33778981877, |
|
|
|
"lxx.baby" => 50433688641, |
|
|
|
"seolhyun.aoa" => 1511848858, |
|
|
|
"202innewyork" => 2967989437, |
|
|
|
"superfetish" => 1154961788, |
|
|
|
@ -580,7 +580,7 @@ class InstagramService |
|
|
|
"q_gill" => 1567349, |
|
|
|
"wang52001112" => 8285185524, |
|
|
|
"jiee_wen" => 29364142936, |
|
|
|
"ling.lingerie" => 32000498374, |
|
|
|
"ling.lingerie" => 49122819171, |
|
|
|
"zzzzm83" => 8010039182, |
|
|
|
"shika.xiaolu_lu" => 8739724418, |
|
|
|
"min_ching_chang" => 499591666, |
|
|
|
@ -960,11 +960,14 @@ class InstagramService |
|
|
|
"_2km2km_" => 8419330744, |
|
|
|
"2km2km" => 1261174072, |
|
|
|
"2km_2km_dj2" => 50785456344, |
|
|
|
"17_chill" => 38054610130 |
|
|
|
"17_chill" => 38054610130, |
|
|
|
"gawonaa" => 6552618014, |
|
|
|
"bitnara_daily" => 56599499536, |
|
|
|
"bonnie.90106_" => 55798122328, |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
private $userAliasMap = [ |
|
|
|
"yifei_cc" => "yifeis", |
|
|
|
"2km2km" => "2km_2km_dj2", |
|
|
|
"siawase726" => "snow1111726" |
|
|
|
]; |
|
|
|
@ -1038,64 +1041,64 @@ class InstagramService |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
// try {
|
|
|
|
// $cn_match = "https://scontent-lax3-1.cdninstagram.com";
|
|
|
|
// $options = array(
|
|
|
|
// 'ssl' => array(
|
|
|
|
// 'verify_peer' => true,
|
|
|
|
// 'cafile' => "/Users/shixuesen/Downloads/cacert.pem",
|
|
|
|
// 'ciphers' => 'HIGH:TLSv1.2:TLSv1.1:TLSv1.0:!SSLv3:!SSLv2',
|
|
|
|
// 'CN_match' => $cn_match,
|
|
|
|
// 'disable_compression' => true,
|
|
|
|
// )
|
|
|
|
// );
|
|
|
|
// $context = stream_context_create($options);
|
|
|
|
// $ch = curl_init();
|
|
|
|
//
|
|
|
|
// curl_setopt_array($ch, array(
|
|
|
|
// CURLOPT_URL => $filenameUrl,
|
|
|
|
// CURLOPT_RETURNTRANSFER => true,
|
|
|
|
// CURLOPT_ENCODING => '',
|
|
|
|
// CURLOPT_MAXREDIRS => 10,
|
|
|
|
// CURLOPT_TIMEOUT => 0,
|
|
|
|
// CURLOPT_FOLLOWLOCATION => true,
|
|
|
|
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
|
|
|
// CURLOPT_CUSTOMREQUEST => 'GET',
|
|
|
|
// CURLOPT_HTTPHEADER => array(
|
|
|
|
// 'authority: scontent-hkt1-2.cdninstagram.com',
|
|
|
|
// 'accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8',
|
|
|
|
// 'accept-language: zh-CN,zh;q=0.9',
|
|
|
|
// 'cache-control: no-cache',
|
|
|
|
// 'origin: https://www.instagram.com',
|
|
|
|
// 'pragma: no-cache',
|
|
|
|
// 'referer: https://www.instagram.com/',
|
|
|
|
// 'sec-ch-ua: "Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"',
|
|
|
|
// 'sec-ch-ua-mobile: ?0',
|
|
|
|
// 'sec-ch-ua-platform: "macOS"',
|
|
|
|
// 'sec-fetch-dest: image',
|
|
|
|
// 'sec-fetch-mode: cors',
|
|
|
|
// 'sec-fetch-site: cross-site',
|
|
|
|
// 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36'
|
|
|
|
// ),
|
|
|
|
// ));
|
|
|
|
// $image = curl_exec($ch);
|
|
|
|
// curl_close($ch);
|
|
|
|
// // $image = file_get_contents($filenameUrl, false, null);
|
|
|
|
// } catch (\Throwable $e) {
|
|
|
|
// var_dump($e->getMessage());
|
|
|
|
// $this->logFailUrl($filePrefix, $filenameUrl);
|
|
|
|
// return -1;
|
|
|
|
// }
|
|
|
|
// try {
|
|
|
|
// $cn_match = "https://scontent-lax3-1.cdninstagram.com";
|
|
|
|
// $options = array(
|
|
|
|
// 'ssl' => array(
|
|
|
|
// 'verify_peer' => true,
|
|
|
|
// 'cafile' => "/Users/shixuesen/Downloads/cacert.pem",
|
|
|
|
// 'ciphers' => 'HIGH:TLSv1.2:TLSv1.1:TLSv1.0:!SSLv3:!SSLv2',
|
|
|
|
// 'CN_match' => $cn_match,
|
|
|
|
// 'disable_compression' => true,
|
|
|
|
// )
|
|
|
|
// );
|
|
|
|
// $context = stream_context_create($options);
|
|
|
|
// $ch = curl_init();
|
|
|
|
//
|
|
|
|
// curl_setopt_array($ch, array(
|
|
|
|
// CURLOPT_URL => $filenameUrl,
|
|
|
|
// CURLOPT_RETURNTRANSFER => true,
|
|
|
|
// CURLOPT_ENCODING => '',
|
|
|
|
// CURLOPT_MAXREDIRS => 10,
|
|
|
|
// CURLOPT_TIMEOUT => 0,
|
|
|
|
// CURLOPT_FOLLOWLOCATION => true,
|
|
|
|
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
|
|
|
// CURLOPT_CUSTOMREQUEST => 'GET',
|
|
|
|
// CURLOPT_HTTPHEADER => array(
|
|
|
|
// 'authority: scontent-hkt1-2.cdninstagram.com',
|
|
|
|
// 'accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8',
|
|
|
|
// 'accept-language: zh-CN,zh;q=0.9',
|
|
|
|
// 'cache-control: no-cache',
|
|
|
|
// 'origin: https://www.instagram.com',
|
|
|
|
// 'pragma: no-cache',
|
|
|
|
// 'referer: https://www.instagram.com/',
|
|
|
|
// 'sec-ch-ua: "Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"',
|
|
|
|
// 'sec-ch-ua-mobile: ?0',
|
|
|
|
// 'sec-ch-ua-platform: "macOS"',
|
|
|
|
// 'sec-fetch-dest: image',
|
|
|
|
// 'sec-fetch-mode: cors',
|
|
|
|
// 'sec-fetch-site: cross-site',
|
|
|
|
// 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36'
|
|
|
|
// ),
|
|
|
|
// ));
|
|
|
|
// $image = curl_exec($ch);
|
|
|
|
// curl_close($ch);
|
|
|
|
// // $image = file_get_contents($filenameUrl, false, null);
|
|
|
|
// } catch (\Throwable $e) {
|
|
|
|
// var_dump($e->getMessage());
|
|
|
|
// $this->logFailUrl($filePrefix, $filenameUrl);
|
|
|
|
// return -1;
|
|
|
|
// }
|
|
|
|
|
|
|
|
echo "new filename: " . $filePrefix . $filename . "\n"; |
|
|
|
$retryTime = 0; |
|
|
|
$downloadResult = ""; |
|
|
|
do { |
|
|
|
$downloadResult = shell_exec("export http_proxy=http://127.0.0.1:1087; export https_proxy=http://127.0.0.1:1087; cd $filePrefix && wget -t 3 '$filenameUrl' -O '$filename' && echo 'ok'"); |
|
|
|
$retryTime ++; |
|
|
|
} while(Str::contains($downloadResult, "Unable to establish SSL connection") && $retryTime < 5); |
|
|
|
$retryTime++; |
|
|
|
} while (Str::contains($downloadResult, "Unable to establish SSL connection") && $retryTime < 5); |
|
|
|
|
|
|
|
// $downloadResult = file_put_contents($filePrefix . $filename, $image);
|
|
|
|
// $downloadResult = file_put_contents($filePrefix . $filename, $image);
|
|
|
|
Log::info("result: $downloadResult"); |
|
|
|
$resultLineArray = explode("\n", $downloadResult); |
|
|
|
if (count($resultLineArray) <= 1) { |
|
|
|
@ -1273,11 +1276,11 @@ class InstagramService |
|
|
|
|
|
|
|
$baseImageDir = "/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/"; |
|
|
|
try { |
|
|
|
// $maxId = "KLYBARoAIAGQAGgASAAwACAAGAAQAAgACAAIAAgACABjuCa_l9v-dr3zx9F7Xp3d-L1r6Vo3DXT_6R-tfP2empv10y5ZsWklYjcXJGpsa50zvaA350LlHBg6cDmivafrIrGQn7gexjClt1_a0r7vgPD6h-s5vczr03H-cNX93_-_f-1Hv1q7_u31__j_-fP7Syn89b577Gk3bPR9K73-l1cMOsnNQL7SxQf8bSAUtXxMoRCYHMIwAEAWpJua5YZhRhgpBBkEIjIA";
|
|
|
|
// $maxId = "KLYBARoAIAGQAGgASAAwACAAGAAQAAgACAAIAAgACABjuCa_l9v-dr3zx9F7Xp3d-L1r6Vo3DXT_6R-tfP2empv10y5ZsWklYjcXJGpsa50zvaA350LlHBg6cDmivafrIrGQn7gexjClt1_a0r7vgPD6h-s5vczr03H-cNX93_-_f-1Hv1q7_u31__j_-fP7Syn89b577Gk3bPR9K73-l1cMOsnNQL7SxQf8bSAUtXxMoRCYHMIwAEAWpJua5YZhRhgpBBkEIjIA";
|
|
|
|
$maxId = null; |
|
|
|
do { |
|
|
|
$response = $this->queryTimeLineSingle($maxId); |
|
|
|
// Log::info("response: " . $response->asJson());
|
|
|
|
// Log::info("response: " . $response->asJson());
|
|
|
|
foreach ($response->getFeedItems() as $item) { |
|
|
|
if ($item->getMediaOrAd() == null || $item->getMediaOrAd()->getProductType() == "ad") { |
|
|
|
continue; |
|
|
|
@ -1348,6 +1351,7 @@ class InstagramService |
|
|
|
sleep(5 * random_int(1, 100)); |
|
|
|
} while ($maxId != null); |
|
|
|
} catch (Exception $e) { |
|
|
|
echo $e->getMessage();exit; |
|
|
|
echo 'scrapeFeeds something went wrong: ' . $e->getTraceAsString() . "\n"; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1537,7 +1541,7 @@ class InstagramService |
|
|
|
$toQueryUsers = Redis::connection()->lrange(self::INS_USER_KEY, 0, 9); |
|
|
|
Redis::connection()->ltrim(self::INS_USER_KEY, 10, -1); |
|
|
|
} |
|
|
|
$alwaysNeedToQueryUsers = ["doly0818", "siawase726", "yifei_cc", "17_chill", "shinapit46", "crissielee_", "boram__jj", "cho_hyunyoung", "cxxsomi", "inkyung97", "na0912mi", "naughty_rabbit_", "sejinming", "zyzyxin222"]; |
|
|
|
$alwaysNeedToQueryUsers = ["bonnie.90106_", "amy00522", "bitnara1105", "zhizhibooty", "_azhua", "exy_s2", "colin.anthony2", "7alice77", "leeesovelys2", "anran.1033", "doly0818", "siawase726", "yifei_cc", "17_chill", "shinapit46", "crissielee_", "boram__jj", "cho_hyunyoung", "cxxsomi", "inkyung97", "na0912mi", "naughty_rabbit_", "sejinming", "zyzyxin222"]; |
|
|
|
$toQueryUsers = array_unique(array_merge($alwaysNeedToQueryUsers, $toQueryUsers)); |
|
|
|
} else { |
|
|
|
if (is_array($singleUser)) { |
|
|
|
@ -1545,25 +1549,26 @@ class InstagramService |
|
|
|
} else { |
|
|
|
$toQueryUsers[] = $singleUser; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// dump($toQueryUsers);exit;
|
|
|
|
// dump($toQueryUsers);exit;
|
|
|
|
|
|
|
|
// $userList = array_slice($userList, $start, 20);
|
|
|
|
// $userList = array_slice($userList, $start, 20);
|
|
|
|
// $userList = ['1992.ai_'];
|
|
|
|
// print_r($userList);exit;
|
|
|
|
// print_r($userList);
|
|
|
|
//$userList = ["ngoctrinh89"];
|
|
|
|
// $userList = ["_2km2km_", "2km2km", "janed_404"];
|
|
|
|
// $userList = ["mobe_carrie0223", "na0912mi", "naughty_rabbit_", "sejinming", "zyzyxin222"];
|
|
|
|
// $userList = ["_2km2km_", "2km2km", "janed_404"];
|
|
|
|
// $userList = ["mobe_carrie0223", "na0912mi", "naughty_rabbit_", "sejinming", "zyzyxin222"];
|
|
|
|
$userList = $toQueryUsers; |
|
|
|
// 打乱下
|
|
|
|
shuffle($userList); |
|
|
|
// cherry_quahst 2928997722502282551_22834825
|
|
|
|
// $userList = ["shinapit46"];
|
|
|
|
// $userList = ["shinapit46"];
|
|
|
|
|
|
|
|
|
|
|
|
// 跳过逻辑
|
|
|
|
$skipUsers = ["youbastardddd", "bitnara1105", "hanna91914", "amandacerny"]; |
|
|
|
$skipUsers = ["youbastardddd", "hanna91914", "amandacerny"]; |
|
|
|
foreach ($userList as $userName) { |
|
|
|
if (in_array($userName, $skipUsers)) { |
|
|
|
continue; |
|
|
|
@ -1575,36 +1580,36 @@ class InstagramService |
|
|
|
if (!is_dir($thisUserImageDir)) { |
|
|
|
mkdir($thisUserImageDir); |
|
|
|
} |
|
|
|
echo "open $thisUserImageDir \n"; |
|
|
|
shell_exec("open -g '$thisUserImageDir'"); |
|
|
|
sleep(1*60); |
|
|
|
// echo "open $thisUserImageDir \n";
|
|
|
|
// shell_exec("open -g '$thisUserImageDir'");
|
|
|
|
// sleep(1*60);
|
|
|
|
|
|
|
|
if (array_key_exists($trueName, $this->userAliasMap)) { |
|
|
|
$trueName = trim($this->userAliasMap[$trueName]); |
|
|
|
} |
|
|
|
|
|
|
|
// $existFiles = $this->traceExistFiles($thisUserImageDir);
|
|
|
|
// try {
|
|
|
|
// $userId = $this->ig->people->getUserIdForName(trim($userName));
|
|
|
|
// } catch (Exception $e) {
|
|
|
|
// // if ($e instanceof UserNotFou)
|
|
|
|
// Log::error("ins get user id for name error: " . $e->getMessage() . " username is " . $userName);
|
|
|
|
// $userId = null;
|
|
|
|
// if (array_key_exists(trim($userName), $this->userList)) {
|
|
|
|
// $userId = Arr::get($this->userList, trim($userName));
|
|
|
|
// }
|
|
|
|
// if ($userId == null) {
|
|
|
|
// continue;
|
|
|
|
// }
|
|
|
|
// // continue;
|
|
|
|
// }
|
|
|
|
// try {
|
|
|
|
// $userId = $this->ig->people->getUserIdForName(trim($userName));
|
|
|
|
// } catch (Exception $e) {
|
|
|
|
// // if ($e instanceof UserNotFou)
|
|
|
|
// Log::error("ins get user id for name error: " . $e->getMessage() . " username is " . $userName);
|
|
|
|
// $userId = null;
|
|
|
|
// if (array_key_exists(trim($userName), $this->userList)) {
|
|
|
|
// $userId = Arr::get($this->userList, trim($userName));
|
|
|
|
// }
|
|
|
|
// if ($userId == null) {
|
|
|
|
// continue;
|
|
|
|
// }
|
|
|
|
// // continue;
|
|
|
|
// }
|
|
|
|
$userId = Arr::get($this->userListNew, trim($trueName)); |
|
|
|
if ($userId == null) { |
|
|
|
$userId = Arr::get($this->userList, trim($trueName)); |
|
|
|
if ($userId == null) { |
|
|
|
echo "{$trueName} id is null"; |
|
|
|
continue; |
|
|
|
// exit;
|
|
|
|
// exit;
|
|
|
|
} |
|
|
|
} |
|
|
|
echo "\n username: " . $trueName . " " . $userId . "\n"; |
|
|
|
@ -1644,7 +1649,7 @@ class InstagramService |
|
|
|
// ]);
|
|
|
|
if ($res == 0) { |
|
|
|
$existCount++; |
|
|
|
// goto a;
|
|
|
|
// goto a;
|
|
|
|
} |
|
|
|
break; |
|
|
|
case Item::VIDEO: |
|
|
|
@ -1657,7 +1662,7 @@ class InstagramService |
|
|
|
// ]);
|
|
|
|
if ($res == 0) { |
|
|
|
$existCount++; |
|
|
|
// goto a;
|
|
|
|
// goto a;
|
|
|
|
} |
|
|
|
break; |
|
|
|
case Item::CAROUSEL: |
|
|
|
@ -1671,7 +1676,7 @@ class InstagramService |
|
|
|
// ]);
|
|
|
|
if ($res == 0) { |
|
|
|
$existCount++; |
|
|
|
// goto a;
|
|
|
|
// goto a;
|
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
@ -1685,13 +1690,13 @@ class InstagramService |
|
|
|
// Now we must update the maxId variable to the "next page".
|
|
|
|
// This will be a null value again when we've reached the last page!
|
|
|
|
// And we will stop looping through pages as soon as maxId becomes null.
|
|
|
|
if ($singleUser!= null || (is_array($singleUser) && count($singleUser) > 0)) { |
|
|
|
if ($singleUser != null || (is_array($singleUser) && count($singleUser) > 0)) { |
|
|
|
if ($count - $existCount > 200) { |
|
|
|
Log::info("new count bigger than 100", ['user' => $trueName]); |
|
|
|
goto a; |
|
|
|
} |
|
|
|
} else { |
|
|
|
if($count > (20 + random_int(0, 20)) || $count - $existCount > 10) { |
|
|
|
if ($count > (20 + random_int(0, 20)) || $count - $existCount > 10) { |
|
|
|
goto a; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2205,24 +2210,24 @@ class InstagramService |
|
|
|
'accept-language' => 'zh-CN,zh;q=0.9', |
|
|
|
'cache-control' => 'no-cache', |
|
|
|
'content-type' => 'application/x-www-form-urlencoded', |
|
|
|
'cookie' => 'ig_did=1E87B96C-B061-484F-89A8-C76BF8E11C52; ig_nrcb=1; mid=Y0QEJQAEAAGK3xW8v5Uwszo_cBzM; ds_user_id=361404591; datr=qAREY1W0Mocw3OoikuJcsL1c; csrftoken=uwK4stsVNJf45PtHH7ZEbtYLFAXTED8K; shbid="10286\\054361404591\\0541701149081:01f730a5922596e95cbb92e5e537ecd62f60c0e4f98ace69b47a2e1bd022bf82699f585b"; shbts="1669613081\\054361404591\\0541701149081:01f7b1b43b17593f3f27f2b60b6dc5e3a80d63f0da70b00370d07497e5dd7a5d77325df0"; dpr=2; sessionid=361404591%3AXGZE01zPoMGO8b%3A13%3AAYcBvpAlq9xmuzvbcZF9g20sktnwq-99J3OkyluPfA; rur="NAO\\054361404591\\0541701256205:01f718ec0648cbcbde1db1175ce492dd3893da402643d7dc1cf698ba88c73ba69d42deb6"', |
|
|
|
'cookie' => 'ig_did=1E87B96C-B061-484F-89A8-C76BF8E11C52; ig_nrcb=1; mid=Y0QEJQAEAAGK3xW8v5Uwszo_cBzM; ds_user_id=361404591; datr=qAREY1W0Mocw3OoikuJcsL1c; csrftoken=o8uqypXnqzLbV4MKBo7ZeI4Tn7s4WwUt; dpr=2; shbid="10286\\054361404591\\0541710812830:01f7d29af58e88473b6537a789f05c33c9f3f0f41339fa59de8559924c7f8c1d51dc5202"; shbts="1679276830\\054361404591\\0541710812830:01f7cc9321450385cca359a813811464e1a637e9e4e8c2080b2e323f8303e37bd9c73a7c"; sessionid=361404591%3AVuUxqubuMmj6HZ%3A25%3AAYfVauWYX0ZMLkdbLaUmu6w7hi0OYzqf9Jz9qHPWqg; rur="NAO\\054361404591\\0541710813556:01f78e24f3dfa349efc89a199901cd50d645eacbe61d0bee262a5684ed303d140ae38986"', |
|
|
|
'origin' => 'https://www.instagram.com', |
|
|
|
'pragma' => 'no-cache', |
|
|
|
'referer' => 'https://www.instagram.com/', |
|
|
|
'sec-ch-prefers-color-scheme' => 'light', |
|
|
|
'sec-ch-ua' => '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"', |
|
|
|
'sec-ch-ua' => '"Chromium";v="110", "Not A(Brand";v="24", "Google Chrome";v="110"', |
|
|
|
'sec-ch-ua-mobile' => '?0', |
|
|
|
'sec-ch-ua-platform' => '"macOS"', |
|
|
|
'sec-fetch-dest' => 'empty', |
|
|
|
'sec-fetch-mode' => 'cors', |
|
|
|
'sec-fetch-site' => 'same-origin', |
|
|
|
'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36', |
|
|
|
'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36', |
|
|
|
'viewport-width' => '1512', |
|
|
|
'x-asbd-id' => '198387', |
|
|
|
'x-csrftoken' => 'uwK4stsVNJf45PtHH7ZEbtYLFAXTED8K', |
|
|
|
'x-csrftoken' => 'o8uqypXnqzLbV4MKBo7ZeI4Tn7s4WwUt', |
|
|
|
'x-ig-app-id' => '936619743392459', |
|
|
|
'x-ig-www-claim' => 'hmac.AR2DN3JP5T1uzerp-Udyl58luFekDMO1MUYZolRys4KAvIQG', |
|
|
|
'x-instagram-ajax' => '1006668857', |
|
|
|
'x-ig-www-claim' => 'hmac.AR2DN3JP5T1uzerp-Udyl58luFekDMO1MUYZolRys4KAvCnY', |
|
|
|
'x-instagram-ajax' => '1007137483', |
|
|
|
'x-requested-with' => 'XMLHttpRequest' |
|
|
|
]; |
|
|
|
$options = [ |
|
|
|
@ -2232,14 +2237,15 @@ class InstagramService |
|
|
|
'is_async_ads_double_request' => '0', |
|
|
|
'rti_delivery_backend' => '0', |
|
|
|
'is_async_ads_in_headload_enabled' => '0' |
|
|
|
]]; |
|
|
|
] |
|
|
|
]; |
|
|
|
if ($maxId != null) { |
|
|
|
$options["form_params"]["max_id"] = $maxId; |
|
|
|
} |
|
|
|
$request = new Request('POST', 'https://i.instagram.com/api/v1/feed/timeline/', $headers); |
|
|
|
$res = $client->sendAsync($request, $options)->wait(); |
|
|
|
$resStr = $res->getBody(); |
|
|
|
// echo $resStr;
|
|
|
|
// echo $resStr;
|
|
|
|
$jsonArray = @json_decode($resStr, true, 512, JSON_BIGINT_AS_STRING); |
|
|
|
$response = new Response\TimelineFeedResponse(); |
|
|
|
$response->assignObjectData($jsonArray); |
|
|
|
@ -2297,23 +2303,22 @@ class InstagramService |
|
|
|
'accept' => '*/*', |
|
|
|
'accept-language' => 'zh-CN,zh;q=0.9', |
|
|
|
'cache-control' => 'no-cache', |
|
|
|
'cookie' => 'ig_did=1E87B96C-B061-484F-89A8-C76BF8E11C52; ig_nrcb=1; mid=Y0QEJQAEAAGK3xW8v5Uwszo_cBzM; ds_user_id=361404591; datr=qAREY1W0Mocw3OoikuJcsL1c; csrftoken=uwK4stsVNJf45PtHH7ZEbtYLFAXTED8K; dpr=2; shbid="10286\\054361404591\\0541701480941:01f7ea16564d38f09b0381cd738fc45b08b9bc86ec05314cc2e36faec6dbe8e3c882f218"; shbts="1669944941\\054361404591\\0541701480941:01f7e8f1bf5ec02b46fac45242931283f00863b0aa0ff1b566d3866cc2a90a43eadb9167"; sessionid=361404591%3AXGZE01zPoMGO8b%3A13%3AAYeyaXqF4vyZSCbOae77yhFjjVaV1EEQTleduQ3rmg; rur="NAO\\054361404591\\0541701481008:01f732bf0b6f375a43739100865ad7e701d1b82c718b484643b3b58e506de199dd3041e4"', |
|
|
|
'cookie' => 'ig_did=1E87B96C-B061-484F-89A8-C76BF8E11C52; ig_nrcb=1; mid=Y0QEJQAEAAGK3xW8v5Uwszo_cBzM; ds_user_id=361404591; datr=qAREY1W0Mocw3OoikuJcsL1c; csrftoken=o8uqypXnqzLbV4MKBo7ZeI4Tn7s4WwUt; dpr=2; shbid="10286\\054361404591\\0541710812830:01f7d29af58e88473b6537a789f05c33c9f3f0f41339fa59de8559924c7f8c1d51dc5202"; shbts="1679276830\\054361404591\\0541710812830:01f7cc9321450385cca359a813811464e1a637e9e4e8c2080b2e323f8303e37bd9c73a7c"; sessionid=361404591%3AVuUxqubuMmj6HZ%3A25%3AAYfVauWYX0ZMLkdbLaUmu6w7hi0OYzqf9Jz9qHPWqg; rur="NAO\\054361404591\\0541710812852:01f76d935ed50ff550dbf89bb5f923ab7d02cb0ac4fc6bc8ff913d9232e56beed0c17b72"', |
|
|
|
'pragma' => 'no-cache', |
|
|
|
'referer' => 'https://www.instagram.com/doly0818/', |
|
|
|
'referer' => 'https://www.instagram.com/yifaer_chen/', |
|
|
|
'sec-ch-prefers-color-scheme' => 'light', |
|
|
|
'sec-ch-ua' => '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"', |
|
|
|
'sec-ch-ua' => '"Chromium";v="110", "Not A(Brand";v="24", "Google Chrome";v="110"', |
|
|
|
'sec-ch-ua-mobile' => '?0', |
|
|
|
'sec-ch-ua-platform' => '"macOS"', |
|
|
|
'sec-fetch-dest' => 'empty', |
|
|
|
'sec-fetch-mode' => 'cors', |
|
|
|
'sec-fetch-site' => 'same-origin', |
|
|
|
'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36', |
|
|
|
'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36', |
|
|
|
'viewport-width' => '1512', |
|
|
|
'x-asbd-id' => '198387', |
|
|
|
'x-csrftoken' => 'uwK4stsVNJf45PtHH7ZEbtYLFAXTED8K', |
|
|
|
'x-csrftoken' => 'o8uqypXnqzLbV4MKBo7ZeI4Tn7s4WwUt', |
|
|
|
'x-ig-app-id' => '936619743392459', |
|
|
|
'x-ig-www-claim' => 'hmac.AR2DN3JP5T1uzerp-Udyl58luFekDMO1MUYZolRys4KAvIQG', |
|
|
|
'x-instagram-ajax' => '1006668857', |
|
|
|
'x-ig-www-claim' => 'hmac.AR2DN3JP5T1uzerp-Udyl58luFekDMO1MUYZolRys4KAvCnY', |
|
|
|
'x-requested-with' => 'XMLHttpRequest' |
|
|
|
]; |
|
|
|
$url = "https://i.instagram.com/api/v1/feed/user/{$userId}/?count=12"; |
|
|
|
@ -2324,13 +2329,12 @@ class InstagramService |
|
|
|
$res = $client->sendAsync($request)->wait(); |
|
|
|
// echo $res->getBody();
|
|
|
|
$resStr = $res->getBody(); |
|
|
|
// echo $resStr;
|
|
|
|
// echo $resStr;
|
|
|
|
Log::info($resStr); |
|
|
|
$jsonArray = @json_decode($resStr, true, 512, JSON_BIGINT_AS_STRING); |
|
|
|
$response = new Response\UserFeedResponse(); |
|
|
|
$response->assignObjectData($jsonArray, false); |
|
|
|
return $response; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public function queryUser() |
|
|
|
@ -2423,6 +2427,5 @@ class InstagramService |
|
|
|
} catch (\Exception $e) { |
|
|
|
echo $e->getMessage(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |