fix: get phone from phone pool when ENABLE_IP_PROXY is False
This commit is contained in:
parent
b7fe5b730a
commit
ad69e63d5f
|
@ -136,11 +136,11 @@ class XiaoHongShuCrawler(AbstractCrawler):
|
||||||
|
|
||||||
def create_proxy_info(self) -> Tuple[Optional[str], Optional[Dict], Optional[str]]:
|
def create_proxy_info(self) -> Tuple[Optional[str], Optional[Dict], Optional[str]]:
|
||||||
"""Create proxy info for playwright and httpx"""
|
"""Create proxy info for playwright and httpx"""
|
||||||
if not config.ENABLE_IP_PROXY:
|
|
||||||
return None, None, None
|
|
||||||
utils.logger.info("Begin proxy info for playwright and httpx ...")
|
|
||||||
# phone: 13012345671 ip_proxy: 111.122.xx.xx1:8888
|
# phone: 13012345671 ip_proxy: 111.122.xx.xx1:8888
|
||||||
phone, ip_proxy = self.account_pool.get_account()
|
phone, ip_proxy = self.account_pool.get_account()
|
||||||
|
if not config.ENABLE_IP_PROXY:
|
||||||
|
return phone, None, None
|
||||||
|
utils.logger.info("Begin proxy info for playwright and httpx ...")
|
||||||
playwright_proxy = {
|
playwright_proxy = {
|
||||||
"server": f"{config.IP_PROXY_PROTOCOL}{ip_proxy}",
|
"server": f"{config.IP_PROXY_PROTOCOL}{ip_proxy}",
|
||||||
"username": config.IP_PROXY_USER,
|
"username": config.IP_PROXY_USER,
|
||||||
|
|
Loading…
Reference in New Issue