Announcing wcurl: a curl wrapper to download files | Samuel Henrique (samueloph)

My personal website

Samuel Henrique (samueloph)
@bagder oh wonderful no more fiddling with curl flags to just download a file
@bagder ohhh, that is actually awesome!
@bagder Oh my, I might finally get to stop using wget -nd ... ?

@bagder

Nice to read this:
'You know... "it's that wget alternative for when you want to use curl instead"'

and followed by:
'wcurl will come installed with the curl package from now on'

Congrats all team involved!

@bagder I would have liked wurl as a name, but oh well :D.

This seems like a nice shortcut/wrapper though.

@Bubu @bagder interesting suggestion, it would go beyond my English abilities to be able to say that word, though, hahahaha
@bagder Upstream it!
@icing @bagder Why would you upstream a wget clone?
@pierreprinetti @bagder To make it part of curl and with that available to other distributions and people?
@icing @bagder OK, wrong question. I understand the implications of giving an authoritative home to the wcurl project; what I fail to understand is why you think that the world needs you to distribute a wget clone.

@icing @bagder

Curl is the ideal tool for downloading files and for interacting with HTTP APIs. Many people use two different tools just because their API specializes on one or the other use.

Functionally, you could often replace wget with a spicy Bash alias of curl.

So my point is: you are saying that the two-tools solution is THE solution to this API problem, so much so that it’s worth replicating it in a domain (the curl brand) you have complete control over. It’s surprising.

@pierreprinetti @bagder No, I am not putting out a dogma about anything.

I see that people made something that they consider useful. It is a script on top of curl, it seems to fit into what curl distributes.

On Debian is was already added to the curl distribution. So, if people using other platform also want it, it seems the curl project is the best place to keep and maintain it - assuming its author wants to, of course.

@pierreprinetti @icing @bagder There clearly are two mutually-exclusive needs for the CLI commands:
1) One that spits out the return in stdout by default
2) One that saves the output in a file by default

The use case is so common that people will naturally stick to the tool that doesn't require any parameters for the majority of the cases within that main goal (e.g.: retries by default). Thus it's impossible to have a single command addressing both issues at the same time.

@bagder neato, thank you for mentioning this! Gave me a chance to offer a hopefully useful little behavior tweak to diminish potential surprise behavior, https://github.com/Debian/wcurl/pull/9
Disable curl's URL globbing parser by gnomon- · Pull Request #9 · Debian/wcurl

Users may not expect URLs that include [] and {} character pairs to be interpolated by curl's globbing parser when they are expecting the behavior of a simple download tool. This change adds the "...

GitHub
@bagder Available for MacPorts as of yesterday!

@schamschula @bagder I'd love to say the same for Homebrew, but without any releases that'll be a tough sell.

Any chance we can get a tag to package it?

@bagder @SMillerNL @schamschula yes, that's going to be fixed later today along with some other changes (including non-linux support)
@samueloph
@bagder
I vote for naming it "wurl", though, as already proposed in the previous comments 😁

@bagder @SMillerNL @schamschula

We now have tagged releases, besides non-linux support (we dropped getopt) and a few other things.

@samueloph @bagder @schamschula Thanks for that, Homebrew is going to merge it in https://github.com/Homebrew/homebrew-core/pull/176667. One issue was the fact that it takes the first curl install in PATH, which was not new enough on our Linux CI.
wcurl 2024-07-07 (new formula) by p-linnane · Pull Request #176667 · Homebrew/homebrew-core

Have you followed the guidelines for contributing? Have you ensured that your commits follow the commit style guide? Have you checked that there aren't other open pull requests for the same formu...

GitHub
@SMillerNL @bagder @schamschula sounds like you found out that wcurl doesn't work with an older curl release, is that right? If so, we should document this on our side (if not possible to address it), can you point me to the failing CI run and/or the curl version that it failed with, please?
@samueloph @bagder @schamschula we're using Ubuntu 22.04 as a base (which has curl 7.81.0). The CI run is replaced by a successful one unfortunately.

@SMillerNL @bagder @schamschula support for Ubuntu 22.04 should arrive at https://salsa.debian.org/debian/wcurl/-/merge_requests/6

We will try to document the minimum curl version required for wcurl for the next release (should happen in the next couple of days).

Only set --no-clobber if curl is 7.83 or newer (!6) · Merge requests · Debian / wcurl · GitLab

Issue pointed out at https://mastodon.social/@SMillerNL/112751350330636658

GitLab
@samueloph @bagder @schamschula Cool, great work! Homebrew might still keep hardcoding the curl version since we can't be sure what the curl version is otherwise. But I'm sure this will make it easier to use for others.
@bagder at first sounded like a joke to me ngl lmao
But then ig made sense tbh, I had the exact thing happen to me when I forgot flags for curl when I needed to quickly download a file and just installed wget lol, so yeah this is great

@bagder I don't get it. A new binary because people can't remember the switches? Alias the command with switches and no extra binary needed.

alias wcurl='curl -L -O -C'

@stoeps 1. it's not a binary, it's a 100-line script. 2. I didn't do it, I just mention it here. 3. lots of people seem to see the point
@bagder even a wrapper or 100 lines of code. :D
@bagder I'm waiting for this 200 line simple bash script to explode into a 10k lines of pure bash warship!