Skip to content

Commit

Permalink
[common] simplify 'status_code' check in Extractor.request()
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Apr 16, 2024
1 parent 68f4208 commit 923c6f3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gallery_dl/extractor/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ def request(self, url, method="GET", session=None,
code = response.status_code
if self._write_pages:
self._dump_response(response)
if 200 <= code < 400 or fatal is None and \
(400 <= code < 500) or not fatal and \
(400 <= code < 429 or 431 <= code < 500):
if (
code < 400 or
code < 500 and (not fatal and code != 429 or fatal is None)
):
if encoding:
response.encoding = encoding
return response
Expand Down

0 comments on commit 923c6f3

Please sign in to comment.