Skip to content

Commit 296519b

Browse files
committed
refactor: simplify common path verification logic in resolve_privacy_url function
1 parent 4b583bc commit 296519b

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/main.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -546,20 +546,11 @@ def resolve_privacy_url(input_url: str) -> tuple[str, str | None]:
546546
return cand, input_url
547547

548548
# === PHASE 3: Common paths (last resort) ===
549-
path_heads: list[str] = []
550-
for p in _COMMON_PATHS:
551-
cand = base + p
552-
if _head_ok(cand) or _light_verify(cand):
553-
if _light_verify(cand):
554-
print(f"DEBUG: Found via common path: {cand}")
555-
return cand, input_url
556-
path_heads.append(cand)
557-
558-
for cand in path_heads:
559-
if _light_verify(cand):
560-
print(f"DEBUG: Found via common path (verified): {cand}")
561-
return cand, input_url
562-
549+
for candidate_url in (base + path for path in _COMMON_PATHS):
550+
if _light_verify(candidate_url):
551+
print(f"DEBUG: Found via common path: {candidate_url}")
552+
return candidate_url, input_url
553+
563554
return input_url, None
564555

565556

0 commit comments

Comments
 (0)