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

Proxy Spinner

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-spinner

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for proxy-spinner-0.5.tar.gz
Algorithm Hash digest
SHA256 1e2fce5568ba6607bdf0ae8048f7b3d8e8bd5ab4b0c81a54aeb791fcce88967a
MD5 f402df102055d30990493bb222533368
BLAKE2b-256 b4dc3941ffb66dbe290c3a768320eb89d28925ec30f04f2d3c9ef2340e8e0339

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for proxy_spinner-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c4b92ae25f5db95d75bd8f6386e91557ced70a5c8c9d7f0a6d675db9b21039e0
MD5 75b9979d8fd63e570174d52063965d05
BLAKE2b-256 e3a61027c0e0e49ddfdee2dc0c0619602afa3c95f9e0dfaf9d6e27bb687512d7

See more details on using hashes here.

Supported by

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