Preventing possible errors in the deletion process
This commit is contained in:
parent
9e54100939
commit
684deb7f6d
1 changed files with 1 additions and 0 deletions
|
@ -31,6 +31,7 @@ abstract class Ytdlp {
|
|||
formats?(): any;
|
||||
|
||||
public async clean() {
|
||||
if (!this._filePath) return;
|
||||
const downloadedFile = Bun.file(this._filePath);
|
||||
if (await downloadedFile.exists()) {
|
||||
await downloadedFile.delete();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue