skyjake / lagrange

A Beautiful Gemini Client
https://gmi.skyjake.fi/lagrange/
BSD 2-Clause "Simplified" License
1.22k stars 65 forks source link

Allow using a download manager to get files over HTTP(S) #196

Open handicraftsman opened 3 years ago

handicraftsman commented 3 years ago

This would be a nice feature in case somebody posts a link to an HTTP(S) resource in a gemtext file, as it would allow easier file download without either using such a manager manually or starting a heavy web browser.

skyjake commented 3 years ago

This could go together with #135 and #66 so that wget/curl gets called in the background to handle the actual HTTP(S) request. Then it would appear like a regular download inside Lagrange.

handicraftsman commented 3 years ago

Oh, nice!

0v3rCl0kEd commented 3 years ago

Wouldn't using wget or curl break lagrange on windows? There is wget for windows from gnuwin32 project but not everyone uses it so it's not a good choice to rely on it. I think you could use .net framework to download files but I think it would be a bit to hacky.

skyjake commented 3 years ago

Hmm, the Windows build is MSYS2 based. I think an MSYS2 build of wget or curl could be included with Lagrange, if we go this route.

I don't think it's appropriate to add a dependency on .NET. I haven't looked through the Win32 APIs with this in mind, but maybe there's something useful in there.

0v3rCl0kEd commented 3 years ago

From what I read on the internet, windows 10 now ships with curl installed but it would still be a problem for windows 7/8. I think you can also download things with some powershell commands so it might be doable without more dependencies.

handicraftsman commented 3 years ago

From what I read on the internet, windows 10 now ships with curl installed but it would still be a problem for windows 7/8. I think you can also download things with some powershell commands so it might be doable without more dependencies.

It's curl has a different syntax. Also you can just ship a curl executable yourself, maybe just slightly renamed to avoid collisions on windows.