Br1in

SessioniD.py

Jan 29th, 2021 (edited)
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. try:
  2. import requests
  3. import uuid
  4. import os
  5. import re
  6.  
  7. except Exception as e:
  8. try:
  9. print(e)
  10. finally:
  11. e = None
  12. del e
  13. except Exception as e:
  14. try:
  15. print(e)
  16. finally:
  17. e = None
  18. del e
  19. email = ''
  20. fullname = ''
  21. phone = ''
  22. counter = 0
  23. u = str(uuid.uuid4())
  24. req = requests.session()
  25. ThreadStart = True
  26. def c():
  27. exit(0)
  28.  
  29. clear = lambda : os.system('cls')
  30.  
  31. head = {
  32. 'User-Agent': 'Instagram 93.1.0.19.102 Android (21/5.0.2; 240dpi; 540x960; samsung; SM-G530H; fortuna3g; qcom; ar_AE; 154400379)',
  33. "Accept": "*/*",
  34. "Accept-Encoding": "gzip, deflate",
  35. "Accept-Language": "en-US",
  36. "X-IG-Capabilities": "3brTvw==",
  37. "X-IG-Connection-Type": "WIFI",
  38. "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
  39. 'Host': 'i.instagram.com'
  40. }
  41.  
  42. clear()
  43. print()
  44.  
  45.  
  46. uid = str(uuid.uuid4())
  47.  
  48. def for_login():
  49. global username
  50. global password
  51. username = input('[+]username:')
  52.  
  53. password = input('[+]Password:')
  54.  
  55. for_login()
  56.  
  57.  
  58.  
  59.  
  60.  
  61. def info():
  62. global email
  63. global fulname
  64. global number
  65. global head
  66. global coo
  67. try:
  68. txt = requests.get("https://i.instagram.com/api/v1/accounts/current_user/?edit=true", headers=head,
  69. cookies=coo).json()
  70. email = txt['user']['email']
  71. number = txt['user']['phone_number']
  72. fulname = txt['user']['full_name']
  73. except:
  74. pass
  75.  
  76.  
  77. def login(username, password):
  78. global head
  79. global coo
  80. login_url = "https://i.instagram.com/api/v1/accounts/login/"
  81. data_login = {'uuid': uid,
  82. 'password': password,
  83. 'username': username,
  84. 'device_id': uid,
  85. 'from_reg': 'false',
  86. '_csrftoken': 'missing',
  87. 'login_attempt_count': '0'}
  88. loginc = requests.post(login_url, data=data_login, headers=head)
  89. login1 = loginc.text
  90. if ('"logged_in_user"') in login1:
  91. coo = loginc.cookies
  92. return True
  93. elif ("Incorrect Username") in login1:
  94. print(
  95. "The username you entered doesn't appear to belong to an account. Please check your username and try again.")
  96. c()
  97. exit()
  98. elif ('Incorrect password') in login1:
  99. print("The password you entered is incorrect. Please try again.")
  100. c()
  101. exit()
  102. elif ('"inactive user"') in login1:
  103. print(
  104. 'Your account has been disabled for violating our terms. Learn how you may be able to restore your account.')
  105. c()
  106. exit()
  107. elif ('checkpoint_challenge_required') in login1:
  108. print(
  109. 'Your account is secure , Please try again')
  110. c()
  111. exit()
  112. else:
  113. print(login1)
  114. c()
  115. exit()
  116. if login(username, password):
  117. info()
  118. clear()
  119. print()
  120. print()
  121.  
  122.  
  123.  
  124.  
  125.  
  126. coo = f" {coo}\n"
  127.  
  128. file = open('cookies.txt','a')
  129. file.write(coo)
  130. print(coo)
Add Comment
Please, Sign In to add comment