From 7fa67eb13b973f78f5c6d871e9ac7d9d0b5dfa6d Mon Sep 17 00:00:00 2001 From: xhagrg Date: Tue, 28 May 2024 14:46:11 -0500 Subject: [PATCH] Use env variable for cache dir. --- pyQuARC/code/url_validator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyQuARC/code/url_validator.py b/pyQuARC/code/url_validator.py index ae886fb4..55a74e61 100644 --- a/pyQuARC/code/url_validator.py +++ b/pyQuARC/code/url_validator.py @@ -1,3 +1,4 @@ +import os import requests from urlextract import URLExtract @@ -54,7 +55,7 @@ def status_code_from_request(url): validity = True # extract URLs from text - extractor = URLExtract(cache_dir="/tmp") + extractor = URLExtract(cache_dir=os.environ.get("CACHE_DIR")) urls = extractor.find_urls(text_with_urls) urls.extend(UrlValidator._extract_http_texts(text_with_urls))