Files
nordvpn/change-checker.py
2024-09-03 20:01:19 -05:00

42 lines
1.1 KiB
Python

import requests
# Changedetection.io details
base_url = "http://change.ext.ben.io"
auth_cookie = "6abdf17c692daf27a79c9d23a63c7d96"
# Headers for the requests
headers = {
"Cookie": f"sessionid={auth_cookie}"
}
# Function to get system information
def get_system_info():
url = f"{base_url}/api/v1/system/info"
print(f"Testing URL: {url}")
response = requests.get(url, headers=headers)
if response.status_code == 200:
system_info = response.json()
print("System Information:")
print(system_info)
else:
print(f"Error getting system information: {response.status_code}")
# Function to list watch IDs
def list_watch_ids():
url = f"{base_url}/api/v1/watches"
print(f"Testing URL: {url}")
response = requests.get(url, headers=headers)
if response.status_code == 200:
watches = response.json()
watch_ids = [watch['uuid'] for watch in watches]
print("Available Watch IDs:")
print(watch_ids)
else:
print(f"Error listing watch IDs: {response.status_code}")
# Main execution
if __name__ == "__main__":
get_system_info()
list_watch_ids()