Spaces:
Sleeping
Sleeping
Upload 101 files
Browse files- fsb.env +4 -4
- internal/stream/pipe.go +4 -5
fsb.env
CHANGED
|
@@ -54,7 +54,7 @@ STREAM_MAX_RETRIES=15
|
|
| 54 |
# For muti token support
|
| 55 |
# Refer https://github.com/EverythingSuckz/TG-FileStreamBot/tree/golang#use-multiple-bots-to-speed-up
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
| 54 |
# For muti token support
|
| 55 |
# Refer https://github.com/EverythingSuckz/TG-FileStreamBot/tree/golang#use-multiple-bots-to-speed-up
|
| 56 |
|
| 57 |
+
MULTI_TOKEN1=8494492850:AAFdX-Yc4ySy5eZdK01OC-nu1-mDKB9hoj4
|
| 58 |
+
MULTI_TOKEN2=8735857251:AAFFNFpYoA1IX86h7pm9YSEnv6RIzuSb4Uw
|
| 59 |
+
MULTI_TOKEN3=8688814148:AAGWuPXlupqhSqsGHP1eVO8Fm-oMRvjQESg
|
| 60 |
+
MULTI_TOKEN4=8610183721:AAGtGBqIzRIFD5dIHGGWwYCuUMkoQYbqdec
|
internal/stream/pipe.go
CHANGED
|
@@ -16,19 +16,18 @@ import (
|
|
| 16 |
"go.uber.org/zap"
|
| 17 |
)
|
| 18 |
|
| 19 |
-
// calculateBlockSize func determines optimal block size based on the range requested.
|
| 20 |
-
// Smaller ranges use smaller blocks to reduce wasted bandwidth during seeks.
|
| 21 |
func calculateBlockSize(start, end int64) int64 {
|
| 22 |
size := end - start + 1
|
| 23 |
|
| 24 |
switch {
|
| 25 |
case size < 512*1024: // < 512KB
|
| 26 |
return 64 * 1024 // 64KB blocks
|
| 27 |
-
case size <
|
| 28 |
return 256 * 1024 // 256KB blocks
|
| 29 |
-
case size < 32*1024*1024: // < 32MB
|
| 30 |
-
return 512 * 1024 // 512KB blocks
|
| 31 |
default:
|
|
|
|
|
|
|
|
|
|
| 32 |
return 1024 * 1024 // 1MB blocks by default
|
| 33 |
}
|
| 34 |
}
|
|
|
|
| 16 |
"go.uber.org/zap"
|
| 17 |
)
|
| 18 |
|
|
|
|
|
|
|
| 19 |
func calculateBlockSize(start, end int64) int64 {
|
| 20 |
size := end - start + 1
|
| 21 |
|
| 22 |
switch {
|
| 23 |
case size < 512*1024: // < 512KB
|
| 24 |
return 64 * 1024 // 64KB blocks
|
| 25 |
+
case size < 1024*1024: // < 1MB
|
| 26 |
return 256 * 1024 // 256KB blocks
|
|
|
|
|
|
|
| 27 |
default:
|
| 28 |
+
// Para imágenes pesadas (>1MB), pedimos pedazos de 1MB a la vez.
|
| 29 |
+
// Telegram rate-limitea por cantidad de peticiones concurrentes, no tanto por Mbps.
|
| 30 |
+
// Al pedir 1MB en vez de 512KB, cortamos a la mitad la cantidad de peticiones a la API.
|
| 31 |
return 1024 * 1024 // 1MB blocks by default
|
| 32 |
}
|
| 33 |
}
|