Replace '100%' with the calculated percent

This commit is contained in:
tcely 2025-02-07 15:34:24 -05:00 committed by GitHub
parent 90b892fd85
commit 23abc545d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -116,6 +116,7 @@ def yt_dlp_progress_hook(event):
pass pass
if fragment_index > 0 and fragment_count > 0: if fragment_index > 0 and fragment_count > 0:
percent = round(100 * fragment_index / fragment_count) percent = round(100 * fragment_index / fragment_count)
percent_str = f'{percent}%'
elif downloaded_bytes > 0 and total_bytes > 0: elif downloaded_bytes > 0 and total_bytes > 0:
percent = round(100 * downloaded_bytes / total_bytes) percent = round(100 * downloaded_bytes / total_bytes)
if percent and (status.next_progress() < percent) and (0 == percent % 5): if percent and (status.next_progress() < percent) and (0 == percent % 5):