from datetime import datetime

# Define start and end year-week
start_year = 1970
start_week = 53
end_year = 2025
end_week = 33

# Generate list of URLs
urls = []
for year in range(start_year, end_year + 1):
    max_week = 53 if year != end_year else end_week
    for week in range(1, max_week + 1):
        if year == start_year and week < start_week:
            continue
        urls.append(f"https://www.veikkaus.fi/api/draw-results/v1/games/LOTTO/draws/by-week/{year}-{week:02d}")

# Write URLs to a text file
with open("lotto_urls.txt", "w") as file:
    for url in urls:
        file.write(url + "\n")

# Optional: Print summary
print(f"✅ Total URLs written: {len(urls)}")
print("📄 File saved as: lotto_urls.txt")
print("🔍 First 5 URLs:")
print("\n".join(urls[:5]))
print("🔍 Last 5 URLs:")
print("\n".join(urls[-5:]))

