fix: filter invalid kwargs from recommended next_url pagination
illust_recommended's next_url contains array params like "viewed[]" which are invalid Python identifiers and crash **kwargs unpacking. Filter to isidentifier() keys only so pagination works correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
5327bf1adc
commit
0f1e087d64
+2
-1
@@ -26,7 +26,8 @@ class PixivClient:
|
||||
|
||||
def _next_qs(self, next_url: str) -> dict:
|
||||
parsed = urlparse(next_url)
|
||||
return {k: v[0] for k, v in parse_qs(parsed.query).items()}
|
||||
# Filter out array-style keys like "viewed[]" — invalid as Python kwargs
|
||||
return {k: v[0] for k, v in parse_qs(parsed.query).items() if k.isidentifier()}
|
||||
|
||||
def get_login_url(self, code_challenge: str) -> str:
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user