-
Notifications
You must be signed in to change notification settings - Fork 3
Sourcery refactored main branch #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to GitHub API limits, only the first 60 comments can be shown.
| def parser_error(self): | ||
| banner() | ||
| print("Usage: python " + sys.argv[0] + " [Options] use -h for help") | ||
| print(f"Usage: python {sys.argv[0]} [Options] use -h for help") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function parser_error refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation)
| parser.add_argument('-o', '--output', required=False) | ||
| args = parser.parse_args() | ||
| return args | ||
| return parser.parse_args() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function parse_args refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| if (url == []): | ||
| if not url: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function urlExtract refactored with the following changes:
- Replaces an empty collection equality with a boolean operation (
simplify-empty-collection-comparison)
| if(args.dorkfile): | ||
| if args.dorkfile: | ||
| with open(dorks) as f: | ||
| while True: | ||
| line = f.readline() | ||
| if not line: | ||
| if not (line := f.readline()): | ||
| break | ||
| else: | ||
| driver = helium.start_firefox(headless=False) | ||
| go_to('https://www.google.com/search?q=site:doxbin.com | site:instagram.com | site:facebook.com | site:youtube.com | site:zerobin.net | site:pastebin.com | site:skidbin.net | site:hastebin.com | site:twitter.com | site:linkedin.com | site:pinterest.com | site:tumblr.com | site:snapchat.com | site:reddit.com | site:github.com | site:gitlab.com | site:pornhub.com | site:whatsapp.com \ site:tiktok.com "' + test +'"') | ||
| input_(line) | ||
| time.sleep(5) | ||
| flow() | ||
| driver = helium.start_firefox(headless=False) | ||
| go_to('https://www.google.com/search?q=site:doxbin.com | site:instagram.com | site:facebook.com | site:youtube.com | site:zerobin.net | site:pastebin.com | site:skidbin.net | site:hastebin.com | site:twitter.com | site:linkedin.com | site:pinterest.com | site:tumblr.com | site:snapchat.com | site:reddit.com | site:github.com | site:gitlab.com | site:pornhub.com | site:whatsapp.com \ site:tiktok.com "' + test +'"') | ||
| input_(line) | ||
| time.sleep(5) | ||
| flow() | ||
|
|
||
| else: | ||
| line = args.dork | ||
| driver = helium.start_firefox(headless=False) | ||
| time.sleep(5) | ||
| go_to('https://www.google.com/search?q="' + test + '"') | ||
| go_to(f'https://www.google.com/search?q="{test}"') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function exechaha refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression) - Swap if/else branches [×2] (
swap-if-else-branches) - Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation) - Remove unnecessary else after guard condition (
remove-unnecessary-else)
| if(args.output): | ||
| file1 = open(args.output+'.txt', 'w') | ||
| for i in clean(final): | ||
| file1.write(i.strip()+'\n') | ||
| file1.close() | ||
| if args.output: | ||
| with open(f'{args.output}.txt', 'w') as file1: | ||
| for i in clean(final): | ||
| file1.write(i.strip()+'\n') | ||
| else: | ||
| for i in clean(final): | ||
| print(f"{Fore.YELLOW}[{Fore.GREEN}ϟ{Fore.YELLOW}] {Fore.BLUE}" + i) | ||
| print(f"{Fore.YELLOW}[{Fore.GREEN}ϟ{Fore.YELLOW}] {Fore.BLUE}{i}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function main refactored with the following changes:
- Use
withwhen opening file to ensure closure (ensure-file-closed) - Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation)
| print(Fore.WHITE+'# Commands') | ||
| print('python geo-recon.py --help or -h (Display help)') | ||
| print('python geo-recon.py 138.121.128.19 --nmap or -n (Nmap standard use)') | ||
| print('python geo-recon.py 138.121.128.19 (Standard use, infos about IP)') | ||
| print('python geo-recon.py --commands or -c (Display commands availables )') | ||
| print(f'{Fore.WHITE}# Commands') | ||
| print('python geo-recon.py --help or -h (Display help)') | ||
| print('python geo-recon.py 138.121.128.19 --nmap or -n (Nmap standard use)') | ||
| print('python geo-recon.py 138.121.128.19 (Standard use, infos about IP)') | ||
| print('python geo-recon.py --commands or -c (Display commands availables )') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function listCommand refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation)
| r = requests.get('http://ip-api.com/json/'+syA1) | ||
| r = requests.get(f'http://ip-api.com/json/{syA1}') | ||
| response = json.loads(r.text) | ||
|
|
||
| #Iterate the data, filter & print ( data for specific fields | ||
| #print ( sys.argv[1] ) | ||
| print ( Fore.WHITE + "Country: "+ response["country"]) | ||
| #print ( sys.argv[1] ) | ||
| print(f"{Fore.WHITE}Country: " + response["country"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function getGeo refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation)
| response = json.loads(r.text) | ||
| ip = (response["ip"]) | ||
| return ip | ||
| return response["ip"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function myIp refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| 'FullName': str(FullName)+" / "+str(data['entry'][0]["profileUrl"]), | ||
| 'FullName': f"{str(FullName)} / " | ||
| + str(data['entry'][0]["profileUrl"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function gravatar refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation)
| if rep["available"]: | ||
| out.append({"name": name,"domain":domain,"method":method,"frequent_rate_limit":frequent_rate_limit, | ||
| "rateLimit": False, | ||
| "exists": False, | ||
| "emailrecovery": None, | ||
| "phoneNumber": None, | ||
| "others": None}) | ||
| elif rep["message"]=="You cannot use this email address.": | ||
| if ( | ||
| rep["available"] | ||
| or rep["message"] == "You cannot use this email address." | ||
| ): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function voxmedia refactored with the following changes:
- Merge duplicate blocks in conditional (
merge-duplicate-blocks) - Remove redundant conditional (
remove-redundant-if)
Branch
mainrefactored 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
mainbranch, then run:Help us improve this pull request!