Skip to content

Commit 03c71b5

Browse files
authored
Merge pull request #1 from riodevnet/improvemnt-cli
feat: add banner & input when urls it empty
2 parents fa53b90 + 9978f6d commit 03c71b5

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

pyhttrack.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ def install_wget():
5050
print("Automatic installation only supported on Linux.")
5151
return None
5252

53+
def print_banner ():
54+
print(f"""
55+
{Fore.RED}
56+
:::==== ::: === ::: === :::==== :::==== :::==== :::==== :::===== ::: ===
57+
::: === ::: === ::: === :::==== :::==== ::: === ::: === ::: ::: ===
58+
======= ===== ======== === === ======= ======== === ====== {Fore.WHITE}
59+
=== === === === === === === === === === === === ===
60+
=== === === === === === === === === === ======= === ===
61+
62+
{Style.RESET_ALL}
63+
""")
64+
65+
5366
if wget_path and os.path.isfile(wget_path):
5467
wget_exec = wget_path
5568
elif shutil.which("wget"):
@@ -63,14 +76,21 @@ def install_wget():
6376
os.system('cls' if os.name == 'nt' else 'clear')
6477

6578
results = []
79+
urls = []
80+
6681
os.makedirs("web", exist_ok=True)
6782

6883
try:
6984
with open('web.json', 'r') as file:
7085
urls = json.load(file)
7186
except FileNotFoundError:
7287
print("File 'web.json' not found.")
73-
sys.exit(1)
88+
89+
print_banner()
90+
91+
if not urls:
92+
print("No URLs found in 'web.json'.")
93+
urls.append(input("Enter URL: "))
7494

7595
print(f"\nTotal URL : {len(urls)}")
7696
print("==================\n")

0 commit comments

Comments
 (0)