Created
August 8, 2022 19:35
-
-
Save MayankPandey01/6ad6ddb586de47b2e5b248a5e5b59139 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import requests | |
from fake_useragent import UserAgent | |
from stem import Signal | |
from stem.control import Controller | |
proxies = { | |
'http': 'socks5://127.0.0.1:9050', | |
'https': 'socks5://127.0.0.1:9050' | |
} | |
print("Changing IP Address in every 10 seconds....\n\n") | |
while True: | |
headers = { 'User-Agent': UserAgent().random } | |
time.sleep(10) | |
with Controller.from_port(port = 9051) as c: | |
c.authenticate() | |
c.signal(Signal.NEWNYM) | |
print(f"Your IP is : {requests.get('https://ident.me', proxies=proxies, headers=headers).text} || User Agent is : {headers['User-Agent']}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment