Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

AutoThrottle: respect download_delay=0 spider attribute

Mikhail Korobov1fef9f113237
diff --git a/scrapy/extensions/throttle.py b/scrapy/extensions/throttle.py
index 46273353b..d2ff8665e 100644
--- a/scrapy/extensions/throttle.py
+++ b/scrapy/extensions/throttle.py
@@ -28,7 +28,7 @@ class AutoThrottle(object):
def _min_delay(self, spider):
s = self.crawler.settings
- return getattr(spider, 'download_delay', 0.0) or s.getfloat('DOWNLOAD_DELAY')
+ return getattr(spider, 'download_delay', s.getfloat('DOWNLOAD_DELAY'))
def _max_delay(self, spider):
return self.crawler.settings.getfloat('AUTOTHROTTLE_MAX_DELAY')