mirror of
https://github.com/sherlock-project/sherlock
synced 2024-11-22 20:03:03 +00:00
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
This commit is contained in:
parent
0f51e01686
commit
73989aaf5f
1 changed files with 8 additions and 11 deletions
|
@ -118,22 +118,19 @@ class SitesInformation():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if data_file_path is None:
|
if data_file_path is None:
|
||||||
#Use internal default.
|
# The default data file is the live data.json which is in the GitHub repo. The reason why we are using
|
||||||
data_file_path = \
|
# this instead of the local one is so that the user has the most up to date data. This prevents
|
||||||
os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
# users from creating issue about false positives which has already been fixed or having outdated data
|
||||||
"resources/data.json"
|
data_file_path = "https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock/resources/data.json"
|
||||||
)
|
|
||||||
|
|
||||||
#Ensure that specified data file has correct extension.
|
# Ensure that specified data file has correct extension.
|
||||||
if ".json" != data_file_path[-5:].lower():
|
if not data_file_path.lower().endswith(".json"):
|
||||||
raise FileNotFoundError(f"Incorrect JSON file extension for "
|
raise FileNotFoundError(f"Incorrect JSON file extension for "
|
||||||
f"data file '{data_file_path}'."
|
f"data file '{data_file_path}'."
|
||||||
)
|
)
|
||||||
|
|
||||||
if ( ("http://" == data_file_path[:7].lower()) or
|
if "http://" == data_file_path[:7].lower() or "https://" == data_file_path[:8].lower():
|
||||||
("https://" == data_file_path[:8].lower())
|
# Reference is to a URL.
|
||||||
):
|
|
||||||
#Reference is to a URL.
|
|
||||||
try:
|
try:
|
||||||
response = requests.get(url=data_file_path)
|
response = requests.get(url=data_file_path)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
|
|
Loading…
Reference in a new issue