mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 22:44:21 +01:00
chore: Remove functions that had been removed on the master branch recently
This commit is contained in:
@@ -21,28 +21,12 @@ def sanitize_url(url):
|
|||||||
return urljoin(url, urlparse(url).path)
|
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
|
# Define and check for local file address prefixes
|
||||||
def check_local_file_access(url):
|
def check_local_file_access(url):
|
||||||
local_prefixes = ['file:///', 'file://localhost', 'http://localhost', 'https://localhost']
|
local_prefixes = ['file:///', 'file://localhost', 'http://localhost', 'https://localhost']
|
||||||
return any(url.startswith(prefix) for prefix in local_prefixes)
|
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):
|
def get_response(url, headers=cfg.user_agent_header, timeout=10):
|
||||||
try:
|
try:
|
||||||
# Restrict access to local files
|
# Restrict access to local files
|
||||||
|
|||||||
Reference in New Issue
Block a user