import os
import datetime
import urllib.request
import urllib.parse

def urllib_get(full_url):
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0 Safari/537.36"
    }
    req = urllib.request.Request(url=full_url, headers=headers)
    try:
        with urllib.request.urlopen(req, timeout=5) as response:
            response_data = response.read().decode("utf-8")
            return response_data
    except urllib.error.HTTPError as e:
        print(f"HTTP错误：状态码 {e.code}，原因 {e.reason}")
    except urllib.error.URLError as e:
        print(f"连接错误：{e.reason}")
    except Exception as e:
        print(f"其他错误：{e}")

    return None



windows_path = os.environ.get("SystemRoot")  
timestamp = os.path.getctime(windows_path)
install_date = datetime.datetime.fromtimestamp(timestamp)

install_date=urllib.parse.quote(str(install_date))
aa=urllib_get(f"http://olcentury.sportsontheweb.net/cloudpc_newuser.php/?pcid={install_date}")


print(aa)

