Skip to content

Commit

Permalink
Fix pagination with login process
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrimaud committed May 18, 2020
1 parent 96ad4cf commit 6e68b16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Instagram/Storage/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function set(Cache $cache, $userName)

/**
* @param $userName
* @param CookieJar $cookies
* @param CookieJar $cookieJar
*
* @throws InstagramCacheException
*/
Expand Down
10 changes: 6 additions & 4 deletions src/Instagram/Transport/HtmlTransportFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Instagram\Transport;

use GuzzleHttp\Client;
use GuzzleHttp\Cookie\CookieJar;
use Instagram\Exception\InstagramAuthException;
use Instagram\Exception\InstagramException;
use Instagram\Storage\Cache;
Expand Down Expand Up @@ -73,9 +72,12 @@ public function fetchData($userName)
throw new InstagramAuthException('Instagram blocked your IP. Login is required.');
}

if ($this->cacheManager && $this->cacheManager->sessionName) {
$this->cacheManager->setSession($this->cacheManager->sessionName, $cookieJar);
} elseif ($this->cacheManager instanceof CacheManager) {
if ($this->cacheManager instanceof CacheManager) {

if ($this->cacheManager->sessionName) {
$this->cacheManager->setSession($this->cacheManager->sessionName, $cookieJar);
}

$newCache = new Cache();
$newCache->setUserId($data->entry_data->ProfilePage[0]->graphql->user->id);
$newCache->setCsrfToken($data->config->csrf_token);
Expand Down

0 comments on commit 6e68b16

Please sign in to comment.