You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create one bar or multiple ones for the length of the download list, I am using goroutines to download the list really fast.
as follows : Inside the main
funcDownload(trackDownloadTrack, dlpathstring) string {
trackName:=track.SoundData.Title+"["+track.Quality+"]."+track.Extpath:=validateDownload(dlpath, trackName)
resp, err:=http.Get(track.Url)
iferr!=nil {
return""
}
deferresp.Body.Close()
// check if the file existsf, _:=os.OpenFile(path, os.O_CREATE|os.O_WRONLY, 0644)
deferf.Close()
// here I am using the progress bar from "github.com/schollz/progressbar/v3" but it doesn't support poolsbar:=bar.DefaultBytes(
resp.ContentLength,
"Downloading",
)
io.Copy(io.MultiWriter(f, bar), resp.Body)
returnpath
}
Sorry for such a question but I searched the docs and I found nothing, I would really appreciate your help 😃
The text was updated successfully, but these errors were encountered:
There is an example for multiple bars at https://github.com/cheggaaa/pb/blob/master/example_multiple_test.go .. To use with v3, change the import line, and remove the ".Prefix()" suffixes to the end of the New calls. If you're properly starting and stopping the bars, it works from inside other goros. You can dynamically add new bars to the pool with .Add(pb). I haven't tested what happens with large numbers (multiple screens) of bars, but have used it with less than a screenful with great success.
I am trying to create one bar or multiple ones for the length of the download list, I am using goroutines to download the list really fast.
as follows :
Inside the main
and here is my
Download
function :Sorry for such a question but I searched the docs and I found nothing, I would really appreciate your help 😃
The text was updated successfully, but these errors were encountered: