Sourcery refactored master branch#2
Open
sourcery-ai[bot] wants to merge 1 commit intomasterfrom
Open
Conversation
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: |
Author
There was a problem hiding this comment.
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)
| def setProxy(): | ||
| for proxy in proxies_list: | ||
| print('[*] Proxy: %s' % proxy) | ||
| print(f'[*] Proxy: {proxy}') |
Author
There was a problem hiding this comment.
Function setProxy refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
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 |
Author
There was a problem hiding this comment.
Function Instabrute.userExists refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring) - Simplify conditional into switch-like form (
switch) - Simplify boolean if expression (
boolean-if-exp-identity) - Replace if statement with if expression (
assign-if-exp) - Remove unnecessary casts to int, str, float or bool (
remove-unnecessary-cast)
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']}) |
Author
There was a problem hiding this comment.
Function Instabrute.login refactored with the following changes:
- Merge else clause's nested if statement into elif (
merge-else-if-into-elif) - Replace interpolated string formatting with f-string [×3] (
replace-interpolation-with-fstring) - Remove redundant pass statement (
remove-redundant-pass)
This removes the following comments ( why? ):
#Do you want to wait or use proxy?
Comment on lines
-170
to
+163
| print ('[*] %s passwords loaded successfully' % len(passwords)) | ||
| print(f'[*] {len(passwords)} passwords loaded successfully') |
Author
There was a problem hiding this comment.
Lines 170-170 refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch
masterrefactored 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
masterbranch, then run:Help us improve this pull request!