import requests
from bs4 import BeautifulSoup


def netcdf_links(year: str, month: str) -> list[str]:
    """ Return any netcdf links for the selected month and year """
    fetch_url = f"https://www.ncei.noaa.gov/data/sea-surface-temperature-optimum-interpolation/v2.1/access/avhrr/{year}{month}/"
    req = requests.get(fetch_url)

    soup = BeautifulSoup(req.text, "html.parser")
    links = []

    for link in soup.find_all("a"):
        href = link.get("href")
        if ".nc" in href:
            links.append(fetch_url + href)
    return links