1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-14 03:27:17 +08:00

no need to check state['downloaded_bytes'] > 0

This commit is contained in:
xantares 2015-02-16 19:21:00 +01:00
parent f457fb5f01
commit d837a0db41

View File

@ -335,8 +335,10 @@ class F4mFD(FileDownloader):
# report totals to actual hooks # report totals to actual hooks
toplevel_status = {'status': 'downloading', 'filename': filename, 'tmpfilename': tmpfilename} toplevel_status = {'status': 'downloading', 'filename': filename, 'tmpfilename': tmpfilename}
toplevel_status['downloaded_bytes'] = state['downloaded_bytes'] toplevel_status['downloaded_bytes'] = state['downloaded_bytes']
if (state['downloaded_bytes'] > 0) and (progress > 0): total_bytes = 0
toplevel_status['total_bytes'] = int(100.0 * state['downloaded_bytes'] / progress) if progress > 0:
total_bytes = int((100.0 * state['downloaded_bytes']) / progress)
toplevel_status['total_bytes'] = total_bytes
if 'speed' in status: if 'speed' in status:
toplevel_status['speed'] = status['speed'] toplevel_status['speed'] = status['speed']
if 'eta' in status: if 'eta' in status: