chore: remove temp txt file after reading

This commit is contained in:
Ovler 2024-06-15 13:42:41 +00:00
parent aa93f7104c
commit e3757b1aa0

View File

@ -26,4 +26,5 @@ 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