|
| 1 | +import httpx |
| 2 | +import json |
| 3 | +from user_scanner.core.result import Result |
| 4 | + |
| 5 | +async def _check(email: str) -> Result: |
| 6 | + url = "https://lovescape.com/api/front/auth/signup" |
| 7 | + show_url = "https://lovescape.com" |
| 8 | + |
| 9 | + payload = { |
| 10 | + "username": "W3ak3n3dCut3n3ss3674", |
| 11 | + "email": email, |
| 12 | + "password": "igy8868yiyy", |
| 13 | + "recaptcha": "", |
| 14 | + "fingerprint": "", |
| 15 | + "modelName": "", |
| 16 | + "isPwa": False, |
| 17 | + "affiliateId": "", |
| 18 | + "trafficSource": "", |
| 19 | + "isUnThrottled": False, |
| 20 | + "hasActionParam": False, |
| 21 | + "source": "page_signup", |
| 22 | + "device": "mobile", |
| 23 | + "deviceName": "Android Mobile", |
| 24 | + "browser": "Chrome", |
| 25 | + "os": "Android", |
| 26 | + "locale": "en", |
| 27 | + "authType": "native", |
| 28 | + "ampl": { |
| 29 | + "ep": { |
| 30 | + "source": "page_signup", |
| 31 | + "startSessionUrl": "/create-ai-sex-girlfriend/style", |
| 32 | + "firstVisitedUrl": "/create-ai-sex-girlfriend/style", |
| 33 | + "referrerHost": "hakurei.us-cdnbo.org", |
| 34 | + "referrerId": "us-cdnbo", |
| 35 | + "signupUrl": "/signup", |
| 36 | + "page": "signup", |
| 37 | + "project": "Lovescape", |
| 38 | + "isCookieAccepted": True, |
| 39 | + "displayMode": "browser" |
| 40 | + }, |
| 41 | + "up": { |
| 42 | + "source": "page_signup", |
| 43 | + "startSessionUrl": "/create-ai-sex-girlfriend/style", |
| 44 | + "firstVisitedUrl": "/create-ai-sex-girlfriend/style", |
| 45 | + "referrerHost": "hakurei.us-cdnbo.org", |
| 46 | + "referrerId": "us-cdnbo", |
| 47 | + "signupUrl": "/signup" |
| 48 | + }, |
| 49 | + "device_id": "", |
| 50 | + "session_id": 1774884558258 |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + headers = { |
| 55 | + 'User-Agent': "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Mobile Safari/537.36", |
| 56 | + 'Accept': "application/json", |
| 57 | + 'Accept-Encoding': "identity", |
| 58 | + 'Content-Type': "text/plain;charset=UTF-8", |
| 59 | + 'sec-ch-ua-platform': '"Android"', |
| 60 | + 'sec-ch-ua': '"Chromium";v="146", "Not-A.Brand";v="24", "Google Chrome";v="146"', |
| 61 | + 'sec-ch-ua-mobile': "?1", |
| 62 | + 'Origin': "https://lovescape.com", |
| 63 | + 'Referer': "https://lovescape.com/signup", |
| 64 | + 'Priority': "u=1, i" |
| 65 | + } |
| 66 | + |
| 67 | + try: |
| 68 | + async with httpx.AsyncClient(timeout=7.0) as client: |
| 69 | + response = await client.post(url, content=json.dumps(payload), headers=headers) |
| 70 | + |
| 71 | + if response.status_code == 403: |
| 72 | + return Result.error("403") |
| 73 | + |
| 74 | + data = response.json() |
| 75 | + error_msg = data.get("error", "") |
| 76 | + |
| 77 | + if "Email is already used" in error_msg: |
| 78 | + return Result.taken(url=show_url) |
| 79 | + |
| 80 | + if "recaptcha is required" in error_msg: |
| 81 | + return Result.available(url=show_url) |
| 82 | + |
| 83 | + return Result.error(f"Unexpected: {error_msg}") |
| 84 | + |
| 85 | + except Exception as e: |
| 86 | + return Result.error(e) |
| 87 | + |
| 88 | +async def validate_lovescape(email: str) -> Result: |
| 89 | + return await _check(email) |
0 commit comments