fix: audit findings — edge cases in paginate, output, run

- paginate.py: max(nums) on empty set → guard
- paginate.py: HEAD fallback to GET if server doesn't support HEAD
- output.py: disk health check every 500 topics
- run.py: avoid page-1 extra redirect
- __main__.py: URL validation (must contain vwts.ru)
This commit is contained in:
2026-06-04 08:58:09 +03:00
parent 010b10c43e
commit 1cfa6d1595
4 changed files with 32 additions and 13 deletions
+2 -1
View File
@@ -48,7 +48,8 @@ def run(section_url: str):
consecutive_404 = 0
continue
url = f"{section_url}page-{pg}"
# page-1 = базовый URL (чтобы не было лишнего редиректа)
url = section_url if pg == 1 else f"{section_url}page-{pg}"
log.info(f"📄 [{pg}/{total_pages}]")
page_soup = get(url)