fix: get_list_info was mistakenly as get_collect_info

This commit is contained in:
Ovler 2024-06-15 15:10:37 +00:00
parent 8d3cd53832
commit 8911ce404c
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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