Skip to content
This repository was archived by the owner on Nov 5, 2023. It is now read-only.

Commit 00c73de

Browse files
Update documentation
1 parent 642d586 commit 00c73de

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ https_pf = ProxyFetcher(
4242
# Get one socks proxy, followed by 10 https proxies
4343
# NOTE: even though there are multiple `ProxyFetcher`s the delays are
4444
# coordinated between them to prevent rate limiting
45-
socks_proxy = socks_pf.get_proxy() # Get a single proxy as a string
46-
https_proxies = https_pf.get_proxies(10) # Get a list of proxies as strings
45+
socks_proxy = socks_pf.get()[0] # Get a single socks proxy
46+
https_proxies = https_pf.get(10) # Get a 10 https proxies
4747

4848
# And then if you want to get any remaining proxies left over before you're
4949
# done you can!
@@ -54,7 +54,7 @@ unused_proxies = socks_pf.drain()
5454

5555
## Documentation
5656

57-
Getting proxies is handled by the `ProxyFetcher` class. There are several parameters you can pass on initialization to narrow down the proxies to a suitable type. From there you can just call `get_proxy` to receive a proxy in the form of `{ip-address}:{port-number}` or call `get_proxies(amount)` to receive a list of `amount` proxies. There is an internal blacklist to ensure that the same proxy IP and port combo will not be used more than once by any `ProxyFetcher`, unless `exclude_used` is `False`.
57+
Getting proxies is handled by the `ProxyFetcher` class. There are several parameters you can pass on initialization to narrow down the proxies to a suitable type. From there you can just call `.get(amount=1)` to receive a list of `amount` proxies where each proxy is in the form of `"{ip}:{port}"`. There is an internal blacklist to ensure that the same proxy IP and port combo will not be used more than once by any `ProxyFetcher`, unless `exclude_used` is `False`.
5858

5959
### `ProxyFetcher` Parameters
6060

@@ -80,13 +80,12 @@ Since the API doesn't check pretty much anything for correctness, we do our best
8080

8181
### `ProxyFetcher` Methods
8282

83-
Keeping it simple (stupid), so just `get_proxy()`, `get_proxies(amount)`, and `drain()`.
83+
Keeping it simple (stupid), so just `.get(amount=1)` and `.drain()`.
8484

8585
|Method|Returns|
8686
|:--|:--|
87-
|`get_proxy()`|Single proxy as a string, format `{ip}:{port}`|
88-
|`get_proxies(amount)`|List of `amount` proxies, same format as above|
89-
|`drain()`|Returns any proxies remaining in the current list, useful if you are no longer getting proxies and want to save any left over|
87+
|`.get(amount=1)`|List of `amount` proxies, where each proxy is a `str` in the form `"{ip}:{port}"`|
88+
|`.drain()`|Returns any proxies remaining in the current list, useful if you are no longer getting proxies and want to save any left over|
9089

9190
### Exceptions
9291

0 commit comments

Comments
 (0)