add download progress logs for videos with no downloaded bytes total

This commit is contained in:
meeb 2020-12-14 00:58:39 +11:00
parent 39ea60baa4
commit df988547e7
1 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,12 @@ def download_media(url, media_format, extension, output_file):
hook.download_progress = p
log.info(f'[youtube-dl] downloading: {filename} - {percent_done} '
f'of {total} at {speed}, {eta} remaining')
else:
# No progress to monitor, just spam every 10 download messages instead
hook.download_progress += 1
if hook.download_progress % 10 == 0:
log.info(f'[youtube-dl] downloading: {filename} - {percent_done} '
f'of {total} at {speed}, {eta} remaining')
elif event['status'] == 'finished':
total_size_str = event.get('_total_bytes_str', '?').strip()
elapsed_str = event.get('_elapsed_str', '?').strip()