
Прокси [Находитель | Проверщик | Сервер]. HTTP(S) и SOCKS 🎭
.. image:: https://img.shields.io/pypi/v/proxybroker.svg?style=flat-square :target: https://pypi.python.org/pypi/proxybroker/ .. image:: https://img.shields.io/travis/constverum/ProxyBroker.svg?style=flat-square :target: https://travis-ci.org/constverum/ProxyBroker .. image:: https://img.shields.io/pypi/wheel/proxybroker.svg?style=flat-square :target: https://pypi.python.org/pypi/proxybroker/ .. image:: https://img.shields.io/pypi/pyversions/proxybroker.svg?style=flat-square :target: https://pypi.python.org/pypi/proxybroker/ .. image:: https://img.shields.io/pypi/l/proxybroker.svg?style=flat-square :target: https://pypi.python.org/pypi/proxybroker/
ProxyBroker — это инструмент с открытым исходным кодом, который асинхронно находит общедоступные прокси из нескольких источников и одновременно проверяет их.
.. * Save found proxies to a file in custom format.
aiohttp <https://pypi.python.org/pypi/aiohttp>_aiodns <https://pypi.python.org/pypi/aiodns>_maxminddb <https://pypi.python.org/pypi/maxminddb>_Чтобы установить последнюю стабильную версию из pypi:
.. code-block:: bash
$ pip install proxybroker
Последнюю разрабатываемую версию можно установить напрямую из GitHub:
.. code-block:: bash
$ pip install -U git+https://github.com/constverum/ProxyBroker.git
Примеры CLI
Поиск
""""
Найти и показать 10 HTTP(S) прокси из США с высоким уровнем анонимности:
.. code-block:: bash
$ proxybroker find --types HTTP HTTPS --lvl High --countries US --strict -l 10
.. image:: https://raw.githubusercontent.com/constverum/ProxyBroker/master/docs/source/_static/cli_find_example.gif
Сбор
""""
Найти и сохранить в файл 10 прокси из США (без проверки):
.. code-block:: bash
$ proxybroker grab --countries US --limit 10 --outfile ./proxies.txt
.. image:: https://raw.githubusercontent.com/constverum/ProxyBroker/master/docs/source/_static/cli_grab_example.gif
Сервер
"""""
Запустить локальный прокси-сервер, распределяющий входящие запросы по пулу
найденных HTTP(S) прокси с высоким уровнем анонимности:
.. code-block:: bash
$ proxybroker serve --host 127.0.0.1 --port 8888 --types HTTP HTTPS --lvl High
.. image:: https://raw.githubusercontent.com/constverum/ProxyBroker/master/docs/source/_static/cli_serve_example.gif
| Выполните ``proxybroker --help`` для получения дополнительной информации о доступных опциях.
| Выполните ``proxybroker <command> --help`` для получения дополнительной информации о команде.
Базовый пример кода
Найти и показать 10 рабочих HTTP(S) прокси:
.. code-block:: python
import asyncio
from proxybroker import Broker
async def show(proxies):
while True:
proxy = await proxies.get()
if proxy is None: break
print('Found proxy: %s' % proxy)
proxies = asyncio.Queue()
broker = Broker(proxies)
tasks = asyncio.gather(
broker.find(types=['HTTP', 'HTTPS'], limit=10),
show(proxies))
loop = asyncio.get_event_loop()
loop.run_until_complete(tasks)
Больше примеров <https://proxybroker.readthedocs.io/en/latest/examples.html>_.
https://proxybroker.readthedocs.io/
git checkout -b my-new-featuregit commit -am 'Add some feature'git push origin my-new-featureЛицензировано по лицензии Apache, версия 2.0
Этот продукт включает данные GeoLite2, созданные MaxMind, доступные по адресу http://www.maxmind.com <http://www.maxmind.com>_.