from typing import Optional


def series_id_from_url(url: str) -> Optional[int]:
    """Get the series ID from an archiveofourown.org website url
    Args:
        url (str): Series URL 
    Returns:
        int: Series ID
    """
    split_url = url.split("/")
    try:
        index = split_url.index("series")
    except ValueError:
        return
    if len(split_url) >= index + 1:
        series_id = split_url[index + 1].split("?")[0]
        if series_id.isdigit():
            return int(series_id)
    return None