Skip to main content

ProxySpinner is an straightforward, non-reliable, non-secure, but easy-to-use library for avoiding IP blocking by rotating free proxies on demand. It relies in services like proxyscrape.com to get the proxies and rotates them on demand, and is subject to the availability of that service and the proxies it lists.

Project description

'ProxyRotator is an straightforward, non-reliable, non-secure, but easy-to-use library for ' 'avoiding IP blocking by rotating free proxies on demand. It relies in services like ' 'proxyscrape.com to get the proxies and rotates them on demand, and is subject to the ' 'availability of that service and the proxies it lists.',

Proxy Rotator

ProxyRotator is an straightforward, non-reliable, non-secure, but easy-to-use library for avoiding IP blocking by rotating free proxies on demand. It relies in services like ProxyScrape.com to get the proxies and rotate them on demand, and is subject to the availability of that service and the proxies it lists.

Installation

pip install proxy-rotator

Usage

from proxy_spinner import ProxySpinner
import requests

# Initialize the proxy rotator. By default it uses no proxy until you call renew_proxy
proxy_manager = ProxySpinner()
# Renew the proxy to use a new one. Could take a while to find a working one
found_proxy = proxy_manager.renew_proxy()

# Use the proxy in your requests within a context manager
with proxy_manager:
    response = requests.get("https://cmp.inmobi.com/geoip").json()
    print(f"PROXY ENABLED: You are at  {response['city']} ({response['country']}) "
          "[Proxy: {found_proxy}]")

# Without the context manager, the proxy is not used
response = requests.get("https://cmp.inmobi.com/geoip").json()
print(f"PROXY DISABLED: You are at  {response['city']} ({response['country']})")

Output:

PROXY ENABLED: You are at budapest (hun) [Proxy: 178.48.68.61:18080]
PROXY DISABLED: You are at ********** (esp)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proxy-spinner-0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

proxy_spinner-0.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file proxy-spinner-0.1.tar.gz.

File metadata

  • Download URL: proxy-spinner-0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for proxy-spinner-0.1.tar.gz
Algorithm Hash digest
SHA256 91fc02d4f96d87c558feb269c0cfafe58cd958b29e4a02b501711e3f01192644
MD5 e56572e34f65bb84e07222d5f70b29ac
BLAKE2b-256 9340f338ce1d9539a7c99913e09d85ba0d98a588ccafe5e7efbb3d5b85d1e8b6

See more details on using hashes here.

File details

Details for the file proxy_spinner-0.1-py3-none-any.whl.

File metadata

  • Download URL: proxy_spinner-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for proxy_spinner-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c451af260097044e9c44f6b0e3faece5a2b462a7b4f54c81f1b1ba1c76506aac
MD5 d922b58a23050b208b42d76461d55bfa
BLAKE2b-256 2dcbfd05f67f9c689d99f7899a5159b4a8a35c868b7bbb783eacfbf14596767e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page