settings.py 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # -*- coding: utf-8 -*-
  2. # Scrapy settings for hg3535 project
  3. #
  4. # For simplicity, this file contains only settings considered important or
  5. # commonly used. You can find more settings consulting the documentation:
  6. #
  7. # https://doc.scrapy.org/en/latest/topics/settings.html
  8. # https://doc.scrapy.org/en/latest/topics/downloader-middleware.html
  9. # https://doc.scrapy.org/en/latest/topics/spider-middleware.html
  10. BOT_NAME = 'hg3535'
  11. SPIDER_MODULES = ['hg3535.spiders']
  12. NEWSPIDER_MODULE = 'hg3535.spiders'
  13. # Crawl responsibly by identifying yourself (and your website) on the user-agent
  14. USER_AGENT = {
  15. 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20120813 Firefox/16.0'
  16. }
  17. # Obey robots.txt rules
  18. ROBOTSTXT_OBEY = False
  19. # Configure maximum concurrent requests performed by Scrapy (default: 16)
  20. CONCURRENT_REQUESTS = 64
  21. # Configure a delay for requests for the same website (default: 0)
  22. # See https://doc.scrapy.org/en/latest/topics/settings.html#download-delay
  23. # See also autothrottle settings and docs
  24. #DOWNLOAD_DELAY = 3
  25. DOWNLOAD_DELAY = 0
  26. # The download delay setting will honor only one of:
  27. CONCURRENT_REQUESTS_PER_DOMAIN = 32
  28. CONCURRENT_REQUESTS_PER_IP = 0
  29. # Disable cookies (enabled by default)
  30. #COOKIES_ENABLED = False
  31. # Disable Telnet Console (enabled by default)
  32. #TELNETCONSOLE_ENABLED = False
  33. # Override the default request headers:
  34. #DEFAULT_REQUEST_HEADERS = {
  35. # 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  36. # 'Accept-Language': 'en',
  37. #}
  38. # Enable or disable spider middlewares
  39. # See https://doc.scrapy.org/en/latest/topics/spider-middleware.html
  40. # from scrapy_deltafetch
  41. # SPIDER_MIDDLEWARES = {
  42. # # 'scrapy_deltafetch.DeltaFetch': 100,
  43. # 'hg3535.middlewares.Hg3535SpiderMiddleware': 543
  44. # }
  45. # #
  46. # DELTAFETCH_ENABLED = True
  47. # Enable or disable downloader middlewares
  48. # See https://doc.scrapy.org/en/latest/topics/downloader-middleware.html
  49. # DOWNLOADER_MIDDLEWARES = {
  50. # 'hg3535.middlewares.Hg3535DownloaderMiddleware': 543,
  51. # }
  52. # Enable or disable extensions
  53. # See https://doc.scrapy.org/en/latest/topics/extensions.html
  54. #EXTENSIONS = {
  55. # 'scrapy.extensions.telnet.TelnetConsole': None,
  56. #}
  57. # Configure item pipelines
  58. # See https://doc.scrapy.org/en/latest/topics/item-pipeline.html
  59. ITEM_PIPELINES = {
  60. # 篮球
  61. 'hg3535.pipelines.Lanqiupipeline': 300,
  62. # 冠军
  63. 'hg3535.pipelines.Guanjunpipeline': 300,
  64. # 联赛
  65. 'hg3535.pipelines.Liansaipipeline': 300,
  66. # 足球
  67. 'hg3535.pipelines.Zuqiupipeline': 300,
  68. # 网球
  69. "hg3535.pipelines.Wangqiupipeline": 300,
  70. # 网球波胆
  71. 'hg3535.pipelines.Wqbodanpipeline': 300,
  72. # 棒球让球&大小盘
  73. "hg3535.pipelines.Bangqiupipeline": 300,
  74. }
  75. # Enable and configure the AutoThrottle extension (disabled by default)
  76. # See https://doc.scrapy.org/en/latest/topics/autothrottle.html
  77. #AUTOTHROTTLE_ENABLED = True
  78. # The initial download delay
  79. #AUTOTHROTTLE_START_DELAY = 5
  80. # The maximum download delay to be set in case of high latencies
  81. #AUTOTHROTTLE_MAX_DELAY = 60
  82. # The average number of requests Scrapy should be sending in parallel to
  83. # each remote server
  84. #AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
  85. # Enable showing throttling stats for every response received:
  86. #AUTOTHROTTLE_DEBUG = False
  87. # Enable and configure HTTP caching (disabled by default)
  88. # See https://doc.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
  89. #HTTPCACHE_ENABLED = True
  90. #HTTPCACHE_EXPIRATION_SECS = 0
  91. #HTTPCACHE_DIR = 'httpcache'
  92. #HTTPCACHE_IGNORE_HTTP_CODES = []
  93. #HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'
  94. POST_HOST = 'localhost'
  95. POST_DATABASE = 'postgres'
  96. POST_USER = 'postgres'
  97. POST_PORT = '5433'
  98. POST_PASSWORD = '123456'
  99. R_HOST = 'localhost'
  100. R_POST = '6379'
  101. R_PASSWORD = '123456'
  102. # POST_HOST = '192.168.2.200'
  103. # POST_DATABASE = 'kaiyou'
  104. # POST_USER = 'kaiyou'
  105. # POST_PORT = '10432'
  106. # POST_PASSWORD = '123456'