Wrap up file downloading feature

This commit is contained in:
Mukhtar Akere
2024-09-22 16:28:31 +01:00
parent ba147ac56c
commit ff74e279d9
12 changed files with 94 additions and 133 deletions

View File

@@ -217,7 +217,7 @@ func NewLogger(prefix string, output *os.File) *log.Logger {
func GetInfohashFromURL(url string) (string, error) {
// Download the torrent file
var magnetLink string
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
client := &http.Client{
Timeout: 30 * time.Second,