def __init__( self, mailru, mailru_password, headless=False, memory_hogging_processes=["Fire", "Chrome", "chromedriver", "DrCleaner"], ): self.mailru = mailru self.mailru_password = mailru_password self.multi_logs = True self.logfolder = get_logfolder(self.mailru, self.multi_logs, Settings) self.get_mailrualive_logger() for mhp in memory_hogging_processes: check_kill_process(mhp, self.logger) self.page_delay = 25 self.use_firefox = headless self.headless_browser = headless self.disable_image_load = False self.browser_profile_path = None self.proxy_chrome_extension = None self.proxy_address = None self.proxy_address = None Settings.profile["name"] = self.mailru if not get_workspace(Settings): raise SocialPyError("Oh no! I don't have a workspace to work at :'(") get_database(Settings, make=True) self.set_selenium_local_session(Settings)
def __init__(self, fb_userid=None, fb_password=None, tags_to_check=[]): if fb_userid and fb_password: self.fb_userid = fb_userid self.fb_password = fb_password else: cli_args = parse_cli_args() self.fb_userid = cli_args.fb_userid self.fb_password = cli_args.fb_password self.multi_logs = True self.logfolder = get_logfolder(self.fb_userid, self.multi_logs, Settings) self.logger = self.get_ritetagpy_logger() # self.logfolder = HOME + '/RitetagPy/logs/' + self.fb_userid self.use_api = False # for mhp in memory_hogging_processes: # self.check_kill_process(mhp) self.browser = None # Initiated later self.page_delay = 25 self.use_firefox = False self.bypass_suspicious_attempt = False self.bypass_with_mobile = False self.disable_image_load = False self.browser_profile_path = None self.headless_browser = False self.proxy_chrome_extension = None self.proxy_username = None self.proxy_fb_password = None self.proxy_address = None self.proxy_port = None self.use_stored_metadata = False self.latest_term = None self.clsosing_line = "" self.launch = True self.tags_to_check = tags_to_check Settings.profile["name"] = self.fb_userid if not get_workspace(Settings): raise SocialPyError( "Oh no! I don't have a workspace to work at :'(") get_database(Settings, make=True) if self.use_api == False: self.set_selenium_local_session(Settings)
def get_logger(): logger = logging.getLogger('*****@*****.**') logger.setLevel(logging.DEBUG) logfolder = get_logfolder('*****@*****.**', False, Settings) file_handler = logging.FileHandler("{}general.log".format(logfolder)) file_handler.setLevel(logging.DEBUG) extra = {} logger_formatter = logging.Formatter( "%(levelname)s [%(asctime)s] [protonMailGenerator:] %(message)s", datefmt="%Y-%m-%d %H:%M:%S", ) file_handler.setFormatter(logger_formatter) logger.addHandler(file_handler) console_handler = logging.StreamHandler() console_handler.setLevel(logging.DEBUG) console_handler.setFormatter(logger_formatter) logger.addHandler(console_handler) logger = logging.LoggerAdapter(logger, extra) return logger
def __init__(self, username=None, password=None, userid=None, selenium_local_session=True, browser_profile_path=None, page_delay=25, show_logs=True, headless_browser=False, disable_image_load=False, multi_logs=True, use_firefox=False): cli_args = parse_cli_args() username = cli_args.username or username password = cli_args.password or password userid = cli_args.userid or userid page_delay = cli_args.page_delay or page_delay headless_browser = cli_args.headless_browser or headless_browser disable_image_load = cli_args.disable_image_load or disable_image_load self.browser = None self.headless_browser = headless_browser self.use_firefox = use_firefox self.selenium_local_session = selenium_local_session self.disable_image_load = disable_image_load self.username = username or os.environ.get('TWITTER_USER') self.password = password or os.environ.get('TWITTER_PW') self.email = username or os.environ.get('TWITTER_EMAIL') self.userid = userid Settings.profile["name"] = self.username self.browser_profile_path = browser_profile_path self.page_delay = page_delay self.followed = 0 self.followed_by = 0 self.following_num = 0 self.follow_times = 1 self.do_follow = False self.dont_include = set() self.white_list = set() self.user_interact_amount = 0 self.user_interact_media = None self.user_interact_percentage = 0 self.user_interact_random = False self.jumps = { "consequent": { "likes": 0, "comments": 0, "follows": 0, "unfollows": 0 }, "limit": { "likes": 7, "comments": 3, "follows": 5, "unfollows": 4 } } self.start_time = time.time() # assign logger self.show_logs = show_logs Settings.show_logs = show_logs or None self.multi_logs = multi_logs self.logfolder = get_logfolder(self.username, self.multi_logs, Settings) self.logger = self.get_mediumpy_logger(self.show_logs) if self.selenium_local_session is True: self.set_selenium_local_session(Settings)
def __init__(self, username=None, userid=None, password=None, nogui=False, selenium_local_session=True, use_firefox=False, browser_profile_path=None, page_delay=25, show_logs=True, headless_browser=False, proxy_address=None, proxy_chrome_extension=None, proxy_port=None, disable_image_load=False, bypass_suspicious_attempt=False, bypass_with_mobile=False, multi_logs=True): cli_args = parse_cli_args() username = cli_args.username or username userid = cli_args.userid or userid password = cli_args.password or password use_firefox = cli_args.use_firefox or use_firefox page_delay = cli_args.page_delay or page_delay headless_browser = cli_args.headless_browser or headless_browser proxy_address = cli_args.proxy_address or proxy_address proxy_port = cli_args.proxy_port or proxy_port disable_image_load = cli_args.disable_image_load or disable_image_load bypass_suspicious_attempt = ( cli_args.bypass_suspicious_attempt or bypass_suspicious_attempt) bypass_with_mobile = cli_args.bypass_with_mobile or bypass_with_mobile if not get_workspace(Settings): raise SocialPyError( "Oh no! I don't have a workspace to work at :'(") self.nogui = nogui if nogui: self.display = Display(visible=0, size=(800, 600)) self.display.start() self.browser = None self.headless_browser = headless_browser self.proxy_address = proxy_address self.proxy_port = proxy_port self.proxy_chrome_extension = proxy_chrome_extension self.selenium_local_session = selenium_local_session self.bypass_suspicious_attempt = bypass_suspicious_attempt self.bypass_with_mobile = bypass_with_mobile self.disable_image_load = disable_image_load self.username = username or os.environ.get('GITHUB_USER') self.password = password or os.environ.get('GITHUB_PW') self.userid = userid if not self.userid: self.userid = self.username.split('@')[0] Settings.profile["name"] = self.username self.page_delay = page_delay self.switch_language = True self.use_firefox = use_firefox Settings.use_firefox = self.use_firefox self.browser_profile_path = browser_profile_path self.do_comment = False self.comment_percentage = 0 self.comments = ['Cool!', 'Nice!', 'Looks good!'] self.photo_comments = [] self.video_comments = [] self.do_reply_to_comments = False self.reply_to_comments_percent = 0 self.comment_replies = [] self.photo_comment_replies = [] self.video_comment_replies = [] self.liked_img = 0 self.already_liked = 0 self.liked_comments = 0 self.commented = 0 self.replied_to_comments = 0 self.followed = 0 self.already_followed = 0 self.unfollowed = 0 self.followed_by = 0 self.following_num = 0 self.inap_img = 0 self.not_valid_users = 0 self.video_played = 0 self.already_Visited = 0 self.follow_times = 1 self.do_follow = False self.follow_percentage = 0 self.dont_include = set() self.white_list = set() self.blacklist = {'enabled': 'True', 'campaign': ''} self.automatedFollowedPool = {"all": [], "eligible": []} self.do_like = False self.like_percentage = 0 self.smart_hashtags = [] self.dont_like = ['sex', 'nsfw'] self.mandatory_words = [] self.ignore_if_contains = [] self.ignore_users = [] self.user_interact_amount = 0 self.user_interact_media = None self.user_interact_percentage = 0 self.user_interact_random = False self.dont_follow_inap_post = True self.use_clarifai = False self.clarifai_api_key = None self.clarifai_models = [] self.clarifai_workflow = [] self.clarifai_probability = 0.50 self.clarifai_img_tags = [] self.clarifai_img_tags_skip = [] self.clarifai_full_match = False self.clarifai_check_video = False self.clarifai_proxy = None self.potency_ratio = None # 1.3466 self.delimit_by_numbers = None self.max_followers = None # 90000 self.max_following = None # 66834 self.min_followers = None # 35 self.min_following = None # 27 self.delimit_liking = False self.liking_approved = True self.max_likes = 1000 self.min_likes = 0 self.delimit_commenting = False self.commenting_approved = True self.max_comments = 35 self.min_comments = 0 self.comments_mandatory_words = [] self.max_posts = None self.min_posts = None self.skip_business_categories = [] self.dont_skip_business_categories = [] self.skip_business = False self.skip_no_profile_pic = False self.skip_private = True self.skip_business_percentage = 100 self.skip_no_profile_pic_percentage = 100 self.skip_private_percentage = 100 self.relationship_data = { username: {"all_following": [], "all_followers": []}} self.simulation = {"enabled": True, "percentage": 100} self.mandatory_language = False self.mandatory_character = [] self.check_letters = {} # use this variable to terminate the nested loops after quotient # reaches self.quotient_breach = False # hold the consecutive jumps and set max of it used with QS to break # loops self.jumps = {"consequent": {"likes": 0, "comments": 0, "follows": 0, "unfollows": 0}, "limit": {"likes": 7, "comments": 3, "follows": 5, "unfollows": 4}} # stores the features' name which are being used by other features self.internal_usage = {} if ( self.proxy_address and self.proxy_port > 0) or \ self.proxy_chrome_extension: Settings.connection_type = "proxy" self.aborting = False self.start_time = time.time() # assign logger self.show_logs = show_logs Settings.show_logs = show_logs or None self.multi_logs = multi_logs self.logfolder = get_logfolder(self.username, self.multi_logs, Settings) self.logger = self.get_youtubepy_logger(self.show_logs) get_database(Settings, make=True) # IMPORTANT: think twice before relocating if self.selenium_local_session is True: self.set_selenium_local_session(Settings)
def __init__(self, username=None, userid=None, password=None, nogui=False, selenium_local_session=True, use_firefox=False, browser_profile_path=None, page_delay=25, show_logs=True, headless_browser=False, proxy_address=None, proxy_chrome_extension=None, proxy_port=None, disable_image_load=False, bypass_suspicious_attempt=False, bypass_with_mobile=False, multi_logs=True): cli_args = parse_cli_args() username = cli_args.username or username password = cli_args.password or password use_firefox = cli_args.use_firefox or use_firefox page_delay = cli_args.page_delay or page_delay headless_browser = cli_args.headless_browser or headless_browser proxy_address = cli_args.proxy_address or proxy_address proxy_port = cli_args.proxy_port or proxy_port disable_image_load = cli_args.disable_image_load or disable_image_load bypass_suspicious_attempt = (cli_args.bypass_suspicious_attempt or bypass_suspicious_attempt) bypass_with_mobile = cli_args.bypass_with_mobile or bypass_with_mobile if not get_workspace(Settings): raise SocialPyError( "Oh no! I don't have a workspace to work at :'(") self.nogui = nogui if nogui: self.display = Display(visible=0, size=(800, 600)) self.display.start() self.browser = None self.headless_browser = headless_browser self.proxy_address = proxy_address self.proxy_port = proxy_port self.proxy_chrome_extension = proxy_chrome_extension self.selenium_local_session = selenium_local_session self.bypass_suspicious_attempt = bypass_suspicious_attempt self.bypass_with_mobile = bypass_with_mobile self.disable_image_load = disable_image_load self.username = username or os.environ.get('LINKEDIN_USER') self.password = password or os.environ.get('LINKEDIN_PW') Settings.profile["name"] = self.username self.page_delay = page_delay self.switch_language = True self.use_firefox = use_firefox Settings.use_firefox = self.use_firefox self.browser_profile_path = browser_profile_path self.liked_img = 0 self.already_liked = 0 self.liked_comments = 0 self.commented = 0 self.replied_to_comments = 0 self.connected = 0 self.already_connected = 0 self.unconnected = 0 self.connected_by = 0 self.connecting_num = 0 self.inap_img = 0 self.not_valid_users = 0 self.connect_times = 1 self.start_time = time.time() # assign logger self.show_logs = show_logs Settings.show_logs = show_logs or None self.multi_logs = multi_logs self.logfolder = get_logfolder(self.username, self.multi_logs, Settings) self.logger = self.get_linkedinpy_logger(self.show_logs) get_database(Settings, make=True) # IMPORTANT: think twice before relocating if self.selenium_local_session is True: self.set_selenium_local_session(Settings)