Git Product home page Git Product logo

ballyregan's Introduction

Ballyregan

Find fetch & validate free proxies fast.

Package version Supported Python versions License: Apache 2.0 Coverage


Ballyregan is a super fast proxy fetcher.
It provides a python package and an easy-to-use CLI to help you fetch Free Tested Proxies fast, and keep your privacy.


Key features:


Install

All you need to do is install the package from pypi, and it will automatically install the CLI for you.

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

Need some help?

ballyregan get --help

Get one proxy

ballyregan get

Get all proxies

ballyregan get --all

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

How does it work?

When you use the ProxyFetcher to fetch a proxy, it performs several steps:

  1. Gather all the available proxies from a list of built-in providers (each provider gathers its own and returns it to the fetcher).
  1. Filter all the gathered proxies by the given protocols and anonymities (if exist).
  2. Validate the filtered proxies and return them.

Note
You can write and append your own custom providers and pass them to the ProxyFetcher class as an attribute.
Every custom proxy provider must implement the IProxyProvider base interface.

Behind the scenes

Fetching a proxy is an IO bound operation that depends on the network. A common approach for this problem is performing your network requests async.
After digging a bit, and 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 can validate thousands of proxies really fast.
it to the ProxyFetcher class as an attribute.

Every custom proxy provider must implement the IProxyProvider base interface.


๐Ÿ“ License

Copyright ยฉ 2022 Idan Daniel.
This project is Apache License Version 2.0 licensed.

ballyregan's People

Contributors

idandaniel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.