Skip to content

How to pipe curl or wget to tqdm cli? #1291

Answered by casperdcl
ketozhang asked this question in Q&A
Discussion options

You must be logged in to vote

curl

url="http://ipv4.download.thinkbroadband.com/100MB.zip"
total=$(curl -fsIL "$url" | sed -nr 's/.*Content-Length: ([0-9]+).*/\1/p')
curl -fsL "$url" | tqdm --bytes --total=$total > "$(basename "$url")"

wget

url="http://ipv4.download.thinkbroadband.com/100MB.zip"
total=$(wget -S --spider "$url" 2>&1 | sed -nr 's/.*Content-Length: ([0-9]+).*/\1/p')
wget -nv -O - "$url" | tqdm --bytes --total=$total > "$(basename "$url")"

Replies: 1 comment

Comment options

casperdcl
Jan 18, 2022
Maintainer Sponsor

You must be logged in to vote
0 replies
Answer selected by ketozhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants