stogers
stogers

Reputation: 259

Unable to curl or wget an image from remote URL

I am just trying to download an image from Facebook from the command-line (in Mac OSX)

Any ideas as to why I can't curl an image from Facebook?

curl -O https://scontent-b.xx.fbcdn.net/hphotos-prn2/v/t34.0-12/s720x720/10361106_862849933729442_781906896_n.jpg?oh=180f721d0cd3107253c49448dffda02a&oe=537C1807

When I try curl, I get the html instead of the image (I am guessing because it doesn't have the image extension).

When I try wget, I get an error:

ERROR: The certificate of 'scontent-b.xx.fbcdn.net' is not trusted.
ERROR: The certificate of 'scontent-b.xx.fbcdn.net' hasn't got a known issuer.

Is there a way I can fix this? I specifically want that image! Thanks.

Upvotes: 2

Views: 1270

Answers (1)

Tobi
Tobi

Reputation: 31479

You can use wget instead of curl:

wget --accept .jpg,.jpeg --cookies=on -p "https://scontent-b.xx.fbcdn.net/hphotos-prn2/v/t34.0-12/s720x720/10361106_862849933729442_781906896_n.jpg?oh=180f721d0cd3107253c49448dffda02a&oe=537C1807" -O "image.jpg"

Upvotes: 1

Related Questions