From c2fa2e6e84e9845a6f388a8e37e9321d965be6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C5=A0incek?= <35937483+ivan-sincek@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:13:48 +0200 Subject: [PATCH] Minor Code Refactoring Because of Dependency Update --- README.md | 6 +++--- pyproject.toml | 4 ++-- src/chad/chad.py | 30 ++++++++++++++-------------- src/chad_extractor/chad_extractor.py | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 219d516..e9bcf9b 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ python3 -m pip install --upgrade build python3 -m build -python3 -m pip install dist/google_chad-6.4-py3-none-any.whl +python3 -m pip install dist/google_chad-6.5-py3-none-any.whl ``` ## Shortest Possible @@ -279,7 +279,7 @@ Additionally, to avoid hitting rate limits on platforms like [Instagram's](https ## Usage ```fundamental -Chad v6.4 ( github.com/ivan-sincek/chad ) +Chad v6.5 ( github.com/ivan-sincek/chad ) Usage: chad -q queries [-s site ] [-x proxies ] [-o out ] Example: chad -q queries.txt [-s *.example.com] [-x proxies.txt] [-o results.json] @@ -346,7 +346,7 @@ DEBUG ``` ```fundamental -Chad Extractor v6.4 ( github.com/ivan-sincek/chad ) +Chad Extractor v6.5 ( github.com/ivan-sincek/chad ) Usage: chad-extractor -t template -res results -o out [-s sleep] [-rs random-sleep] Example: chad-extractor -t template.json -res chad_results -o report.json [-s 1.5 ] [-rs ] diff --git a/pyproject.toml b/pyproject.toml index 9b88654..df2ab61 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "google-chad" -version = "6.4" +version = "6.5" authors = [{ name = "Ivan Sincek" }] description = "Not another Google Dorking tool." readme = "README.md" @@ -19,7 +19,7 @@ dependencies = [ "asyncio>=3.4.3", "colorama>=0.4.6", "datetime>=5.2", - "nagooglesearch>=7.2", + "nagooglesearch>=7.3", "playwright>=1.47.0", "regex>=2023.8.8", "requests>=2.31.0", diff --git a/src/chad/chad.py b/src/chad/chad.py index d54ebfc..e87347f 100644 --- a/src/chad/chad.py +++ b/src/chad/chad.py @@ -162,13 +162,13 @@ def run(self): for query in self.__queries: count += 1 entry = {"query": query, "proxy": None, "urls": None} - parameters = { + search_parameters = { "q" : entry["query"], "tbs" : self.__tbs, - "num" : self.__get_num_pages(), "hl" : "en", "filter": "0", - "safe" : "images" + "safe" : "images", + "num" : self.__get_num_pages() } while not exit_program: # -------------------- @@ -181,24 +181,24 @@ def run(self): # -------------------- self.__status(count, entry["query"], entry["proxy"]) client = nagooglesearch.SearchClient( - tld = "com", - parameters = parameters, - max_results = self.__total_results, - user_agent = self.__get_user_agent(), - proxy = entry["proxy"], - min_sleep = self.__minimum_pages, - max_sleep = self.__maximum_pages, - debug = self.__debug + tld = "com", + search_parameters = search_parameters, + user_agent = self.__get_user_agent(), + proxy = entry["proxy"], + max_results = self.__total_results, + min_sleep = self.__minimum_pages, + max_sleep = self.__maximum_pages, + debug = self.__debug ) entry["urls"] = client.search() # -------------------- remove_proxy = False - error = client.get_current_error() + error = client.get_error() if error: termcolor.cprint(error, "yellow") if error == "INIT_ERROR": exit_program = True - elif error == "REQUESTS_ERROR" or error == "429_TOO_MANY_REQUESTS": + elif error == "REQUESTS_EXCEPTION" or error == "429_TOO_MANY_REQUESTS": if entry["proxy"]: remove_proxy = True else: @@ -337,7 +337,7 @@ def remove_proxy(self, proxy): class MyArgParser(argparse.ArgumentParser): def print_help(self): - print("Chad v6.4 ( github.com/ivan-sincek/chad )") + print("Chad v6.5 ( github.com/ivan-sincek/chad )") print("") print("Usage: chad -q queries [-s site ] [-x proxies ] [-o out ]") print("Example: chad -q queries.txt [-s *.example.com] [-x proxies.txt] [-o results.json]") @@ -568,7 +568,7 @@ def main(): if validate.run(): print("###########################################################################") print("# #") - print("# Chad v6.4 #") + print("# Chad v6.5 #") print("# by Ivan Sincek #") print("# #") print("# Search Google Dorks like Chad. #") diff --git a/src/chad_extractor/chad_extractor.py b/src/chad_extractor/chad_extractor.py index 0a6e99c..8781e5f 100644 --- a/src/chad_extractor/chad_extractor.py +++ b/src/chad_extractor/chad_extractor.py @@ -749,7 +749,7 @@ def __page_block(self, request): class MyArgParser(argparse.ArgumentParser): def print_help(self): - print("Chad Extractor v6.4 ( github.com/ivan-sincek/chad )") + print("Chad Extractor v6.5 ( github.com/ivan-sincek/chad )") print("") print("Usage: chad-extractor -t template -res results -o out [-s sleep] [-rs random-sleep]") print("Example: chad-extractor -t template.json -res chad_results -o report.json [-s 1.5 ] [-rs ]") @@ -1103,7 +1103,7 @@ def main(): if validate.run(): print("###########################################################################") print("# #") - print("# Chad Extractor v6.4 #") + print("# Chad Extractor v6.5 #") print("# by Ivan Sincek #") print("# #") print("# Extract and validate data from Chad results or plaintext files. #")