From 73989aaf5f2adb0adbb1f638812b19bce926c412 Mon Sep 17 00:00:00 2001 From: Siddharth Dushantha Date: Fri, 7 Aug 2020 18:38:19 +0200 Subject: [PATCH] Sherlock will from now on not use the local data.json It will now use the data that is in the GitHub repo instead. The reason why we are using this instead of the local one is so that the user has the most up to date data. This prevents users from creating issue about false positives which has already been fixed or having outdated data --- sherlock/sites.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sherlock/sites.py b/sherlock/sites.py index 25ea0093..20e1e1af 100644 --- a/sherlock/sites.py +++ b/sherlock/sites.py @@ -118,22 +118,19 @@ class SitesInformation(): """ if data_file_path is None: - #Use internal default. - data_file_path = \ - os.path.join(os.path.dirname(os.path.realpath(__file__)), - "resources/data.json" - ) - - #Ensure that specified data file has correct extension. - if ".json" != data_file_path[-5:].lower(): + # The default data file is the live data.json which is in the GitHub repo. The reason why we are using + # this instead of the local one is so that the user has the most up to date data. This prevents + # users from creating issue about false positives which has already been fixed or having outdated data + data_file_path = "https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock/resources/data.json" + + # Ensure that specified data file has correct extension. + if not data_file_path.lower().endswith(".json"): raise FileNotFoundError(f"Incorrect JSON file extension for " f"data file '{data_file_path}'." ) - if ( ("http://" == data_file_path[:7].lower()) or - ("https://" == data_file_path[:8].lower()) - ): - #Reference is to a URL. + if "http://" == data_file_path[:7].lower() or "https://" == data_file_path[:8].lower(): + # Reference is to a URL. try: response = requests.get(url=data_file_path) except Exception as error: