cUrl not behaving the way it used to
I have followed every piece of advice, consulted the man pages numerous times, and no syntax seems to work when downloading pictures with the files I give them. They consistently arrive on my hard drive with the original filename (e.g.: 2.jpg) instead of the more descriptive name I assign in the "curl [options] [URL]" string that downloads the file.
wget? Use wget? I would except there are some sites where wget pulls down a 'dummy" image instead of the one I see on the webpage. I suspect that might have something to do with assigning Konqueror as user-agent in my wgetrc instead of a more widely-used browser like Firefox. (There again I'm the maverick) Why use a CLI downloader at all? Until I can bash script a browser, I will prefer the flexibility of curl, wget, Axel (which I love except for the fact that it doesn't preserve server timestamps) and aria2. Not too long ago, I had bash scripts written for cUrl. Of course, that was a few cUrl versions back; if these new behaviours came as part of the development arc, I'll write scripts that invoke wget instead. Carver |
Which options are you actually giving to curl? Please show a sample that is giving you trouble.
|
An example
Quote:
Code:
curl http://galleries.blahblah.com/77/7765/071/pic/5.jpg -o "blah77-7765-071-005.jpg" As I tried to indicate in my OP, I've done it both ways (local name before and after the URL) with no difference in the result. Might I need to tweak the .curlrc file, if such a thing exists? Carver |
I'm not able to duplicate the problem with curl 7.35.0. Which version do you have that is causing the problem?
|
i cannot reproduce this:
Code:
curl http://dt.iki.fi/stuff/powerline-shell.png -o "stuff.jpg" is it part of a script? show us the script? does it work outside the script? which curl version? |
Quote:
Quote:
Quote:
Carver |
strace it?
|
Quote:
A pointless side-track, imo. I can post the code from another strace, certainly, if you can draw out what might be going wrong here, but it would make the post in which I pasted it especially long. I read on one page that redirecting the downloaded file (">") and naming it in that command should work. I tried it and got an empty file with the name I gave it. Carver |
This is what I did:
Code:
c0wb0y@laptop:~> strace -e open -o strace-curl.txt curl -o /tmp/test.png http://dt.iki.fi/stuff/powerline-shell.png The output above can help you trace if you have any ~/.curlrc or even a global rc at /etc? |
Still using the server end filename
I tried your test string, minus the redirect to /tmp.
Quote:
Code:
#this is a sample .curlrc file It occurred to me just now I've been enclosing my 'wanted' file names in double quotes (an old habit from using Cygwin). Could that be why I'm not getting the filename I ask for? Carver |
Did you try:
- renaming your curlc so it does not get used - double quote should have no bearing to filename creation. - run strace similar to what I did so you can see how filename is created. |
Seems now to do it right half the time
I'm getting just about every other download I do locally named; the others named as they are/were on the server. Not a script-able thing, as I see it, but as with everything else I'm finding different (and "bad") in this LinuxMint install, I feel like I'm edging closer to a solution. I'm starting to think some of the difficulty might be attributable to flaws, maybe even bugs, in my curl version that will, hopefully, be worked out in the next (or the next after that) dot-upgrade. And when you find something that's buggy, and you want more than to hope for resolution, the thing to do is communicate with the developers.
That may be the ultimate step. Carver |
Code:
curl -A "Mozilla/5.0" http://www....com -o - > filename.xyz |
Quote:
I have curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 and I don't have this behavior.. |
Quoted URL does not work, either way
I tried
Code:
curl -o "imagegame12128-007.jpg" -R "http://img63.imagegame.com/i/12828/5c5lzwbrpnhn.jpg/img07.jpg" Code:
ls: cannot access 'imagegame.jpg': No such file or directory Code:
curl -R "http://img63.imagegame.com/i/12828/5c5lzwbrpnhn.jpg/img07.jpg" -o "imagegame12128-007.jpg" Code:
ls: cannot access 'imagegame.jpg': No such file or directory Carver |
All times are GMT -5. The time now is 08:21 AM. |