andrscrrn / pizza-guy

If you already have a big list of urls of files that you want to download but you don't know how, this is your module.
MIT License
7 stars 3 forks source link

Empty files issue related with url redirects #19

Closed neddihrehat closed 8 years ago

neddihrehat commented 8 years ago

Just downloaded a sample gist from github. And it returned empty files.

The code:

var pizzaGuy = require('pizza-guy');
const files = [
  'https://github.com/andresdavid90/pizza-guy/archive/master.zip'
];
pizzaGuy
  .deliver(files)
  .onAddress('./downloads')
  .onSuccess((info) => {
    console.log(`${info.fileName} succeed!`);
  })
  .onError((info) => {
    console.log(`${info.fileName} failed`);
  })
  .start();

The result is a empty file. http://i.imgur.com/aalTtaw.png

Probably issue with https and/or redirects?

andrscrrn commented 8 years ago

@neddihrehat Thank you for reporting this. I was already able to replicate the issue and I'm currently investigating.

andrscrrn commented 8 years ago

We injected the issue in the commit beb6883458a3e785d186b54c0290679c7b5156c4. Still investigating.

andrscrrn commented 8 years ago

Well, actually the commit that I just mentioned injected an issue that is affecting any kind of file, but even if we fix the issue, zip files with redirections like https://github.com/andresdavid90/pizza-guy/archive/master.zip are still failing.

I'm creating a separate issue for the big bug affecting everything, and we'll use this one to track files with url redirects.

andrscrrn commented 8 years ago

@neddihrehat I just fixed this issue in #37. We'll have this fix soon in master so it would be reflected in NPM soon. Thanks for reporting this. 🤗