fix
This commit is contained in:
parent
cf5bde7e08
commit
d6cb8e4251
@ -24,7 +24,8 @@ class ProxyMiddleware(object):
|
||||
def process_request(self, request, spider):
|
||||
url = request.url
|
||||
logging.debug(f"proxy url=== {url} {str(url).split('.')[-1]}")
|
||||
if str(url).split('.')[-1] not in HTTPCACHE_ALLOW_PREFIXS or str(url).replace("https://", "").replace("http://", "").split("/") in HTTPCACHE_PROXY_DOMAINS:
|
||||
domain = str(url).replace("https://", "").replace("http://", "").split("/")[0]
|
||||
if str(url).split('.')[-1] not in HTTPCACHE_ALLOW_PREFIXS or domain in HTTPCACHE_PROXY_DOMAINS:
|
||||
if len(PROXY_LIST) != 0:
|
||||
request.meta["proxy"] = random.choice(PROXY_LIST)
|
||||
else:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user