# -*- coding: utf-8 -*-
import random, base64


class ProxyMiddleware(object):

    proxyList = [ \
        '82.214.139.109:8080', '78.38.67.218:8080'
        ]

    def process_request(self, request, spider):
        # Set the location of the proxy
        pro_adr = random.choice(self.proxyList)
        print("USE PROXY -> " + pro_adr)
        request.meta['proxy'] = "http://" + pro_adr
