Skip to content

Commit 54e1c8d

Browse files
committed
remove 697 GiB upload filesize limit
1 parent a0cc4ca commit 54e1c8d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

bin/up2k.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"""
55
up2k.py: upload to copyparty
6-
2022-09-05, v0.19, ed <irc.rizon.net>, MIT-Licensed
6+
2022-10-30, v0.20, ed <irc.rizon.net>, MIT-Licensed
77
https://github.com/9001/copyparty/blob/hovudstraum/bin/up2k.py
88
99
- dependencies: requests
@@ -415,7 +415,7 @@ def up2k_chunksize(filesize):
415415
while True:
416416
for mul in [1, 2]:
417417
nchunks = math.ceil(filesize * 1.0 / chunksize)
418-
if nchunks <= 256 or chunksize >= 32 * 1024 * 1024:
418+
if nchunks <= 256 or (chunksize >= 32 * 1024 * 1024 and nchunks < 4096):
419419
return chunksize
420420

421421
chunksize += stepsize

copyparty/up2k.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3164,7 +3164,7 @@ def up2k_chunksize(filesize: int) -> int:
31643164
while True:
31653165
for mul in [1, 2]:
31663166
nchunks = math.ceil(filesize * 1.0 / chunksize)
3167-
if nchunks <= 256 or chunksize >= 32 * 1024 * 1024:
3167+
if nchunks <= 256 or (chunksize >= 32 * 1024 * 1024 and nchunks <= 4096):
31683168
return chunksize
31693169

31703170
chunksize += stepsize

copyparty/web/up2k.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,7 @@ function up2k_init(subtle) {
18041804
while (true) {
18051805
for (var mul = 1; mul <= 2; mul++) {
18061806
var nchunks = Math.ceil(filesize / chunksize);
1807-
if (nchunks <= 256 || chunksize >= 32 * 1024 * 1024)
1807+
if (nchunks <= 256 || (chunksize >= 32 * 1024 * 1024 && nchunks <= 4096))
18081808
return chunksize;
18091809

18101810
chunksize += stepsize;

0 commit comments

Comments
 (0)