From a5503751a50a2b55b7df6076052e3117da34ba90 Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Mon, 6 Jan 2025 14:41:43 -0500 Subject: [PATCH] fix(youtubedl): always cast to int when formatting duration --- youtubedl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtubedl.py b/youtubedl.py index 83588b9..b479435 100644 --- a/youtubedl.py +++ b/youtubedl.py @@ -122,8 +122,8 @@ class QueuedPlayer: return self.__repr__() -def format_duration(duration: int) -> str: - hours, duration = divmod(duration, 3600) +def format_duration(duration: int | float) -> str: + hours, duration = divmod(int(duration), 3600) minutes, duration = divmod(duration, 60) segments = [hours, minutes, duration] if len(segments) == 3 and segments[0] == 0: