From 944c4d51f6dacf929eee5fa28fa936d860473a15 Mon Sep 17 00:00:00 2001 From: David Wicker Date: Sat, 5 Dec 2020 13:21:38 +0100 Subject: [PATCH] v2.1.11 --- instaclient/classes/baseprofile.py | 10 ++++++++++ instaclient/client/instaclient.py | 2 -- setup.py | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/instaclient/classes/baseprofile.py b/instaclient/classes/baseprofile.py index 2f78120..6792eca 100644 --- a/instaclient/classes/baseprofile.py +++ b/instaclient/classes/baseprofile.py @@ -18,6 +18,16 @@ def __init__(self, id:str, viewer:str, username:str, name:str): def __repr__(self) -> str: return f'BaseProfile<{self.username}>' + def __eq__(self, o: object) -> bool: + if not isinstance(o, BaseProfile): + return False + try: + self_id = self.get_id() + o_id = o.get_id() + return self_id == o_id + except: + return self.username == o.username + def from_username(username:str): request = GraphUrls.GRAPH_USER.format(username) result = requests.get(request) diff --git a/instaclient/client/instaclient.py b/instaclient/client/instaclient.py index b79febf..68868c9 100644 --- a/instaclient/client/instaclient.py +++ b/instaclient/client/instaclient.py @@ -180,8 +180,6 @@ def login(self, username:str, password:str, check_user:bool=True, discard_driver self.__dismiss_cookies() # Get Form elements - if self.debug: - self.error_callback(self.driver) username_input = self.__find_element(EC.presence_of_element_located((By.XPATH,Paths.USERNAME_INPUT)), url=ClientUrls.LOGIN_URL) password_input = self.__find_element(EC.presence_of_element_located((By.XPATH,Paths.PASSWORD_INPUT)), url=ClientUrls.LOGIN_URL) self.logger.debug('INSTACLIENT: Found elements') diff --git a/setup.py b/setup.py index a77f745..a3750fb 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name = 'instaclient', # How you named your package folder (MyLib) packages = find_packages(exclude=['tests, drivers']), # Chose the same as "name" - version = '2.1.10', # Start with a small number and increase it with every change you make + version = '2.1.11', # Start with a small number and increase it with every change you make license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository description = 'Instagram client built with Python 3.8 and the Selenium package.', long_description=README, @@ -19,7 +19,7 @@ author = 'David Wicker', # Type in your name author_email = 'davidwickerhf@gmail.com', # Type in your E-Mail url = 'https://github.com/wickerdevs/py-instaclient', # Provide either the link to your github or to your website - download_url = 'https://github.com/wickerdevs/py-instaclient/archive/v2.1.10.tar.gz', # I explain this later on + download_url = 'https://github.com/wickerdevs/py-instaclient/archive/v2.1.11.tar.gz', # I explain this later on keywords = ['INSTAGRAM', 'BOT', 'INSTAGRAM BOT', 'INSTAGRAM CLIENT'], # Keywords that define your package best install_requires=[ # I get to this in a second 'selenium',