chore: Remove functions that had been removed on the master branch recently

This commit is contained in:
Drikus Roor
2023-04-13 10:56:02 +02:00
parent d1ea6cf002
commit 62edc148a8

View File

@@ -21,28 +21,12 @@ def sanitize_url(url):
return urljoin(url, urlparse(url).path)
# Function to make a request with a specified timeout and handle exceptions
def make_request(url, timeout=10):
try:
response = requests.get(url, headers=cfg.user_agent_header, timeout=timeout)
response.raise_for_status()
return response
except requests.exceptions.RequestException as e:
return "Error: " + str(e)
# Define and check for local file address prefixes
def check_local_file_access(url):
local_prefixes = ['file:///', 'file://localhost', 'http://localhost', 'https://localhost']
return any(url.startswith(prefix) for prefix in local_prefixes)
def scrape_text(url):
"""Scrape text from a webpage"""
# Basic check if the URL is valid
if not url.startswith('http'):
return "Error: Invalid URL"
def get_response(url, headers=cfg.user_agent_header, timeout=10):
try:
# Restrict access to local files