Closed satyamtg closed 4 years ago
Quick comment: magic is a slow process. We usually want to use it when we don't have another way to get it or when the chances of an erroneous info is high and the consequences important.
Quick comment: magic is a slow process. We usually want to use it when we don't have another way to get it or when the chances of an erroneous info is high and the consequences important.
Okay. I know magic is slow but did that because using save_large_file from zimscraperlib.download means we do not get headers and doing another request would mean a bit longer wait time. Maybe we should refactor save_large_file() in zimscraperlib to also return headers if required. I have made this PR to solve it - https://github.com/openzim/python_scraperlib/pull/28. Will revert to original way of filetype checking for now
So, this uses save_large_file() from zimscraperlib.download. Also, I've made the following changes -
This introduces the following changes -
This fixes #36
Will be opened for review once scraperlib is updatedDepends on https://github.com/openzim/python_scraperlib/pull/28This now uses HEAD requests