Use a more readable name for cache files
This commit is contained in:
parent
ea03f0cf75
commit
82178b4c6e
|
@ -29,7 +29,9 @@ async def main() -> None:
|
|||
start = perf_counter()
|
||||
|
||||
# Construct a unique file-name for each URL & ALLOWED_HOSTS_RE combination
|
||||
cache_file = CACHE_RESULTS_DIR / base64.b64encode((str(URL) + str(ALLOWED_HOSTS_RE)).encode("utf-8")).hex()
|
||||
readable_prefix = str(URL).removeprefix("https://").removeprefix("http://").replace("/", "_")
|
||||
unique_suffix = base64.b64encode((str(URL) + str(ALLOWED_HOSTS_RE)).encode("utf-8")).hex()
|
||||
cache_file = CACHE_RESULTS_DIR / (readable_prefix + "-" + unique_suffix + ".csv")
|
||||
|
||||
if cache_file.exists():
|
||||
print("> Using cached urlmap dataframe")
|
||||
|
|
Loading…
Reference in a new issue