text: # -*- coding: utf-8 -*-
  # Scrapy settings for zspider project
  #
  # For simplicity, this file contains only settings considered important or
  # commonly used. You can find more settings consulting the documentation:
  #
  #     http://doc.scrapy.org/en/latest/topics/settings.html
  #     http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
  #     http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html
  from .conf import DEBUG
  from .conf import MC_SERVERS
  
  BOT_NAME = "ZSPIDER"
  
  SPIDER_MODULES = ["zspider.spiders"]
  
  DUPEFILTER_DEBUG = DEBUG
  DUPEFILTER_CLASS = "zspider.dupefilters.MemcachedDupeFilter"
  DUPEFILTER_SERVERS = MC_SERVERS
  
  CONCURRENT_ITEMS = 5
  # Crawl responsibly by identifying yourself (and your website) on the user-agent
  USER_AGENT = (
      "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) "
      "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
  )
  
  # Configure maximum concurrent requests performed by Scrapy (default: 16)
  CONCURRENT_REQUESTS = 30
  
  # Configure a delay for requests for the same website (default: 0)
  # See http://scrapy.readthedocs.org/en/latest/topics/settings.html#download-delay
  # See also autothrottle settings and docs
  # DOWNLOAD_DELAY = 3
  # The download delay setting will honor only one of:
  # CONCURRENT_REQUESTS_PER_DOMAIN = 16
  CONCURRENT_REQUESTS_PER_IP = 5
  
  # Disable cookies (enabled by default)
  # COOKIES_ENABLED=False
  
  MEMDEBUG_ENABLED = True
  # Disable Telnet Console (enabled by default)
  TELNETCONSOLE_ENABLED = False
  
  # Override the default request headers:
  # DEFAULT_REQUEST_HEADERS = {
  #   'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  #   'Accept-Language': 'en',
  # }
  
  # Enable or disable spider middlewares
  # See http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html
  # SPIDER_MIDDLEWARES = {
  #    'zspider.middlewares.MyCustomSpiderMiddleware': 543,
  # }
  
  # Enable or disable downloader middlewares
  # See http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
  DOWNLOADER_MIDDLEWARES = {
      "zspider.middlewares.SeleniumMiddleware": 1,
      # 'zspider.middlewares.RandUAMiddleware': 400,
      "zspider.middlewares.RecordReqMiddleware": 650,  # 保证该中间件process_response在302跳转处理前面
      # 'zspider.middlewares.HttpProxyMiddleware': 740,  # scrapy httpproxy中间件为750
  }
  
  # Enable or disable extensions
  # See http://scrapy.readthedocs.org/en/latest/topics/extensions.html
  # EXTENSIONS = {
  #    'scrapy.telnet.TelnetConsole': None,
  # }
  
  # Configure item pipelines
  # See http://scrapy.readthedocs.org/en/latest/topics/item-pipeline.html
  PUB_PORT = "http://pubserver.com"
  TRANS_PORT = "http://image.server.com/totranslate/images"
  ITEM_PIPELINES = {
      # "zspider.pipelines.PubPipeLine": 300,
      "zspider.pipelines.CappedStorePipeLine": 999,
  }
  
  # Enable and configure the AutoThrottle extension (disabled by default)
  # See http://doc.scrapy.org/en/latest/topics/autothrottle.html
  # NOTE: AutoThrottle will honour the standard settings for concurrency and delay
  AUTOTHROTTLE_ENABLED = True
  # The initial download delay
  AUTOTHROTTLE_START_DELAY = 2
  # The maximum download delay to be set in case of high latencies
  AUTOTHROTTLE_MAX_DELAY = 10
  # Enable showing throttling stats for every response received:
  AUTOTHROTTLE_DEBUG = False
  