Skip to content

Commit

Permalink
remove 697 GiB upload filesize limit
Browse files Browse the repository at this point in the history
  • Loading branch information
9001 committed Oct 30, 2022
1 parent a0cc4ca commit 54e1c8d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bin/up2k.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"""
up2k.py: upload to copyparty
2022-09-05, v0.19, ed <irc.rizon.net>, MIT-Licensed
2022-10-30, v0.20, ed <irc.rizon.net>, MIT-Licensed
https://github.com/9001/copyparty/blob/hovudstraum/bin/up2k.py
- dependencies: requests
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion copyparty/up2k.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion copyparty/web/up2k.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 54e1c8d

Please sign in to comment.