mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-13 20:27:27 +08:00
mention approximation
This commit is contained in:
parent
6c5b7e5885
commit
1270808b7c
@ -333,15 +333,16 @@ class F4mFD(FileDownloader):
|
|||||||
status.get('speed'), eta)
|
status.get('speed'), eta)
|
||||||
|
|
||||||
# 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, 'eta': eta}
|
||||||
toplevel_status['downloaded_bytes'] = state['downloaded_bytes']
|
toplevel_status['downloaded_bytes'] = state['downloaded_bytes']
|
||||||
total_bytes = 0
|
total_bytes = 0
|
||||||
if progress > 0:
|
if progress > 0:
|
||||||
|
# subject to rounding error
|
||||||
total_bytes = int((100.0 * state['downloaded_bytes']) / progress)
|
total_bytes = int((100.0 * state['downloaded_bytes']) / progress)
|
||||||
toplevel_status['total_bytes'] = total_bytes
|
toplevel_status['total_bytes'] = total_bytes
|
||||||
if 'speed' in status:
|
if 'speed' in status:
|
||||||
toplevel_status['speed'] = status['speed']
|
toplevel_status['speed'] = status['speed']
|
||||||
toplevel_status['eta'] = eta
|
|
||||||
self._hook_progress(toplevel_status)
|
self._hook_progress(toplevel_status)
|
||||||
|
|
||||||
http_dl.add_progress_hook(frag_progress_hook)
|
http_dl.add_progress_hook(frag_progress_hook)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user