ndrplz / google-drive-downloader

Minimal class to download shared files from Google Drive.
MIT License
268 stars 63 forks source link

- Added the ability to print the size of the currently downloaded data #5

Closed TheZoc closed 5 years ago

TheZoc commented 5 years ago

While I was downloading a few big files, sometimes I had no idea if the download stalled or if was just slow but still going. This is a simple modification to allow checking how much data was downloaded. Seems to be working on my side.

If you'd like me to modify anything prior merging, please, let me know :)

TheZoc commented 5 years ago

I just made dest_path an optional argument. If missing, the filename is retrieved from the response headers.

ndrplz commented 5 years ago

Hi @TheZoc , thanks for your contribution I'll give it a look asap!

ndrplz commented 5 years ago

Hi @TheZoc , just merged the PR. However I had to revert 0c9073c039fda776e54136c58fdb47e59d29abad for the moment since I did some tests and it fails the find the filename correctly. It must be something in the regex but I didn't had time to look into it. Does that work on your side you say?

TheZoc commented 5 years ago

Hey @ndrplz,

Yeah, it works for me :D

The file you attempted probably has a character that's not being caught by that regexp.

The current regexp is: [0-9A-Za-z ,.-+()[]]+

Matches any number, upper or lower case letters, spaces, commas, dots, minus sign, plus sign, parenthesis or brackets.

Then it splits commas and replaces it with underscore character. (That could be the character it's failing for you, since it's not in the regexp... Just noticed it!)

Can you provide an example of link that's failing to you? (You can upload a simple test text file and name it to one or the files you has trouble with).

I'd be happy to improve it :)