diff --git a/src/modules/core/email.py b/src/modules/core/email.py index d9b2bbbe..cd7f1d71 100644 --- a/src/modules/core/email.py +++ b/src/modules/core/email.py @@ -10,14 +10,14 @@ os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "src")) ) -from src.modules.utils.filter import filterFoundAccounts, applyFilters -from src.modules.utils.parse import extractMetadata -from src.modules.utils.http_client import do_async_request -from src.modules.whatsmyname.list_operations import readList -from src.modules.utils.input import processInput -from src.modules.utils.log import logError -from src.modules.export.dump import dumpContent -from src.modules.utils.precheck import perform_pre_check +from ..utils.filter import filterFoundAccounts, applyFilters +from ..utils.parse import extractMetadata +from ..utils.http_client import do_async_request +from ..whatsmyname.list_operations import readList +from ..utils.input import processInput +from ..utils.log import logError +from ..export.dump import dumpContent +from ..utils.precheck import perform_pre_check # Verify account existence based on list args diff --git a/src/modules/core/username.py b/src/modules/core/username.py index ee9c786a..87f24b4f 100644 --- a/src/modules/core/username.py +++ b/src/modules/core/username.py @@ -8,14 +8,14 @@ os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "src")) ) -from src.modules.whatsmyname.list_operations import readList -from src.modules.utils.parse import extractMetadata, remove_duplicates -from src.modules.utils.filter import filterFoundAccounts, applyFilters -from src.modules.utils.http_client import do_async_request -from src.modules.utils.log import logError -from src.modules.export.dump import dumpContent -from src.modules.sites.instagram import get_instagram_account_info -from src.modules.ner.entity_extraction import extract_data_with_ai +from ..whatsmyname.list_operations import readList +from ..utils.parse import extractMetadata, remove_duplicates +from ..utils.filter import filterFoundAccounts, applyFilters +from ..utils.http_client import do_async_request +from ..utils.log import logError +from ..export.dump import dumpContent +from ..sites.instagram import get_instagram_account_info +from ..ner.entity_extraction import extract_data_with_ai sys.path.append(os.path.join(os.path.dirname(__file__), "..")) @@ -133,11 +133,14 @@ async def fetchResults(username, config): # Start username check and presents results to user -def verifyUsername(username, config): +def verifyUsername(username, config, sitesToSearch=None, metadata_params=None): - data = readList("username", config) - config.metadata_params = readList("metadata", config) - sitesToSearch = data["sites"] + if sitesToSearch is None or metadata_params is None: + data = readList("username", config) + sitesToSearch = data["sites"] + config.metadata_params = readList("metadata", config) + + config.metadata_params = metadata_params config.username_sites = applyFilters(sitesToSearch, config) config.console.print( diff --git a/src/modules/export/csv.py b/src/modules/export/csv.py index 2c4b7b53..1dbbc096 100644 --- a/src/modules/export/csv.py +++ b/src/modules/export/csv.py @@ -6,9 +6,9 @@ os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "src")) ) -from src.modules.export.file_operations import generateName +from ..export.file_operations import generateName -from src.modules.utils.log import logError +from ..utils.log import logError # Save results to CSV file diff --git a/src/modules/export/pdf.py b/src/modules/export/pdf.py index 15f6c16c..9dde058f 100644 --- a/src/modules/export/pdf.py +++ b/src/modules/export/pdf.py @@ -11,10 +11,10 @@ os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "src")) ) -from src.modules.export.file_operations import generateName +from ..export.file_operations import generateName -from src.modules.utils.log import logError +from ..utils.log import logError # Save results to PDF file diff --git a/src/modules/ner/entity_extraction.py b/src/modules/ner/entity_extraction.py index c159ba00..d9aeb167 100644 --- a/src/modules/ner/entity_extraction.py +++ b/src/modules/ner/entity_extraction.py @@ -5,7 +5,7 @@ import sys import traceback import re -from src.modules.utils.parse import download_image +from ..utils.parse import download_image warnings.filterwarnings("ignore", category=MarkupResemblesLocatorWarning) diff --git a/src/modules/sites/instagram.py b/src/modules/sites/instagram.py index 3253ed29..b2eb2917 100644 --- a/src/modules/sites/instagram.py +++ b/src/modules/sites/instagram.py @@ -5,9 +5,9 @@ os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "src")) ) -from src.modules.utils.http_client import do_sync_request -from src.modules.utils.log import logError -from src.modules.utils.parse import extractMetadata +from ..utils.http_client import do_sync_request +from ..utils.log import logError +from ..utils.parse import extractMetadata from json import dumps from urllib.parse import urlencode diff --git a/src/modules/utils/parse.py b/src/modules/utils/parse.py index 0c2a1ffc..5634b2bc 100644 --- a/src/modules/utils/parse.py +++ b/src/modules/utils/parse.py @@ -5,7 +5,7 @@ os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "src")) ) -from src.modules.utils.http_client import do_sync_request +from ..utils.http_client import do_sync_request import re import os diff --git a/src/modules/utils/precheck.py b/src/modules/utils/precheck.py index cf811f38..8ff8fc00 100644 --- a/src/modules/utils/precheck.py +++ b/src/modules/utils/precheck.py @@ -5,8 +5,8 @@ os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "src")) ) -from src.modules.utils.http_client import do_sync_request -from src.modules.utils.log import logError +from ..utils.http_client import do_sync_request +from ..utils.log import logError def perform_pre_check(precheck_params, headers, config): diff --git a/tests/test_core.py b/tests/test_core.py index 5bb311bc..b5df0dc1 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -6,13 +6,13 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "..", "src")) import config -from src.modules.core.username import verifyUsername -from src.modules.core.email import verifyEmail -from src.modules.export.csv import saveToCsv -from src.modules.export.pdf import saveToPdf -from src.modules.utils.userAgent import getRandomUserAgent +from ..core.username import verifyUsername +from ..core.email import verifyEmail +from ..export.csv import saveToCsv +from ..export.pdf import saveToPdf +from ..utils.userAgent import getRandomUserAgent from datetime import datetime -from src.modules.whatsmyname.list_operations import checkUpdates +from ..whatsmyname.list_operations import checkUpdates config.no_nsfw = None config.proxy = None diff --git a/tests/test_export.py b/tests/test_export.py index f09b58a8..ed39bfb1 100644 --- a/tests/test_export.py +++ b/tests/test_export.py @@ -7,9 +7,9 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "..", "src")) import config -from src.modules.export.csv import saveToCsv -from src.modules.export.pdf import saveToPdf -from src.modules.export.file_operations import createSaveDirectory +from ..export.csv import saveToCsv +from ..export.pdf import saveToPdf +from ..export.file_operations import createSaveDirectory from datetime import datetime config.console = Console()