This repository was archived by the owner on Nov 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed
Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change 88from datetime import datetime as dt
99import json
1010import os
11+ import sys
1112from time import sleep
1213from urllib .parse import urlencode
1314
@@ -178,12 +179,7 @@ def drain(self):
178179 """
179180 return self .get_proxies (len (self ._proxies ))
180181
181- def get_proxy (self ):
182- """Attempts to get a single proxy matching the specified params
183- """
184- return self .get_proxies (1 )[0 ]
185-
186- def get_proxies (self , amount ):
182+ def get (self , amount = 1 ):
187183 """Attempts to get `amount` proxies matching the specified params
188184 """
189185 # Remove any blacklisted proxies from the internal list
@@ -210,6 +206,25 @@ def get_proxies(self, amount):
210206
211207 return temp
212208
209+ def get_proxy (self ):
210+ """
211+ !DEPRECATED!
212+ Attempts to get a single proxy matching the specified params
213+ """
214+ return self .get_proxies (1 )[0 ]
215+
216+ def get_proxies (self , amount ):
217+ """
218+ !DEPRECATED!
219+ Attempts to get `amount` proxies matching the specified params
220+ """
221+ print (
222+ "DEPRECATED: this method is deprecated in favor of `.get(...)` and"
223+ " will be removed in the next major version of the library (2.0)" ,
224+ file = sys .stderr ,
225+ )
226+ return self .get (amount )
227+
213228 def _fetch (self ):
214229 """Attempts to get the proxies from pubproxy.com, will `sleep` to
215230 prevent getting rate-limited
You can’t perform that action at this time.
0 commit comments