def createaccount(self):
     # Account creation payload
     payload = {
         "email": self.email,
         "password": self.password,
         "username": self.username,
         "first_name": self.name,
         "client_id": "W6mHTAAEAAHsVu2N0wGEChTQpTfn",
         "seamless_login_enabled": "1",
         "gdpr_s": "%5B0%2C2%2C0%2Cnull%5D",
         "tos_version": "eu",
         "opt_into_one_tap": "false",
     }
     if self.use_local_ip_address is True:
         request = requests.post(self.url,
                                 data=payload,
                                 headers=self.headers)
     else:
         try:
             request = requests.post(self.url,
                                     data=payload,
                                     proxies=self.sockets.pop(0))
         except requests.exceptions.ProxyError:
             print("Proxy fail, retrying with new one...")
             self.createaccount()
     try:
         response = json.loads(request.text)
     except ValueError:
         print("JSON invalid, retrying... Status code was {}".format(
             request.status_code))
         self.createaccount()
     if not "account_created" in response:
         print("Ratelimited. Retrying in 5...")
         sleep(5)
         self.createaccount()
     if response["account_created"] is False:
         if not response["errors"]:
             print("Failed, Instagram pretends account exists.")
         elif response["errors"].get("password"):
             print(response["errors"]["password"][0])
             quit()
         elif response["errors"].get("ip"):
             print(response["errors"]["ip"][0])
         self.createaccount()
     else:
         store(payload)
Ejemplo n.º 2
0
    def createaccount(self, proxy=None):
        chrome_options = webdriver.ChromeOptions()
        if proxy != None:
            chrome_options.add_argument('--proxy-server=%s' % proxy)

        driver = webdriver.Chrome(chrome_options=chrome_options)
        driver.get(self.url)
        sleep(5)
        name = accnt.username()
        # username

        # fill the email value
        email_field = driver.find_element_by_name('emailOrPhone')
        email_field.send_keys(accnt.genEmail())

        # fill the fullname value
        fullname_field = driver.find_element_by_name('fullName')
        fullname_field.send_keys(accnt.genName())

        # fill username value
        username_field = driver.find_element_by_name('username')
        username_field.send_keys(name)

        # fill password value
        password_field = driver.find_element_by_name('password')
        passW = accnt.generatePassword()
        password_field.send_keys(passW)

        submit = driver.find_element_by_xpath(
            '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[7]/div/button')
        submit.click()

        print('Registering....')
        store(name)

        sleep(4)
        driver.close()
Ejemplo n.º 3
0
    def createaccount(self, proxy=None):
        chrome_options = webdriver.ChromeOptions()
        if proxy != None:
            chrome_options.add_argument('--proxy-server=%s' % proxy)

        # chrome_options.add_argument('headless')
        # ua = UserAgent()
        # user_agent = ua.random
        chrome_options.add_argument('--user-agent="Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 640 XL LTE) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Edge/12.10166"')
        # chrome_options.add_argument("--incognito")
        chrome_options.add_argument('window-size=1200x600')
        driver = webdriver.Chrome(chrome_options=chrome_options)
        print('Opening Browser')
        driver.get(self.url)

        print('Browser Opened')
        sleep(5)




        action_chains = ActionChains(driver)
        sleep(5)
        account_info = accnt.new_account()

        # fill the email value
        print('Filling email field')
        email_field = driver.find_element_by_name('emailOrPhone')
        print(email_field)
        sleep(1)
        action_chains.move_to_element(email_field)
        print(account_info["email"])
        email_field.send_keys(str(account_info["email"]))

        sleep(2)

        # fill the fullname value
        print('Filling fullname field')
        fullname_field = driver.find_element_by_name('fullName')
        action_chains.move_to_element(fullname_field)
        fullname_field.send_keys(account_info["name"])

        sleep(2)

        # fill username value
        print('Filling username field')
        username_field = driver.find_element_by_name('username')
        action_chains.move_to_element(username_field)
        username_field.send_keys(account_info["username"])

        sleep(2)

        # fill password value
        print('Filling password field')
        password_field = driver.find_element_by_name('password')
        action_chains.move_to_element(password_field)
        passW = account_info["password"]
        print(passW)
        password_field.send_keys(str(passW))
        sleep(1)

        sleep(2)

        submit = driver.find_element_by_xpath(
            '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[7]/div/button')

        action_chains.move_to_element(submit)

        sleep(2)
        submit.click()

        sleep(3)
        try:

            age_button = driver.find_element_by_xpath( "//input[@name='ageRadio' and @value='above_18']")
            age_button.click()


            sleep(2)
            next_button = driver.find_elements_by_xpath('//button[text()="Next"]')[1]
            next_button.click()

        except Exception as e :
            pass


        sleep(4)
        # After the first fill save the account account_info
        store(account_info)

        # Activate the account
        confirm_url = get_activation_url(account_info['email'])
        logging.info("The confirm url is {}".format(confirm_url))
        driver.get(confirm_url)

        driver.close()
Ejemplo n.º 4
0
    def createaccount(self, proxy=None):
        chrome_options = webdriver.ChromeOptions()
        if proxy != None:
            chrome_options.add_argument('--proxy-server=%s' % proxy)

        # chrome_options.add_argument('headless')
        ua = UserAgent()
        user_agent = ua.random
        # user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36'
        chrome_options.add_argument('--user-agent="%s"' % user_agent)
        chrome_options.add_argument("--incognito")
        chrome_options.add_argument('window-size=1200x600')
        chrome_options.add_argument('--no-sandbox')
        driver = webdriver.Chrome(chrome_options=chrome_options, executable_path=config.Config['chromedriver_path'])
        print('Opening Browser')
        driver.get(self.url)

        print('Browser Opened')
        sleep(5)




        action_chains = ActionChains(driver)
        sleep(5)
        account_info = accnt.new_account()

        # fill the email value
        print('Filling email field')
        email_field = driver.find_element_by_name('emailOrPhone')
        print(email_field)
        sleep(1)
        action_chains.move_to_element(email_field)
        print(account_info["email"])
        email_field.send_keys(str(account_info["email"]))

        sleep(2)

        # fill the fullname value
        print('Filling fullname field')
        fullname_field = driver.find_element_by_name('fullName')
        action_chains.move_to_element(fullname_field)
        fullname_field.send_keys(account_info["name"])

        sleep(2)

        # fill username value
        print('Filling username field')
        username_field = driver.find_element_by_name('username')
        action_chains.move_to_element(username_field)
        username_field.send_keys(account_info["username"])

        sleep(2)

        # fill password value
        print('Filling password field')
        password_field = driver.find_element_by_name('password')
        action_chains.move_to_element(password_field)
        passW = account_info["password"]
        print(passW)
        password_field.send_keys(str(passW))
        sleep(1)

        sleep(2)

        submit = driver.find_element_by_xpath(
            '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[7]/div/button')

        action_chains.move_to_element(submit)

        sleep(2)
        submit.click()

        sleep(3)
        try:

            age_button = driver.find_element_by_xpath( "//input[@name='ageRadio' and @value='above_18']")
            age_button.click()


            sleep(2)
            next_button = driver.find_elements_by_xpath('//button[text()="Next"]')[1]
            next_button.click()

        except Exception as e :
            pass


        sleep(4)

        search_button = driver.find_element_by_xpath('//input[@placeholder="Search"]')
        action_chains.move_to_element(search_button)
        search_button.send_keys('letsbefity')

        # After the first fill save the account account_info
        store(account_info)
        
        """
            Currently buggy code.
        """
        # Activate the account
        # confirm_url = get_activation_url(account_info['email'])
        # logging.info("The confirm url is {}".format(confirm_url))
        # driver.get(confirm_url)

        driver.close()
Ejemplo n.º 5
0
    def createaccount(self, proxy=None):
        chrome_options = webdriver.ChromeOptions()
        if proxy != None:
            chrome_options.add_argument('--proxy-server=%s' % proxy)

        # chrome_options.add_argument('headless')
        # ua = UserAgent()
        # user_agent = ua.random
        chrome_options.add_argument(
            '--user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36"'
        )
        # chrome_options.add_argument("--incognito")
        chrome_options.add_argument('window-size=1200x600')
        driver = webdriver.Chrome(
            chrome_options=chrome_options,
            executable_path=config.Config['chromedriver_path'])
        print('Opening Browser')
        driver.get(self.url)

        print('Browser Opened')
        sleep(5)

        action_chains = ActionChains(driver)
        sleep(5)
        account_info = accnt.new_account()

        # fill the email value
        print('Filling email field')
        email_field = driver.find_element_by_name('emailOrPhone')
        print(email_field)
        sleep(1)
        action_chains.move_to_element(email_field)
        print(account_info["email"])
        email_field.send_keys(str(account_info["email"]))

        sleep(2)

        # fill the fullname value
        print('Filling fullname field')
        fullname_field = driver.find_element_by_name('fullName')
        action_chains.move_to_element(fullname_field)
        fullname_field.send_keys(account_info["name"])

        sleep(2)

        # fill username value
        print('Filling username field')
        username_field = driver.find_element_by_name('username')
        action_chains.move_to_element(username_field)
        username_field.send_keys(account_info["username"])

        sleep(2)

        # fill password value
        print('Filling password field')
        password_field = driver.find_element_by_name('password')
        action_chains.move_to_element(password_field)
        passW = account_info["password"]
        print(passW)
        password_field.send_keys(str(passW))
        sleep(1)

        sleep(2)

        submit = driver.find_element_by_xpath(
            '//*[@id="react-root"]/section/main/div/div/div[1]/div/form/div[7]/div/button'
        )

        action_chains.move_to_element(submit)

        sleep(2)
        submit.click()

        sleep(3)
        try:

            month_button = driver.find_element_by_xpath(
                '//*[@id="react-root"]/section/main/div/div/div[1]/div/div[4]/div/div/span/span[1]/select'
            )
            month_button.click()
            month_button.send_keys(account_info["birthday"].split(" ")[0])
            sleep(1)
            day_button = driver.find_element_by_xpath(
                '//*[@id="react-root"]/section/main/div/div/div[1]/div/div[4]/div/div/span/span[2]/select'
            )
            day_button.click()
            day_button.send_keys(account_info["birthday"].split[" "][1][:-1])
            sleep(1)
            year_button = driver.find_element_by_xpath(
                '//*[@id="react-root"]/section/main/div/div/div[1]/div/div[4]/div/div/span/span[3]/select'
            )
            year_button.click()
            year_button.send_keys(account_info["birthday"].split[" "][2])

            sleep(2)
            next_button = driver.find_elements_by_xpath(
                '//*[@id="react-root"]/section/main/div/div/div[1]/div/div[6]/button'
            )
            next_button.click()

        except Exception as e:
            pass

        sleep(4)
        # After the first fill save the account account_info
        store(account_info)
        """
            Currently buggy code.
        """
        # Activate the account
        # confirm_url = get_activation_url(account_info['email'])
        # logging.info("The confirm url is {}".format(confirm_url))
        # driver.get(confirm_url)

        driver.close()
    def createaccount(self, proxy=None):
        chrome_options = webdriver.ChromeOptions()
        if proxy != None:
            chrome_options.add_argument('--proxy-server=%s' % proxy)

        chrome_options.add_argument('headless')
        chrome_options.add_argument('window-size=1200x600')
        driver = webdriver.Chrome(chrome_options=chrome_options)
        print('Opening Browser')
        driver.get(self.url)

        print('Browser Opened')
        sleep(5)

        print('Generating username')
        name = accnt.username()
        print('username Generated')
        # username

        action_chains = ActionChains(driver)
        sleep(5)
        # username
        account_info = accnt.new_account()

        # fill the email value
        print('Filling email field')
        email_field = driver.find_element_by_name('emailOrPhone')

        email_field.send_keys(accnt.genEmail())
        sleep(1)

        action_chains.move_to_element(email_field)
        email_field.send_keys(account_info["email"])

        sleep(2)

        # fill the fullname value
        print('Filling fullname field')
        fullname_field = driver.find_element_by_name('fullName')
        action_chains.move_to_element(fullname_field)
        fullname_field.send_keys(account_info["name"])

        sleep(2)

        # fill username value
        print('Filling username field')
        username_field = driver.find_element_by_name('username')
        action_chains.move_to_element(username_field)
        username_field.send_keys(account_info["username"])

        sleep(2)

        # fill password value
        print('Filling password field')
        password_field = driver.find_element_by_name('password')
        action_chains.move_to_element(password_field)
        passW = account_info["password"]
        password_field.send_keys(passW)
        sleep(1)

        sleep(2)

        submit = driver.find_element_by_xpath(
            '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[7]/div/button'
        )

        action_chains.move_to_element(submit)

        sleep(2)
        submit.click()

        sleep(3)

        age_button = driver.find_element_by_xpath(
            "//input[@name='ageRadio' and @value='above_18']")
        age_button.click()

        sleep(2)
        next_button = driver.find_elements_by_xpath(
            '//button[text()="Next"]')[1]
        next_button.click()

        sleep(4)
        # After the first fill save the account account_info
        store(account_info)

        # Activate the account
        confirm_url = get_activation_url(account_info['email'])
        logging.info("The confirm url is {}".format(confirm_url))
        driver.get(confirm_url)

        driver.close()