-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Description
count := len(num)
bar1 := uiprogress.AddBar(count).AppendCompleted().PrependElapsed()
bar1.PrependFunc(func(b *uiprogress.Bar) string {
return fmt.Sprintf("Task (%d/%d)", b.Current(), count)
})
for bar1.Incr() {
//time.Sleep(time.Second * 5)
for i := 0; i < count; i++ {
s := rand.Float32()
time.Sleep(time.Second * time.Duration(s))
tsUrl := fmt.Sprintf("%s", baseUrl+num[i])
req, _ := http.NewRequest("GET", baseUrl, nil)
req.Header.Add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36")
resp, _ := client.Do(req)
body, _ := ioutil.ReadAll(resp.Body)
if len(key) != 0 {
data, _ = AesCrypt.AesDecrypt(body, key, iv)
} else {
data = []byte(string(body))
}
write.Write(data)
}
write.Flush()
}
This will always show the first progress bar after the request is sent
Metadata
Metadata
Assignees
Labels
No labels