From 54e1c8d261df54e4509529e334af8dfb16accdf8 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 30 Oct 2022 12:51:20 +0000 Subject: [PATCH] remove 697 GiB upload filesize limit --- bin/up2k.py | 4 ++-- copyparty/up2k.py | 2 +- copyparty/web/up2k.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/up2k.py b/bin/up2k.py index 56f72be7..94e4c676 100755 --- a/bin/up2k.py +++ b/bin/up2k.py @@ -3,7 +3,7 @@ """ up2k.py: upload to copyparty -2022-09-05, v0.19, ed , MIT-Licensed +2022-10-30, v0.20, ed , MIT-Licensed https://github.com/9001/copyparty/blob/hovudstraum/bin/up2k.py - dependencies: requests @@ -415,7 +415,7 @@ def up2k_chunksize(filesize): while True: for mul in [1, 2]: nchunks = math.ceil(filesize * 1.0 / chunksize) - if nchunks <= 256 or chunksize >= 32 * 1024 * 1024: + if nchunks <= 256 or (chunksize >= 32 * 1024 * 1024 and nchunks < 4096): return chunksize chunksize += stepsize diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 4f9bb97c..90ee2891 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -3164,7 +3164,7 @@ def up2k_chunksize(filesize: int) -> int: while True: for mul in [1, 2]: nchunks = math.ceil(filesize * 1.0 / chunksize) - if nchunks <= 256 or chunksize >= 32 * 1024 * 1024: + if nchunks <= 256 or (chunksize >= 32 * 1024 * 1024 and nchunks <= 4096): return chunksize chunksize += stepsize diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 50c2bfec..a761a039 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -1804,7 +1804,7 @@ function up2k_init(subtle) { while (true) { for (var mul = 1; mul <= 2; mul++) { var nchunks = Math.ceil(filesize / chunksize); - if (nchunks <= 256 || chunksize >= 32 * 1024 * 1024) + if (nchunks <= 256 || (chunksize >= 32 * 1024 * 1024 && nchunks <= 4096)) return chunksize; chunksize += stepsize;