mirror of https://github.com/scrapy/scrapy.git
Merge pull request #1883 from lopuhin/botocore-files-store-fix
[MRG+1] Make FilesPipeline work with S3FilesStore using botocore
This commit is contained in:
commit
9ae4e46f32
|
|
@ -147,7 +147,7 @@ class S3FilesStore(object):
|
|||
Bucket=self.bucket,
|
||||
Key=key_name,
|
||||
Body=buf,
|
||||
Metadata={k: str(v) for k, v in six.iteritems(meta)},
|
||||
Metadata={k: str(v) for k, v in six.iteritems(meta or {})},
|
||||
ACL=self.POLICY,
|
||||
**extra)
|
||||
else:
|
||||
|
|
@ -364,8 +364,9 @@ class FilesPipeline(MediaPipeline):
|
|||
def file_downloaded(self, response, request, info):
|
||||
path = self.file_path(request, response=response, info=info)
|
||||
buf = BytesIO(response.body)
|
||||
self.store.persist_file(path, buf, info)
|
||||
checksum = md5sum(buf)
|
||||
buf.seek(0)
|
||||
self.store.persist_file(path, buf, info)
|
||||
return checksum
|
||||
|
||||
def item_completed(self, results, item, info):
|
||||
|
|
|
|||
Loading…
Reference in New Issue