Skip to content

Sourcery refactored master branch#2

Open
sourcery-ai[bot] wants to merge 1 commit intomasterfrom
sourcery/master
Open

Sourcery refactored master branch#2
sourcery-ai[bot] wants to merge 1 commit intomasterfrom
sourcery/master

Conversation

@sourcery-ai
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot commented May 21, 2023

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai Bot requested a review from Aijaj125 May 21, 2023 13:43
Comment thread hackinsta.py
Comment on lines -31 to +32
if not (x == None or x == ''):
if not x in newList:
if x is not None and x != '':
if x not in newList:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function cleanList refactored with the following changes:

  • Simplify logical expression using De Morgan identities [×2] (de-morgan)
  • Use x is None rather than x == None (none-compare)

Comment thread hackinsta.py
def setProxy():
for proxy in proxies_list:
print('[*] Proxy: %s' % proxy)
print(f'[*] Proxy: {proxy}')
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function setProxy refactored with the following changes:

Comment thread hackinsta.py
Comment on lines -88 to +89
r = requests.get('https://www.instagram.com/%s/?__a=1' % self.username)
if r.status_code == 404:
return False
elif r.status_code == 200:
return True
else:
return False
r = requests.get(f'https://www.instagram.com/{self.username}/?__a=1')
return r.status_code == 200
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function Instabrute.userExists refactored with the following changes:

Comment thread hackinsta.py
Comment on lines -138 to +135
exit('[%s] Yay, the password is "%s"' % (str(self.attempts+1), self.passwords[0]))
#update csrf token after login try (if you want to keep the session)
#sess.headers.update({'X-CSRFToken' : r.cookies.get_dict()['csrftoken']})
exit(f'[{str(self.attempts + 1)}] Yay, the password is "{self.passwords[0]}"')
#update csrf token after login try (if you want to keep the session)
#sess.headers.update({'X-CSRFToken' : r.cookies.get_dict()['csrftoken']})
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function Instabrute.login refactored with the following changes:

This removes the following comments ( why? ):

#Do you want to wait or use proxy?

Comment thread hackinsta.py
Comment on lines -170 to +163
print ('[*] %s passwords loaded successfully' % len(passwords))
print(f'[*] {len(passwords)} passwords loaded successfully')
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Lines 170-170 refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants