MCPcopy Create free account
hub / github.com/NanmiCoder/MediaCrawler / is_current_proxy_expired

Method is_current_proxy_expired

proxy/proxy_ip_pool.py:118–128  ·  view source on GitHub ↗

Check if current proxy has expired Args: buffer_seconds: Buffer time (seconds), how many seconds ahead to consider expired Returns: bool: True means expired or no current proxy, False means still valid

(self, buffer_seconds: int = 30)

Source from the content-addressed store, hash-verified

116 return proxy
117
118 def is_current_proxy_expired(self, buffer_seconds: int = 30) -> bool:
119 """
120 Check if current proxy has expired
121 Args:
122 buffer_seconds: Buffer time (seconds), how many seconds ahead to consider expired
123 Returns:
124 bool: True means expired or no current proxy, False means still valid
125 """
126 if self.current_proxy is None:
127 return True
128 return self.current_proxy.is_expired(buffer_seconds)
129
130 async def get_or_refresh_proxy(self, buffer_seconds: int = 30) -> IpInfoModel:
131 """

Calls 1

is_expiredMethod · 0.80

Tested by 2