-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathaccessories.py
99 lines (81 loc) · 3.41 KB
/
accessories.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
"""
accessory module used to design and color the output text for pretty terminal
output.
"""
ascii_art = """
____ __ ___ __
/ __/__ ____ ____ / |/ /__ ___/ /__
_\ \/ _ `/ _ `/ -_) / /|_/ / _ \/ _ / -_)
/___/\_,_/\_, /\__/ /_/ /_/\___/\_,_/\__/
/___/
@@@%%%%%@@@
@%##`````@`````##&@
@##````````@````````##@
@%#`````````@@@`````````#%@
&#``````````@@@``````````#&
@#````@@@@@@@@@@@@@@@@@````#@
@%@``@@@@@@@@@@@@@@@@@@@``@%@
@%@```@@@@@@@@@@@@@@@@@```#%@
@@# `````````@@@``````````#@@
&#``````````@@@``````````#&
@##`````````@`````````##@
@##```````@``````###@
@@#````@````#@@
@@@%%%%%@@@
"""
def start(banner: str, delay=0.001):
"""
Parameters:
banner
delay=0.2
"""
# import random
from time import sleep
from rich import print as rprint
for line in banner.split("\n"):
for character in line:
if character in ["#", "@", "%", "&"]:
rprint(f"[yellow]{character}", end="", flush=True)
else:
rprint(f"[bright_red]{character}", end="", flush=True)
print()
class Notify:
"A helper class for notifications of Sagemode process"
@staticmethod
def start(username: str, number_of_sites) -> str:
start(ascii_art, delay=0.1)
if username or sites is not None:
return f"[yellow][[bright_red]*[yellow][yellow]] [bright_blue]Searching {number_of_sites} sites for target: [bright_yellow]{username}"
# notify the user how many sites the username has been found
@staticmethod
def positive_res(username: str, count) -> str:
return f"\n[yellow][[bright_red]+[yellow]][bright_green] Found [bright_red]{username} [bright_green]on [bright_magenta]{count}[bright_green] sites"
# notify the user where the result is stored
@staticmethod
def stored_result(result_file: str) -> str:
return f"[bright_green][[yellow]@[bright_green]] [orange3]Results stored in: [bright_green]{result_file}\n"
@staticmethod
def not_found(site: str, status_code="") -> str:
if status_code:
return f"[black][[red]-[black]] [blue]{site}: [yellow]Not Found! {status_code}"
return f"[black][[red]-[black]] [blue]{site}: [yellow]Not Found!"
@staticmethod
def found(site: str, url: str) -> str:
return f"[red][[green]+[red]] [green]{site}: [blue]{url}"
@staticmethod
def update(local_version: str, remote_version: str) -> str:
return (
"[red][[bright_red]![red]] [yellow]Update Available!\n[/yellow]"
+ f"[red][[yellow]![red]] [bright_yellow]You are running Version: [bright_green]{local_version}\n"
+ f"[red][[/red][yellow]![red]][bright_yellow] New Version Available: [bright_green]{remote_version}"
)
@staticmethod
def update_error(error: str) -> str:
return f"[bright_red][[bright_red]![bright_red]] [bright_yellow]A problem occured while checking for an update: [bright_red]{error}"
@staticmethod
def version(version: str) -> str:
return f"[bright_yellow]Sagemode [bright_red]{version}"
def exception(site, error):
return f"[black][[red]![black]] [blue]{site}: [bright_red]{error}..."
if __name__ == "__main__":
start(ascii_art)