mirror of https://github.com/scrapy/scrapy.git
fixed a couple of bugs caused by adding priority to Requests (thanks Artem for reporting)
This commit is contained in:
parent
4a1a01354b
commit
7c2476bb25
|
|
@ -44,8 +44,8 @@ class RobotsTxtMiddleware(object):
|
|||
else:
|
||||
self._parsers[urldomain] = None
|
||||
robotsurl = "%s://%s/robots.txt" % parsedurl[0:2]
|
||||
robotsreq = Request(robotsurl)
|
||||
dfd = scrapyengine.schedule(robotsreq, spiders.fromdomain(spiderdomain), priority=self.DOWNLOAD_PRIORITY)
|
||||
robotsreq = Request(robotsurl, priority=self.DOWNLOAD_PRIORITY)
|
||||
dfd = scrapyengine.schedule(robotsreq, spiders.fromdomain(spiderdomain))
|
||||
dfd.addCallbacks(callback=self._parse_robots, callbackArgs=[urldomain])
|
||||
self._spiderdomains[spiderdomain].add(urldomain)
|
||||
|
||||
|
|
|
|||
|
|
@ -122,7 +122,8 @@ class MediaPipeline(object):
|
|||
request fingerprint is used as cache key.
|
||||
|
||||
"""
|
||||
return scrapyengine.schedule(request, info.spider, priority=self.DOWNLOAD_PRIORITY)
|
||||
request.priority = self.DOWNLOAD_PRIORITY
|
||||
return scrapyengine.schedule(request, info.spider)
|
||||
|
||||
def media_to_download(self, request, info):
|
||||
""" Ongoing request hook pre-cache
|
||||
|
|
|
|||
Loading…
Reference in New Issue