Skip to content

Commit 5976f2e

Browse files
committed
fix(youtube-upload): progress bar
1 parent dd8ca9c commit 5976f2e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/youtube.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,14 @@ pub async fn upload_video<'a>(
6262
.to_str()
6363
.unwrap();
6464

65-
let pb = indicatif::ProgressBar::new(20);
65+
let pb = indicatif::ProgressBar::new(file_size);
66+
pb.set_style(
67+
indicatif::ProgressStyle::with_template(
68+
"[{elapsed_precise}] [{wide_bar:.cyan/blue}] {bytes}/{total_bytes} ({eta})",
69+
)
70+
.unwrap(),
71+
);
72+
6673
let file = pb.wrap_async_read(file);
6774

6875
let req = client

0 commit comments

Comments
 (0)