feat: 사이트 검사 최대 페이지 수 무제한 옵션 추가
- max_pages=0으로 무제한 모드 지원 (안전 상한 500페이지) - 프론트엔드에 "무제한" 버튼 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@ -29,6 +29,9 @@ _SKIP_EXTENSIONS = {
|
||||
# Type alias for progress callback: (pages_found, current_url) -> None
|
||||
ProgressCallback = Callable[[int, str], Awaitable[None]]
|
||||
|
||||
# Safety limit for "unlimited" mode to prevent runaway crawls
|
||||
_UNLIMITED_SAFETY_CAP = 500
|
||||
|
||||
|
||||
def normalize_url(url: str) -> str:
|
||||
"""
|
||||
@ -112,7 +115,8 @@ class LinkCrawler:
|
||||
max_depth: int = 2,
|
||||
):
|
||||
self.root_url = normalize_url(root_url)
|
||||
self.max_pages = max_pages
|
||||
# 0 means unlimited → use safety cap
|
||||
self.max_pages = max_pages if max_pages > 0 else _UNLIMITED_SAFETY_CAP
|
||||
self.max_depth = max_depth
|
||||
|
||||
parsed = urlparse(self.root_url)
|
||||
|
||||
Reference in New Issue
Block a user