Skip to content

Commit

Permalink
update ffmpeg_s.py
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Dec 8, 2024
1 parent 03ffbed commit f110a51
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bot/helper/aeon_utils/ffmpeg_s.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,16 @@ async def progress(self, status: str = ""):
except ValueError:
hh, mm, sms = 0, 0, 0
time_to_second = (int(hh) * 3600) + (int(mm) * 60) + float(sms)
self._processed_bytes = int(progress["size"].rstrip("kB")) * 1024
self._percentage = (
f"{round((time_to_second / self._duration) * 100, 2)}%"
)
try:
self._processed_bytes = int(progress["size"].rstrip("kB")) * 1024
except ValueError:
self._processed_bytes = 0
try:
self._percentage = (
f"{round((time_to_second / self._duration) * 100, 2)}%"
)
except ValueError:
self._percentage = "0%"
with contextlib.suppress(Exception):
self._eta = (
self._duration / float(progress["speed"].strip("x"))
Expand Down

0 comments on commit f110a51

Please sign in to comment.