surishortlink/suri

[Q] Any way to use curl/wget a referenced file?

2ndMessiah opened this issue · 3 comments

Hi Jstayton!

Nice job on Suri!!

My question is: Is it possible to download a file that's pointed to by Suri?

Forgive my noobness.

Appreciate it!

Hey @2ndMessiah – Sorry for the long delay. If you're still wondering about this, can you explain a bit more? Are you wanting to use cURL/Wget on the command line to download a file that's redirected to by Suri?

Hey @2ndMessiah – Sorry for the long delay. If you're still wondering about this, can you explain a bit more? Are you wanting to use cURL/Wget on the command line to download a file that's redirected to by Suri?

Thx for the reply. Yeah exactly. Now I would curl the shortened url to get the original url and curl it again to download it. Is there a better way? It's all good never mind:)

The short URL will respond with the HTML to do the redirect. You would need to parse the original URL out of that to then download it, since non-HTML environments like cURL/Wget don't automatically follow that type of redirect (as they do with 3xx HTTP status codes, which Suri doesn't use).

Hope that helps!