mirror of
https://github.com/j93es/browser-use-oauth.git
synced 2026-06-04 06:31:51 +09:00
도메인 파일 다운로드 기능에 버전 선택 지원 추가 및 특정 날짜 버전 다운로드 옵션 구현
This commit is contained in:
parent
319c5bb72f
commit
ca4811043c
2 changed files with 19 additions and 4 deletions
22
run.py
22
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(
|
||||
|
|
|
|||
1
setup.py
1
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}},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue