import requests

base_url = "https://apid.sky.it/gtv/v1/events?from={from_d}&to={to_d}&pageSize=999&pageNum=0&env=DTH&channels=9044"
headers = {"User-Agent": "Mozilla/5.0"}

tests = [
    # 24 hours starting 18:00 UTC
    ("2026-05-30T18:00:00Z", "2026-05-31T18:00:00Z"),
    # 24 hours starting 19:00 UTC
    ("2026-05-30T19:00:00Z", "2026-05-31T19:00:00Z"),
    # 24 hours starting 20:00 UTC
    ("2026-05-30T20:00:00Z", "2026-05-31T20:00:00Z"),
    # 24 hours starting 21:00 UTC
    ("2026-05-30T21:00:00Z", "2026-05-31T21:00:00Z"),
    # 24 hours starting 22:00 UTC
    ("2026-05-30T22:00:00Z", "2026-05-31T22:00:00Z"),
    # 24 hours starting 23:00 UTC
    ("2026-05-30T23:00:00Z", "2026-05-31T23:00:00Z"),
    # Less than 24 hours
    ("2026-05-30T18:00:00Z", "2026-05-31T17:59:59Z"),
    # Within local day minus 4 hours
    ("2026-05-30T22:00:00Z", "2026-06-01T02:00:00Z"),
    # Two separate API calls: one from 18:00 to 22:00, one from 22:00 to 22:00 next day
    ("2026-05-30T18:00:00Z", "2026-05-30T22:00:00Z"),
]

for fd, td in tests:
    url = base_url.format(from_d=fd, to_d=td)
    resp = requests.get(url, headers=headers)
    print(f"{fd} to {td} -> {resp.status_code}")
