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.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: proxy-spinner-0.2.tar.gz
  • Upload date:
  • Size: 4.0 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.2.tar.gz
Algorithm Hash digest
SHA256 dbcd09e7c6dea1dc098b7595783017ec9f3b16a9be3865587b6231678504127c
MD5 6585d2666b4e52b0a654c43e9af9b71c
BLAKE2b-256 7629bee7fce3a4597a474356acd5fda0a1513550892585ab1307a559cf2ff651

See more details on using hashes here.

File details

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

File metadata

  • Download URL: proxy_spinner-0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fd37bb6c1701e113890b29ef43d29e2cecb7f1f19515a1aab183b4f940ec81b2
MD5 0126e9807612e51beb1c190f2b2a8597
BLAKE2b-256 631db690dbf1752024f23afccec5542eea655d37826ef1a1d05073e248c81cf0

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