Spaces:
Sleeping
Sleeping
Commit ·
e2d980c
1
Parent(s): c10b1dd
changed proxy pool
Browse files- proxy_pool.py +5 -0
proxy_pool.py
CHANGED
|
@@ -170,6 +170,11 @@ class ProxyPool:
|
|
| 170 |
if not self.available_proxies:
|
| 171 |
print("No available proxies")
|
| 172 |
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
proxy = self.available_proxies[self.current_index]
|
| 174 |
self.current_index = (self.current_index + 1) % len(self.available_proxies)
|
| 175 |
return proxy
|
|
|
|
| 170 |
if not self.available_proxies:
|
| 171 |
print("No available proxies")
|
| 172 |
return None
|
| 173 |
+
|
| 174 |
+
# Ensure current_index is within bounds
|
| 175 |
+
if self.current_index >= len(self.available_proxies):
|
| 176 |
+
self.current_index = 0
|
| 177 |
+
|
| 178 |
proxy = self.available_proxies[self.current_index]
|
| 179 |
self.current_index = (self.current_index + 1) % len(self.available_proxies)
|
| 180 |
return proxy
|