Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zoemyatt committed Apr 21, 2024
1 parent 934a70f commit fd31c49
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scrapy/pipelines/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,12 @@ def media_downloaded(self, response, request, info, *, item=None):
raise FileException("download-error")

if not response.body:
if response.status == 201 and 'Location' in response.headers:
extra_request = Request(response.headers['Location'], callback=self.file_downloaded, meta={'info': info, 'item': item})
if response.status == 201 and "Location" in response.headers:
extra_request = Request(
response.headers["Location"],
callback=self.file_downloaded,
meta={"info": info, "item": item},
)
return extra_request
else:
logger.warning(
Expand Down

0 comments on commit fd31c49

Please sign in to comment.