From 8911ce404c8685892b40999785ee5a74b66c2932 Mon Sep 17 00:00:00 2001 From: Ovler Date: Sat, 15 Jun 2024 15:10:37 +0000 Subject: [PATCH] fix: get_list_info was mistakenly as get_collect_info --- biliarchiver/cli_tools/get_command.py | 2 +- biliarchiver/rest_api/main.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/biliarchiver/cli_tools/get_command.py b/biliarchiver/cli_tools/get_command.py index 25cfcff..3c80383 100644 --- a/biliarchiver/cli_tools/get_command.py +++ b/biliarchiver/cli_tools/get_command.py @@ -26,7 +26,7 @@ async def by_series(url_or_sid: str, truncate: int = int(1e10)) -> Path: ) # type: ignore client = AsyncClient(**api.dft_client_settings) print(_("正在获取 {sid} 的视频列表……").format(sid=sid)) - col_name, up_name, bvids = await api.get_collect_info(client, sid) + col_name, up_name, bvids = await api.get_list_info(client, sid) filepath = f"bvids/by-sapce_fav_season/sid-{sid}-{int(time.time())}.txt" os.makedirs(os.path.dirname(filepath), exist_ok=True) abs_filepath = os.path.abspath(filepath) diff --git a/biliarchiver/rest_api/main.py b/biliarchiver/rest_api/main.py index 31a4c47..7fa0b37 100644 --- a/biliarchiver/rest_api/main.py +++ b/biliarchiver/rest_api/main.py @@ -111,7 +111,7 @@ async def source_action(fun, source_id: str, TRUNCATE=20): txt_path = await fun(source_id, truncate=TRUNCATE) except Exception as e: print(f"Failed to call {fun}: {e}") - raise HTTPException(status_code=500, detail=f"Failed to call {fun}") + raise HTTPException(status_code=500, detail=f"Failed to call {fun}: {e}") if not isinstance(txt_path, Path): raise HTTPException(status_code=500, detail="Failed to get path") @@ -120,6 +120,7 @@ async def source_action(fun, source_id: str, TRUNCATE=20): return {"success": True, "bvids": bvids} +@app.get("/get_bvids_by/{source_type}/{source_id}") @app.post("/get_bvids_by/{source_type}/{source_id}") async def perform_source_action_from_req(source_type: str, source_id: str): # make sure source_id is valid integer