Skip to content

Commit

Permalink
adding cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zfleeman committed Mar 1, 2024
1 parent 75d3a72 commit 8920cb5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ To enable "drag and drop" functionality for this package, Windows users can crea
@echo off
Set filename=%1
ff4d %filename% -o "C:/output/folder/" --web
DEL "ffmpeg2*"
PAUSE
```

Expand Down
7 changes: 4 additions & 3 deletions ffmpeg4discord/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def twopass_loop(twopass: TwoPass, target_filesize: float) -> None:
# adjust the class's target file size to set a lower bitrate for the next run
twopass.target_filesize -= 0.2

# clean up
for file in glob("ffmpeg2pass*"):
os.remove(file)

twopass.message = f"Your compressed video file ({round(twopass.output_filesize, 2)}MB) is located at {Path(twopass.output_filename).resolve()}"


Expand Down Expand Up @@ -72,9 +76,6 @@ def form_twopass():

twopass_loop(twopass=twopass, target_filesize=target_filesize)

for file in glob("ffmpeg2pass*"):
os.remove(file)

return render_template(
"web.html",
file_url=url_for("static", filename=path.name),
Expand Down
4 changes: 3 additions & 1 deletion ffmpeg4discord/twopass.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ def run(self) -> float:
)
else:
if ext != self.output.suffix:
logging.warning(f"You specified {self.codec}, but your output file name ends with {self.output.suffix}. I've corrected this.")
logging.warning(
f"You specified {self.codec}, but your output file name ends with {self.output.suffix}. I've corrected this."
)

# correct the file suffix
if self.codec == "libvpx-vp9":
Expand Down

0 comments on commit 8920cb5

Please sign in to comment.