Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests, uuid, secrets, json
- from time import sleep
- from colorama import Fore
- hdid = {
- "Host": "www.instagram.com",
- "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8",
- "Cookie": "csrftoken=missing; sessionid=missing; mid=missing",
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1",
- "Accept-Language": "en-us",
- "Accept-Encoding": "gzip, deflate, br",
- "Connection": "keep-alive"
- }
- r = requests.session()
- print("""
- ██████╗ ██████╗███████╗██████╗
- ██╔════╝ ██╔════╝╚════██║██╔══██╗
- ███████╗ ██║ ███╗ ██╔╝██████╔╝
- ██╔═══██╗██║ ██║ ██╔╝ ██╔══██╗
- ╚██████╔╝╚██████╔╝ ██║ ██║ ██║
- ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
- """)
- user = input('Username : ')
- password = input('password : ')
- sle = int(input("sleep ?:"))
- def login():
- global hdid
- url_login = 'https://www.instagram.com/accounts/login/ajax/'
- headers_login = {
- "Accept": "/",
- "Accept-Encoding": "gzip, deflate, br",
- "Accept-Language": "en-US,en;q=0.5",
- "Content-Length": "267",
- "Content-Type": "application/x-www-form-urlencoded",
- "Cookie": "missing",
- "Host": "www.instagram.com",
- "Origin": "https://www.instagram.com/",
- "Referer": "https://www.instagram.com/",
- "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0",
- "X-CSRFToken": "missing",
- "X-IG-App-ID": "936619743392459",
- "X-IG-WWW-Claim": "0",
- "X-Instagram-AJAX": "a57770cf770b",
- "X-Requested-With": "XMLHttpRequest"
- }
- data_login = {
- 'username': user,
- 'enc_password': f'#PWD_INSTAGRAM_BROWSER:0:1589682409:{password}',
- 'queryParams':'{}',
- 'optIntoOneTap':'false'
- }
- req = requests.post(url_login,headers=headers_login,data=data_login)
- if ("userId") in req.text:
- print('Done login ! > : ')
- reqid = requests.get(f'https://instagram.com/{user}/?__a=1', headers=hdid)
- id = json.loads(reqid.text)["graphql"]["user"]["id"]
- url1 = 'https://www.instagram.com/accounts/set_private/'
- headers2 = {
- 'Accept': '*/*',
- 'Accept-Encoding': 'gzip, deflate, br',
- 'Accept-Language': 'ar,en-US;q=0.7,en;q=0.3',
- 'Connection': 'keep-alive',
- 'Content-Length': '16',
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'Cookie': f'mid=YG-TiwALAAE2ks16hlE80Wi1oYTc; ig_did=CF89BCF1-054E-46DB-98B6-A1B025A7597C; ig_nrcb=1; rur=FTW; shbid=7843; shbts=1617925079.6532674; csrftoken=JyZhm9whGTrh18py604FBZDPWa7pG6j7; ds_user_id={id}; sessionid={id}%3AMSVaPjB4yrds8K%3A22',
- 'Host':'www.instagram.com',
- 'Origin':'https://www.instagram.com',
- 'Referer':'https://www.instagram.com/accounts/privacy_and_security/',
- 'TE':'Trailers',
- 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0',
- 'X-CSRFToken':'JyZhm9whGTrh18py604FBZDPWa7pG6j7',
- 'X-IG-App-ID':'936619743392459',
- 'X-IG-WWW-Claim':'hmac.AR0PgHlJ-bCUiS-TTDbxUCGD0oOf2mSo5aRkGfixmRD0GULS',
- 'X-Instagram-AJAX':'1e298a12d662',
- 'X-Requested-With':'XMLHttpRequest',
- }
- data2 = {
- 'is_private':"false"
- }
- url12 = 'https://www.instagram.com/accounts/set_private/'
- headers22 = {
- 'Accept': '*/*',
- 'Accept-Encoding': 'gzip, deflate, br',
- 'Accept-Language': 'ar,en-US;q=0.7,en;q=0.3',
- 'Connection': 'keep-alive',
- 'Content-Length': '15',
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'Cookie': f'mid=YG-TiwALAAE2ks16hlE80Wi1oYTc; ig_did=CF89BCF1-054E-46DB-98B6-A1B025A7597C; ig_nrcb=1; rur=FTW; shbid=7843; shbts=1617925079.6532674; csrftoken=JyZhm9whGTrh18py604FBZDPWa7pG6j7; ds_user_id={id}; sessionid={id}%3AMSVaPjB4yrds8K%3A22',
- 'Host': 'www.instagram.com',
- 'Origin': 'https://www.instagram.com',
- 'Referer': 'https://www.instagram.com/accounts/privacy_and_security/',
- 'TE': 'Trailers',
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0',
- 'X-CSRFToken': 'JyZhm9whGTrh18py604FBZDPWa7pG6j7',
- 'X-IG-App-ID': '936619743392459',
- 'X-IG-WWW-Claim': 'hmac.AR0PgHlJ-bCUiS-TTDbxUCGD0oOf2mSo5aRkGfixmRD0GULS',
- 'X-Instagram-AJAX': '1e298a12d662',
- 'X-Requested-With': 'XMLHttpRequest',
- }
- data22 = {
- 'is_private': "true"
- }
- done = 1
- error = 1
- while True:
- sleep(60)
- req2 = requests.post(url1,headers=headers2,data=data2)
- if ("Please wait a few minutes before you try again.") in req2.text:
- print('Error ! > : ',done)
- done += 1
- if ("ok") in req2.text:
- print('Done ! ',done)
- done += 1
- sleep(2)
- req3 = requests.post(url12,headers=headers22,data=data22)
- if ("Please wait a few minutes before you try again.") in req3.text:
- print('Error private ! > : ',error)
- error += 1
- else:
- print('Done private ! > : ',error)
- done += 1
- login()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement