fix: Correct indentation errors in backend services
- Fix 2 indentation errors in domain_checker.py (lines 200, 205) - Fix 2 indentation errors in domain_health.py (lines 412, 436, 447) - Fix NameError in playwright_scraper.py when playwright not installed - Add fallback type definitions for Browser, BrowserContext, Page
This commit is contained in:
@ -197,12 +197,12 @@ class DomainChecker:
|
||||
# Expiration date - check multiple variations
|
||||
if not expiration_date:
|
||||
if any(x in action for x in ['expiration', 'expire']):
|
||||
expiration_date = self._parse_datetime(date_str)
|
||||
expiration_date = self._parse_datetime(date_str)
|
||||
|
||||
# Creation/registration date
|
||||
if not creation_date:
|
||||
if any(x in action for x in ['registration', 'created']):
|
||||
creation_date = self._parse_datetime(date_str)
|
||||
creation_date = self._parse_datetime(date_str)
|
||||
|
||||
# Update date
|
||||
if any(x in action for x in ['changed', 'update', 'last changed']):
|
||||
|
||||
@ -409,7 +409,7 @@ class DomainHealthChecker:
|
||||
result.has_ssl = True
|
||||
result.is_valid = True # Certificate exists and is technically valid, just can't verify chain locally
|
||||
except Exception:
|
||||
result.has_ssl = True
|
||||
result.has_ssl = True
|
||||
result.is_valid = False
|
||||
result.error = "Certificate exists but could not be parsed"
|
||||
return result
|
||||
@ -433,8 +433,8 @@ class DomainHealthChecker:
|
||||
for item in issuer:
|
||||
if isinstance(item, tuple) and len(item) > 0:
|
||||
if isinstance(item[0], tuple) and item[0][0] == 'organizationName':
|
||||
result.issuer = item[0][1]
|
||||
break
|
||||
result.issuer = item[0][1]
|
||||
break
|
||||
elif isinstance(item[0], str) and item[0] == 'organizationName':
|
||||
result.issuer = item[1] if len(item) > 1 else None
|
||||
break
|
||||
@ -444,8 +444,8 @@ class DomainHealthChecker:
|
||||
result.has_ssl = False
|
||||
result.error = "Port 443 not responding"
|
||||
else:
|
||||
result.has_ssl = False
|
||||
result.error = "no_ssl"
|
||||
result.has_ssl = False
|
||||
result.error = "no_ssl"
|
||||
except Exception as e:
|
||||
result.error = str(e)
|
||||
|
||||
|
||||
@ -42,6 +42,10 @@ try:
|
||||
except ImportError:
|
||||
PLAYWRIGHT_AVAILABLE = False
|
||||
Stealth = None
|
||||
# Define dummy types for type hints
|
||||
Browser = Any
|
||||
BrowserContext = Any
|
||||
Page = Any
|
||||
logger.warning("Playwright not installed. Stealth scraping disabled.")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user