Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for Zend Guard Encoder)
- *
- * @ Version : 3.0.4.0
- * @ Author : DeZender
- * @ Release on : 02.04.2017
- * @ Official site : http://DeZender.Net
- *
- */
- class Instagram
- {
- protected $username = null;
- protected $password = null;
- /**
- * @var Device
- */
- protected $device = null;
- public $account_id = null;
- public $uuid = null;
- protected $adid = null;
- protected $phone_id = null;
- protected $device_id = null;
- /**
- * @var Settings
- */
- public $settings = null;
- public $token = null;
- protected $isLoggedIn = false;
- protected $rank_token = null;
- protected $IGDataPath = null;
- public function __construct($username, $password, $account_id = NULL, $forceUserIP = false)
- {
- $username = trim( $username );
- $password = trim( $password );
- if ($account_id === NULL) {
- try {
- $userData = file_get_contents( 'https://www.instagram.com/' . $username . '/?__a=1' );
- }
- catch (Exception $e) {
- $userData = '';
- }
- $userData = json_decode( $userData, true );
- if (!(is_array( $userData )) || !(isset( $userData['user']['id'] ))) {
- throw new Exception( 'Invalid username!' );
- }
- $account_id = $userData['user']['id'];
- }
- $this->setUser( $username, $password, $account_id, $forceUserIP );
- }
- public function setUser($username, $password, $account_id, $forceUserIP = false)
- {
- $this->username = $username;
- $this->password = $password;
- $this->account_id = $account_id;
- $this->IGDataPath = Wow::get( 'project/cookiePath' ) . 'instagramv3/' . substr( $this->account_id, -1 ) . '/';
- $this->settings = new Settings( $this->IGDataPath . $account_id . '.iwb' );
- $this->checkSettings( $forceUserIP );
- $this->uuid = $this->settings->get( 'uuid' );
- $this->adid = $this->settings->get( 'adid' );
- $this->rank_token = $this->account_id . '_' . $this->uuid;
- $this->phone_id = $this->settings->get( 'phone_id' );
- $this->device_id = $this->settings->get( 'device_id' );
- if ($this->settings->get( 'token' ) != NULL) {
- $this->isLoggedIn = true;
- $this->token = $this->settings->get( 'token' );
- }
- else {
- $this->isLoggedIn = false;
- }
- }
- protected function checkSettings($forceUserIP = false)
- {
- $settingsCompare = $this->settings->get( 'sets' );
- $savedDeviceString = $this->settings->get( 'devicestring' );
- $this->device = new Device( Constants::IG_VERSION, Constants::USER_AGENT_LOCALE, $savedDeviceString );
- $deviceString = $this->device->getDeviceString( );
- if ($deviceString !== $savedDeviceString) {
- $this->settings->set( 'devicestring', $deviceString );
- }
- if ($this->settings->get( 'uuid' ) == NULL) {
- ....................................................................
- ...................................
- .........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement