Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests, uuid, time
- id = ''
- user = ''
- username = ''
- print(“””
- ____ ______ __
- | _ \ ____|____ /_ |
- | |_) |_ _ / __ \ / / | | ___ ___
- | _ <| | | | / / _` | / / | |/ _ \ / __|
- | |_) | |_| | | | (_| |/ / | | (_) | (__
- |____/ \__, | \ \__,_/_/ |_|\___/ \___|
- __/ | \____/
- |___/
- “””)
- username = input("[US] Username : ")
- password = input("[PS] Password : ")
- MySle = int(input("[SP] Sleep : "))
- uid = str(uuid.uuid4())
- head = {
- 'User-Agent': 'Instagram 93.1.0.19.102 Android (21/5.0.2; 240dpi; 540x960; samsung; SM-G530H; fortuna3g; qcom; ar_AE; 154400379)',
- "Accept": "*/*",
- "Accept-Encoding": "gzip, deflate",
- "Accept-Language": "en-US",
- "X-IG-Capabilities": "3brTvw==",
- "X-IG-Connection-Type": "WIFI",
- "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
- 'Host': 'i.instagram.com'
- }
- headweb = {
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0',
- "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
- "Upgrade-Insecure-Requests": "1",
- "Accept-Language": "en-US,en;q=0.5",
- 'Host': 'www.instagram.com'
- }
- def get_challenge_choices(last_json):
- choices = []
- if last_json.get("step_name", "") == "select_verify_method":
- choices.append("[+] Challenge received")
- if "phone_number" in last_json["step_data"]:
- choices.append("[+] 0 - Phone")
- if "email" in last_json["step_data"]:
- choices.append("[+] 1 - Email")
- if last_json.get("step_name", "") == "delta_login_review":
- choices.append("[+] Login attempt challenge received")
- choices.append("[+] 0 - It was me")
- choices.append("[+] 0 - It wasn't me")
- if not choices:
- choices.append(
- '"{}" challenge received'.format(last_json.get("step_name", "Unknown"))
- )
- choices.append("[+] 0 - Default")
- return choices
- def challange(login_json):
- global coo
- challenge_url = 'https://i.instagram.com/api/v1/' + login_json["challenge"]["api_path"][1:]
- try:
- b = requests.get(challenge_url, headers=head, cookies=coo)
- except Exception as e:
- print("solve_challenge; {}".format(e))
- return False
- choiccc = get_challenge_choices(b.json())
- for choice in choiccc:
- print(choice)
- code = input("[+] Enter Email Or Phone : ")
- data_c = {
- 'choice': code,
- '_uuid': uid,
- '_uid': uid,
- '_csrftoken': 'missing'
- }
- send_c = requests.post(challenge_url, data=data_c, headers=head, cookies=coo)
- print("[+] Done sent Code To {}".format(send_c.json()['step_data']['contact_point']))
- code = input("[+] Enter Code : ").strip()
- data_co = {
- 'security_code': code,
- '_uuid': uid,
- '_uid': uid,
- '_csrftoken': 'missing'
- }
- send_o = requests.post(challenge_url, data=data_co, headers=head, cookies=coo)
- send_coj = send_o.json()
- if ('logged_in_user') in send_coj:
- 'Logged in :)'
- coo = send_o.cookies
- getid()
- return True
- return False
- unfollow = 0
- def getid():
- global coo
- global id
- global idme
- global unfollow
- global user
- a = -1
- urlacc = "https://www.instagram.com/" + username + "/?__a=1&include_reel=true"
- tx = requests.get(urlacc, headers=headweb, cookies=coo).json()
- idme = str(tx['graphql']['user']['id'])
- urlacc = f"https://i.instagram.com/api/v1/friendships/{idme}/following/?includes_hashtags=true&search_surface=follow_list_page&query=&enable_groups=true&rank_token={uid}"
- while True:
- get_id = requests.post(urlacc, headers=head, cookies=coo)
- try:
- if ("pk") in get_id.text:
- a += 1
- ends = str(get_id.json()["users"][a]['pk'])
- user = str(get_id.json()["users"][a]['username'])
- elif ("Please wait a few minutes before you try again.") in get_id.text:
- print("[+] Please Wait 10Min")
- time.sleep(600)
- else:
- print("[+] Done Delete All Following")
- input("")
- exit()
- exit(0)
- urlii = f"https://i.instagram.com/api/v1/friendships/{ends}/following/?includes_hashtags=true&search_surface=follow_list_page&query=&enable_groups=true&rank_token={uid}"
- CheckMe = requests.post(urlii, headers=head, cookies=coo)
- if (username) in CheckMe.text:
- print(f"[+] @{user} is Following You")
- else:
- urlun = f"https://i.instagram.com/api/v1/friendships/destroy/{ends}/"
- t = requests.post(urlun, headers=head, cookies=coo)
- if t.text.find("ok") >= 0:
- unfollow += 1
- a -= 1
- print(f"[+] @{user} isn't Following You > {unfollow}")
- time.sleep(MySle)
- else:
- print(f"\r[+] Error Remove > @{user}", end='')
- time.sleep(160)
- except:
- get_id = requests.post(urlacc, headers=head, cookies=coo)
- a = 0
- def login():
- global head
- global coo
- login_url = "https://i.instagram.com/api/v1/accounts/login/"
- data_login = {'uuid': uid,
- 'password': password,
- 'username': username,
- 'device_id': uid,
- 'from_reg': 'false',
- '_csrftoken': 'missing',
- 'login_attempt_count': '0'}
- loginc = requests.post(login_url, data=data_login, headers=head)
- login1 = loginc.text
- if ('"logged_in_user"') in login1:
- coo = loginc.cookies
- getid()
- elif ('checkpoint_challenge_required') in login1:
- coo = loginc.cookies
- return challange(loginc.json())
- else:
- print(login1)
- login()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement