improve ip re-selection

This commit is contained in:
Niko Storni 2019-07-13 12:15:19 +02:00
parent 1b55033bb8
commit df08d42d9b

View file

@ -210,11 +210,12 @@ func (v *YoutubeVideo) download(useIPv6 bool) error {
case <-v.stopGroup.Ch():
return errors.Err("interrupted by user")
default:
time.Sleep(20 * time.Second)
sourceAddress, err = ipManager.GetNextIP(useIPv6)
if err == nil {
break
}
}
time.Sleep(ipManager.IPCooldownPeriod)
sourceAddress, err = ipManager.GetNextIP(useIPv6)
if err == nil {
break
}
}
} else {