diff --git a/pySmartDL/pySmartDL.py b/pySmartDL/pySmartDL.py index 2f993aa..d321b96 100644 --- a/pySmartDL/pySmartDL.py +++ b/pySmartDL/pySmartDL.py @@ -679,12 +679,12 @@ def _calc_chunk_size(filesize, threads, minChunkFile): if not filesize: return [(0, 0)] - while filesize/threads < minChunkFile and threads > 1: + while math.ceil(filesize/threads) < minChunkFile and threads > 1: threads -= 1 args = [] pos = 0 - chunk = filesize/threads + chunk = math.ceil(filesize/threads) for i in range(threads): startByte = pos endByte = pos + chunk