mirror of
https://github.com/saveweb/biliarchiver.git
synced 2024-09-19 11:05:28 -07:00
chore: move delete file out the func read_bvids_from_txt
This commit is contained in:
parent
e3757b1aa0
commit
469701a803
@ -26,5 +26,4 @@ def read_bvids(bvids: str) -> list[str]:
|
||||
def read_bvids_from_txt(txt_path: Union[Path,str]) -> List[str]:
|
||||
with open(txt_path, "r", encoding="utf-8") as f:
|
||||
bvids = [line.strip() for line in f if line.strip().startswith("BV")]
|
||||
txt_path.unlink(missing_ok=True)
|
||||
return bvids
|
@ -116,6 +116,7 @@ async def source_action(fun, source_id: str, TRUNCATE=20):
|
||||
raise HTTPException(status_code=500, detail="Failed to get path")
|
||||
|
||||
bvids = read_bvids_from_txt(txt_path)
|
||||
txt_path.unlink(missing_ok=True)
|
||||
|
||||
return {"success": True, "bvids": bvids}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user