@@ -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