Skip to content

Commit

Permalink
fix: get phone from phone pool when ENABLE_IP_PROXY is False
Browse files Browse the repository at this point in the history
  • Loading branch information
yangrq1018 committed Aug 31, 2023
1 parent b7fe5b7 commit ad69e63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions media_platform/xhs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ async def get_comments(self, note_id: str, semaphore: asyncio.Semaphore):

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,
Expand Down

0 comments on commit ad69e63

Please sign in to comment.