File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 3
3
4
4
"""
5
5
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
7
7
https://github.com/9001/copyparty/blob/hovudstraum/bin/up2k.py
8
8
9
9
- dependencies: requests
@@ -415,7 +415,7 @@ def up2k_chunksize(filesize):
415
415
while True :
416
416
for mul in [1 , 2 ]:
417
417
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 ) :
419
419
return chunksize
420
420
421
421
chunksize += stepsize
Original file line number Diff line number Diff line change @@ -3164,7 +3164,7 @@ def up2k_chunksize(filesize: int) -> int:
3164
3164
while True :
3165
3165
for mul in [1 , 2 ]:
3166
3166
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 ) :
3168
3168
return chunksize
3169
3169
3170
3170
chunksize += stepsize
Original file line number Diff line number Diff line change @@ -1804,7 +1804,7 @@ function up2k_init(subtle) {
1804
1804
while ( true ) {
1805
1805
for ( var mul = 1 ; mul <= 2 ; mul ++ ) {
1806
1806
var nchunks = Math . ceil ( filesize / chunksize ) ;
1807
- if ( nchunks <= 256 || chunksize >= 32 * 1024 * 1024 )
1807
+ if ( nchunks <= 256 || ( chunksize >= 32 * 1024 * 1024 && nchunks <= 4096 ) )
1808
1808
return chunksize ;
1809
1809
1810
1810
chunksize += stepsize ;
You can’t perform that action at this time.
0 commit comments