import cloudscraper
import socket

# Known Indonesian ISP DNS servers that might give different results
indo_dns = [
    '202.134.0.155',  # Telkom
    '118.98.44.10',   # Telkom
    '202.134.1.10',   # Telkom
    '202.152.0.1',    # Indosat
]

scraper = cloudscraper.create_scraper()

# Try with different headers that might indicate Indonesian origin
headers = {
    'User-Agent': 'Mozilla/5.0 (Linux; Android 13; SM-A546B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36',
    'Accept-Language': 'id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
    'X-Forwarded-For': '36.79.0.1',  # Indonesian IP range
    'CF-IPCountry': 'ID',  # Try to spoof country
    'CF-Connecting-IP': '36.79.0.1',
}

print("[*] Testing with Indonesian mobile headers...")
try:
    response = scraper.get('https://an.fisip.unisri.ac.id/', headers=headers, timeout=30)
    print(f"[*] Status: {response.status_code}")
    if 'WordPress' in response.text or 'wp-content' in response.text:
        print("[+] SUCCESS!")
    else:
        print("[-] Still blocked")
except Exception as e:
    print(f"[-] Error: {e}")
