diff --git a/setup.py b/setup.py index 689ddac..1f67db2 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -VERSION = "2.0.2" +VERSION = "2.0.3" SHORT_DESCRIPTION = "TweeterPy is a python library to extract data from Twitter. TweeterPy API lets you scrape data from a user's profile like username, userid, bio, followers/followings list, profile media, tweets, etc." with open("requirements.txt") as file: diff --git a/tweeterpy/api_util.py b/tweeterpy/api_util.py index f9db805..d87aa38 100644 --- a/tweeterpy/api_util.py +++ b/tweeterpy/api_util.py @@ -4,7 +4,7 @@ import tempfile import demjson3 import logging.config -from tweeterpy.request_util import RequestClient +from tweeterpy.utils.request import RequestClient from tweeterpy.constants import Path, FeatureSwitch, API_TMP_FILE, LOGGING_CONFIG logging.config.dictConfig(LOGGING_CONFIG) diff --git a/tweeterpy/constants.py b/tweeterpy/constants.py index 92995f3..fd5d31b 100644 --- a/tweeterpy/constants.py +++ b/tweeterpy/constants.py @@ -30,7 +30,7 @@ }, 'custom': { # 'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s' - 'class': 'tweeterpy.logging_util.CustomFormatter', + 'class': 'tweeterpy.utils.logging.CustomFormatter', } }, 'handlers': { diff --git a/tweeterpy/login_util.py b/tweeterpy/login_util.py index 12419c1..72e2217 100644 --- a/tweeterpy/login_util.py +++ b/tweeterpy/login_util.py @@ -1,8 +1,8 @@ import random from tweeterpy.constants import Path from tweeterpy.util import find_nested_key -from tweeterpy.request_util import RequestClient -from tweeterpy.logging_util import disable_logger +from tweeterpy.utils.request import RequestClient +from tweeterpy.utils.logging import disable_logger class TaskHandler: @@ -90,19 +90,6 @@ def _handle_suspicious_login(self, flow_token, subtask_id="LoginAcid",verificati @disable_logger def login(self, username, password, email=None, phone=None, **kwargs): - # MANUAL WAY OF HANDLING LOG IN - """ - initital_flow_token = self._get_flow_token() - self._get_javscript_instrumentation_subtask() - user_flow_token = self._get_user_flow_token(initital_flow_token) - password_flow_token = self._get_password_flow_token( - user_flow_token, username=username) - account_duplication_flow_token = self._get_account_duplication_flow_token( - password_flow_token, password=password) - return self._check_account_duplication(account_duplication_flow_token) - """ - - # DYNAMIC WAY OF HANDLING LOG IN - BETTER response = None error_message = None tasks_pending = True diff --git a/tweeterpy/tweeterpy.py b/tweeterpy/tweeterpy.py index e0bcd86..3bc9bca 100644 --- a/tweeterpy/tweeterpy.py +++ b/tweeterpy/tweeterpy.py @@ -10,9 +10,9 @@ from tweeterpy.api_util import ApiUpdater from tweeterpy.tid import ClientTransaction from tweeterpy.login_util import TaskHandler -from tweeterpy.request_util import RequestClient -from tweeterpy.logging_util import set_log_level -from tweeterpy.session_util import load_session, save_session +from tweeterpy.utils.request import RequestClient +from tweeterpy.utils.logging import set_log_level +from tweeterpy.utils.session import load_session, save_session from tweeterpy.constants import Path, FeatureSwitch, LOGGING_CONFIG logging.config.dictConfig(LOGGING_CONFIG) diff --git a/tweeterpy/utils/__init__.py b/tweeterpy/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tweeterpy/logging_util.py b/tweeterpy/utils/logging.py similarity index 100% rename from tweeterpy/logging_util.py rename to tweeterpy/utils/logging.py diff --git a/tweeterpy/request_util.py b/tweeterpy/utils/request.py similarity index 100% rename from tweeterpy/request_util.py rename to tweeterpy/utils/request.py diff --git a/tweeterpy/session_util.py b/tweeterpy/utils/session.py similarity index 100% rename from tweeterpy/session_util.py rename to tweeterpy/utils/session.py