colors
This commit is contained in:
parent
375a5ad681
commit
d196031762
|
@ -9,6 +9,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/dustin/go-humanize"
|
"github.com/dustin/go-humanize"
|
||||||
|
"github.com/logrusorgru/aurora"
|
||||||
"github.com/tjhorner/e6dl/e621"
|
"github.com/tjhorner/e6dl/e621"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -56,15 +57,17 @@ func work(wn int, posts []e621.Post, directory string, completed *int, successes
|
||||||
for _, post := range posts {
|
for _, post := range posts {
|
||||||
*completed++
|
*completed++
|
||||||
|
|
||||||
fmt.Printf(
|
progress := aurora.Sprintf(aurora.Green("[%d/%d]"), *completed, *total)
|
||||||
"[%d/%d] [w%d] Downloading post %d (%s) -> %s...\n",
|
workerText := aurora.Sprintf(aurora.Cyan("[w%d]"), wn)
|
||||||
*completed,
|
|
||||||
*total,
|
fmt.Println(aurora.Sprintf(
|
||||||
wn,
|
"%s %s Downloading post %d (%s) -> %s...",
|
||||||
|
progress,
|
||||||
|
workerText,
|
||||||
post.ID,
|
post.ID,
|
||||||
humanize.Bytes(uint64(post.FileSize)),
|
humanize.Bytes(uint64(post.FileSize)),
|
||||||
getSavePath(&post, &directory),
|
getSavePath(&post, &directory),
|
||||||
)
|
))
|
||||||
|
|
||||||
err := downloadPost(&post, directory)
|
err := downloadPost(&post, directory)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue