|
|
@ -177,6 +177,7 @@ class InstagramService |
|
|
curl_setopt($ch, CURLOPT_VERBOSE, 1); |
|
|
curl_setopt($ch, CURLOPT_VERBOSE, 1); |
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
|
curl_setopt($ch, CURLOPT_AUTOREFERER, false); |
|
|
curl_setopt($ch, CURLOPT_AUTOREFERER, false); |
|
|
|
|
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
|
|
curl_setopt($ch, CURLOPT_REFERER, "https://scontent-lax3-1.cdninstagram.com"); |
|
|
curl_setopt($ch, CURLOPT_REFERER, "https://scontent-lax3-1.cdninstagram.com"); |
|
|
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); |
|
|
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); |
|
|
curl_setopt($ch, CURLOPT_HEADER, 0); |
|
|
curl_setopt($ch, CURLOPT_HEADER, 0); |
|
|
@ -338,7 +339,11 @@ class InstagramService |
|
|
// $maxId = '1451179182821586881_19900699';
|
|
|
// $maxId = '1451179182821586881_19900699';
|
|
|
// } else {
|
|
|
// } else {
|
|
|
|
|
|
|
|
|
$response = $ig->story->getUserReelMediaFeed($userId); |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
$response = $ig->story->getUserReelMediaFeed($userId); |
|
|
|
|
|
} catch (\Exception $e) { |
|
|
|
|
|
Log::error("current user has error, $userName, " . $e->getMessage()); |
|
|
|
|
|
} |
|
|
foreach ($response->getItems() as $item) { |
|
|
foreach ($response->getItems() as $item) { |
|
|
if (Item::VIDEO == $item->getMediaType()) { |
|
|
if (Item::VIDEO == $item->getMediaType()) { |
|
|
$videoUrl = $item->getVideoVersions()[0]->getUrl(); |
|
|
$videoUrl = $item->getVideoVersions()[0]->getUrl(); |
|
|
@ -352,7 +357,12 @@ class InstagramService |
|
|
do { |
|
|
do { |
|
|
// Request the page corresponding to maxId.
|
|
|
// Request the page corresponding to maxId.
|
|
|
echo "\n current maxId: " . $maxId; |
|
|
echo "\n current maxId: " . $maxId; |
|
|
$response = $ig->timeline->getUserFeed($userId, $maxId); |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
$response = $ig->timeline->getUserFeed($userId, $maxId); |
|
|
|
|
|
} catch (\Exception $e) { |
|
|
|
|
|
Log::error("current user has error, $userName, " . $e->getMessage()); |
|
|
|
|
|
continue 2; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// In this example we're simply printing the IDs of this page's items.
|
|
|
// In this example we're simply printing the IDs of this page's items.
|
|
|
foreach ($response->getItems() as $item) { |
|
|
foreach ($response->getItems() as $item) { |
|
|
|