Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format code with Yapf #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
ip = requests.get("https://api.ipify.org").text
if ip != last_ip:
response = requests.post("https://proxy.webshare.io/api/proxy/config/",
json={"authorized_ips": [ip]},
headers={"Authorization": apikey})
json={"authorized_ips": [ip]},
headers={"Authorization": apikey})
if response.status_code == 200:
if response.json()["authorized_ips"][0] == ip:
logging.warning("Successfully updated ip to: " + ip)
else:
logging.warning("Ip didn't update to " + ip + " for some reason")
logging.warning("Ip didn't update to " + ip +
" for some reason")
else:
logging.warning("Received " + response.status_code + " error while updating ip to: " + ip)
logging.warning("Received " + response.status_code +
" error while updating ip to: " + ip)
last_ip = ip
time.sleep(delay)
time.sleep(delay)
Loading