shodan-python icon indicating copy to clipboard operation
shodan-python copied to clipboard

Warning before overwriting a file

Open nk9 opened this issue 6 years ago • 3 comments

I just downloaded 10k results before running out of credits. I didn't know that's why the download had stopped prematurely; I made a mistake and used shodan download again to the same file to continue from where I had left off.

Result: the file of 10k results was replaced with an empty file. But it's gzipped, so at least it's small!

AAAAAnyway, it would have really been preferred if the CLI had complained before blowing away the initial multi-megabyte .gz.

nk9 avatar Apr 24 '20 21:04 nk9

Agreed. Actually, I think it would make life easier if we appended to any existing file instead of overwriting the data. That way you don't need to concatenate .json.gz files together if you want to merge multiple files - you can just run the download request and output the results to the same file.

achillean avatar Apr 28 '20 21:04 achillean

Sounds even better. I guess this means I should close my pull request then?

nk9 avatar Apr 28 '20 21:04 nk9

It looks like you edited the wrong download method in your pull request. The one you edited is responsible for the bulk data downloads (shodan data download). And yes, I don't think that will be necessary anymore but I'll keep this issue open until that code is changed.

achillean avatar Apr 28 '20 22:04 achillean