(self)
| 32 | |
| 33 | @tools.retry(3, interval=5) |
| 34 | def pull_proxies(self): |
| 35 | resp = requests.get(self.proxy_api) |
| 36 | proxies = resp.text.strip() |
| 37 | resp.close() |
| 38 | if "{" in proxies or not proxies: |
| 39 | raise Exception("获取代理失败", proxies) |
| 40 | # 使用 /r/n 分隔 |
| 41 | return proxies.split("\r\n") |
| 42 | |
| 43 | def get_proxy(self): |
| 44 | try: |