Closed fmkaiser closed 1 year ago
unless explicitly calling response.raise_for_status.
PR welcome to add this
Wow, that was fast ;)
Here is the pull request, it's a pretty trivial change.
I hope it doesn't cause problems with ancient versions of the requests library. But from what I can see in the changelog the raise_for_status function has been a thing for a long time.
First of all thanks for providing this useful tool!
However at least on my machine with
Python 3.6.15, requests==2.28.1
, the script tries to download files even after receiving 404 errors from the server!It seems that at least in newer versions of the
requests
library,requests.exceptions.HTTPError
is not raised unless explicitly calling response.raise_for_status.So it might be a good idea to either do that after the
requests.get()
call, or just checkresponse.ok
.