(self, p, profile="generic", locale="en-US")
| 14452 | return False |
| 14453 | |
| 14454 | def _social_create_context(self, p, profile="generic", locale="en-US"): |
| 14455 | user_agents = [ |
| 14456 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36", |
| 14457 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.2420.81", |
| 14458 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0", |
| 14459 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" |
| 14460 | ] |
| 14461 | browser = p.chromium.launch( |
| 14462 | headless=True, |
| 14463 | args=[ |
| 14464 | "--log-level=3", |
| 14465 | "--disable-blink-features=AutomationControlled", |
| 14466 | "--no-first-run", |
| 14467 | "--disable-dev-shm-usage" |
| 14468 | ] |
| 14469 | ) |
| 14470 | context = browser.new_context( |
| 14471 | user_agent=random.choice(user_agents), |
| 14472 | viewport={"width": random.choice([1280, 1366, 1440]), "height": random.choice([1700, 1024, 1200])}, |
| 14473 | locale=locale, |
| 14474 | timezone_id="Europe/Rome" if locale == "it-IT" else "UTC", |
| 14475 | color_scheme="light", |
| 14476 | reduced_motion="reduce" if profile == "aggressive" else "no-preference" |
| 14477 | ) |
| 14478 | context.set_extra_http_headers({ |
| 14479 | "Accept-Language": "en-US,en;q=0.9,it;q=0.8", |
| 14480 | "Sec-Fetch-Dest": "document", |
| 14481 | "Sec-Fetch-Mode": "navigate", |
| 14482 | "Sec-Fetch-Site": "none", |
| 14483 | "Sec-Fetch-User": "?1", |
| 14484 | "Upgrade-Insecure-Requests": "1", |
| 14485 | }) |
| 14486 | return browser, context |
| 14487 | |
| 14488 | def analyze_social_onlyfans(self, username, base): |
| 14489 | return self._analyze_social_onlyfans_v2(username, base) |
no outgoing calls
no test coverage detected