# -*- coding: utf-8 -*-

# Scrapy settings for kindle project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
#     http://doc.scrapy.org/en/latest/topics/settings.html
#

BOT_NAME = 'kindle'

SPIDER_MODULES = ['kindle.spiders']
NEWSPIDER_MODULE = 'kindle.spiders'
# DUPEFILTER_DEBUG = True
ITEM_PIPELINES = ['kindle.pipelines.KindlePipeline']

# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'kindle (+http://www.yourdomain.com)'
#USER_AGENT = 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36'
USER_AGENT = 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/36.0.1985.125 Chrome/36.0.1985.125 Safari/537.36'

HTTP_PROXY = 'http://127.0.0.1:8123'
#disable the default useragent, enable the new useragent
DOWNLOADER_MIDDLEWARES = {
        'scrapy.contrib.downloadermiddleware.useragent.UserAgentMiddleware' : None,
        'kindle.spiders.random_useragent.RandomUserAgentMiddleware' :400,
        'kindle.spiders.middlewares.ProxyMiddleware': 410
    }

COOKIES_ENABLES=False
DOWNLOAD_DELAY = 0.2