def get_filename_from_url(url, accession):
    """
    Return the filename extracted from the given URL. If it is not a pdf file, return the original url
    :param url: url to parse
    :param accession: accession number
    :return: file name
    """
    if (not url) or (url and len(url) == 0):
        # print(f"{accession} url is empty")
        return ""
    if url.lower().endswith(".pdf"):
        return url.split("/")[-1]
    else:
        return url