import requests
import sys

def check_site(url):
    try:
        response = requests.get(url, timeout=5)
        if response.status_code == 200:
            print(f"✅ Succes! {url} este online.")
        else:
            print(f"⚠️ Atentie! {url} a raspuns cu status: {response.status_code}")
    except Exception as e:
        print(f"❌ Eroare: Nu am putut accesa {url}. Motiv: {e}")
        sys.exit(1) 

if __name__ == "__main__":
    check_site("https://www.youtube.com/")