15 lines
487 B
Go
15 lines
487 B
Go
package tdler
|
|
|
|
import (
|
|
"github.com/gotd/td/telegram/downloader"
|
|
"github.com/krau/SaveAny-Bot/common/utils/dlutil"
|
|
"github.com/krau/SaveAny-Bot/config"
|
|
"github.com/krau/SaveAny-Bot/pkg/consts/tglimit"
|
|
"github.com/krau/SaveAny-Bot/pkg/tfile"
|
|
)
|
|
|
|
func NewDownloader(file tfile.TGFile) *downloader.Builder {
|
|
return downloader.NewDownloader().WithPartSize(tglimit.MaxPartSize).
|
|
Download(file.Dler(), file.Location()).WithThreads(dlutil.BestThreads(file.Size(), config.C().Threads))
|
|
}
|