diff --git a/sherlock_project/__init__.py b/sherlock_project/__init__.py index ad6c9e308f..1d12afdff5 100644 --- a/sherlock_project/__init__.py +++ b/sherlock_project/__init__.py @@ -9,7 +9,6 @@ import pathlib import tomli - def get_version() -> str: """Fetch the version number of the installed package.""" try: diff --git a/sherlock_project/sherlock.py b/sherlock_project/sherlock.py index a284f47ad5..0f582db092 100644 --- a/sherlock_project/sherlock.py +++ b/sherlock_project/sherlock.py @@ -884,6 +884,13 @@ def main(): ] ) if args.xlsx: + result_file = f"{username}.xlsx" + if args.folderoutput: + # The usernames results should be stored in a targeted folder. + # If the folder doesn't exist, create it first + os.makedirs(args.folderoutput, exist_ok=True) + result_file = os.path.join(args.folderoutput, result_file) + usernames = [] names = [] url_main = [] @@ -922,7 +929,7 @@ def main(): "response_time_s": response_time_s, } ) - DataFrame.to_excel(f"{username}.xlsx", sheet_name="sheet1", index=False) + DataFrame.to_excel(result_file, sheet_name="sheet1", index=False) print() query_notify.finish() diff --git a/sherlock_project/sites.py b/sherlock_project/sites.py index c42554bacc..91912521a3 100644 --- a/sherlock_project/sites.py +++ b/sherlock_project/sites.py @@ -56,7 +56,7 @@ def __init__(self, name, url_home, url_username_format, username_claimed, self.url_username_format = url_username_format self.username_claimed = username_claimed - self.username_unclaimed = secrets.token_urlsafe(32) + self.username_unclaimed = username_unclaimed self.information = information self.is_nsfw = is_nsfw