From d837a0db4159fa80c74d42d51cbc3d013bcdef5d Mon Sep 17 00:00:00 2001 From: xantares Date: Mon, 16 Feb 2015 19:21:00 +0100 Subject: [PATCH] no need to check state['downloaded_bytes'] > 0 --- youtube_dl/downloader/f4m.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/youtube_dl/downloader/f4m.py b/youtube_dl/downloader/f4m.py index a8a51546e..ddbcc5d1c 100644 --- a/youtube_dl/downloader/f4m.py +++ b/youtube_dl/downloader/f4m.py @@ -335,8 +335,10 @@ class F4mFD(FileDownloader): # report totals to actual hooks toplevel_status = {'status': 'downloading', 'filename': filename, 'tmpfilename': tmpfilename} toplevel_status['downloaded_bytes'] = state['downloaded_bytes'] - if (state['downloaded_bytes'] > 0) and (progress > 0): - toplevel_status['total_bytes'] = int(100.0 * state['downloaded_bytes'] / progress) + total_bytes = 0 + if progress > 0: + total_bytes = int((100.0 * state['downloaded_bytes']) / progress) + toplevel_status['total_bytes'] = total_bytes if 'speed' in status: toplevel_status['speed'] = status['speed'] if 'eta' in status: