Change the IP address with each http request using the AWS API Gateway.
Project description
aiohttp-ip-rotator
An asynchronous alternative to the requests-ip-rotator (https://github.com/Ge0rg3/requests-ip-rotator) library based on aiohttp, completely copying its functionality
Example
from asyncio import get_event_loop
from aiohttp_ip_rotator import RotatingClientSession
async def main():
session = RotatingClientSession("https://api.ipify.org", "aws access key id", "aws access key secret")
await session.start()
for i in range(5):
response = await session.get("https://api.ipify.org")
print(f"Your ip: {await response.text()}")
await session.close()
if __name__ == "__main__":
get_event_loop().run_until_complete(main())
Example 2
from asyncio import get_event_loop
from aiohttp_ip_rotator import RotatingClientSession
async def main():
async with RotatingClientSession(
"https://api.ipify.org",
"aws access key id",
"aws access key secret"
) as session:
for i in range(5):
response = await session.get("https://api.ipify.org")
print(f"Your ip: {await response.text()}")
if __name__ == "__main__":
get_event_loop().run_until_complete(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file aiohttp-ip-rotator-1.0.tar.gz
.
File metadata
- Download URL: aiohttp-ip-rotator-1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5de03738117e484748755d07a3b96dc54bc72a1a3b0d92941037c5f3c19d125b |
|
MD5 | d80d86f6a2bc4db017c38d5323c09fe7 |
|
BLAKE2b-256 | 131759ce2b5fab9142e9712508f5c445965b5b618b829f62a597f4f276785eb6 |