From ad69e63d5fdb918a81f345524816036d342a0e41 Mon Sep 17 00:00:00 2001 From: xiaoniu Date: Thu, 31 Aug 2023 13:57:54 +0800 Subject: [PATCH] fix: get phone from phone pool when ENABLE_IP_PROXY is False --- media_platform/xhs/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/media_platform/xhs/core.py b/media_platform/xhs/core.py index d62ac1d..60136cf 100644 --- a/media_platform/xhs/core.py +++ b/media_platform/xhs/core.py @@ -136,11 +136,11 @@ class XiaoHongShuCrawler(AbstractCrawler): def create_proxy_info(self) -> Tuple[Optional[str], Optional[Dict], Optional[str]]: """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, 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 = { "server": f"{config.IP_PROXY_PROTOCOL}{ip_proxy}", "username": config.IP_PROXY_USER,