Skip to content

Commit

Permalink
fix: turnstile check return
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Aug 19, 2024
1 parent f493732 commit 2fb02c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/contrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Annotated

import litestar
import orjson
from litestar.enums import RequestEncodingType
from litestar.exceptions import (
HTTPException,
Expand Down Expand Up @@ -68,6 +69,9 @@ async def suggest_api(
) as res:
if res.status > 300:
raise BadRequestException("验证码无效")
data = orjson.loads(await res.read())
if data.get("success") is not True:

Check failure on line 73 in server/contrib.py

View workflow job for this annotation

GitHub Actions / mypy

"CreateSuggestion" has no attribute "get"
raise BadRequestException("验证码无效")

async with http_client.get(f"https://next.bgm.tv/p1/wiki/subjects/{subject_id}") as res:
res.raise_for_status()
Expand Down

0 comments on commit 2fb02c5

Please sign in to comment.