Find fetch & validate free proxies fast.
Project description
🔷 Ballyregan
Find fetch & validate free proxies fast.
Ballyregan is a package & CLI that allows you to fetch free tested proxies really fast!
Key features:
- Fetch free tested proxies super fast with ProxyFetcher
- Validate your own proxies with ProxyValidator
- Filter custom proxy list by protocol & anonymity with ProxyFilterer
How does it work?
When you use the ProxyFetcher to fetch a proxy, it performs several steps:
- Gather all the available proxies from a list of built in providers (each provider gathers it's own and returns it to the fetcher).
-
Provider - any website that serves free proxy lists (e.g https://free-proxy-list.net).
- Filter all the gathered proxies by the given protocols and anonymities (if exist).
- Validate the filtered proxies and return them.
Note
You can write and append your own custom providers and pass it to the ProxyFetcher class as attribute.
Every custom proxy provider must implement the IProxyProvider base interface.
Behind the scenes
Fetching a proxy is an IO bound operation which depends on network. A common approach for this problem is performing your network requests async.
After digging a bit, testing Threads, Greenlets and async operations, we decided to go the async way.
To perform async http requests, ballyregan uses aiohttp and asyncio,
as "asyncio is often a perfect fit for IO-bound and high-level structured network code." (from asyncio docs).
By using the power of async http requests, ballyregan is able to validate thousands of proxies really fast.
Install
pip install ballyregan
Usage
📦 Package
Create a fetcher instance
from ballyregan import ProxyFetcher
# Setting the debug mode to True, defaults to False
fetcher = ProxyFetcher(debug=True)
Get one proxy
proxy = fetcher.get_one()
print(proxy)
Get multiple proxies
proxies = fetcher.get(limit=4)
print(proxies)
Get proxies by filters
from ballyregan.models import Protocols, Anonymities
proxies = fetcher.get(
limit=4,
protocols=[Protocols.HTTPS, Protocols.SOCKS5],
anonymities=[Anonymities.ELITE]
)
print(proxies)
💻 CLI
Get all proxies
ballyregan get --all
Get one proxy
ballyregan get
Use debug mode
ballyregan --debug get [OPTIONS]
Format output to json
ballyregan get -o json
Get proxies by limit
ballyregan get -l 4
Get proxies by filters
ballyregan get -l 4 -p https -p socks5 -a elite
👤 Author
Idan Daniel
- Github: @idandaniel
📝 License
Copyright © 2022 Idan Daniel.
This project is Apache License Version 2.0 licensed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ballyregan-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78e7603093318ce82420e99585c0afc8113ddcde6678f1e5274a7e91d0b1eec3 |
|
MD5 | 74bcdfd3b31ae719ebf9104ff31a21e6 |
|
BLAKE2b-256 | 47227878ac73d2d3b25c8b42690f77ae9a8c6d59ffe4538613ec4c587d4e0b92 |