Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for Zend Guard Encoder)
  6. *
  7. * @ Version : 3.0.4.0
  8. * @ Author : DeZender
  9. * @ Release on : 02.04.2017
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class Instagram
  15. {
  16. protected $username = null;
  17. protected $password = null;
  18. /**
  19. * @var Device
  20. */
  21. protected $device = null;
  22. public $account_id = null;
  23. public $uuid = null;
  24. protected $adid = null;
  25. protected $phone_id = null;
  26. protected $device_id = null;
  27. /**
  28. * @var Settings
  29. */
  30. public $settings = null;
  31. public $token = null;
  32. protected $isLoggedIn = false;
  33. protected $rank_token = null;
  34. protected $IGDataPath = null;
  35.  
  36. public function __construct($username, $password, $account_id = NULL, $forceUserIP = false)
  37. {
  38. $username = trim( $username );
  39. $password = trim( $password );
  40.  
  41. if ($account_id === NULL) {
  42. try {
  43. $userData = file_get_contents( 'https://www.instagram.com/' . $username . '/?__a=1' );
  44. }
  45. catch (Exception $e) {
  46. $userData = '';
  47. }
  48.  
  49. $userData = json_decode( $userData, true );
  50. if (!(is_array( $userData )) || !(isset( $userData['user']['id'] ))) {
  51. throw new Exception( 'Invalid username!' );
  52. }
  53.  
  54. $account_id = $userData['user']['id'];
  55. }
  56.  
  57. $this->setUser( $username, $password, $account_id, $forceUserIP );
  58. }
  59.  
  60. public function setUser($username, $password, $account_id, $forceUserIP = false)
  61. {
  62. $this->username = $username;
  63. $this->password = $password;
  64. $this->account_id = $account_id;
  65. $this->IGDataPath = Wow::get( 'project/cookiePath' ) . 'instagramv3/' . substr( $this->account_id, -1 ) . '/';
  66. $this->settings = new Settings( $this->IGDataPath . $account_id . '.iwb' );
  67. $this->checkSettings( $forceUserIP );
  68. $this->uuid = $this->settings->get( 'uuid' );
  69. $this->adid = $this->settings->get( 'adid' );
  70. $this->rank_token = $this->account_id . '_' . $this->uuid;
  71. $this->phone_id = $this->settings->get( 'phone_id' );
  72. $this->device_id = $this->settings->get( 'device_id' );
  73.  
  74. if ($this->settings->get( 'token' ) != NULL) {
  75. $this->isLoggedIn = true;
  76. $this->token = $this->settings->get( 'token' );
  77. }
  78. else {
  79. $this->isLoggedIn = false;
  80. }
  81. }
  82.  
  83. protected function checkSettings($forceUserIP = false)
  84. {
  85. $settingsCompare = $this->settings->get( 'sets' );
  86. $savedDeviceString = $this->settings->get( 'devicestring' );
  87. $this->device = new Device( Constants::IG_VERSION, Constants::USER_AGENT_LOCALE, $savedDeviceString );
  88. $deviceString = $this->device->getDeviceString( );
  89.  
  90. if ($deviceString !== $savedDeviceString) {
  91. $this->settings->set( 'devicestring', $deviceString );
  92. }
  93.  
  94. if ($this->settings->get( 'uuid' ) == NULL) {
  95. ....................................................................
  96. ...................................
  97. .........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement