feat: 补全短剧全量清单并接入 DramaBox 官网登录

This commit is contained in:
Nixevol
2026-10-22 02:20:16 +08:00
parent 39774ad9cc
commit 00e78661a7
22 changed files with 894 additions and 194 deletions
+16 -1
View File
@@ -24,6 +24,11 @@ class EnterBody(BaseModel):
language: str = ""
class AccountBody(BaseModel):
language: str = ""
user: dict = {}
class TokenBody(BaseModel):
token: str = ""
refresh: bool = False
@@ -75,6 +80,11 @@ def login_device(body: EnterBody | None = None):
return call(lambda: db_login.enter(language))
@router.post("/login/account")
def login_account(body: AccountBody):
return call(lambda: db_login.apply_account(body.language, body.user))
@router.post("/me")
def me(body: TokenBody):
return call(lambda: db_login.current(body.token))
@@ -230,7 +240,12 @@ def list_downloads():
def start_downloads(body: DownloadStartBody):
def action():
_require_token(body.token)
return db_downloads.enqueue(body.token, None, [item.model_dump() for item in body.items])
items = []
for item in body.items:
data = item.model_dump()
data["language"] = client.language
items.append(data)
return db_downloads.enqueue(body.token, None, items)
return call(action)