Skip to content

Commit 5997af2

Browse files
authored
Merge pull request #273 from shredzwho/fix/netflix-loud-module
fix: refine Netflix module logic and add to LOUD_MODULES
2 parents 38c3b1a + 6447aeb commit 5997af2

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

user_scanner/core/helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"email": [
1818
"leetcode",
1919
"instagram",
20+
"netflix",
2021
"sexvid",
2122
"made_porn",
2223
"flirtbate",

user_scanner/email_scan/entertainment/netflix.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ async def _check(email: str) -> Result:
66
show_url = "https://netflix.com"
77
headers = {
88
'User-Agent': "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Mobile Safari/537.36",
9-
'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
9+
'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
1010
'Accept-Language': "en-US,en;q=0.9",
1111
'Origin': "https://www.netflix.com",
1212
'Referer': "https://www.netflix.com/",
1313
}
1414

1515
try:
16-
async with httpx.AsyncClient(timeout=5.0, follow_redirects=True) as client:
17-
await client.get("https://www.netflix.com/in/", headers=headers)
16+
async with httpx.AsyncClient(timeout=10.0, follow_redirects=True) as client:
17+
await client.get("https://www.netflix.com/", headers=headers)
1818

1919
flwssn = client.cookies.get("flwssn")
2020
if not flwssn:
@@ -33,7 +33,7 @@ async def _check(email: str) -> Result:
3333
"operationName": "CLCSWebInitSignup",
3434
"variables": {
3535
"inputUserJourneyNode": "WELCOME",
36-
"locale": "en-IN",
36+
"locale": "en-US",
3737
"inputFields": [
3838
{"name": "flwssn", "value": {"stringValue": flwssn}},
3939
{"name": "email", "value": {"stringValue": email}}
@@ -52,13 +52,16 @@ async def _check(email: str) -> Result:
5252
if response.status_code == 200:
5353
resp_text = response.text
5454

55-
if "sign-up link to" in resp_text:
55+
if "Welcome back!" in resp_text:
56+
return Result.taken(url=show_url)
57+
58+
if "sign-up link" in resp_text or "create your account" in resp_text:
5659
return Result.available(url=show_url)
5760

58-
elif "Welcome back!" in resp_text:
59-
return Result.taken(url=show_url)
60-
else:
61-
return Result.error("Unexpected response, Try an India-based VPN or report it via GitHub issues")
61+
if '"errors"' in resp_text:
62+
return Result.error("GraphQL error, report it via GitHub issues")
63+
64+
return Result.error("Unexpected response from Netflix")
6265

6366
return Result.error(f"HTTP {response.status_code}")
6467

0 commit comments

Comments
 (0)