diff --git a/lib/agents/__init__.py b/lib/agents/__init__.py index 56568e5..c8eac1d 100644 --- a/lib/agents/__init__.py +++ b/lib/agents/__init__.py @@ -1,5 +1,5 @@ from lib.agents.get_sso_list import get_sso_list -# 버전 업데이트 대비 +# 업데이트될 버전 import 아직 개발 중 from lib.agents.get_sso_list_v2 import get_sso_list as get_sso_list_v2 from lib.agents.login_google import login_google diff --git a/lib/agents/login_google/prompt.py b/lib/agents/login_google/prompt.py index a57e1f4..98d34ec 100644 --- a/lib/agents/login_google/prompt.py +++ b/lib/agents/login_google/prompt.py @@ -32,12 +32,12 @@ Instructions: - Immediately stop and return the appropriate status. 7. If login proceeds without interruptions, wait for redirection back to the original site and record the final URL. -Credentials to use (only if needed): +Credentials to use for Google login: - Email: {GOOGLE_ID} - Password: {GOOGLE_PASSWORD} Constraints: -- Do NOT use search engines or guess URLs — only navigate links discoverable from https://example.com +- Do NOT use search engines or guess URLs. - Do NOT use autofill, saved sessions, or cookies. - Do NOT proceed with login if: - The login opens in a new window (only tabs are allowed) @@ -46,7 +46,7 @@ Constraints: - If the user is already logged in to Google and redirected back automatically, stop there and report success. - If the login page cannot be found, return "login_page_not_found". - If the Google login button is not found, return "sso_not_found". -- If a page such as a sign-up page appears after entering the ID and password, consider it a successful login and terminate immediately. +- If a page such as a sign-up page appears, consider it a successful login and terminate immediately. Final Output: Return the result in the following format only: diff --git a/lib/utils/__init__.py b/lib/utils/__init__.py index b42b9eb..260fcda 100644 --- a/lib/utils/__init__.py +++ b/lib/utils/__init__.py @@ -3,6 +3,8 @@ from lib.utils.is_html import is_html_url from lib.utils.logger import logger from lib.utils.notify_backend import notify_backend from lib.utils.progress_checker import save_progress, load_progress +# v2 import => 아직 개발 중 +from lib.utils.progress_checker_v2 import ProgressChecker from lib.utils.read_txt import read_lines_between from lib.utils.save_oauth_providers import save_oauth_providers diff --git a/lib/utils/progress_checker.py b/lib/utils/progress_checker.py index 11311c4..5cd5c4c 100644 --- a/lib/utils/progress_checker.py +++ b/lib/utils/progress_checker.py @@ -4,27 +4,6 @@ from pathlib import Path progress_file = Path("data/scan_progress.json") -class ProgressChecker: - def __init__(self, filepath): - self.filepath = filepath - self.progress = self.load_progress() - - def save(self): - """현재 진행 상황을 파일에 저장""" - with open(self.filepath, 'w', encoding='utf-8') as f: - json.dump(self.progress, f, ensure_ascii=False, indent=2) - - def load(self): - """이전 진행 상황을 파일에서 불러오기""" - if os.path.exists(self.filepath): - try: - with open(self.filepath, 'r', encoding='utf-8') as f: - return json.load(f) - except: - return None - return None - - def save_progress(current_progress): """현재 진행 상황을 파일에 저장""" with open(progress_file, 'w', encoding='utf-8') as f: diff --git a/lib/utils/progress_checker_v2.py b/lib/utils/progress_checker_v2.py new file mode 100644 index 0000000..9906321 --- /dev/null +++ b/lib/utils/progress_checker_v2.py @@ -0,0 +1,25 @@ +import json +import os +from pathlib import Path + +progress_file = Path("data/scan_progress.json") + +class ProgressChecker: + def __init__(self, filepath): + self.filepath = filepath + self.progress = self.load_progress() + + def save(self): + """현재 진행 상황을 파일에 저장""" + with open(self.filepath, 'w', encoding='utf-8') as f: + json.dump(self.progress, f, ensure_ascii=False, indent=2) + + def load(self): + """이전 진행 상황을 파일에서 불러오기""" + if os.path.exists(self.filepath): + try: + with open(self.filepath, 'r', encoding='utf-8') as f: + return json.load(f) + except: + return None + return None diff --git a/main.py b/main.py index 5ac8425..d2ef63a 100644 --- a/main.py +++ b/main.py @@ -106,7 +106,7 @@ async def loop( current_progress["current_index"] = actual_index print(f"\n🔄 Processing {actual_index + 1}/{current_progress['total']}: {url}") - print(f"📍 domains.txt의 {start_line + actual_index}번째 줄") + print(f"📍 domains.txt의 {actual_index}번째 줄") await scan_one_url(url, skip_html_check=skip_html_check)