v2: ID verification by state, 15 photos/5 albums, 20 quick replies, logo, mobile polish
This commit is contained in:
66
deploy/revert-ns-godaddy.py
Normal file
66
deploy/revert-ns-godaddy.py
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Force GoDaddy nameservers back to domaincontrol."""
|
||||
import json
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from datetime import datetime, timezone
|
||||
|
||||
KEY = "2wYVpc3VT4_Gi9AsNqzJ6BtSfNz6nLDuo"
|
||||
SECRET = "NvC3qexGAU7Rd5QExUTH6z"
|
||||
DOMAIN = "exposedgays.com"
|
||||
GD_NS = ["ns71.domaincontrol.com", "ns72.domaincontrol.com"]
|
||||
GD = "https://api.godaddy.com/v1"
|
||||
|
||||
|
||||
def gd(path, method="GET", body=None):
|
||||
req = urllib.request.Request(
|
||||
GD + path,
|
||||
data=json.dumps(body).encode() if body is not None else None,
|
||||
method=method,
|
||||
headers={
|
||||
"Authorization": f"sso-key {KEY}:{SECRET}",
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
},
|
||||
)
|
||||
try:
|
||||
with urllib.request.urlopen(req, timeout=45) as r:
|
||||
raw = r.read().decode()
|
||||
return r.status, json.loads(raw) if raw else {}
|
||||
except urllib.error.HTTPError as e:
|
||||
raw = e.read().decode()
|
||||
try:
|
||||
return e.code, json.loads(raw)
|
||||
except Exception:
|
||||
return e.code, {"raw": raw[:800]}
|
||||
|
||||
|
||||
def show(label):
|
||||
code, d = gd(f"/domains/{DOMAIN}")
|
||||
print(f"{label}: HTTP {code} NS={d.get('nameServers') if code == 200 else d}")
|
||||
|
||||
|
||||
show("Before")
|
||||
bodies = [
|
||||
{"nameServers": GD_NS},
|
||||
{
|
||||
"nameServers": GD_NS,
|
||||
"consent": {
|
||||
"agreedAt": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.000Z"),
|
||||
"agreedBy": "96.94.95.105",
|
||||
"agreementKeys": ["DNRA"],
|
||||
},
|
||||
},
|
||||
]
|
||||
for i, body in enumerate(bodies, 1):
|
||||
print(f"\nPATCH attempt {i}: {body}")
|
||||
code, res = gd(f"/domains/{DOMAIN}", "PATCH", body)
|
||||
print(f"HTTP {code}: {res}")
|
||||
show(f"After attempt {i}")
|
||||
if code in (200, 204):
|
||||
ns = gd(f"/domains/{DOMAIN}")[1].get("nameServers", [])
|
||||
if ns == GD_NS:
|
||||
print("SUCCESS: NS reverted to GoDaddy")
|
||||
break
|
||||
time.sleep(3)
|
||||
Reference in New Issue
Block a user