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
Built Distribution
File details
Details for the file proxy-spinner-0.4.tar.gz
.
File metadata
- Download URL: proxy-spinner-0.4.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a91620cd704ce32a9c0c5ab70bf35e18a83869aa126a3e1f68d358adb9e4a3f6 |
|
MD5 | 805c43127bf431a5178db2af2d5154ac |
|
BLAKE2b-256 | 974143cab413d11869515459f5cdd05880694a38d6021781555b8b6bb08fddf1 |
File details
Details for the file proxy_spinner-0.4-py3-none-any.whl
.
File metadata
- Download URL: proxy_spinner-0.4-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbf5b897ce58ac06e64eb94a680bfc39f1c9814493694bec3c6b8c0dd9c38fa8 |
|
MD5 | 6c5014c59cb5294c7306ea1de48df360 |
|
BLAKE2b-256 | f0bcf1b4200ed9ac990bc6a9009bcde3bd592e83aa9156d85b8664c54fa03e5e |