asiniy

asiniy

Download - the easiest way to download files from the internet

Hey there!

I wrote a download elixir package which does exactly what its name about - an easy way to download files.

I saw solutions about how to do it with HTTPoison but these solutions have disadvantages:

  • The whole response is loading to the RAM, and only after then is going to the File.write/1. You have to choose async HTTPoison request to escape high memory consumption.
  • There is no restriction of the file size to download. If you handle, saying, user input and then you’re trying to download any file user provided, your server can go down for downloading a file which has 1TB size.

download depends on HTTPoison and successfully sidestep these issues.

Enjoy :wink:

Most Liked

NobbZ

NobbZ

This project is about downloading a single resource from the specified URL. It does not any magic to determine what the resource actually is. It gets saved as is and then you get path of the saved file.

This is in contrast to using HTTPoison without thinking about it and loading the full response into RAM.

One can get the same behaviour with HTTPosion directly though using async requests, but this package makes it a bit easier to process those.

gon782

gon782

Important to note is that with, for example, youtube-dl you also get support for downloading from Twitch and vimeo.

Eiji

Eiji

@asiniy: Nice, but I have a few ideas:

  1. Support for POST requests, because some pages requires it
  2. Support for parameters (GET) and data (POST), because it’s easier to read code (parameters) + some pages requires POST with data
  3. Support for finders, for example: Download.from(url, finder: Download.Finders.Video)
  4. Support for Traditional units
NobbZ

NobbZ

I do not like that page you linked @Eiji, it seems to confuse metric and binary prefixes.

Even gives megabyte as an example for binary and mebibyte as example while on the linked pages about binary and metric prefixes they are the other way round.

So I am not sure what you exactly mean by “traditional units”?

outlog

outlog

I would think you just downloaded the html file.

You probably need to use something like https://github.com/rg3/youtube-dl/ to get to the video file - you might want to use Porcelain to interface it https://github.com/alco/porcelain

Where Next?

Popular in Libraries Top

Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 13801 100
New
woylie
I released Doggo, a collection of unstyled Phoenix components. Features Unstyled Phoenix components. Storybook that can be added to...
New
treble37
Just looking for a little feedback on a tiny helper library I built - Sometimes I find the need to convert maps with atom keys to maps...
New
danschultzer
In short Plug n’ play OAuth 2.0 provider library. Just set up a resource owner schema with Ecto (your user schema), install the dependen...
New
Jskalc
Hi! Today, after a couple weeks of development I’ve released v0.1 of LiveVue. It’s a seamless integration of Vue and Phoenix LiveView, i...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
mtrudel
Bandit is an HTTP server for Plug and WebSock apps. Bandit is written entirely in Elixir and is built atop Thousand Island. It can serve...
New
Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Th...
New
KallDrexx
For a good number of months I've been working on creating a very basic RTMP live video streaming server. Now that I have a very, very ba...
New
mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Sub Categories:

We're in Beta

About us Mission Statement