acecalisto3 commited on
Commit
2713a9a
·
verified ·
1 Parent(s): 2328bdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -42,13 +42,15 @@ class URLProcessor:
42
  })
43
 
44
  def validate_url(self, url: str) -> bool:
45
- """Validate URL format and accessibility"""
46
- try:
47
- result = urlparse(url)
48
- return all([result.scheme, result.netloc]) and validators.url(url)
49
- except Exception as e:
50
- logger.warning(f"Invalid URL format: {url} - {str(e)}")
51
- return False
 
 
52
 
53
  def fetch_content(self, url: str) -> Optional[str]:
54
  """Fetch content from URL with retry mechanism"""
 
42
  })
43
 
44
  def validate_url(self, url: str) -> bool:
45
+ """Validate URL format and accessibility"""
46
+ try:
47
+ result = urlparse(url)
48
+ is_valid = all([result.scheme, result.netloc]) and validators.url(url)
49
+ logger.info(f"Validating URL: {url} - Result: {is_valid}")
50
+ return is_valid
51
+ except Exception as e:
52
+ logger.warning(f"Invalid URL format: {url} - {str(e)}")
53
+ return False
54
 
55
  def fetch_content(self, url: str) -> Optional[str]:
56
  """Fetch content from URL with retry mechanism"""