Earlier quoted context omitted.
I just look at my curl / wget note for some sane examples. i cant believe one needed chatgpt to be productive
If chatgpt makes someone more productive, then why not. It's just a tool as any other tool.
The curl-wget Venn diagram
101–110 of 159 posts
Re: The curl-wget Venn diagram
#102Re: The curl-wget Venn diagram
#103Earlier quoted context omitted.
Also -OJ : with -O you get the name derived from the URL (the initial one, I think, even if redirects are being followed), with -OJ you get the one from the Content-Disposition header or the final URL, the way browsers do it. Of course, plain -O is safer. (For parity with Wget, you might also want to add -R to set the downloaded file’s mtime according to the Last-Modified header.)
-OJ is nice but doesn't work with -C- for some reason
Re: The curl-wget Venn diagram
#104Earlier quoted context omitted.
> You recall incorrectly. curl's -C flag does not work as-is. You must specify the offset from where it should continue. Why doesn't it take the resumed file's existing length as the guess by default? What else could the user want outside of some very exotic cases? But... it does, though. From the man page ( https://curl.se/docs/manpage.html#-C ) > Use "-C -" to tell curl to automatically find out where/how to resume…
No, `-C -` is not a flag. It is specifying the `-C` argument with obscure special value of `-`, which causes curl to determine the offset to continue from the output file length. This might be obvious to you if you are well-versed in curl command line, but it's by no means expected or obvious like a simple flag. > But curl is perfectly capable of resuming downloads automatically, you're just (very arrogantly) wrong o…
Yes you did:
> You must specify the offset from where it should continue
No, you mustn't, you can specify - and it does exactly what you want. The docs are very clear and even provide examples. At some point you should stop blaming curl for your inability to read a man page and admit that you were simply mistaken.
Re: The curl-wget Venn diagram
#105For the intersection area, I see no reason to use curl or wget over requests / urllib. Assuming one is inside a script.
Re: The curl-wget Venn diagram
#106On the cURL side; ridiculous manual I regularly forget the order for the values for --resolve , try searching for that word and figuring it out quickly I've been relegated to grepping a flippin' manual
Re: The curl-wget Venn diagram
#107Re: The curl-wget Venn diagram
#108I would also add at least "sane default options", "continues downloads" and "retries on error" to the Wget column. I recently had to write a script that downloads a very large file over a somewhat unreliable connection. The common wisdom among the engineers is that you need to use Wget for this job. I tried using curl but out of the box it could not resume or retry the download. I would have to study the manual and s…
Re: The curl-wget Venn diagram
#109Earlier quoted context omitted.
well, depends on the usecase. sometimes you want the whole url, like when i want to mirror a site and it has stuff like foo.html?page=1 foo.html?page=2 ... wget does have options to use the name proposed by the server, and so another option to remove the query arguments would be useful, and in line with those.
A new option to strip query parameters from the output filename would be interesting. But its not so simple. When combined with recursion, one will often see a lot of pages with the same name but different query parameters. How should they be stored on disk? There's a couple of different issues I can think of. However, if the potential issues can be resolved with sane defaults, I think this would be a great new switc…
Re: The curl-wget Venn diagram
#110I would also add at least "sane default options", "continues downloads" and "retries on error" to the Wget column. I recently had to write a script that downloads a very large file over a somewhat unreliable connection. The common wisdom among the engineers is that you need to use Wget for this job. I tried using curl but out of the box it could not resume or retry the download. I would have to study the manual and s…
Indeed - and curl requires `-L` to follow redirects whereas wget just does that by default too. So for ad-hoc CLI use, I turn to wget rather than remember all the curl options required.
(Though both can be made to do the other thing in some capacity)