Spaces:
Sleeping
Sleeping
Commit
·
719dfa7
1
Parent(s):
d51c3cd
adjustments to claim_verifier.py
Browse files
deploy/main/claim_verifier.py
CHANGED
|
@@ -30,9 +30,9 @@ class ClaimVerifier:
|
|
| 30 |
self.suspicious_domains = SUSPICIOUS_DOMAINS
|
| 31 |
self.domain_weights = {"trusted": 2.0, "suspicious": 0.3, "neutral": 1.0}
|
| 32 |
self.user_agents = [
|
| 33 |
-
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
| 34 |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
| 35 |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
|
|
|
| 36 |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0",
|
| 37 |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15",
|
| 38 |
"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1",
|
|
@@ -194,6 +194,7 @@ class ClaimVerifier:
|
|
| 194 |
def _get_user_agent(self) -> str:
|
| 195 |
ua = self.user_agents[self.current_ua_index]
|
| 196 |
self.current_ua_index = (self.current_ua_index + 1) % len(self.user_agents)
|
|
|
|
| 197 |
return ua
|
| 198 |
|
| 199 |
def _cache_key(self, text: str) -> str:
|
|
|
|
| 30 |
self.suspicious_domains = SUSPICIOUS_DOMAINS
|
| 31 |
self.domain_weights = {"trusted": 2.0, "suspicious": 0.3, "neutral": 1.0}
|
| 32 |
self.user_agents = [
|
|
|
|
| 33 |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
| 34 |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
| 35 |
+
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
| 36 |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0",
|
| 37 |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15",
|
| 38 |
"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1",
|
|
|
|
| 194 |
def _get_user_agent(self) -> str:
|
| 195 |
ua = self.user_agents[self.current_ua_index]
|
| 196 |
self.current_ua_index = (self.current_ua_index + 1) % len(self.user_agents)
|
| 197 |
+
print(f"Using User-Agent: {ua}")
|
| 198 |
return ua
|
| 199 |
|
| 200 |
def _cache_key(self, text: str) -> str:
|