From ca4811043cab8b6364e3bb6d14f4fb50473b655f Mon Sep 17 00:00:00 2001 From: imnyang Date: Tue, 15 Jul 2025 21:20:27 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8F=84=EB=A9=94=EC=9D=B8=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=EC=97=90=20=EB=B2=84=EC=A0=84=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=EC=A7=80=EC=9B=90=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=ED=8A=B9?= =?UTF-8?q?=EC=A0=95=20=EB=82=A0=EC=A7=9C=20=EB=B2=84=EC=A0=84=20=EB=8B=A4?= =?UTF-8?q?=EC=9A=B4=EB=A1=9C=EB=93=9C=20=EC=98=B5=EC=85=98=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.py | 22 ++++++++++++++++++---- setup.py | 1 + 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/run.py b/run.py index 787b429..55c2335 100644 --- a/run.py +++ b/run.py @@ -16,12 +16,12 @@ DOMAIN_FILE = "./data/domains.txt" def download_domains(): - """도메인 파일 다운로드""" + """도메인 파일 다운로드 (버전 선택 지원)""" try: print("도메인 파일 다운로드 중...") - response = requests.get( - "https://f.imnya.ng/.whs/tp-domains/data/domains/latest.txt" - ) + # date_str이 있으면 해당 날짜 파일, 없으면 latest.txt + url = download_domains.date_url if hasattr(download_domains, "date_url") else "https://f.imnya.ng/.whs/tp-domains/data/domains/latest.txt" + response = requests.get(url) response.raise_for_status() # 디렉토리가 없으면 생성 @@ -125,6 +125,7 @@ def main(): uv run run.py 10000 11000 # 10000~11000 라인 처리 uv run run.py 10000 11000 --skh # SKH 옵션 활성화 uv run run.py 10000 11000 --no-download # 다운로드 생략 + uv run run.py 10000 11000 --date=20250607 # 2025-06-07 버전 도메인 파일 사용 """, ) @@ -134,6 +135,12 @@ def main(): parser.add_argument( "--no-download", action="store_true", help="도메인 파일 다운로드 생략" ) + parser.add_argument( + "--date", + type=str, + default=None, + help="특정 날짜(YYYYMMDD) 버전 도메인 파일 다운로드 (예: --date=20250607)", + ) args = parser.parse_args() @@ -148,6 +155,13 @@ def main(): # 도메인 파일 다운로드 if not args.no_download: + if args.date: + # 날짜 형식 검증 (8자리 숫자) + if not (len(args.date) == 8 and args.date.isdigit()): + print("--date는 YYYYMMDD 형식의 8자리 숫자여야 합니다.") + sys.exit(1) + # URL 지정 + download_domains.date_url = f"https://f.imnya.ng/.whs/tp-domains/data/domains/{args.date[:4]}-{args.date[4:6]}-{args.date[6:]}.txt" download_domains() elif not os.path.exists(DOMAIN_FILE): print( diff --git a/setup.py b/setup.py index ef19e77..3c3c76c 100644 --- a/setup.py +++ b/setup.py @@ -110,6 +110,7 @@ async def setup_user_data(): print("======================================================") llm = ChatGoogle( model="gemini-2.0-flash", + ) initial_actions = [ {"go_to_url": {"url": "https://www.google.com", "new_tab": False}},