mirror of https://github.com/scrapy/scrapy.git
imagepipeline: return a dict instead of a path joined with checksum with a hash
--HG-- extra : rebase_source : cd450c66be44381e905264ecff3f709bb9d302d4
This commit is contained in:
parent
91ff9c9d50
commit
b05fd80640
|
|
@ -72,7 +72,7 @@ class BaseImagesPipeline(MediaPipeline):
|
|||
log.msg(str(ex), level=log.WARNING, domain=info.domain)
|
||||
raise ex
|
||||
|
||||
return '%s#%s' % (key, checksum) if checksum else key
|
||||
return {'scraped_url': request.url, 'path': key, 'checksum': checksum}
|
||||
|
||||
def media_failed(self, failure, request, info):
|
||||
referer = request.headers.get('Referer')
|
||||
|
|
@ -101,7 +101,7 @@ class BaseImagesPipeline(MediaPipeline):
|
|||
self.inc_stats(info.domain, 'uptodate')
|
||||
|
||||
checksum = result.get('checksum', None)
|
||||
return '%s#%s' % (key, checksum) if checksum else key
|
||||
return {'scraped_url': request.url, 'path': key, 'checksum': checksum}
|
||||
|
||||
key = self.image_key(request.url)
|
||||
dfd = defer.maybeDeferred(self.stat_key, key, info)
|
||||
|
|
|
|||
Loading…
Reference in New Issue