Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Recommend following accounts like fortnite, callofduty, etc you will get followers (mainly bots) from following and un-following
- # Just input account details, user to follow, and what you where you want info outputted to.
- #Py3
- import requests, getpass, time
- AccUser = input("[?] Username: ")
- AccPass = getpass.getpass(prompt="[?] Password: ")
- AccToFollow = input("[?] Account To Follow: ")
- OutputFile = input("[?] Output file: ")
- OutputF = open(OutputFile, "w")
- UserIDUrl = f'https://www.instagram.com/{AccToFollow}/?__a=1'
- RequestID = requests.get(UserIDUrl)
- UserID = RequestID.json()['logging_page_id'].split('_')[1]
- refer = f'https://www.instagram.com/{AccToFollow}/'
- FollowURL = "https://www.instagram.com/web/friendships/%s/follow/" % (UserID)
- UnfollowURL = "https://www.instagram.com/web/friendships/%s/unfollow/" % (UserID)
- def Follow(user, passw, acc2follow):
- s = requests.session()
- GetTok = "https://www.instagram.com/accounts/login/"
- Grab = s.get(GetTok)
- LoginURL = 'https://www.instagram.com/accounts/login/ajax/'
- Headd = {
- 'accept': '*/*',
- 'accept-encoding': 'gzip, deflate, br',
- 'accept-language': 'en-US,en;q=0.9',
- 'content-type': 'application/x-www-form-urlencoded',
- 'origin': 'https://www.instagram.com',
- 'referer': 'https://www.instagram.com/accounts/login/',
- 'user-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.2; zh) AppleWebKit/522.13.1 (KHTML, like Gecko) Version/3.0.2 Safari/522.13.1',
- 'x-csrftoken': Grab.cookies.get_dict()['csrftoken'],
- 'x-instagram-ajax': '1',
- 'x-requested-with': 'XMLHttpRequest'
- }
- LoginData = {
- 'username': user,
- 'password': passw,
- 'queryParams': '{}'
- }
- x = 0
- try:
- AccLogin = s.post(LoginURL, headers=Headd, data=LoginData)
- if AccLogin.json()['authenticated']:
- OutputF.write(f"{AccLogin.json()} | {x}")
- x += 1
- print(f"Logged in | {user}")
- head = {
- 'accept': '*/*',
- 'accept-encoding': 'gzip, deflate, br',
- 'accept-language': 'en-US,en;q=0.9',
- 'content-type': 'application/x-www-form-urlencoded',
- 'origin': 'https://www.instagram.com',
- 'referer': refer,
- 'user-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.2; zh) AppleWebKit/522.13.1 (KHTML, like Gecko) Version/3.0.2 Safari/522.13.1',
- 'x-csrftoken': AccLogin.cookies.get_dict()['csrftoken'],
- 'x-instagram-ajax': '1',
- 'x-requested-with': 'XMLHttpRequest'
- }
- Followed = 0
- Unfollowed = 0
- while True:
- try:
- RequestFollow = s.post(FollowURL, headers=head, data={})
- try:
- if RequestFollow.status_code == 200:
- x += 1
- OutputF.write(f"{RequestFollow.json()} | {x}")
- Followed += 1
- print(f"[!] {user} followed {acc2follow} | {RequestFollow.status_code} ")
- time.sleep(20)
- try:
- Unfollow = s.post(UnfollowURL, headers=head)
- if Unfollow.status_code == 200:
- Unfollowed += 1
- x += 1
- OutputF.write(f"{Unfollow.json()} | {x}")
- print(f"[!] {user} unfollowed {acc2follow} | Followed [{Followed}] times - Unfollowed [{Unfollowed}] times | {Unfollow.status_code}")
- time.sleep(20)
- except Exception as e : print(e)
- else : print(f"[-] {user} failed to follow {acc2follow}")
- except Exception as e : print(e)
- except Exception as e : print(e)
- else : print(f"[-] {user} unable to login")
- except Exception as e : print(e)
- Follow(AccUser, AccPass, AccToFollow)
- OutputF.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement