Skip to content

Instantly share code, notes, and snippets.

@shanehull
Created September 12, 2017 01:02
Show Gist options
  • Save shanehull/ba649d7fabfd03a60663f74f5f3ce2d8 to your computer and use it in GitHub Desktop.
Save shanehull/ba649d7fabfd03a60663f74f5f3ce2d8 to your computer and use it in GitHub Desktop.
Script to reboot all Chromecasts on 172.16.31.1
import requests
payload = {"params": "now"}
while True:
for ip in range (1, 255):
try:
print("working on 172.16.31.{}".format(ip))
response = requests.post("http://172.16.31.{}:8008/setup/reboot".format(ip), json=payload, timeout=1.0)
if response.ok:
print("ok")
else:
print("failed")
print(response.status)
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment