You can now disable creation of a txt file

This commit is contained in:
ntexe 2024-08-21 14:01:22 +03:00
parent 573ae6c488
commit 2cc854bd6b

View file

@ -716,6 +716,14 @@ def main():
help="Include checking of NSFW sites from default list.", help="Include checking of NSFW sites from default list.",
) )
parser.add_argument(
"--no-txt",
action="store_true",
dest="no_txt",
default=False,
help="Disable creation of a txt file",
)
args = parser.parse_args() args = parser.parse_args()
# If the user presses CTRL-C, exit gracefully without throwing errors # If the user presses CTRL-C, exit gracefully without throwing errors
@ -847,14 +855,15 @@ def main():
else: else:
result_file = f"{username}.txt" result_file = f"{username}.txt"
with open(result_file, "w", encoding="utf-8") as file: if not args.no_txt:
exists_counter = 0 with open(result_file, "w", encoding="utf-8") as file:
for website_name in results: exists_counter = 0
dictionary = results[website_name] for website_name in results:
if dictionary.get("status").status == QueryStatus.CLAIMED: dictionary = results[website_name]
exists_counter += 1 if dictionary.get("status").status == QueryStatus.CLAIMED:
file.write(dictionary["url_user"] + "\n") exists_counter += 1
file.write(f"Total Websites Username Detected On : {exists_counter}\n") file.write(dictionary["url_user"] + "\n")
file.write(f"Total Websites Username Detected On : {exists_counter}\n")
if args.csv: if args.csv:
result_file = f"{username}.csv" result_file = f"{username}.csv"