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

Uploaded Source

Built Distribution

proxy_spinner-0.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: proxy-spinner-0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 f0b09bc6bed1f84cadd1e5de839be28f26d322cc1c894c9693b48b8536ae75af
MD5 d087a550783565b78097d480408eb65b
BLAKE2b-256 6109e3b2a6f6ddaf86efe66e52f7ef3951da2ae932e7f47dae7dab58371f3771

See more details on using hashes here.

File details

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

File metadata

  • Download URL: proxy_spinner-0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ff3e01d951a77cbd87aeb444a847184e3326d3c2bcb303ffd5aa58ac4aef857e
MD5 e3933a3777e42f1059ffbd07e64074b5
BLAKE2b-256 343494126fc6e0f61e33d5c0a7e2f741d610097e600831dc7e29d41f79fc6d88

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