Gemini: do not correct URLs when redirecting

This commit is contained in:
projectmoon 2024-11-30 20:57:21 +01:00
parent ac64e9fc43
commit 966242d03f
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ def fetch(gemini_url: str, correct_urls: bool=False, prev_url: Optional[str]=Non
if redirects > 5:
return f"Too many redirects (ended at {gemini_url})"
if correct_urls:
if correct_urls and not prev_url:
corrected_url = correct_url(gemini_url)
if corrected_url != gemini_url:
print(f"[Gemini] URL '{gemini_url}' corrected to '{corrected_url}'")