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 33
44"""
55up2k.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
77https://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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments