Last active
September 30, 2020 22:17
-
-
Save m0pfin/55e87f78b779158b47d37f32cc8ed9d6 to your computer and use it in GitHub Desktop.
Python скрипт для массовой авторизации в ФБ (Подробнее: https://vk.com/bearded_cpa)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
from selenium.common.exceptions import TimeoutException | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support.ui import Select | |
import re | |
import time | |
import sys | |
with open('acc.txt', 'r') as f: | |
for line in f: | |
line = line.strip() | |
fb_login, fb_password, num_prof, num_browser = line.split(';') | |
print('Логин: %s, Пароль: %s, Номер профиля: %s Номер браузера: %s' % (fb_login, fb_password, num_prof, num_browser)) | |
profile_number = num_browser #номер браузера, который вы хотите запускать | |
user_profile_number = num_prof #номер профиля, который вы хотите запускать | |
# Вместо ENTER_NAME_MACOS ваш логин на MacOS | |
PROFILE_NUMBER_STRING = str(profile_number)+'/' | |
EXTENTION_DIR = '/Users/ENTER_NAME_MACOS/Library/Application Support/Aezakmi/core/' | |
USERDATA_DIR = '/Users/ENTER_NAME_MACOS/Library/Application Support/Aezakmi/Profiles/' | |
options = Options() | |
options.binary_location = '/Applications/Aezakmi/Aezakmi '+str(profile_number)+'.app/Contents/MacOS/Chromium' | |
options.add_argument('--disable-infobars') | |
options.add_argument('--load-extension=' + EXTENTION_DIR) | |
options.add_argument('--no-default-browser-check') | |
options.add_argument('--user-data-dir=' + USERDATA_DIR + PROFILE_NUMBER_STRING) | |
options.add_argument('account.aezakmi.run') | |
driver = webdriver.Chrome(options=options) | |
# Для включения смены IP по ссылке раскоментируйте три строки ниже (удалить # решетку) | |
# Ссылка для смены IP | |
# driver.get("http://192.168.0.1/recconnekt.php") | |
# element = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.TAG_NAME, "html"))) | |
# time.sleep(5) # Ждем пока перезагрузится роутер | |
# заходим на страницу плагина и вводим логин и пароль | |
driver.get("chrome-extension://fmklgidcemllamkndiefdhnkjgmommce/index.html#/auth") | |
time.sleep(3) | |
login = driver.find_element_by_id("login") | |
password = driver.find_element_by_id("password") | |
login.send_keys("YOUR_LOGIN") # Aezakmi login | |
password.send_keys("YOUR_PASS") # Aezakmi pass | |
driver.find_element_by_xpath("//*[@id=\"root\"]/div/form/div/button").click() | |
delay = 3 | |
try: | |
users_profiles = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.XPATH, '//*[@id="users-profiles"]/option[2]'))) | |
except TimeoutException: | |
print("Loading took too much time!") | |
# выбираем нужный профиль пользователя (по порядковому номеру) | |
select = Select(driver.find_element_by_id('users-profiles')) | |
select.select_by_index(user_profile_number) | |
start_profile = driver.find_elements_by_xpath("//*[contains(text(), 'Start')]") | |
start_profile[0].click() | |
time.sleep(7) | |
# переходим в гугл | |
driver.get('https://www.facebook.com/login') | |
login = driver.find_element_by_id("email") | |
password = driver.find_element_by_id("pass") | |
login.send_keys(fb_login) # Логин аккаунта ФБ | |
password.send_keys(fb_password) # Пасс аккаунта ФБ | |
driver.find_element_by_id("loginbutton").click() | |
# Ожидаем загрузки страницы после ввода логина и пароля | |
element = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.TAG_NAME, "html"))) | |
url = driver.current_url | |
#print(url) | |
# функция раскраски текста checkpoint | |
if re.search(r'\blogin\b', url): | |
print("\033[31m {}\033[0m" .format("Не залогинился")) | |
my_file = open('bad.txt', 'a+') | |
my_file.write(fb_login + ';' + fb_password + '\n') | |
my_file.close() | |
if re.search(r'\bcheckpoint\b', url): | |
print("\033[33m {}\033[0m" .format("Чекпоинт!")) | |
my_file = open('checkpoint.txt', 'a+') | |
my_file.write(fb_login + ';' + fb_password + '\n') | |
my_file.close() | |
if url == "https://www.facebook.com/": | |
print("\033[32m {}\033[0m" .format("Активный!")) | |
my_file = open('good.txt', 'a+') | |
my_file.write(fb_login + ';' + fb_password + '\n') | |
my_file.close() | |
time.sleep(7) | |
driver.get("chrome-extension://fmklgidcemllamkndiefdhnkjgmommce/index.html") | |
time.sleep(3) | |
driver.find_element_by_xpath("//*[@id=\"root\"]/div/div[2]/div[2]/button[2]").click() | |
driver.quit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment