Skip to content

Commit

Permalink
fix: get_list_info was mistakenly as get_collect_info
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovler-Young committed Jun 15, 2024
1 parent 8d3cd53 commit 8911ce4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion biliarchiver/cli_tools/get_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion biliarchiver/rest_api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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
Expand Down

0 comments on commit 8911ce4

Please sign in to comment.