From 50e4aafb12de56f58b8a4415ee0da4499da5b648 Mon Sep 17 00:00:00 2001 From: Joel Margolis Date: Thu, 11 Jun 2015 10:28:09 -0400 Subject: [PATCH] update for 9.9.0.0 --- src/snapchat.php | 12 ++++++++++-- src/snapchat_agent.php | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/snapchat.php b/src/snapchat.php index 404d2fe..2c3d3af 100755 --- a/src/snapchat.php +++ b/src/snapchat.php @@ -221,7 +221,15 @@ public function getAuthToken() $return['error'] = 0; $exploded = explode("\n", $result); - $return['auth'] = substr($exploded[1], 5); + $return['auth'] = ""; + foreach($exploded as $line) + { + if(substr($line, 0, 5) == "Auth=") + { + $return["auth"] = substr($line, 5); + break; + } + } } else { @@ -323,7 +331,7 @@ public function login($password, $force = FALSE) return $auth; } parent::setGAuth($auth); - $attestation = $this->getAttestation(); + $attestation = $this->getAttestation(); $result = parent::post( '/loq/login', array( diff --git a/src/snapchat_agent.php b/src/snapchat_agent.php index 959b645..a385699 100644 --- a/src/snapchat_agent.php +++ b/src/snapchat_agent.php @@ -11,7 +11,7 @@ abstract class SnapchatAgent { * Before updating this value, confirm * that the library requests everything in the same way as the app. */ - const USER_AGENT = 'Snapchat/9.8.0.0 (HTC One; Android 4.4.2#302626.7#19; gzip)'; + const USER_AGENT = 'Snapchat/9.9.0.0 (HTC One; Android 4.4.2#302626.7#19; gzip)'; /* * The API URL. We're using the /bq endpoint, the one that the iPhone