mirror of https://github.com/scrapy/scrapy.git
Do not try to set item['images'] if it is not defined in the Item.
This commit is contained in:
parent
43028876b5
commit
2b93b0a93c
|
|
@ -309,5 +309,6 @@ class ImagesPipeline(MediaPipeline):
|
|||
return [Request(x) for x in item.get('image_urls', [])]
|
||||
|
||||
def item_completed(self, results, item, info):
|
||||
item['images'] = [x for ok, x in results if ok]
|
||||
if 'images' in item.fields:
|
||||
item['images'] = [x for ok, x in results if ok]
|
||||
return item
|
||||
|
|
|
|||
Loading…
Reference in New Issue