https://github.com/tigregotico/anon_requests
anonymous requests
https://github.com/tigregotico/anon_requests
anonymous proxies proxy proxy-checker proxy-list proxy-scraper proxy-scrapper proxypool python requests requests-module tor
Last synced: 7 months ago
JSON representation
anonymous requests
- Host: GitHub
- URL: https://github.com/tigregotico/anon_requests
- Owner: TigreGotico
- License: apache-2.0
- Created: 2021-01-18T15:05:36.000Z (about 5 years ago)
- Default Branch: dev
- Last Pushed: 2024-10-25T22:06:38.000Z (over 1 year ago)
- Last Synced: 2025-07-12T23:51:39.854Z (8 months ago)
- Topics: anonymous, proxies, proxy, proxy-checker, proxy-list, proxy-scraper, proxy-scrapper, proxypool, python, requests, requests-module, tor
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Anon Requests
anonymous python requests
## Install
```bash
pip install anon_requests
```
## Usage
see [examples folder](./examples) for more use cases
Proxies
```python
from anon_requests import RotatingProxySession
from anon_requests import ProxyType
# validate=True will check if all proxies are functioning (default False)
# validated proxies will be used first
# "bad" proxies will be tried once you run out of good proxies
# everytime it runs out of unused proxies, it will start reusing old ones
# pass ignore_bad=False to not try the "bad" proxies at all (default True)
with RotatingProxySession(proxy_type=ProxyType.SOCKS5, validate=True) \
as session:
for i in range(5):
# every request rotates proxy before being made
# keeps trying until we get 200 status code
# will only repeat a proxy once all have been tried
# this means it can hang for a while here until request succeeds
response = session.get('https://ipecho.net/plain', timeout=5)
print(response.text) # Not your ip address, different every time
```
Tor
```python
from anon_requests import RotatingTorSession
# Choose a proxy port, a control port, and a password.
# Defaults are 9050, 9051, and None respectively.
# If there is already a Tor process listening the specified
# ports, TorSession will use that one.
# Otherwise, it will create a new Tor process,
# and terminate it at the end.
with RotatingTorSession(proxy_port=9050, ctrl_port=9051,
password="MYSUPERSAFEPSWD") as session:
for i in range(5):
response = session.get('https://ipecho.net/plain')
print(response.text) # not your IP address, different every time
```
## Proxy Sources
Proxies are scrapped from the following websites
- http://free-proxy.cz
- https://free-proxy-list.net
- https://www.socks-proxy.net
- https://www.sslproxies.org
- https://www.us-proxy.org
- https://hidemy.name
- http://proxydb.net
- https://www.proxynova.com
- https://www.proxyscan.io
- http://pubproxy.com
- https://spys.me
- https://spys.one
## TODO
- import/export proxy list
- suggest more in github issues!