Code Monkey home page Code Monkey logo

downloader-cli's People

Contributors

chancencounter avatar deepjyoti30 avatar heavytony2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

downloader-cli's Issues

ERROR: float division by zero

Hey, I've noticed that I often get a divide by zero error when trying to download files.
It appears the code does not handle the case when cur_time - beg_time is 0

Traceback (most recent call last):
  File "downloader-cli\0.3.1\downloader_cli\download.py", line 376, in _download
    speed, s_unit, time_left, time_unit = self._get_speed_n_time(
  File "downloader-cli\0.3.1\downloader_cli\download.py", line 264, in _get_speed_n_time
    speed = (file_size_dl / 1024) / (cur_time - beg_time)
ZeroDivisionError: float division by zero

ERROR: Errno 22 on instagram pictures

If I try to download a picture from instagram I get errno 22.

For example if I try to download the picture from this url:

https://scontent-muc2-1.cdninstagram.com/v/t51.2885-15/e35/p1080x1080/138734412_2824463591207841_3866668501561580560_n.jpg?_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_cat=109&_nc_ohc=KyByhjfBR1cAX9pp60k&tp=1&oh=c6072950e86196c504ac446f885378f3&oe=6037334E

I get following error:

ERROR: [Errno 22] Invalid argument: '138734412_2824463591207841_3866668501561580560_n.jpg?_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_cat=109&_nc_ohc=KyByhjfBR1cAX9pp60k&tp=1&oh=c6072950e86196c504ac446f885378f3&oe=6037334E'

I think it tries to get the filename and splits the url wrong?

UPDATE: Only happens on Python3 installed on Windows 10. On my linux machine it runs without an error.

doesn't skip fully downloaded files

Seems to download unnecessary data onto already completed files instead of skipping it. The file size just ends up larger than the original size. So maybe add a condition for cur_size >= int(original_size) or something

if original_size is None:
print("WARNING: Could not perform sanity check on partial download.",
file=self.ostream)
self._build_headers(cur_size)
elif cur_size < int(original_size):
self._build_headers(cur_size)

ERROR 'is a directory'

Everytime I try to download a file I get the error '{foldername} is a directory'.
des= the foldername I wan't to download the file to.

Where is the error?

image

Thanks!

Filesize check on line 76 can fail on missing Content-Length header

I don't know much more about it than the person on reddit knew, but I thought I'd document this here. Some download requests don't get Content-Length, causing a TypeError exception on line 76. I was able to reproduce this by attempting to download download.py directly from this repo (via the raw content link.)

Robust tests

Now that GitHub Actions are free, depending on the storage situation, it might be possible to run pytest on push/PR. Also to have it try each invocation in succession, against a checksum (download, check integrity, delete, download, interrupt, resume, check integrity...)

Turn this into a package?

Display is very cool, but having an alias/copying download.py to whatever directory you want to use it it in is fiddly, especially in big projects.

It would be easier if this was installed using setuptools, which would automatically install urllib3, and create the dw console script regardless of OS. (so no need to create the alias)

If it was installed into the global python packages, one could use it anywhere, by doing something like

pip3 install --user git+https://github.com/deepjyoti30/downloader-cli

and then importing it like any other package you'd install with pip.

If this seems like something you'd want to do, I can create a PR.

Inappropriate ioctl for device

The downloader in a specific machine writes 8192 bytes to a file and an exception occurs with this message: ERROR: [Errno 25] Inappropriate ioctl for device

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.