новый мииф\
Some checks failed
CI / Lint (ruff + mypy) (push) Failing after 36s
CI / Run tests (push) Has been skipped
CI / Docker build test (push) Successful in 18s

This commit is contained in:
2026-03-30 17:10:24 +07:00
parent 03aa7805d1
commit 1d2f615b21
2 changed files with 22 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import logging
from urllib.parse import parse_qs, urlparse
import httpx
@@ -88,9 +89,15 @@ class GlitchTipClient:
if 'rel="next"' not in part or 'results="true"' not in part or "cursor=" not in part:
continue
start = part.index("cursor=") + len("cursor=")
end = part.find(">", start)
return part[start:end] if end != -1 else part[start:]
url_start = part.find("<")
url_end = part.find(">", url_start + 1)
if url_start == -1 or url_end == -1:
continue
parsed = urlparse(part[url_start + 1 : url_end].strip())
cursor_values = parse_qs(parsed.query).get("cursor")
if cursor_values:
return cursor_values[0]
return None